ulysses-you commented on a change in pull request #32084: URL: https://github.com/apache/spark/pull/32084#discussion_r612105250
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/UnionAwareOptimizerRule.scala ########## @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.adaptive + +import org.apache.spark.sql.execution.{SparkPlan, UnionExec} + +trait UnionAwareOptimizerRule { Review comment: > Can we make this rule more general? Ideally we need to split the query plan of the given query stage into several groups. The shuffles within one group must have the same number of partitions. > > This rule is overly simplified right now and assumes the entire query stage is one group. It's definitely wrong with Union and we should fix it. To be conservative we can try to put everything in one group except for Union. We should make the code extensible so that we can add more "breaking points" that can split groups in the future @cloud-fan agree with it, try to add a new trait to make it clear. I believe other query stage optimizer rule e.g., `OptimizeSkewedJoin` also need this. Do you have any thought ? -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
