You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/05/13 14:19:58 UTC

[GitHub] [calcite] rubenada commented on a change in pull request #1156: [CALCITE-2973] Allow theta joins that have equi conditions to be exec…

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

 ##########
 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:
   Maybe I'm missing something, but it seems that we have converted an enumerable (`inner`) into a list (`rightList`), and then back to enumerable (`Linq4j.asEnumerable(rightList)`). Wouldn't it be simpler to keep this line and the next one unchanged (using `inner`)?

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