Skip to content

Commit ee5384c

Browse files
author
gituser
committed
Merge branch 'hotfix_1.10_4.0.x_32069' into 1.10_release_4.0.x
2 parents 8de2992 + 057b7fb commit ee5384c

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

core/src/main/java/com/dtstack/flink/sql/parser/CreateTableParser.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
20-
2119
package com.dtstack.flink.sql.parser;
2220

2321
import com.dtstack.flink.sql.util.DtStringUtil;
@@ -41,8 +39,6 @@ public class CreateTableParser implements IParser {
4139

4240
private static final Pattern PATTERN = Pattern.compile(PATTERN_STR);
4341

44-
private static final Pattern PROP_PATTERN = Pattern.compile("^'\\s*(.+)\\s*'$");
45-
4642
public static CreateTableParser newInstance(){
4743
return new CreateTableParser();
4844
}
@@ -70,28 +66,19 @@ public void parseSql(String sql, SqlTree sqlTree) {
7066
}
7167
}
7268

73-
private Map parseProp(String propsStr){
74-
propsStr = propsStr.replaceAll("'\\s*,", "'|");
75-
String[] strs = propsStr.trim().split("\\|");
69+
private Map<String, Object> parseProp(String propsStr){
70+
List<String> strings = DtStringUtil.splitIgnoreQuota(propsStr.trim(), ',');
7671
Map<String, Object> propMap = Maps.newHashMap();
77-
for (String str : strs) {
72+
for (String str : strings) {
7873
List<String> ss = DtStringUtil.splitIgnoreQuota(str, '=');
7974
String key = ss.get(0).trim();
80-
String value = extractValue(ss.get(1).trim());
75+
String value = ss.get(1).trim().replaceAll("'", "").trim();
8176
propMap.put(key, value);
8277
}
8378

8479
return propMap;
8580
}
8681

87-
private String extractValue(String value) {
88-
Matcher matcher = PROP_PATTERN.matcher(value);
89-
if (matcher.find()) {
90-
return matcher.group(1);
91-
}
92-
throw new RuntimeException("[" + value + "] format is invalid");
93-
}
94-
9582
public static class SqlParserResult{
9683

9784
private String tableName;

0 commit comments

Comments
 (0)