Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1626#discussion_r155283460
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonPreAggregateRules.scala
---
@@ -725,6 +786,31 @@ case class CarbonPreAggregateQueryRules(sparkSession:
SparkSession) extends Rule
Alias(aggExp,
name)(NamedExpression.newExprId,
alias.qualifier).asInstanceOf[NamedExpression]
+ case alias@Alias(expression: Expression, name) =>
+ val updatedExp =
+ if (expression.isInstanceOf[ScalaUDF] &&
+
expression.asInstanceOf[ScalaUDF].function.getClass.getName.equalsIgnoreCase(
+
"org.apache.spark.sql.execution.command.timeseries.TimeseriesUDf")) {
+ expression.asInstanceOf[ScalaUDF].transform {
+ case attr: AttributeReference =>
+ val childAttributeReference =
getChildAttributeReference(aggDataMapSchema,
+ attr,
+ attributes,
+ timeseriesFunction =
--- End diff --
remove it
---