Github user ravipesala commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1728#discussion_r159056348 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonPreAggregateRules.scala --- @@ -330,6 +207,264 @@ case class CarbonPreAggregateQueryRules(sparkSession: SparkSession) extends Rule } } + /** + * Below method will be used to validate the logical plan + * and get all the details from to select proper aggregate table + * @param logicalPlan + * actual query logical plan + * @param list + * list of projection column present in plan + * @param qAggExprs + * list of aggregate expression + * @return if plan is valid for tranformation, parent table, parent logical relaion + */ + def validatePlanAndGetFields(logicalPlan: LogicalPlan, + list: scala.collection.mutable.HashSet[QueryColumn], + qAggExprs: scala.collection.mutable.HashSet[AggregateExpression]): (Boolean, + CarbonTable, LogicalRelation) = { + var isValidPlan = false + var pTable: CarbonTable = null + var qLRelation: LogicalRelation = null + logicalPlan.transform { --- End diff -- It seems Join condition of two plans is not handled here. Please handle Join, Union cases also using recursion.
---