qiuchenjian commented on a change in pull request #3058: [CARBONDATA-3238] Solve StackOverflowError using MV datamap
URL:
https://github.com/apache/carbondata/pull/3058#discussion_r248959581
##########
File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/rewrite/DefaultMatchMaker.scala
##########
@@ -677,8 +677,18 @@ object SelectSelectGroupbyChildDelta extends DefaultMatchPattern with PredicateH
val aliasMap_exp = AttributeMap(
gb_2c.outputList.collect {
case a: Alias => (a.toAttribute, a) })
+
+ // avoid to transform a expression more than twrice
+ // accept for select and having
+ val transformedExpFlags = scala.collection.mutable.Map[ExprId, Int]()
+ aliasMap_exp.keySet.map(alias =>
+ transformedExpFlags += (alias.exprId -> 0))
val sel_3q_exp = sel_3q.transformExpressions({
- case attr: Attribute if aliasMap_exp.contains(attr) => aliasMap_exp(attr)
+ case attr: Attribute if aliasMap_exp.contains(attr) &&
+ transformedExpFlags(attr.exprId) < 2 => {
+ transformedExpFlags(attr.exprId) += 1
+ aliasMap_exp(attr)
+ }
Review comment:
@ravipesala done! thanks for your help
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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