Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1626#discussion_r155277594
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateListeners.scala
---
@@ -51,8 +63,26 @@ object LoadPostAggregateListener extends
OperationEventListener {
carbonLoadModel.getTableName, "false")
val childTableName =
dataMapSchema.getRelationIdentifier.getTableName
val childDatabaseName =
dataMapSchema.getRelationIdentifier.getDatabaseName
- val childDataFrame = sparkSession.sql(new
CarbonSpark2SqlParser().addPreAggLoadFunction(
- s"${ dataMapSchema.getProperties.get("CHILD_SELECT QUERY") }
")).drop("preAggLoad")
+ val childDataFrame =
+ if
(!dataMapSchema.asInstanceOf[AggregationDataMapSchema].isTimeseriesDataMap) {
+ sparkSession.sql(new
CarbonSpark2SqlParser().addPreAggLoadFunction(
+ s"${ dataMapSchema.getProperties.get("CHILD_SELECT QUERY") }
")).drop("preAggLoad")
+ } else {
+ // for timeseries rollup policy
+ val tableSelectedForRollup =
PreAggregateUtil.getRollupDataMapNameForTimeSeries(list,
+ dataMapSchema.asInstanceOf[AggregationDataMapSchema])
+ // if non of the rollup data map is selected hit the maintable
and prepare query
+ val childQuery = if (!tableSelectedForRollup.isDefined) {
--- End diff --
use isEmpty
---