SML0127 commented on code in PR #1549:
URL: https://github.com/apache/fluss/pull/1549#discussion_r2285942988
##########
fluss-lake/fluss-lake-paimon/src/test/java/com/alibaba/fluss/lake/paimon/flink/FlinkUnionReadLogTableITCase.java:
##########
@@ -95,11 +95,37 @@ void testReadLogTableFullType(boolean isPartitioned) throws
Exception {
.map(row -> Row.of(row.getField(1)))
.collect(Collectors.toList());
assertThat(actual).containsExactlyInAnyOrderElementsOf(expected);
+
+ if (isPartitioned) {
+ // get first partition
+ String partition =
waitUntilPartitions(t1).values().iterator().next();
+ String sqlWithPartitionFilter =
+ "select * FROM " + tableName + " WHERE p = '" + partition
+ "'";
+
+ String plan = batchTEnv.explainSql(sqlWithPartitionFilter);
+
+ // check if the plan contains partition filter
+ assertThat(plan)
+ .contains("TableSourceScan(")
+ .contains("filter=[=(p, _UTF-16LE'" + partition + "'");
+
+ List<Row> expectedFiltered =
+ writtenRows.stream()
+ .filter(r -> partition.equals(r.getField(15)))
+ .collect(Collectors.toList());
+
+ List<Row> actualFiltered =
+ CollectionUtil.iteratorToList(
+
batchTEnv.executeSql(sqlWithPartitionFilter).collect());
+
+
assertThat(actualFiltered).containsExactlyInAnyOrderElementsOf(expectedFiltered);
+ }
Review Comment:
The newly added test case is failing; I'm debugging it.
```
plan =
== Abstract Syntax Tree ==
LogicalProject(f_boolean=[$0], f_byte=[$1], f_short=[$2], f_int=[$3],
f_long=[$4], f_float=[$5], f_double=[$6], f_string=[$7], f_decimal1=[$8],
f_decimal2=[$9], f_timestamp_ltz1=[$10], f_timestamp_ltz2=[$11],
f_timestamp_ntz1=[$12], f_timestamp_ntz2=[$13], f_binary=[$14], p=[$15])
+- LogicalFilter(condition=[=($15, _UTF-16LE'2025')])
+- LogicalTableScan(table=[[testcatalog, fluss, logTable_partitioned]])
== Optimized Physical Plan ==
Calc(select=[f_boolean, f_byte, f_short, f_int, f_long, f_float, f_double,
f_string, f_decimal1, f_decimal2, f_timestamp_ltz1, f_timestamp_ltz2,
f_timestamp_ntz1, f_timestamp_ntz2, f_binary, CAST('2025' AS
VARCHAR(2147483647)) AS p])
+- TableSourceScan(table=[[testcatalog, fluss, logTable_partitioned,
filter=[=(p, _UTF-16LE'2025':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")],
project=[f_boolean, f_byte, f_short, f_int, f_long, f_float, f_double,
f_string, f_decimal1, f_decimal2, f_timestamp_ltz1, f_timestamp_ltz2,
f_timestamp_ntz1, f_timestamp_ntz2, f_binary]]], fields=[f_boolean, f_byte,
f_short, f_int, f_long, f_float, f_double, f_string, f_decimal1, f_decimal2,
f_timestamp_ltz1, f_timestamp_ltz2, f_timestamp_ntz1, f_timestamp_ntz2,
f_binary])
== Optimized Execution Plan ==
Calc(select=[f_boolean, f_byte, f_short, f_int, f_long, f_float, f_double,
f_string, f_decimal1, f_decimal2, f_timestamp_ltz1, f_timestamp_ltz2,
f_timestamp_ntz1, f_timestamp_ntz2, f_binary, CAST('2025' AS
VARCHAR(2147483647)) AS p])
+- TableSourceScan(table=[[testcatalog, fluss, logTable_partitioned,
filter=[=(p, _UTF-16LE'2025':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")],
project=[f_boolean, f_byte, f_short, f_int, f_long, f_float, f_double,
f_string, f_decimal1, f_decimal2, f_timestamp_ltz1, f_timestamp_ltz2,
f_timestamp_ntz1, f_timestamp_ntz2, f_binary]]], fields=[f_boolean, f_byte,
f_short, f_int, f_long, f_float, f_double, f_string, f_decimal1, f_decimal2,
f_timestamp_ltz1, f_timestamp_ltz2, f_timestamp_ntz1, f_timestamp_ntz2,
f_binary])
```
--
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]