Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2444#discussion_r200568172
--- Diff:
datamap/mv/core/src/main/scala/org/apache/carbondata/mv/rewrite/DefaultMatchMaker.scala
---
@@ -245,15 +269,22 @@ object SelectSelectNoChildDelta extends
DefaultMatchPattern with PredicateHelper
}
}
val tPredicateList = sel_1q.predicateList.filter { p =>
- !sel_1a.predicateList.exists(_.semanticEquals(p)) }
- val wip = sel_1q.copy(
- predicateList = tPredicateList,
- children = tChildren,
- joinEdges = tJoinEdges.filter(_ != null),
- aliasMap = tAliasMap.toMap)
-
- val done = factorOutSubsumer(wip, usel_1a, wip.aliasMap)
- Seq(done)
+ !sel_1a.predicateList.exists(_.semanticEquals(p))
+ } ++ (if (isLeftJoinView(sel_1a) &&
+ sel_1q.joinEdges.head.joinType == Inner) {
+ sel_1a.children(1)
+
.asInstanceOf[HarmonizedRelation].tag.map(IsNotNull(_)).toSeq
+ } else {
+ Seq.empty
+ })
+ val wip = sel_1q.copy(
--- End diff --
ok
---