You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by ru...@apache.org on 2019/07/01 14:04:07 UTC

[calcite] branch master updated: [CALCITE-3125] Remove completely CorrelateJoinType

This is an automated email from the ASF dual-hosted git repository.

rubenql pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new 64a61cd  [CALCITE-3125] Remove completely CorrelateJoinType
64a61cd is described below

commit 64a61cda18ada294e74ed6841d714d067bf0cb4e
Author: rubenada <ru...@gmail.com>
AuthorDate: Mon Jul 1 13:47:57 2019 +0200

    [CALCITE-3125] Remove completely CorrelateJoinType
---
 .../apache/calcite/linq4j/CorrelateJoinType.java   | 68 ----------------------
 .../apache/calcite/linq4j/DefaultEnumerable.java   |  8 ---
 .../apache/calcite/linq4j/ExtendedEnumerable.java  | 34 +----------
 3 files changed, 1 insertion(+), 109 deletions(-)

diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/CorrelateJoinType.java b/linq4j/src/main/java/org/apache/calcite/linq4j/CorrelateJoinType.java
deleted file mode 100644
index 6561997..0000000
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/CorrelateJoinType.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.calcite.linq4j;
-
-/**
- * Specifies the type of correlation operation: inner, left, semi, or anti.
- * @deprecated Use {@link JoinType}
- */
-@Deprecated // to be removed before 1.21
-public enum CorrelateJoinType {
-  /**
-   * Inner join
-   */
-  INNER,
-
-  /**
-   * Left-outer join
-   */
-  LEFT,
-
-  /**
-   * Semi-join.
-   *
-   * <p>Similar to {@code from A ... where a in (select b from B ...)}</p>
-   */
-  SEMI,
-
-  /**
-   * Anti-join.
-   *
-   * <p>Similar to {@code from A ... where a NOT in (select b from B ...)}
-   *
-   * <p>Note: if B.b is nullable and B has nulls, no rows must be returned.
-   */
-  ANTI;
-
-  /** Transforms this CorrelateJoinType to JoinType. **/
-  public JoinType toJoinType() {
-    switch (this) {
-    case INNER:
-      return JoinType.INNER;
-    case LEFT:
-      return JoinType.LEFT;
-    case SEMI:
-      return JoinType.SEMI;
-    case ANTI:
-      return JoinType.ANTI;
-    }
-    throw new IllegalStateException(
-        "Unable to convert " + this + " to JoinType");
-  }
-}
-
-// End CorrelateJoinType.java
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java
index 86ab173..752e8f7 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java
@@ -372,14 +372,6 @@ public abstract class DefaultEnumerable<T> implements OrderedEnumerable<T> {
         generateNullsOnRight);
   }
 
-  @Deprecated // to be removed before 1.21
-  public <TInner, TResult> Enumerable<TResult> correlateJoin(
-      CorrelateJoinType correlateJoinType, Function1<T, Enumerable<TInner>> inner,
-      Function2<T, TInner, TResult> resultSelector) {
-    return EnumerableDefaults.correlateJoin(correlateJoinType.toJoinType(), getThis(), inner,
-        resultSelector);
-  }
-
   public <TInner, TResult> Enumerable<TResult> correlateJoin(
       JoinType joinType, Function1<T, Enumerable<TInner>> inner,
       Function2<T, TInner, TResult> resultSelector) {
diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java
index 7fc26d0..d9c413f 100644
--- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java
+++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java
@@ -541,46 +541,14 @@ public interface ExtendedEnumerable<TSource> {
    * For each row of the current enumerable returns the correlated rows
    * from the {@code inner} enumerable (nested loops join).
    *
-   * @deprecated Use {@link #correlateJoin(JoinType, Function1, Function2)}
-   *
    * @param joinType inner, left, semi or anti join type
    * @param inner generator of inner enumerable
    * @param resultSelector selector of the result. For semi/anti join
    *                       inner argument is always null.
    */
-  @Deprecated // to be removed before 1.21
   <TInner, TResult> Enumerable<TResult> correlateJoin(
-      CorrelateJoinType joinType, Function1<TSource, Enumerable<TInner>> inner,
-      Function2<TSource, TInner, TResult> resultSelector);
-
-  /**
-   * For each row of the current enumerable returns the correlated rows
-   * from the {@code inner} enumerable (nested loops join).
-   *
-   * @param joinType inner, left, semi or anti join type
-   * @param inner generator of inner enumerable
-   * @param resultSelector selector of the result. For semi/anti join
-   *                       inner argument is always null.
-   */
-  @SuppressWarnings("deprecation")
-  default <TInner, TResult> Enumerable<TResult> correlateJoin(
       JoinType joinType, Function1<TSource, Enumerable<TInner>> inner,
-      Function2<TSource, TInner, TResult> resultSelector) {
-    // temporary default implementation for backwards compatibility
-    switch (joinType) {
-    case INNER:
-      return correlateJoin(CorrelateJoinType.INNER, inner, resultSelector);
-    case LEFT:
-      return correlateJoin(CorrelateJoinType.LEFT, inner, resultSelector);
-    case SEMI:
-      return correlateJoin(CorrelateJoinType.SEMI, inner, resultSelector);
-    case ANTI:
-      return correlateJoin(CorrelateJoinType.ANTI, inner, resultSelector);
-    default:
-      throw new IllegalArgumentException("JoinType " + joinType + " is not valid for correlation");
-    }
-  }
-
+      Function2<TSource, TInner, TResult> resultSelector);
 
   /**
    * Returns the last element of a sequence. (Defined