Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1508#discussion_r151408491
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateListeners.scala
---
@@ -51,11 +51,39 @@ object LoadPostAggregateListener extends
OperationEventListener {
val childDatabaseName =
dataMapSchema.getRelationIdentifier.getDatabaseName
val selectQuery = dataMapSchema.getProperties.get("CHILD_SELECT
QUERY")
sparkSession.sql(s"insert into $childDatabaseName.$childTableName
$selectQuery")
+
CarbonSession.threadUnset(CarbonCommonConstants.CARBON_INPUT_SEGMENTS +
--- End diff --
add this unset to finally
---