kumarvishal09 commented on a change in pull request #3438: [CARBONDATA-3531]Support load and query for MV timeseries and support multiple granularity.
URL:
https://github.com/apache/carbondata/pull/3438#discussion_r347275332
##########
File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/rewrite/DefaultMatchMaker.scala
##########
@@ -448,17 +448,44 @@ object GroupbyGroupbySelectOnlyChildDelta extends DefaultMatchPattern with Predi
subsumer: ModularPlan,
compensation: Option[ModularPlan]) = {
if (subsumee.asInstanceOf[GroupBy].predicateList.contains(exprE)) {
- if (exprListR.exists(_.semanticEquals(exprE)) || canEvaluate(exprE, exprListR)) true
- else false
+ if (exprListR.exists(_.semanticEquals(exprE)) || canEvaluate(exprE, exprListR) ||
+ isDerivableForUDF(exprE, exprListR)) {
+ true
+ } else {
+ false
+ }
} else if (compensation.getOrElse(throw new RuntimeException("compensation cannot be None"))
.asInstanceOf[Select].predicateList.contains(exprE)) {
- if (canEvaluate(exprE, exprListR) || exprListR.exists(_.semanticEquals(exprE))) true
- else false
+ if (canEvaluate(exprE, exprListR) || exprListR.exists(_.semanticEquals(exprE)) ||
+ isDerivableForUDF(exprE, exprListR)) {
+ true
+ } else {
+ false
+ }
} else {
false
}
}
+ /**
+ * org.apache.carbondata.mv.plans.MorePredicateHelper#canEvaluate will be checking the
+ * exprE.references as subset of AttibuteSet(exprListR), which will just take the column name from
+ * UDF, so it will be always false for ScalaUDF.
+ * This method takes care of checking whether the exprE references can be derived form list
+ */
Review comment:
Please add example explaining about the scenario in comments
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services