Github user ravipesala commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1464#discussion_r148998207 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateUtil.scala --- @@ -49,70 +50,109 @@ object PreAggregateUtil { def getParentCarbonTable(plan: LogicalPlan): CarbonTable = { plan match { - case Aggregate(_, aExp, SubqueryAlias(_, l: LogicalRelation, _)) - if l.relation.isInstanceOf[CarbonDatasourceHadoopRelation] => - l.relation.asInstanceOf[CarbonDatasourceHadoopRelation].carbonRelation.metaData.carbonTable + case Aggregate(_, _, SubqueryAlias(_, logicalRelation: LogicalRelation, _)) + if logicalRelation.relation.isInstanceOf[CarbonDatasourceHadoopRelation] => + logicalRelation.relation.asInstanceOf[CarbonDatasourceHadoopRelation]. + carbonRelation.metaData.carbonTable + case Aggregate(_, _, logicalRelation: LogicalRelation) + if logicalRelation.relation.isInstanceOf[CarbonDatasourceHadoopRelation] => + logicalRelation.relation.asInstanceOf[CarbonDatasourceHadoopRelation]. + carbonRelation.metaData.carbonTable case _ => throw new MalformedCarbonCommandException("table does not exist") } } /** * Below method will be used to validate the select plan * and get the required fields from select plan - * Currently only aggregate query is support any other type of query will - * fail + * Currently only aggregate query is support any other type of query will fail + * * @param plan * @param selectStmt * @return list of fields */ def validateActualSelectPlanAndGetAttrubites(plan: LogicalPlan, --- End diff -- typo `Attributes`
---