Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Comet broadcast by default #212

Closed
viirya opened this issue Mar 17, 2024 · 0 comments · Fixed by #213
Closed

Enable Comet broadcast by default #212

viirya opened this issue Mar 17, 2024 · 0 comments · Fixed by #213
Assignees
Labels
enhancement New feature or request

Comments

@viirya
Copy link
Member

viirya commented Mar 17, 2024

What is the problem the feature request solves?

COMET_EXEC_BROADCAST_ENABLED is disabled by default now. It is because as Comet broadcast exec operator CometBroadcastExchange is column-based. So Spark planner will add ColumnarToRow between downstream operator (e.g., BroadcastHashJoinExec) and CometBroadcastExchange. It will cause the following error in runtime:

  org.apache.spark.SparkUnsupportedOperationException: ColumnarToRow does not implement doExecuteBroadcast.                                                                                                                            
  at org.apache.spark.sql.errors.QueryExecutionErrors$.doExecuteBroadcastNotImplementedError(QueryExecutionErrors.scala:2552)                                                                                                          
  at org.apache.spark.sql.execution.SparkPlan.doExecuteBroadcast(SparkPlan.scala:326)                              
  at org.apache.spark.sql.execution.SparkPlan.$anonfun$executeBroadcast$1(SparkPlan.scala:208)                                                                                                                                         
  at org.apache.spark.sql.execution.SparkPlan.$anonfun$executeQuery$1(SparkPlan.scala:246)                         
  at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)                                                                                                                                                      at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:243)                                                                                                                                                        
  at org.apache.spark.sql.execution.SparkPlan.executeBroadcast(SparkPlan.scala:204)                                                                                                                                                    
  at org.apache.spark.sql.execution.joins.BroadcastHashJoinExec.prepareBroadcast(BroadcastHashJoinExec.scala:207)                                                                                                                        at org.apache.spark.sql.execution.joins.BroadcastHashJoinExec.prepareRelation(BroadcastHashJoinExec.scala:221)                                                                                                                       
  at org.apache.spark.sql.execution.joins.HashJoin.codegenInner(HashJoin.scala:390)                                                                                                                                                    

This is because Spark will insert ColumnarToRow between row-based operator (BroadcastHashJoinExec) and column-based operator (CometBroadcastExchange). In BroadcastHashJoinExec, its build side that assumes to be broadcasted operator is changed to ColumnarToRow. But BroadcastHashJoinExec sill invokes doExecuteBroadcast on the changed build side which doesn't implement that.

Describe the potential solution

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant