Skip to content

Commit 4fa5726

Browse files
committed
[fix-33268][core] fix hbase rowKey not available due to remove all single quota. rowKey like 'stu'+'_'+sid+'_'+md5(sid).
1 parent e6a4c6a commit 4fa5726

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import com.dtstack.flink.sql.util.DtStringUtil;
2222
import com.google.common.collect.Maps;
23+
import org.apache.commons.lang3.StringUtils;
2324

2425
import java.util.List;
2526
import java.util.Map;
@@ -72,7 +73,7 @@ private Map<String, Object> parseProp(String propsStr){
7273
for (String str : strings) {
7374
List<String> ss = DtStringUtil.splitIgnoreQuota(str, '=');
7475
String key = ss.get(0).trim();
75-
String value = ss.get(1).trim().replaceAll("'", "").trim();
76+
String value = DtStringUtil.removeStartAndEndQuota(ss.get(1).trim());
7677
propMap.put(key, value);
7778
}
7879

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,7 @@ public static String getTableFullPath(String schema, String tableName) {
373373
return addQuoteForStr(tableName);
374374
}
375375

376-
String schemaAndTabName = addQuoteForStr(schema) + "." + addQuoteForStr(tableName);
377-
return schemaAndTabName;
376+
return addQuoteForStr(schema) + "." + addQuoteForStr(tableName);
378377
}
379378

380379
/**
@@ -407,4 +406,9 @@ public static String getStartQuote() {
407406
public static String getEndQuote() {
408407
return "\"";
409408
}
409+
410+
public static String removeStartAndEndQuota(String str) {
411+
String removeStart = StringUtils.removeStart(str, "'");
412+
return StringUtils.removeEnd(removeStart, "'");
413+
}
410414
}

0 commit comments

Comments
 (0)