cshuo commented on code in PR #13027:
URL: https://github.com/apache/hudi/pull/13027#discussion_r2011433648
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/ITTestHoodieDataSource.java:
##########
@@ -541,24 +540,26 @@ void testReadWithPartitionStatsPruning(HoodieTableType
tableType, boolean hiveSt
"select * from t1 where uuid > 'id5' and age > 15",
// filter by partition stats pruner and dynamic partition pruner
"select * from t1 where uuid > 'id5' and age > 15 and `partition`
> 'par3'");
- List<String> expectResults =
+ List<List<Row>> expectResults =
Arrays.asList(
- "[+I[id1, Danny, 23, 1970-01-01T00:00:00.001, par1], "
- + "+I[id2, Stephen, 33, 1970-01-01T00:00:00.002, par1], "
- + "+I[id3, Julian, 53, 1970-01-01T00:00:00.003, par2], "
- + "+I[id4, Fabian, 31, 1970-01-01T00:00:00.004, par2], "
- + "+I[id5, Sophia, 18, 1970-01-01T00:00:00.005, par3], "
- + "+I[id6, Emma, 20, 1970-01-01T00:00:00.006, par3], "
- + "+I[id7, Bob, 44, 1970-01-01T00:00:00.007, par4], "
- + "+I[id8, Han, 56, 1970-01-01T00:00:00.008, par4]]",
- "[+I[id6, Emma, 20, 1970-01-01T00:00:00.006, par3], "
- + "+I[id7, Bob, 44, 1970-01-01T00:00:00.007, par4], "
- + "+I[id8, Han, 56, 1970-01-01T00:00:00.008, par4]]",
- "[+I[id7, Bob, 44, 1970-01-01T00:00:00.007, par4], "
- + "+I[id8, Han, 56, 1970-01-01T00:00:00.008, par4]]");
+ Arrays.asList(
+ row("id1", "Danny", 23,
TimestampData.fromEpochMillis(1).toLocalDateTime(), "par1"),
+ row("id2", "Stephen", 33,
TimestampData.fromEpochMillis(2).toLocalDateTime(), "par1"),
+ row("id3", "Julian", 53,
TimestampData.fromEpochMillis(3).toLocalDateTime(), "par2"),
+ row("id4", "Fabian", 31,
TimestampData.fromEpochMillis(4).toLocalDateTime(), "par2"),
+ row("id5", "Sophia", 18,
TimestampData.fromEpochMillis(5).toLocalDateTime(), "par3"),
Review Comment:
The changes is introduced for two reasons:
1) reuse testing utils for expected result of type `List<Row>`
2) String representation for results are not suitable for some field types,
for example, MapType, because the order is not stable for Map entry. We can
utilize utils from Flink `RowUtils#compareRows` to compare two `List<Row>`.
For the readability, as the inserting source data is also in form of
List<RowData>, maybe it's more straightforward to compare List<Row> and
List<RowData>.
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/ITTestHoodieDataSource.java:
##########
@@ -541,24 +540,26 @@ void testReadWithPartitionStatsPruning(HoodieTableType
tableType, boolean hiveSt
"select * from t1 where uuid > 'id5' and age > 15",
// filter by partition stats pruner and dynamic partition pruner
"select * from t1 where uuid > 'id5' and age > 15 and `partition`
> 'par3'");
- List<String> expectResults =
+ List<List<Row>> expectResults =
Arrays.asList(
- "[+I[id1, Danny, 23, 1970-01-01T00:00:00.001, par1], "
- + "+I[id2, Stephen, 33, 1970-01-01T00:00:00.002, par1], "
- + "+I[id3, Julian, 53, 1970-01-01T00:00:00.003, par2], "
- + "+I[id4, Fabian, 31, 1970-01-01T00:00:00.004, par2], "
- + "+I[id5, Sophia, 18, 1970-01-01T00:00:00.005, par3], "
- + "+I[id6, Emma, 20, 1970-01-01T00:00:00.006, par3], "
- + "+I[id7, Bob, 44, 1970-01-01T00:00:00.007, par4], "
- + "+I[id8, Han, 56, 1970-01-01T00:00:00.008, par4]]",
- "[+I[id6, Emma, 20, 1970-01-01T00:00:00.006, par3], "
- + "+I[id7, Bob, 44, 1970-01-01T00:00:00.007, par4], "
- + "+I[id8, Han, 56, 1970-01-01T00:00:00.008, par4]]",
- "[+I[id7, Bob, 44, 1970-01-01T00:00:00.007, par4], "
- + "+I[id8, Han, 56, 1970-01-01T00:00:00.008, par4]]");
+ Arrays.asList(
+ row("id1", "Danny", 23,
TimestampData.fromEpochMillis(1).toLocalDateTime(), "par1"),
+ row("id2", "Stephen", 33,
TimestampData.fromEpochMillis(2).toLocalDateTime(), "par1"),
+ row("id3", "Julian", 53,
TimestampData.fromEpochMillis(3).toLocalDateTime(), "par2"),
+ row("id4", "Fabian", 31,
TimestampData.fromEpochMillis(4).toLocalDateTime(), "par2"),
+ row("id5", "Sophia", 18,
TimestampData.fromEpochMillis(5).toLocalDateTime(), "par3"),
Review Comment:
The changes is introduced for two reasons:
1) reuse testing utils for expected result of type `List<Row>`
2) String representation for results are not suitable for some field types,
e.g., MapType, because the order is not stable for Map entry. We can utilize
utils from Flink `RowUtils#compareRows` to compare two `List<Row>`.
For the readability, as the inserting source data is also in form of
List<RowData>, maybe it's more straightforward to compare List<Row> and
List<RowData>.
--
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]