LaiZhou commented on a change in pull request #1156: [CALCITE-2973] Allow theta 
joins that have equi conditions to be exec…
URL: https://github.com/apache/calcite/pull/1156#discussion_r283388282
 
 

 ##########
 File path: 
linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
 ##########
 @@ -1063,22 +1084,25 @@ public void close() {
       final Enumerable<TSource> outer, final Enumerable<TInner> inner,
       final Function1<TSource, TKey> outerKeySelector,
       final Function1<TInner, TKey> innerKeySelector,
+      final Predicate2<TSource, TInner> predicate,
       final Function2<TSource, TInner, TResult> resultSelector,
       final EqualityComparer<TKey> comparer, final boolean generateNullsOnLeft,
       final boolean generateNullsOnRight) {
     return new AbstractEnumerable<TResult>() {
       public Enumerator<TResult> enumerator() {
+        final List<TInner> rightList = inner.toList();
         final Lookup<TKey, TInner> innerLookup =
             comparer == null
-                ? inner.toLookup(innerKeySelector)
-                : inner.toLookup(innerKeySelector, comparer);
+                ? Linq4j.asEnumerable(rightList).toLookup(innerKeySelector)
 
 Review comment:
   @rubenada , we want to get the rightUnmatched, so the inner would be figured 
out at first.
   `        final List<TInner> rightList = inner.toList();
   `
    Converting the rightList back to enumerable would't increase the overhead,
   because `Linq4j.asEnumerable(rightList)`  that will produce a ListEnumerable.
   If we keep the original inner, when doing `toLookup`, this inner will be 
figured out again , it's unnecessary.
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to