englefly commented on code in PR #64535:
URL: https://github.com/apache/doris/pull/64535#discussion_r3433173578
##########
fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PruneNestedColumnTest.java:
##########
@@ -207,6 +241,66 @@ public void
testCardinalityMapElementKeepsValueOffsetPath() throws Exception {
ImmutableList.of());
}
+ @Test
+ public void testDeeperNullCoversValueOffsetForMapArray() throws Exception {
+ // cardinality(map_arr_col['a']) -> normalized to KEYS + VALUES.OFFSET
+ // element_at(map_arr_col['a'], 1) IS NULL -> *.*.NULL
+ // *.*.NULL goes deeper into the value-side array, so VALUES.OFFSET
+ // at the map value level is redundant. Without type-aware comparison
+ // * is not lexically equal to VALUES, so VALUES.OFFSET would survive
+ // and cause BE to skip the item iterator.
+ assertAllAccessPathsContain(
+ "select cardinality(map_arr_col['a']), "
+ + "element_at(map_arr_col['a'], 1) is null from
map_array_tbl",
+ ImmutableList.of(path("map_arr_col", "*", "*", "NULL")),
+ ImmutableList.of(path("map_arr_col", "VALUES", "OFFSET")));
+ }
+
+ @Test
+ public void testDataPathCoversNullPathWithMapAwareComparison() throws
Exception {
+ // element_at(map_col, 'a') -> [map_col, *]
+ // map_values(map_col) IS NULL -> [map_col, VALUES, NULL]
+ // [map_col, *] should cover [map_col, VALUES, NULL] because
+ // * ≡ VALUES at the map level (type-aware comparison).
+ // Without the fix, the lexical prefix check fails and the
+ // BE receives VALUES.NULL alongside *, causing the value
+ // iterator to enter NULL_MAP_ONLY and skip real data.
+ assertAllAccessPathsContain(
Review Comment:
"[m, VALUES] 削 [m, *, NULL]" commit
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]