comphead commented on PR #7663: URL: https://github.com/apache/datafusion-comet/pull/7663#issuecomment-7052098180
Thanks @andygrove. Both asks are addressed in the latest commit. **Fallback reason on the guard path.** You were right that the read fell into the `case op` branch and nothing recorded a reason. The reason now goes on the join, not on the read. With the reason on the read, the forced test found no reason in the final plan, and with partition coalescing off it did. `CoalesceShufflePartitions.updateShuffleReads` builds a new `AQEShuffleReadExec(stage, specs)` after this rule, so the read's tags are lost. The join above it is rebuilt through `mapChildren`, which keeps its tags. I used `withFallbackReason` rather than `withInfo`, because `withInfo` is documented as informational for a node that does not fall back. Its message shows only in the verbose explain tree, not in the `fallback` explain format, the fallback log or `getFallbackReasons`. The case matches any join over a split read that the guard left on Spark, not only `ShuffledJoin`. On Spark 4.2, `SimpleCostEvaluator` also counts a skewed `BroadcastHashJoinExec` (SPARK-44065), and the guard covers that split too. Without the new case, the forced test finds only `Comet columnar shuffle not enabled`, which comes from the shuffle above the join. That test now runs for both join hints. The description covers the guard and the test. **Join types.** `OptimizeSkewedJoin` splits the left side of inner, left outer, left semi and left anti joins, and the right side only of inner and right outer joins. The rules are the same in 3.5, 4.0, 4.1 and 4.2. I folded `left_outer`, `left_semi` and `right_outer` into the existing test, with the skewed table on the side Spark splits. The other table now has even keys only, so the outer joins also emit unmatched rows. To keep the run time down, coalescing and shuffle direct read are now on together and then off together, instead of all four combinations. Spark's own SPARK-29544 test covers these join types, but `dev/diffs` ignores it for Comet because it asserts split counts that depend on Spark's shuffle sizes, so it could not be reused. **One Comet input and one Spark input.** A new test reads the other side from a JSON scan, so its shuffle stays on Spark. It checks that the skew join reads a Comet shuffle on one side and a Spark shuffle on the other, and that no `CometSinkPlaceHolder` is left in the final plan. For `MERGE` it also checks that the Comet sort over the split side still reads the split partitions through `ShuffleScan`. All 10 tests pass locally on Spark 4.1, and all 10 fail on main's planner code. -- 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]
