[GitHub] [spark] viirya commented on a change in pull request #26615: [SPARK-29977][SQL] Remove newMutableProjection/newOrdering/newNaturalAscendingOrdering from SparkPlan
viirya commented on a change in pull request #26615: [SPARK-29977][SQL] Remove newMutableProjection/newOrdering/newNaturalAscendingOrdering from SparkPlan URL: https://github.com/apache/spark/pull/26615#discussion_r348919072 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala ## @@ -93,7 +93,7 @@ case class SortAggregateExec( initialInputBufferOffset, resultExpressions, (expressions, inputSchema) => -newMutableProjection(expressions, inputSchema, subexpressionEliminationEnabled), +MutableProjection.create(expressions, inputSchema), Review comment: MutableProjection now directly gets the config from SQLConf.get.subexpressionEliminationEnabled. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #26615: [SPARK-29977][SQL] Remove newMutableProjection/newOrdering/newNaturalAscendingOrdering from SparkPlan
viirya commented on a change in pull request #26615: [SPARK-29977][SQL] Remove newMutableProjection/newOrdering/newNaturalAscendingOrdering from SparkPlan URL: https://github.com/apache/spark/pull/26615#discussion_r348901445 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ordering.scala ## @@ -102,4 +112,26 @@ object RowOrdering { * Returns true iff outputs from the expressions can be ordered. */ def isOrderable(exprs: Seq[Expression]): Boolean = exprs.forall(e => isOrderable(e.dataType)) + + override protected def createCodeGeneratedObject(in: Seq[SortOrder]): BaseOrdering = { +GenerateOrdering.generate(in) + } + + override protected def createInterpretedObject(in: Seq[SortOrder]): BaseOrdering = { +new InterpretedOrdering(in) + } + + def create(order: Seq[SortOrder], inputSchema: Seq[Attribute]): Ordering[InternalRow] = { Review comment: BaseOrdering? 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #26615: [SPARK-29977][SQL] Remove newMutableProjection/newOrdering/newNaturalAscendingOrdering from SparkPlan
viirya commented on a change in pull request #26615: [SPARK-29977][SQL] Remove newMutableProjection/newOrdering/newNaturalAscendingOrdering from SparkPlan URL: https://github.com/apache/spark/pull/26615#discussion_r348901490 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ordering.scala ## @@ -102,4 +112,26 @@ object RowOrdering { * Returns true iff outputs from the expressions can be ordered. */ def isOrderable(exprs: Seq[Expression]): Boolean = exprs.forall(e => isOrderable(e.dataType)) + + override protected def createCodeGeneratedObject(in: Seq[SortOrder]): BaseOrdering = { +GenerateOrdering.generate(in) + } + + override protected def createInterpretedObject(in: Seq[SortOrder]): BaseOrdering = { +new InterpretedOrdering(in) + } + + def create(order: Seq[SortOrder], inputSchema: Seq[Attribute]): Ordering[InternalRow] = { +createObject(bindReferences(order, inputSchema)) + } + + /** + * Creates a row ordering for the given schema, in natural ascending order. + */ + def createNaturalAscendingOrdering(dataTypes: Seq[DataType]): Ordering[InternalRow] = { Review comment: ditto? 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org