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/05/14 02:00:32 UTC

[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3129: [CARBONDATA-3295] Fix that MV datamap throw exception because its rewrite algorithm when query SQL has multiply subquery

qiuchenjian commented on a change in pull request #3129: [CARBONDATA-3295] Fix that MV datamap throw exception because its rewrite algorithm when query SQL has multiply subquery
URL: https://github.com/apache/carbondata/pull/3129#discussion_r283600537
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVHelper.scala
 ##########
 @@ -596,12 +596,20 @@ object MVHelper {
         case g: GroupBy =>
           MVHelper.updateDataMap(g, rewrite)
       }
-      // TODO Find a better way to set the rewritten flag, it may fail in some conditions.
-      val mapping =
-        rewrittenPlan.collect { case m: ModularPlan => m } zip
-        updatedDataMapTablePlan.collect { case m: ModularPlan => m }
-      mapping.foreach(f => if (f._1.rewritten) f._2.setRewritten())
 
+      // Use coarse equal to set the rewritten flag
+      // We may change the ModularPlan relation
+      // So we match the node excluding child comparison
+      updatedDataMapTablePlan.map(plan => {
+        if (rewrittenPlan.find (
+          oriPlan => oriPlan.rewritten && (plan match {
+            case select: Select => select.coarseEqual(oriPlan)
 
 Review comment:
   done

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


With regards,
Apache Git Services