Skip to content

Commit 6c88bca

Browse files
committed
[fix] value condition bug
1 parent 373ffb2 commit 6c88bca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

impala/impala-sink/src/main/java/com/dtstack/flink/sql/sink/impala/ImpalaOutputFormat.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ private String valueConditionAddQuotation(String valueCondition) {
380380
}
381381
}
382382
);
383-
return valueConditionCopy[0];
383+
return "(" + valueConditionCopy[0] + ")";
384384
}
385385

386386
@Override
@@ -578,13 +578,13 @@ private String buildTableFieldsCondition(List<String> fieldNames, String partiti
578578
* @return condition like '(?, ?, cast(? as string))' and '?' will be replaced with row data
579579
*/
580580
private String buildValuesCondition(List<String> fieldTypes, Row row) {
581-
String valuesCondition = "(" + fieldTypes.stream().map(
581+
String valuesCondition = fieldTypes.stream().map(
582582
f -> {
583583
if (Arrays.asList(NEED_QUOTE_TYPE).contains(f.toLowerCase())) {
584584
return String.format("cast(? as %s)", f.toLowerCase());
585585
}
586586
return "?";
587-
}).collect(Collectors.joining(", ")) + ")";
587+
}).collect(Collectors.joining(", "));
588588
for (int i = 0; i < row.getArity(); i++) {
589589
valuesCondition = valuesCondition.replaceFirst("\\?", Objects.isNull(row.getField(i)) ? "null" : row.getField(i).toString());
590590
}

0 commit comments

Comments
 (0)