|
19 | 19 |
|
20 | 20 | package com.dtstack.flink.sql.table; |
21 | 21 |
|
| 22 | +import com.dtstack.flink.sql.parser.SqlParser; |
22 | 23 | import com.dtstack.flink.sql.side.AbstractSideTableInfo; |
23 | 24 | import com.dtstack.flink.sql.util.ClassUtil; |
24 | 25 | import com.dtstack.flink.sql.util.DtStringUtil; |
25 | 26 | import com.google.common.base.Preconditions; |
26 | 27 | import com.google.common.collect.Maps; |
27 | 28 | import org.apache.commons.lang3.StringUtils; |
28 | 29 | import org.apache.flink.api.java.tuple.Tuple2; |
| 30 | +import org.slf4j.Logger; |
| 31 | +import org.slf4j.LoggerFactory; |
29 | 32 |
|
30 | 33 | import java.util.ArrayList; |
31 | 34 | import java.util.Arrays; |
|
45 | 48 |
|
46 | 49 | public abstract class AbstractTableParser { |
47 | 50 |
|
| 51 | + private static final Logger LOG = LoggerFactory.getLogger(AbstractTableParser.class); |
| 52 | + |
48 | 53 | private static final String PRIMARY_KEY = "primaryKey"; |
49 | 54 | private static final String NEST_JSON_FIELD_KEY = "nestFieldKey"; |
50 | 55 | private static final String CHAR_TYPE_NO_LENGTH = "CHAR"; |
@@ -117,7 +122,13 @@ public void parseFieldsInfo(String fieldsInfo, AbstractTableInfo tableInfo) { |
117 | 122 | if (tableInfo instanceof AbstractSideTableInfo) { |
118 | 123 | tableInfo.getPrimaryKeys().stream() |
119 | 124 | .filter(pk -> !tableInfo.getFieldList().contains(pk)) |
120 | | - .forEach(pk -> handleKeyNotHaveAlias(String.format("%s varchar", pk), tableInfo)); |
| 125 | + .forEach(pk -> { |
| 126 | + try { |
| 127 | + handleKeyNotHaveAlias(String.format("%s varchar", pk), tableInfo); |
| 128 | + } catch (Exception e) { |
| 129 | + LOG.error(String.format("Handle primary key failed. Reason: %s", e.getMessage())); |
| 130 | + } |
| 131 | + }); |
121 | 132 | } |
122 | 133 |
|
123 | 134 | tableInfo.finish(); |
|
0 commit comments