sunchao commented on code in PR #6428:
URL: https://github.com/apache/datafusion-comet/pull/6428#discussion_r4212261256


##########
native/core/src/execution/planner.rs:
##########
@@ -4858,6 +5004,135 @@ mod tests {
     };
     use datafusion_comet_spark_expr::EvalMode;
 
+    #[test]
+    fn test_if_reconciles_nested_branch_nullability() {

Review Comment:
   Removed the duplicate planner IF test and the three-IF SQL query in 
6d8a0a912. The existing IF tests remain the coverage for those shapes. The 
revised fixture focuses on constructor array_union and map-valued CASE 
regressions, and the shared-helper tests cover the coercion distinctions 
introduced by the consolidation.



##########
spark/src/test/resources/sql-tests/expressions/struct/create_named_struct_positional_comparison.sql:
##########
@@ -0,0 +1,38 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- MinSparkVersion: 4.0
+
+-- Config: spark.comet.exec.range.enabled=true
+-- Config: spark.comet.sparkToColumnar.enabled=true
+-- Config: spark.comet.sparkToColumnar.supportedOperatorList=Range
+-- Config: spark.sql.caseSensitive=false

Review Comment:
   Removed the redundant Spark-to-columnar settings and case-sensitivity 
setting from the positional comparison fixture in 6d8a0a912. Both struct 
fixtures now request native Range directly. The constructor/CASE fixture 
retains only caseSensitive=false in addition to native Range because its CASE 
regression deliberately swaps x/X names.



##########
spark/src/test/resources/sql-tests/expressions/struct/create_named_struct_positional_comparison.sql:
##########
@@ -0,0 +1,38 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- MinSparkVersion: 4.0
+
+-- Config: spark.comet.exec.range.enabled=true
+-- Config: spark.comet.sparkToColumnar.enabled=true
+-- Config: spark.comet.sparkToColumnar.supportedOperatorList=Range
+-- Config: spark.sql.caseSensitive=false
+
+-- Spark 4.x compares struct fields by position, irrespective of field names.
+query
+SELECT named_struct('x', CAST(id AS DOUBLE), 'y', CAST(NULL AS DOUBLE)) =
+       named_struct('y', CAST(NULL AS DOUBLE), 'x', CAST(id AS DOUBLE))
+FROM range(8)

Review Comment:
   Added a Parquet table in 6d8a0a912 with swapped struct names, distinct field 
values, NULL structs, NULL leaves, NaN, and -0.0 versus +0.0. Equality covers 
every row; a second query covers `<` and `<=>` with native-expression 
assertions.
   
   The added signed-zero row exposed the existing nested ordering/null-safe 
equality gap #6157 (also marked as a KnownGap in this branch). That is fixed 
separately by the already-merged #6447. The test explicitly excludes that row 
only from ordering/null-safe equality, keeping the positional-alignment change 
independent of that fix.
   
   Local validation: 20 native conditional tests and four constructor tests 
pass; all 27 conditional/struct SQL-file cases pass on Spark 4.0.4. Focused 
Clippy, Rust formatting, Spotless, and Scalastyle pass. Local Spark 3.5/4.1 
tests are dependency-DNS blocked; hosted CI is pending.



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