danny0405 commented on code in PR #7886:
URL: https://github.com/apache/hudi/pull/7886#discussion_r1101210371
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/ITTestHoodieDataSource.java:
##########
@@ -1693,6 +1693,121 @@ void testWriteReadWithLocalTimestamp(HoodieTableType
tableType) {
assertRowsEquals(result, expected);
}
+ @Test
+ void testBulkInsertWithUtcTimezoneRead() {
+ TableEnvironment tableEnv = batchTableEnv;
+
+ String hoodieTableDDL = sql("t1")
+ .option(FlinkOptions.PATH, tempFile.getAbsolutePath())
+ .option(FlinkOptions.OPERATION, "bulk_insert")
+ .option(FlinkOptions.WRITE_BULK_INSERT_SHUFFLE_INPUT, true)
+ .option(FlinkOptions.WRITE_BULK_INSERT_SORT_INPUT, true)
+ .option(FlinkOptions.WRITE_BULK_INSERT_SORT_INPUT_BY_RECORD_KEY, true)
+ .option(FlinkOptions.UTC_TIMEZONE, true)
+ .end();
+ tableEnv.executeSql(hoodieTableDDL);
+
+ final String insertInto = "insert into t1 values\n"
+ + "('id2','Stephen',33,TIMESTAMP '1970-01-01 18:00:02','par1'),\n"
+ + "('id1','Julian',53,TIMESTAMP '1970-01-01 18:00:03','par1')";
+
+ execInsertSql(tableEnv, insertInto);
+
+ List<Row> result = CollectionUtil.iterableToList(
+ () -> tableEnv.sqlQuery("select * from t1").execute().collect());
+ assertRowsEquals(result, "["
+ + "+I[id1, Julian, 53, 1970-01-01T10:00:03, par1], "
+ + "+I[id2, Stephen, 33, 1970-01-01T10:00:02, par1]]", 4);
+ }
+
+ @ParameterizedTest
+ @EnumSource(value = ExecMode.class)
+ void testWriteAndWithoutUtcTimezoneReadParMiddle(ExecMode execMode) throws
Exception {
+ boolean streaming = execMode == ExecMode.STREAM;
+ String hoodieTableDDL = "create table t1(\n"
+ + " uuid varchar(20),\n"
+ + " name varchar(10),\n"
+ + " age int,\n"
Review Comment:
All the sql statements can be moved to `TestSQL`, all the sql DDLs can be
generated using the `sql(...).option(...)` builder,
all the expected results should be moved to `TestData`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]