Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1888#discussion_r164933909
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala
---
@@ -87,6 +88,39 @@ class CarbonLateDecodeRule extends Rule[LogicalPlan]
with PredicateHelper {
}
}
+ /**
+ * Below method will be used to validate if query is directly fired on
pre aggregate
+ * data map or not
+ * @param relations all relations from query
+ *
+ */
+ def validateQueryDirectlyOnDataMap(relations:
Seq[CarbonDecoderRelation]): Unit = {
+ var isPreAggDataMapExists = false
+ // first check if pre aggregate data map exists or not
+ relations.foreach{relation =>
+ if (relation.carbonRelation.carbonTable.isChildDataMap) {
+ isPreAggDataMapExists = true
+ }
+ }
+ val validateQuery = CarbonProperties.getInstance
+ .getProperty(CarbonCommonConstants.VALIDATE_DIRECT_QUERY_ON_DATAMAP,
"true").toBoolean
+ var isThrowException = false
+ // if validate query is enabled and relation contains pre aggregate
data map
+ if (validateQuery && isPreAggDataMapExists) {
+ val carbonSessionInfo = ThreadLocalSessionInfo.getCarbonSessionInfo
--- End diff --
Can you expose a put and get interface in CarbonEnv to manipulate the
SessionParam in CarbonEnv
---