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/10 14:36:48 UTC

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

ravipesala 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_r282911438
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/rewrite/Navigator.scala
 ##########
 @@ -146,21 +146,28 @@ private[mv] class Navigator(catalog: SummaryDatasetCatalog, session: MVSession)
     val rtables = subsumer.collect { case n: modular.LeafNode => n }
     val etables = subsumee.collect { case n: modular.LeafNode => n }
     val pairs = for {
-      rtable <- rtables
-      etable <- etables
-      if rtable == etable
-    } yield (rtable, etable)
+      i <- rtables.indices
+      j <- etables.indices
+      if rtables(i) == etables(j) && reTablesJoinMatched(
+        rtables(i), etables(j), subsumer, subsumee, i, j
+      )
+    } yield (rtables(i), etables(j))
 
     pairs.foldLeft(subsumer) {
       case (curSubsumer, pair) =>
         val mappedOperator =
-          if (pair._1.isInstanceOf[modular.HarmonizedRelation] &&
-              pair._1.asInstanceOf[modular.HarmonizedRelation].hasTag) {
-          pair._2.asInstanceOf[modular.HarmonizedRelation].addTag
-        } else {
-          pair._2
+          pair._1 match {
+            case relation: HarmonizedRelation if relation.hasTag =>
+              pair._2.asInstanceOf[HarmonizedRelation].addTag
+            case _ =>
+              pair._2
+          }
+        val nxtSubsumer = curSubsumer.transform {
+          case node: ModularRelation if node.asInstanceOf[ModularRelation].
 
 Review comment:
   No need to typecast here , you can directly write `f node.fineEquals(pair._1)`

----------------------------------------------------------------
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