[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3125: [CARBONDATA-3291] Fix that MV datamap doesn't take affect when the same table join

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3125: [CARBONDATA-3291] Fix that MV datamap doesn't take affect when the same table join

GitBox
qiuchenjian commented on a change in pull request #3125: [CARBONDATA-3291] Fix that MV datamap doesn't take affect when the same table join
URL: https://github.com/apache/carbondata/pull/3125#discussion_r283600203
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/rewrite/Navigator.scala
 ##########
 @@ -171,4 +178,27 @@ private[mv] class Navigator(catalog: SummaryDatasetCatalog, session: MVSession)
         }
     }
   }
+
+  // match the join table of subsumer and subsumee
+  // when the table names are the same
+  def reTablesJoinMatched(rtable: modular.LeafNode, etable: modular.LeafNode,
+                          subsumer: ModularPlan, subsumee: ModularPlan,
+                          rIndex: Int, eIndex: Int): Boolean = {
+    (rtable, etable) match {
+      case _: (ModularRelation, ModularRelation) =>
+        val rtableParent = subsumer.find(p => p.children.contains(rtable)).get
+        val etableParent = subsumee.find(p => p.children.contains(etable)).get
+        (rtableParent, etableParent) match {
+          case _: (Select, Select) =>
+            val rJoinEdges = rtableParent.asInstanceOf[Select].joinEdges
+            val eJoinEdges = etableParent.asInstanceOf[Select].joinEdges
+            val intersetJoinEdges: Seq[JoinEdge] = rJoinEdges intersect eJoinEdges
 
 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:
[hidden email]


With regards,
Apache Git Services