Skip to content

Commit ecf0bca

Browse files
committed
fix splitIgoreQuota method
1 parent 1977edb commit ecf0bca

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

core/src/main/java/com/dtstack/flink/sql/util/DtStringUtil.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,30 @@ public static List<String> splitIgnoreQuota(String str, char delimiter){
6666
if (idx > 0) {
6767
flag = chars[idx - 1];
6868
}
69-
if(c == delimiter){
69+
if (c == delimiter) {
7070
if (inQuotes) {
7171
b.append(c);
72-
} else if(inSingleQuotes){
72+
} else if (inSingleQuotes) {
7373
b.append(c);
74-
} else if(bracketLeftNum > 0){
74+
} else if (bracketLeftNum > 0) {
7575
b.append(c);
76-
}else {
76+
} else {
7777
tokensList.add(b.toString());
7878
b = new StringBuilder();
7979
}
80-
}else if(c == '\"' && '\\'!=flag && !inSingleQuotes){
80+
} else if (c == '\"' && '\\' != flag && !inSingleQuotes) {
8181
inQuotes = !inQuotes;
8282
b.append(c);
83-
}else if(c == '\'' && '\\'!=flag && !inQuotes){
83+
} else if (c == '\'' && '\\' != flag && !inQuotes) {
8484
inSingleQuotes = !inSingleQuotes;
8585
b.append(c);
86-
}else{
86+
} else if (c == '(') {
87+
bracketLeftNum++;
88+
b.append(c);
89+
} else if (c == ')') {
90+
bracketLeftNum--;
91+
b.append(c);
92+
} else {
8793
b.append(c);
8894
}
8995
idx++;

0 commit comments

Comments
 (0)