Skip to content

Commit 7c2c956

Browse files
committed
update documentation per review
1 parent 0ecd27c commit 7c2c956

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

‎docs/source/user-guide/latest/operators.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ omitted from the tables below and may be reconsidered based on demand:
9696

9797
## Joins
9898

99-
| Operator | Status | Notes |
100-
| ----------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101-
| `BroadcastHashJoinExec` | ✅ | Falls back to Spark for a `NOT IN` (null-aware anti join) whose streamed side reports an ordering. |
102-
| `ShuffledHashJoinExec` | ✅ | |
103-
| `SortMergeJoinExec` | ✅ | Supports `BINARY` join keys. Nested-type (struct, array, map) and collated-string join keys fall back to Spark. |
104-
| `BroadcastNestedLoopJoinExec` | ✅ | Falls back to Spark when the preserved side is broadcast (for example LEFT OUTER with BROADCAST on the left) ([#4429](https://github.com/apache/datafusion-comet/pull/4429)). |
105-
| `CartesianProductExec` | ⚠️ | Opt-in (`spark.comet.exec.cartesianProduct.enabled`). Runs natively only without a join condition and when each input reports exactly one partition. |
99+
| Operator | Status | Notes |
100+
| ----------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101+
| `BroadcastHashJoinExec` | ✅ | Falls back to Spark for a `NOT IN` (null-aware anti join) whose streamed side reports an ordering. |
102+
| `ShuffledHashJoinExec` | ✅ | |
103+
| `SortMergeJoinExec` | ✅ | Supports `BINARY` join keys. Nested-type (struct, array, map) and collated-string join keys fall back to Spark. |
104+
| `BroadcastNestedLoopJoinExec` | ✅ | Falls back to Spark when the preserved side is broadcast (for example LEFT OUTER with BROADCAST on the left) ([#4429](https://github.com/apache/datafusion-comet/pull/4429)). |
105+
| `CartesianProductExec` | ⚠️ | Opt-in (`spark.comet.exec.cartesianProduct.enabled`). Runs natively only without a join condition and when each input reports exactly one partition. Row order can differ from Spark's. |
106106

107107
`ExistenceJoin` (produced when `EXISTS` / `IN` is combined with another predicate via `OR`) runs
108108
natively on `BroadcastHashJoinExec` and `ShuffledHashJoinExec`. Existence sort-merge joins, residual

‎spark/src/main/scala/org/apache/comet/CometConf.scala‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ object CometConf extends ShimCometConf {
377377
"cartesianProduct",
378378
defaultValue = false,
379379
notes = Some(
380-
"Opt-in: DataFusion's CrossJoinExec buffers the left input and cannot spill. Runs " +
381-
"natively only without a join condition and when each input reports exactly one " +
382-
"partition"))
380+
"Opt-in: DataFusion's CrossJoinExec buffers the left input and cannot spill " +
381+
"(https://github.com/apache/datafusion/issues/26383). Runs natively only without a " +
382+
"join condition and when each input reports exactly one partition"))
383383
val COMET_EXEC_SORT_MERGE_JOIN_RIGHT_KEY_REDUCTION_ENABLED: ConfigEntry[Boolean] =
384384
conf(s"$COMET_EXEC_CONFIG_PREFIX.sortMergeJoin.rightKeyReduction.enabled")
385385
.category(CATEGORY_EXEC)

‎spark/src/test/resources/sql-tests/join/cartesian_product.sql‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,29 @@ CREATE TABLE cp_large(k int, v int) USING parquet
4949
statement
5050
INSERT INTO cp_large SELECT id, id FROM range(10000)
5151

52+
-- CrossJoinExec repeats each left row through ScalarValue, so the left side covers every
53+
-- type with NULLs, nested NULLs, NaN and both signed zeros.
54+
statement
55+
CREATE TABLE cp_types(s string, d decimal(10, 2), ts timestamp, dt date, b binary, bo boolean,
56+
f double, a array<int>, st struct<x: int, y: string>, m map<string, int>) USING parquet
57+
58+
statement
59+
INSERT INTO cp_types VALUES
60+
('a', 1.25, TIMESTAMP '2024-01-01 12:34:56', DATE '2024-01-01', X'0102', true, 1.5,
61+
array(1, NULL), named_struct('x', 1, 'y', 'p'), map('k', 1)),
62+
(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
63+
('', -1.25, TIMESTAMP '1969-12-31 23:59:59', DATE '1969-12-31', X'', false,
64+
cast('NaN' AS double), array(), named_struct('x', NULL, 'y', NULL), map('k', NULL)),
65+
('b', 0.00, TIMESTAMP '1970-01-01 00:00:00', DATE '1970-01-01', X'FF', true,
66+
cast('-0.0' AS double), array(NULL), named_struct('x', 2, 'y', NULL), map()),
67+
('c', 99999999.99, TIMESTAMP '2038-01-19 03:14:07', DATE '9999-12-31', X'00', false,
68+
0.0, array(2, 3), NULL, NULL)
69+
70+
-- Native, every type on the left side
71+
query
72+
SELECT * FROM (SELECT /*+ COALESCE(1) */ * FROM cp_types) l
73+
CROSS JOIN (SELECT /*+ COALESCE(1) */ * FROM cp_right) r
74+
5275
-- Native, with NULLs on both sides
5376
query
5477
SELECT * FROM (SELECT /*+ COALESCE(1) */ * FROM cp_left) l

0 commit comments

Comments
 (0)