You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/01/14 12:12:59 UTC

[GitHub] qiuchenjian commented on a change in pull request #3058: [CARBONDATA-3238] Solve StackOverflowError using MV datamap

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_r247469652
 
 

 ##########
 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  i think this method can't solve the problem ,because the first transformExpressions called by sel_3q  runs unlimited and throw StackOverflowError, right? 
   Or i didn't get your idea?
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services