|
3 | 3 | import com.dtstack.flink.sql.side.AllReqRow;
|
4 | 4 | import com.dtstack.flink.sql.side.FieldInfo;
|
5 | 5 | import com.dtstack.flink.sql.side.JoinInfo;
|
6 |
| -import com.dtstack.flink.sql.side.SideInfo; |
7 | 6 | import com.dtstack.flink.sql.side.SideTableInfo;
|
8 | 7 | import com.dtstack.flink.sql.side.mysql.table.MysqlSideTableInfo;
|
9 |
| -import com.dtstack.flink.sql.threadFactory.DTThreadFactory; |
10 | 8 | import com.dtstack.flink.sql.util.DtStringUtil;
|
11 | 9 | import org.apache.calcite.sql.JoinType;
|
12 | 10 | import org.apache.commons.collections.CollectionUtils;
|
13 | 11 | import org.apache.flink.api.java.typeutils.RowTypeInfo;
|
14 | 12 | import org.apache.flink.calcite.shaded.com.google.common.collect.Lists;
|
15 | 13 | import org.apache.flink.calcite.shaded.com.google.common.collect.Maps;
|
16 |
| -import org.apache.flink.configuration.Configuration; |
| 14 | +import org.apache.flink.table.typeutils.TimeIndicatorTypeInfo; |
17 | 15 | import org.apache.flink.types.Row;
|
18 | 16 | import org.apache.flink.util.Collector;
|
19 | 17 | import org.slf4j.Logger;
|
|
28 | 26 | import java.util.Calendar;
|
29 | 27 | import java.util.List;
|
30 | 28 | import java.util.Map;
|
31 |
| -import java.util.concurrent.ExecutorService; |
32 |
| -import java.util.concurrent.Executors; |
33 |
| -import java.util.concurrent.ScheduledExecutorService; |
34 |
| -import java.util.concurrent.TimeUnit; |
35 | 29 | import java.util.concurrent.atomic.AtomicReference;
|
36 | 30 |
|
37 | 31 | /**
|
@@ -59,14 +53,16 @@ public MysqlAllReqRow(RowTypeInfo rowTypeInfo, JoinInfo joinInfo, List<FieldInfo
|
59 | 53 | super(new MysqlAllSideInfo(rowTypeInfo, joinInfo, outFieldInfoList, sideTableInfo));
|
60 | 54 | }
|
61 | 55 |
|
62 |
| - |
63 | 56 | @Override
|
64 | 57 | protected Row fillData(Row input, Object sideInput) {
|
65 | 58 | Map<String, Object> cacheInfo = (Map<String, Object>) sideInput;
|
66 | 59 | Row row = new Row(sideInfo.getOutFieldInfoList().size());
|
67 | 60 | for(Map.Entry<Integer, Integer> entry : sideInfo.getInFieldIndex().entrySet()){
|
68 | 61 | Object obj = input.getField(entry.getValue());
|
69 |
| - if(obj instanceof Timestamp){ |
| 62 | + boolean isTimeIndicatorTypeInfo = TimeIndicatorTypeInfo.class.isAssignableFrom(sideInfo.getRowTypeInfo().getTypeAt(entry.getValue()).getClass()); |
| 63 | + |
| 64 | + //Type information for indicating event or processing time. However, it behaves like a regular SQL timestamp but is serialized as Long. |
| 65 | + if(obj instanceof Timestamp && isTimeIndicatorTypeInfo){ |
70 | 66 | obj = ((Timestamp)obj).getTime();
|
71 | 67 | }
|
72 | 68 | row.setField(entry.getKey(), obj);
|
|
0 commit comments