Skip to content

Commit 6285743

Browse files
committed
[hotfix-35753][impala] fix String.replaceFirst中的坑,replaceFirst("\\?", value),如果value中$后不是数字,那么会出现"illegal group reference:group index is missing"问题
1 parent 2aa79ab commit 6285743

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ private String buildValuesCondition(List<String> fieldTypes, Row row) {
589589
if (DtStringUtil.isEmptyOrNull(rowField)) {
590590
valuesCondition = valuesCondition.replaceFirst("'\\?'", "null");
591591
} else {
592-
valuesCondition = valuesCondition.replaceFirst("\\?", rowField.toString());
592+
valuesCondition = valuesCondition.replaceFirst("\\?", Matcher.quoteReplacement(rowField.toString()));
593593
}
594594
}
595595
return "(" + valuesCondition + ")";

0 commit comments

Comments
 (0)