akashrn5 commented on a change in pull request #3495: [WIP] Support Query
Rollup for MV TimeSeries Queries
URL: https://github.com/apache/carbondata/pull/3495#discussion_r356467457
##########
File path:
datamap/mv/plan/src/main/scala/org/apache/carbondata/mv/plans/package.scala
##########
@@ -42,8 +42,42 @@ package object plans {
expr.references.subsetOf(plan.outputSet)
}
+
+ /**
+ * If exp is a ScalaUDF, then for each of it's children, we have to check
if
+ * children can be derived from another scala UDF children from exprList
+ * @param exp scalaUDF
+ * @param exprList predicate and rejoin output list
+ * @return if udf can be derived from another udf
+ */
+ def canEvaluate(exp: ScalaUDF, exprList: Seq[Expression]): Boolean = {
+ val canBeDerived = false
+ exprList.forall {
+ case udf: ScalaUDF =>
+ if (udf.children.length == exp.children.length) {
+ var canUDFBeDerived = true
+ for (i <- udf.children.indices) {
Review comment:
instead of setting first to true and then check in for loop to set false,
can't we check children.forall, () and then just set to true if condition
matches? else anyway it will be false
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services