comphead commented on code in PR #6938:
URL: https://github.com/apache/datafusion-comet/pull/6938#discussion_r4460453540


##########
spark/src/test/resources/sql-tests/join/cartesian_product.sql:
##########
@@ -0,0 +1,80 @@
+-- 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.
+
+-- Tests for CartesianProductExec, which Spark plans for a cross join with no 
equi key when
+-- nothing is broadcast. Comet runs it natively only without a condition and 
when each input
+-- reports exactly one partition. A non-bucketed Parquet scan reports 
UnknownPartitioning(0), so
+-- each side is coalesced to one partition. Partition coalescing is off so AQE 
cannot merge the
+-- REPARTITION(2) case. cartesian_product_aqe.sql covers AQE splitting a 
REBALANCE(1) input.
+
+-- Config: spark.comet.exec.cartesianProduct.enabled=true
+-- Config: spark.sql.autoBroadcastJoinThreshold=-1
+-- Config: spark.sql.adaptive.autoBroadcastJoinThreshold=-1
+-- Config: spark.sql.adaptive.coalescePartitions.enabled=false
+-- ConfigMatrix: spark.sql.adaptive.enabled=true,false
+
+statement
+CREATE TABLE cp_left(k int, v int) USING parquet
+
+statement
+INSERT INTO cp_left VALUES (0, 10), (NULL, 11), (2, NULL), (NULL, NULL)
+
+statement
+CREATE TABLE cp_right(k int, v int) USING parquet
+
+statement
+INSERT INTO cp_right VALUES (0, 100), (NULL, NULL)
+
+statement
+CREATE TABLE cp_empty(k int, v int) USING parquet
+
+statement
+CREATE TABLE cp_large(k int, v int) USING parquet
+
+-- More rows than the default batch size of 8192.
+statement
+INSERT INTO cp_large SELECT id, id FROM range(10000)
+
+-- Native, with NULLs on both sides
+query

Review Comment:
   Each left row goes through `ScalarValue::try_from_array` and 
`to_array_of_size` for every output batch (DataFusion 55.2 `build_batch`), 
which is a different path from the `take` the other joins use. Every table in 
this file has only `int` columns. Could you add a left side with string, 
decimal, timestamp, date, binary, boolean, double (NaN and `-0.0`), array, 
struct and map columns, with NULLs in each? I have not found a type that 
breaks, and I have not run it.



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