github-actions[bot] commented on code in PR #64265:
URL: https://github.com/apache/doris/pull/64265#discussion_r3385842281


##########
regression-test/suites/nereids_rules_p0/column_pruning/string_length_column_pruning.groovy:
##########
@@ -662,4 +662,82 @@ suite("string_length_column_pruning") {
         contains "OFFSET"
     }
     order_qt_length_varchar "select length(v) from slcp_varchar_tbl"
+
+    // ─── OFFSET covers NULL across all complex data types 
──────────────────────
+    //
+    // When both OFFSET and NULL access paths exist for the same 
field/subfield,
+    // the NULL path is redundant because the OFFSET data already provides
+    // nullness information for variable-length columns. stripNullSuffixPaths()
+    // removes [col.NULL] when [col.OFFSET] exists for the same prefix.
+    //
+    // This applies uniformly to all complex data types: array, map, struct
+    // subfields of string, array, and map.
+
+    // Array root: cardinality(arr_col) -> [arr_col.OFFSET]
+    //             arr_col IS NULL      -> [arr_col.NULL]
+    // OFFSET covers NULL → [arr_col.NULL] must not appear.
+    explain {
+        sql "select cardinality(arr_col), arr_col is null from slcp_str_tbl"
+        contains "nested columns"
+        contains "arr_col.OFFSET"
+        notContains "arr_col.NULL"
+    }
+    order_qt_cardinality_arr_col "select cardinality(arr_col), arr_col is null 
from slcp_str_tbl"

Review Comment:
   Distinct from the earlier no-result-assertion thread: these queries now use 
`order_qt`, but the inserted test data still has every newly tested value 
present (`arr_col`, `map_col`, `struct_col.f3`, `s.arr`, and `s.m` are all 
non-NULL). A regression where the BE/FE reconstructs nullness incorrectly after 
dropping the NULL path and keeping only OFFSET would still pass because every 
expected `is null` value is `false`. Please add rows or separate cases where 
the tested root/subfield is actually NULL and regenerate the `.out`, so this 
proves both the path pruning and the NULL result semantics.



-- 
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]

Reply via email to