Skip to content

Commit e5bfe5c

Browse files
committed
Merge branch 'hotfix_1.10_4.0.x_31804' into '1.10_release_4.0.x'
[fix] 多表join timestamp数据类型异常 See merge request dt-insight-engine/flinkStreamSQL!181
2 parents c3069ae + 40a86e7 commit e5bfe5c

File tree

3 files changed

+140
-16
lines changed

3 files changed

+140
-16
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.sql.Time;
3232
import java.sql.Timestamp;
3333
import java.time.LocalDate;
34+
import java.time.LocalDateTime;
3435
import java.time.LocalTime;
3536

3637
/**
@@ -52,6 +53,8 @@ public static BaseRow convertToBaseRow(Row row) {
5253
} else if (row.getField(i) instanceof Timestamp) {
5354
SqlTimestamp newTimestamp = SqlTimestamp.fromTimestamp(((Timestamp) row.getField(i)));
5455
genericRow.setField(i, newTimestamp);
56+
} else if (row.getField(i) instanceof LocalDateTime) {
57+
genericRow.setField(i, SqlTimestamp.fromLocalDateTime((LocalDateTime) row.getField(i)));
5558
} else if (row.getField(i) instanceof Time) {
5659
genericRow.setField(i, DataFormatConverters.TimeConverter.INSTANCE.toInternal((Time) row.getField(i)));
5760
} else if (row.getField(i) instanceof Double || row.getField(i).getClass().equals(double.class)) {

localTest/pom.xml

Lines changed: 136 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,103 @@
5151
<version>1.0-SNAPSHOT</version>
5252
</dependency>
5353

54-
<!-- <dependency>-->
55-
<!-- <groupId>com.dtstack.flink</groupId>-->
56-
<!-- <artifactId>sql.source.kafka</artifactId>-->
57-
<!-- <version>1.0-SNAPSHOT</version>-->
58-
<!-- </dependency>-->
54+
<!-- <dependency>-->
55+
<!-- <groupId>com.dtstack.flink</groupId>-->
56+
<!-- <artifactId>sql.source.kafka</artifactId>-->
57+
<!-- <version>1.0-SNAPSHOT</version>-->
58+
<!-- </dependency>-->
5959

60-
<!-- <dependency>-->
61-
<!-- <groupId>com.dtstack.flink</groupId>-->
62-
<!-- <artifactId>sql.source.kafka09</artifactId>-->
63-
<!-- <version>1.0-SNAPSHOT</version>-->
64-
<!-- </dependency>-->
60+
<!-- <dependency>-->
61+
<!-- <groupId>com.dtstack.flink</groupId>-->
62+
<!-- <artifactId>sql.source.kafka09</artifactId>-->
63+
<!-- <version>1.0-SNAPSHOT</version>-->
64+
<!-- </dependency>-->
6565

66-
<!-- <dependency>-->
67-
<!-- <groupId>com.dtstack.flink</groupId>-->
68-
<!-- <artifactId>sql.source.kafka10</artifactId>-->
69-
<!-- <version>1.0-SNAPSHOT</version>-->
70-
<!-- </dependency>-->
66+
<!-- <dependency>-->
67+
<!-- <groupId>com.dtstack.flink</groupId>-->
68+
<!-- <artifactId>sql.source.kafka10</artifactId>-->
69+
<!-- <version>1.0-SNAPSHOT</version>-->
70+
<!-- </dependency>-->
7171

7272
<dependency>
7373
<groupId>com.dtstack.flink</groupId>
7474
<artifactId>sql.source.kafka11</artifactId>
7575
<version>1.0-SNAPSHOT</version>
7676
</dependency>
7777

78+
<dependency>
79+
<groupId>com.dtstack.flink</groupId>
80+
<artifactId>sql.mysql</artifactId>
81+
<version>1.0-SNAPSHOT</version>
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>com.dtstack.flink</groupId>
86+
<artifactId>sql.side.all.mysql</artifactId>
87+
<version>1.0-SNAPSHOT</version>
88+
</dependency>
89+
90+
<dependency>
91+
<groupId>com.dtstack.flink</groupId>
92+
<artifactId>sql.sink.mysql</artifactId>
93+
<version>1.0-SNAPSHOT</version>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>com.dtstack.flink</groupId>
98+
<artifactId>sql.side.async.mysql</artifactId>
99+
<version>1.0-SNAPSHOT</version>
100+
</dependency>
101+
102+
<dependency>
103+
<groupId>com.dtstack.flink</groupId>
104+
<artifactId>sql.hbase</artifactId>
105+
<version>1.0-SNAPSHOT</version>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>com.dtstack.flink</groupId>
110+
<artifactId>sql.side.all.hbase</artifactId>
111+
<version>1.0-SNAPSHOT</version>
112+
</dependency>
113+
114+
<dependency>
115+
<groupId>com.dtstack.flink</groupId>
116+
<artifactId>sql.sink.hbase</artifactId>
117+
<version>1.0-SNAPSHOT</version>
118+
</dependency>
119+
120+
<dependency>
121+
<groupId>com.dtstack.flink</groupId>
122+
<artifactId>sql.side.async.hbase</artifactId>
123+
<version>1.0-SNAPSHOT</version>
124+
</dependency>
125+
126+
127+
<dependency>
128+
<groupId>com.dtstack.flink</groupId>
129+
<artifactId>sql.redis</artifactId>
130+
<version>1.0-SNAPSHOT</version>
131+
</dependency>
132+
133+
<dependency>
134+
<groupId>com.dtstack.flink</groupId>
135+
<artifactId>sql.side.all.redis</artifactId>
136+
<version>1.0-SNAPSHOT</version>
137+
</dependency>
138+
139+
<dependency>
140+
<groupId>com.dtstack.flink</groupId>
141+
<artifactId>sql.sink.redis</artifactId>
142+
<version>1.0-SNAPSHOT</version>
143+
</dependency>
144+
145+
<dependency>
146+
<groupId>com.dtstack.flink</groupId>
147+
<artifactId>sql.side.async.redis</artifactId>
148+
<version>1.0-SNAPSHOT</version>
149+
</dependency>
150+
78151
<dependency>
79152
<groupId>com.dtstack.flink</groupId>
80153
<artifactId>sql.impala</artifactId>
@@ -124,6 +197,54 @@
124197
<version>1.0-SNAPSHOT</version>
125198
</dependency>
126199

200+
<dependency>
201+
<groupId>com.dtstack.flink</groupId>
202+
<artifactId>sql.mongo</artifactId>
203+
<version>1.0-SNAPSHOT</version>
204+
</dependency>
205+
206+
<dependency>
207+
<groupId>com.dtstack.flink</groupId>
208+
<artifactId>sql.side.all.mongo</artifactId>
209+
<version>1.0-SNAPSHOT</version>
210+
</dependency>
211+
212+
<dependency>
213+
<groupId>com.dtstack.flink</groupId>
214+
<artifactId>sql.sink.mongo</artifactId>
215+
<version>1.0-SNAPSHOT</version>
216+
</dependency>
217+
218+
<dependency>
219+
<groupId>com.dtstack.flink</groupId>
220+
<artifactId>sql.side.async.mongo</artifactId>
221+
<version>1.0-SNAPSHOT</version>
222+
</dependency>
223+
224+
<dependency>
225+
<groupId>com.dtstack.flink</groupId>
226+
<artifactId>sql.oracle</artifactId>
227+
<version>1.0-SNAPSHOT</version>
228+
</dependency>
229+
230+
<dependency>
231+
<groupId>com.dtstack.flink</groupId>
232+
<artifactId>sql.side.all.oracle</artifactId>
233+
<version>1.0-SNAPSHOT</version>
234+
</dependency>
235+
236+
<dependency>
237+
<groupId>com.dtstack.flink</groupId>
238+
<artifactId>sql.sink.oracle</artifactId>
239+
<version>1.0-SNAPSHOT</version>
240+
</dependency>
241+
242+
<dependency>
243+
<groupId>com.dtstack.flink</groupId>
244+
<artifactId>sql.side.async.oracle</artifactId>
245+
<version>1.0-SNAPSHOT</version>
246+
</dependency>
247+
127248
<dependency>
128249
<groupId>com.dtstack.flink</groupId>
129250
<artifactId>sql.console</artifactId>

localTest/src/main/java/com/dtstack/flink/sql/localTest/LocalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception {
5050
setLogLevel("INFO");
5151

5252
List<String> propertiesList = new ArrayList<>();
53-
String sqlPath = "/Users/wtz/dtstack/job/flinkStreamSQL/sql/impalaDemoThree.sql";
53+
String sqlPath = "/Users/wtz/dtstack/job/flinkStreamSQL/sql/TestDemo/JoinDemoTwo.sql";
5454
Map<String, Object> conf = new HashMap<>();
5555
JSONObject properties = new JSONObject();
5656

0 commit comments

Comments
 (0)