You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Shekharrajak (via GitHub)" <gi...@apache.org> on 2025/12/27 09:15:01 UTC
[PR] Add config to disable columnar shuffle for complex types [datafusion-comet]
Shekharrajak opened a new pull request, #2992:
URL: https://github.com/apache/datafusion-comet/pull/2992
## Which issue does this PR close?
Closes #2904
## Rationale for this change
Benchmarks show that Comet columnar shuffle with complex/nested types (struct, array, map) is significantly slower than Spark's default shuffle. This PR adds a configuration flag to disable columnar shuffle for complex types, falling back to Spark shuffle for better performance until the underlying performance issues can be addressed.
## What changes are included in this PR?
Add spark.comet.columnar.shuffle.complexTypes.enabled config (default: false)
When disabled, queries with complex types in the shuffle schema fall back to Spark shuffle
Update columnarShuffleSupported() to check this config for StructType, ArrayType, and MapTyp
## How are these changes tested?
Updated existing columnar shuffle tests for complex types to explicitly enable the new config
Added new test "Fallback to Spark for complex types when config is disabled (default)" that verifies struct, array, and map types fall back to Spark shuffle when the config is disabled
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Add config to disable columnar shuffle for complex types [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #2992:
URL: https://github.com/apache/datafusion-comet/pull/2992#discussion_r2658172028
##########
spark/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/CometShuffleExchangeExec.scala:
##########
@@ -403,23 +403,39 @@ object CometShuffleExchangeExec
*
* Comet columnar shuffle used native code to convert Spark unsafe rows to Arrow batches, see
* shuffle/row.rs
+ *
+ * Returns None if supported, or Some(reason) if not supported.
*/
- def supportedSerializableDataType(dt: DataType): Boolean = dt match {
+ def supportedSerializableDataType(dt: DataType): Option[String] = dt match {
case _: BooleanType | _: ByteType | _: ShortType | _: IntegerType | _: LongType |
_: FloatType | _: DoubleType | _: StringType | _: BinaryType | _: TimestampType |
_: TimestampNTZType | _: DecimalType | _: DateType =>
- true
+ None
case StructType(fields) =>
- fields.nonEmpty && fields.forall(f => supportedSerializableDataType(f.dataType)) &&
- // Java Arrow stream reader cannot work on duplicate field name
- fields.map(f => f.name).distinct.length == fields.length &&
- fields.nonEmpty
+ if (!COMET_COLUMNAR_SHUFFLE_COMPLEX_TYPES_ENABLED.get(s.conf)) {
+ Some(s"${COMET_COLUMNAR_SHUFFLE_COMPLEX_TYPES_ENABLED.key} is not enabled")
Review Comment:
👍
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Add config to disable columnar shuffle for complex types [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on PR #2992:
URL: https://github.com/apache/datafusion-comet/pull/2992#issuecomment-3694080118
It may be worth enabling `COMET_COLUMNAR_SHUFFLE_COMPLEX_TYPES_ENABLED` in `CometTestBase`
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Add config to disable columnar shuffle for complex types [datafusion-comet]
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #2992:
URL: https://github.com/apache/datafusion-comet/pull/2992#discussion_r2649255940
##########
spark/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/CometShuffleExchangeExec.scala:
##########
@@ -410,13 +410,16 @@ object CometShuffleExchangeExec
_: TimestampNTZType | _: DecimalType | _: DateType =>
true
case StructType(fields) =>
+ COMET_COLUMNAR_SHUFFLE_COMPLEX_TYPES_ENABLED.get(s.conf) &&
Review Comment:
Thanks for review. Added https://github.com/apache/datafusion-comet/pull/2992/changes#diff-b727d0c41eda8ac737e717d79611e54bb175819e07c1c1b5072aa9a64b2e2fe3R465
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Add config to disable columnar shuffle for complex types [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed pull request #2992: Add config to disable columnar shuffle for complex types
URL: https://github.com/apache/datafusion-comet/pull/2992
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Add config to disable columnar shuffle for complex types [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #2992:
URL: https://github.com/apache/datafusion-comet/pull/2992#discussion_r2649216600
##########
spark/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/CometShuffleExchangeExec.scala:
##########
@@ -410,13 +410,16 @@ object CometShuffleExchangeExec
_: TimestampNTZType | _: DecimalType | _: DateType =>
true
case StructType(fields) =>
+ COMET_COLUMNAR_SHUFFLE_COMPLEX_TYPES_ENABLED.get(s.conf) &&
Review Comment:
It would be better to show a specific fallback reason if this config is not enabled
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org