Skip to content

Commit 6e05f14

Browse files
committed
define GroupingExpression as TaggingExpression
1 parent 04e61c5 commit 6e05f14

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/constraintExpressions.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ case class KnownNotNull(child: Expression) extends TaggingExpression {
3939
}
4040

4141
case class KnownFloatingPointNormalized(child: Expression) extends TaggingExpression
42+
43+
/**
44+
* Wrapper expression to avoid further optimizations between the parent and child of this
45+
* expression.
46+
*/
47+
case class GroupingExpression(child: Expression) extends TaggingExpression

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/grouping.scala

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.spark.sql.catalyst.expressions
1919

2020
import org.apache.spark.sql.catalyst.InternalRow
21-
import org.apache.spark.sql.catalyst.expressions.codegen.{CodegenContext, CodegenFallback, ExprCode}
21+
import org.apache.spark.sql.catalyst.expressions.codegen.CodegenFallback
2222
import org.apache.spark.sql.internal.SQLConf
2323
import org.apache.spark.sql.types._
2424

@@ -155,21 +155,3 @@ object GroupingID {
155155
if (SQLConf.get.integerGroupingIdEnabled) IntegerType else LongType
156156
}
157157
}
158-
159-
/**
160-
* Wrapper expression to avoid further optimizations between the parent and child of this
161-
* expression.
162-
*/
163-
case class GroupingExpression(child: Expression) extends UnaryExpression {
164-
override def eval(input: InternalRow): Any = {
165-
child.eval(input)
166-
}
167-
168-
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
169-
child.genCode(ctx)
170-
}
171-
172-
override def dataType: DataType = {
173-
child.dataType
174-
}
175-
}

0 commit comments

Comments
 (0)