Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1521#discussion_r157697249
--- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonPreAggregateRules.scala ---
@@ -308,9 +308,18 @@ case class CarbonPreAggregateQueryRules(sparkSession: SparkSession) extends Rule
val relation = sparkSession.sessionState.catalog.lookupRelation(identifier)
(selectedDataMapSchema, carbonRelation, relation)
}.minBy(f => f._2.sizeInBytes)
- val newRelation = new FindDataSourceTable(sparkSession).apply(relation)
- // transform the query plan based on selected child schema
- transformPreAggQueryPlan(plan, aggDataMapSchema, newRelation)
+ if (carbonRelation.sizeInBytes ==
--- End diff --
This is not the correct place to handle this issue....in this case if many aggregate table is matching the query expression in and smallest is of zero size then it will hit the maintable but we need to check the size of other aggregate table also
---