You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by za...@apache.org on 2019/09/06 07:10:20 UTC

[calcite] branch branch-1.21 updated (3583601 -> 3580276)

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

zabetak pushed a change to branch branch-1.21
in repository https://gitbox.apache.org/repos/asf/calcite.git.


 discard 3583601  [maven-release-plugin] prepare for next development iteration
    omit 4420139  [maven-release-plugin] prepare release calcite-1.21.0
    omit f2f47fa  [CALCITE-3303] Release Calcite 1.21.0
     new 5c25c38  Remove the useless JdbcConvention out in descriptionPrefix for JdbcToEnumerableConverterRule (Wenhui Tang)
     new faeb6d0  [CALCITE-3322] Remove duplicate test case in RelMetadataTest (沈洪)
     new 6fabfd6  [CALCITE-3321] BigQuery does not have correct casing rules (Lindsey Meyer)
     new 8c941e0  Cosmetic code changes
     new 3580276  [CALCITE-3303] Release Calcite 1.21.0

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3583601)
            \
             N -- N -- N   refs/heads/branch-1.21 (3580276)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 babel/pom.xml                                      |   4 +-
 cassandra/pom.xml                                  |   4 +-
 core/pom.xml                                       |   4 +-
 .../adapter/enumerable/EnumerableHashJoin.java     |   4 +-
 .../jdbc/JdbcToEnumerableConverterRule.java        |   2 +-
 .../calcite/sql/dialect/BigQuerySqlDialect.java    |   6 +-
 .../sql/validate/implicit/TypeCoercion.java        |  72 +++---
 .../sql/validate/implicit/TypeCoercionImpl.java    |  33 +--
 .../apache/calcite/sql2rel/SqlToRelConverter.java  |  13 +-
 .../org/apache/calcite/plan/RelWriterTest.java     |   6 +-
 .../apache/calcite/runtime/EnumerablesTest.java    |   6 +-
 .../apache/calcite/sql/parser/SqlParserTest.java   |   5 +
 .../org/apache/calcite/test/RelMetadataTest.java   |   4 +-
 .../test/java/org/apache/calcite/util/Smalls.java  |   8 +-
 druid/pom.xml                                      |   4 +-
 elasticsearch/pom.xml                              |   4 +-
 example/csv/pom.xml                                |   4 +-
 example/function/pom.xml                           |   4 +-
 example/pom.xml                                    |   4 +-
 file/pom.xml                                       |   4 +-
 geode/pom.xml                                      |   4 +-
 kafka/pom.xml                                      |   2 +-
 linq4j/pom.xml                                     |   4 +-
 mongodb/pom.xml                                    |   4 +-
 pig/pom.xml                                        |   4 +-
 piglet/pom.xml                                     |   4 +-
 plus/pom.xml                                       |   4 +-
 pom.xml                                            |   2 +-
 server/pom.xml                                     |   4 +-
 site/_docs/adapter.md                              |   6 +-
 site/_docs/history.md                              | 252 ++++++++++-----------
 site/_docs/reference.md                            | 100 ++++----
 spark/pom.xml                                      |   4 +-
 splunk/pom.xml                                     |   4 +-
 ubenchmark/pom.xml                                 |   2 +-
 35 files changed, 320 insertions(+), 275 deletions(-)


[calcite] 02/05: [CALCITE-3322] Remove duplicate test case in RelMetadataTest (沈洪)

Posted by za...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch branch-1.21
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit faeb6d0ea16c493157a1159c49cb970790c10cc1
Author: 沈洪 <yu...@alipay.com>
AuthorDate: Wed Sep 4 11:02:50 2019 +0800

    [CALCITE-3322] Remove duplicate test case in RelMetadataTest (沈洪)
    
    Alter testcase RelMetadataTest.testRowCountSortLimit0, adding LIMIT 0 so
    that it is not the same as testRowCountSortLimit.
    
    Close apache/calcite#1439
---
 core/src/test/java/org/apache/calcite/test/RelMetadataTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/test/java/org/apache/calcite/test/RelMetadataTest.java b/core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
index f4e4f97..b877680 100644
--- a/core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
@@ -644,8 +644,8 @@ public class RelMetadataTest extends SqlToRelTestBase {
   }
 
   @Test public void testRowCountSortLimit0() {
-    final String sql = "select * from emp order by ename limit 10";
-    checkRowCount(sql, 10d, 0D, 10d);
+    final String sql = "select * from emp order by ename limit 0";
+    checkRowCount(sql, 1d, 0D, 0d);
   }
 
   @Test public void testRowCountSortLimitOffset() {


[calcite] 04/05: Cosmetic code changes

Posted by za...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch branch-1.21
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit 8c941e03d8443d1e0dae12cb740e7eea09d56ab2
Author: Julian Hyde <jh...@apache.org>
AuthorDate: Thu Sep 5 20:03:48 2019 -0700

    Cosmetic code changes
    
    Improve documentation of JDBC adapter (Shuming Li)
    
    Copy-edit SQL reference
---
 .../adapter/enumerable/EnumerableHashJoin.java     |   4 +-
 .../sql/validate/implicit/TypeCoercion.java        |  72 ++++++++-------
 .../sql/validate/implicit/TypeCoercionImpl.java    |  33 ++++---
 .../apache/calcite/sql2rel/SqlToRelConverter.java  |  13 +--
 .../org/apache/calcite/plan/RelWriterTest.java     |   6 +-
 .../apache/calcite/runtime/EnumerablesTest.java    |   6 +-
 .../test/java/org/apache/calcite/util/Smalls.java  |   8 +-
 site/_docs/adapter.md                              |   6 +-
 site/_docs/reference.md                            | 100 +++++++++++++--------
 9 files changed, 143 insertions(+), 105 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableHashJoin.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableHashJoin.java
index 1667260..91f3c90 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableHashJoin.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableHashJoin.java
@@ -244,8 +244,8 @@ public class EnumerableHashJoin extends Join implements EnumerableRel {
                         Expressions.constant(joinType.generatesNullsOnLeft()))
                     .append(
                         Expressions.constant(
-                            joinType.generatesNullsOnRight())).append(predicate)
-            ))
+                            joinType.generatesNullsOnRight()))
+                    .append(predicate)))
             .toBlock());
   }
 }
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
index 4b759b1..9cb773a 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
@@ -74,7 +74,8 @@ public interface TypeCoercion {
 
   /**
    * Finds a wider type when one or both types are decimal type.
-   * If the wider decimal type's precision/scale exceeds system limitation,
+   *
+   * <p>If the wider decimal type's precision/scale exceeds system limitation,
    * this rule will truncate the decimal type to the max precision/scale.
    * For decimal and fractional types, returns a decimal type
    * which has the higher precision of the two.
@@ -86,14 +87,14 @@ public interface TypeCoercion {
   RelDataType getWiderTypeForDecimal(RelDataType type1, RelDataType type2);
 
   /**
-   * Determines common type for a comparison operator whose operands are String type and the
-   * other(non String type) type.
+   * Determines common type for a comparison operator whose operands are String
+   * type and the other (non String) type.
    */
   RelDataType commonTypeForBinaryComparison(RelDataType type1, RelDataType type2);
 
   /**
-   * Widen a SqlNode ith column type to target type, mainly used for set operations like UNION,
-   * INTERSECT and EXCEPT.
+   * Widen a SqlNode ith column type to target type, mainly used for set
+   * operations like UNION, INTERSECT and EXCEPT.
    *
    * @param scope       scope to query
    * @param query       SqlNode which have children nodes as columns
@@ -108,8 +109,9 @@ public interface TypeCoercion {
       RelDataType targetType);
 
   /**
-   * Handles type coercion for IN operation with or without subquery.
-   * see {@link TypeCoercionImpl} for default strategies.
+   * Handles type coercion for IN operation with or without sub-query.
+   *
+   * <p>See {@link TypeCoercionImpl} for default strategies.
    */
   boolean inOperationCoercion(SqlCallBinding binding);
 
@@ -119,32 +121,36 @@ public interface TypeCoercion {
   /**
    * Coerce CASE WHEN statement branches to one common type.
    *
-   * <p>Rules: Find common type for all the then operands and else operands, then
-   * try to coerce the then/else operands to the type if needed.
-   * */
+   * <p>Rules: Find common type for all the then operands and else operands,
+   * then try to coerce the then/else operands to the type if needed.
+   */
   boolean caseWhenCoercion(SqlCallBinding binding);
 
   /**
-   * Type coercion with inferred type from passed in arguments and the {@link SqlTypeFamily}
-   * defined in the checkers, e.g. the {@link org.apache.calcite.sql.type.FamilyOperandTypeChecker}.
+   * Type coercion with inferred type from passed in arguments and the
+   * {@link SqlTypeFamily} defined in the checkers, e.g. the
+   * {@link org.apache.calcite.sql.type.FamilyOperandTypeChecker}.
    *
-   * <p>Caution that We do not cast from numeric if desired type family is also
+   * <p>Caution that we do not cast from numeric if desired type family is also
    * {@link SqlTypeFamily#NUMERIC}.
    *
-   * <p>If the {@link org.apache.calcite.sql.type.FamilyOperandTypeChecker}s are subsumed in a
-   * {@link org.apache.calcite.sql.type.CompositeOperandTypeChecker}, check them based on
-   * their combination order. i.e. If we allows a (numeric, numeric) OR (string, numeric) family
-   * but with arguments (op1, op2) of types (varchar(20), boolean), try to coerce op1
-   * to numeric and op2 to numeric if the type coercion rules allow it, or else try to coerce
-   * op2 to numeric and keep op1 the type as it is.
+   * <p>If the {@link org.apache.calcite.sql.type.FamilyOperandTypeChecker}s are
+   * subsumed in a
+   * {@link org.apache.calcite.sql.type.CompositeOperandTypeChecker}, check them
+   * based on their combination order. i.e. If we allows a (numeric, numeric) OR
+   * (string, numeric) family but with arguments (op1, op2) of types
+   * (varchar(20), boolean), try to coerce op1 to numeric and op2 to numeric if
+   * the type coercion rules allow it, or else try to coerce op2 to numeric and
+   * keep op1 the type as it is.
    *
-   * <p>This is also very interrelated to the
-   * composition predicate for the checkers, if the predicate is AND, we would fail fast
-   * if the first family type coercion fails.
-   * @param binding          call binding.
-   * @param operandTypes     Types of the operands passed in.
-   * @param expectedFamilies Expected SqlTypeFamily list by user specified.
-   * @return true if we successfully do any implicit cast.
+   * <p>This is also very interrelated to the composition predicate for the
+   * checkers: if the predicate is AND, we would fail fast if the first family
+   * type coercion fails.
+   *
+   * @param binding          Call binding
+   * @param operandTypes     Types of the operands passed in
+   * @param expectedFamilies Expected SqlTypeFamily list by user specified
+   * @return true if we successfully do any implicit cast
    */
   boolean builtinFunctionCoercion(
       SqlCallBinding binding,
@@ -152,18 +158,20 @@ public interface TypeCoercion {
       List<SqlTypeFamily> expectedFamilies);
 
   /**
-   * Non builtin functions(UDFs) type coercion, compare the types of arguments with
-   * rules:
+   * Non built-in functions (UDFs) type coercion, compare the types of arguments
+   * with rules:
+   *
    * <ol>
-   * <li>named param: find the desired type by the passed in operand's name.</li>
-   * <li>non-named param: find the desired type by formal parameter ordinal.</li>
+   * <li>named param: find the desired type by the passed in operand's name
+   * <li>non-named param: find the desired type by formal parameter ordinal
    * </ol>
    *
    * <p>Try to make type coercion only of the desired type is found.
    *
-   * @return true if any operands is coerced.
+   * @return true if any operands is coerced
    */
-  boolean userDefinedFunctionCoercion(SqlValidatorScope scope, SqlCall call, SqlFunction function);
+  boolean userDefinedFunctionCoercion(SqlValidatorScope scope, SqlCall call,
+      SqlFunction function);
 }
 
 // End TypeCoercion.java
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
index 0a2a5d7..cfc8cca 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
@@ -346,21 +346,28 @@ public class TypeCoercionImpl extends AbstractTypeCoercion {
   /**
    * STRATEGIES
    *
-   * <p>with/Without subquery:</p>
+   * <p>with/Without sub-query:
+   *
    * <ul>
-   * <li>With subquery: find the common type through comparing the left hand side (LHS)
-   * expression types with corresponding right hand side (RHS) expression derived
-   * from the subquery expression's row type. Wrap the fields of the
-   * LHS and RHS in CAST operators if it is needed.</li>
-   * <li>Without subquery: convert the nodes of the RHS to the
-   * common type by checking all the argument types and find out
-   * the minimum common type that all the arguments can be cast to.</li>
+   *
+   * <li>With sub-query: find the common type through comparing the left hand
+   * side (LHS) expression types with corresponding right hand side (RHS)
+   * expression derived from the sub-query expression's row type. Wrap the
+   * fields of the LHS and RHS in CAST operators if it is needed.
+   *
+   * <li>Without sub-query: convert the nodes of the RHS to the common type by
+   * checking all the argument types and find out the minimum common type that
+   * all the arguments can be cast to.
+   *
    * </ul>
    *
-   * How to find the common type:
+   * <p>How to find the common type:
+   *
    * <ul>
-   *   <li>For both struct sql types(LHS and RHS), find the common type of every LHS and RHS
-   *   fields pair:
+   *
+   * <li>For both struct sql types (LHS and RHS), find the common type of every
+   * LHS and RHS fields pair:
+   *
    *<pre>
    * (field1, field2, field3)    (field4, field5, field6)
    *    |        |       |          |       |       |
@@ -435,7 +442,7 @@ public class TypeCoercionImpl extends AbstractTypeCoercion {
           coerced = coerceOperandType(scope, binding.getCall(), 0, desired)
               || coerced;
         }
-        // RSH may be a row values expression or subquery.
+        // RHS may be a row values expression or sub-query.
         if (node2 instanceof SqlNodeList) {
           final SqlNodeList node3 = (SqlNodeList) node2;
           boolean listCoerced = false;
@@ -456,7 +463,7 @@ public class TypeCoercionImpl extends AbstractTypeCoercion {
             }
           }
         } else {
-          // Another subquery.
+          // Another sub-query.
           SqlValidatorScope scope1 = node2 instanceof SqlSelect
               ? validator.getSelectScope((SqlSelect) node2)
               : scope;
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java b/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
index 9da2c35..aeaf99e 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
@@ -1102,13 +1102,14 @@ public class SqlToRelConverter {
       //   where emp.deptno <> null
       //         and q.indicator <> TRUE"
       //
-      // Note:
-      // Subquery can be used as SqlUpdate#condition like below:
-      // "update emp
-      //  set empno = 1 where emp.empno in (
-      //   select emp.empno from emp where emp.empno=2)"
+      // Note: Sub-query can be used as SqlUpdate#condition like below:
+      //
+      //   UPDATE emp
+      //   SET empno = 1 WHERE emp.empno IN (
+      //     SELECT emp.empno FROM emp WHERE emp.empno = 2)
+      //
       // In such case, when converting SqlUpdate#condition, bb.root is null
-      // and it makes no sense to do the subquery substituion.
+      // and it makes no sense to do the sub-query substitution.
       if (bb.root == null) {
         return;
       }
diff --git a/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java b/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
index 690c372..60af563 100644
--- a/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
+++ b/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
@@ -620,8 +620,7 @@ public class RelWriterTest {
         + "    LogicalProject(JOB=[$2], SAL=[$5])\n"
         + "      LogicalTableScan(table=[[scott, EMP]])\n";
 
-    assertThat(s, isLinux(expected)
-    );
+    assertThat(s, isLinux(expected));
   }
 
   @Test public void testAggregateWithoutAlias() {
@@ -661,8 +660,7 @@ public class RelWriterTest {
         + "    LogicalProject(JOB=[$2], SAL=[$5])\n"
         + "      LogicalTableScan(table=[[scott, EMP]])\n";
 
-    assertThat(s, isLinux(expected)
-    );
+    assertThat(s, isLinux(expected));
   }
 
   /** Returns the schema of a {@link org.apache.calcite.rel.core.TableScan}
diff --git a/core/src/test/java/org/apache/calcite/runtime/EnumerablesTest.java b/core/src/test/java/org/apache/calcite/runtime/EnumerablesTest.java
index 8c7f427..690cdaa 100644
--- a/core/src/test/java/org/apache/calcite/runtime/EnumerablesTest.java
+++ b/core/src/test/java/org/apache/calcite/runtime/EnumerablesTest.java
@@ -297,8 +297,7 @@ public class EnumerablesTest {
             e -> e.deptno,
             d -> d.deptno,
             (v0, v1) -> v0 + ", " + v1, null, false, true,
-            (v0, v1) -> v0.deptno < 30
-        )
+            (v0, v1) -> v0.deptno < 30)
             .toList()
             .toString(),
         equalTo("[Emp(10, Fred), null,"
@@ -326,8 +325,7 @@ public class EnumerablesTest {
             e -> e.deptno,
             d -> d.deptno,
             (v0, v1) -> v0 + ", " + v1, null, true, false,
-            (v0, v1) -> v0.deptno < 30
-        )
+            (v0, v1) -> v0.deptno < 30)
             .toList()
             .toString(),
         equalTo("[Emp(20, Theodore), Dept(20, Sales),"
diff --git a/core/src/test/java/org/apache/calcite/util/Smalls.java b/core/src/test/java/org/apache/calcite/util/Smalls.java
index 991090f..9c437e2 100644
--- a/core/src/test/java/org/apache/calcite/util/Smalls.java
+++ b/core/src/test/java/org/apache/calcite/util/Smalls.java
@@ -371,8 +371,8 @@ public class Smalls {
   /** Example of a UDF with a non-static {@code eval} method,
    * and named parameters. */
   public static class MyPlusFunction {
-    public static final ThreadLocal<AtomicInteger> INSTANCE_COUNT
-        = new ThreadLocal<>().withInitial(() -> new AtomicInteger(0));
+    public static final ThreadLocal<AtomicInteger> INSTANCE_COUNT =
+        new ThreadLocal<>().withInitial(() -> new AtomicInteger(0));
 
     // Note: Not marked @Deterministic
     public MyPlusFunction() {
@@ -387,8 +387,8 @@ public class Smalls {
 
   /** As {@link MyPlusFunction} but declared to be deterministic. */
   public static class MyDeterministicPlusFunction {
-    public static final ThreadLocal<AtomicInteger> INSTANCE_COUNT
-        = new ThreadLocal<>().withInitial(() -> new AtomicInteger(0));
+    public static final ThreadLocal<AtomicInteger> INSTANCE_COUNT =
+        new ThreadLocal<>().withInitial(() -> new AtomicInteger(0));
 
     @Deterministic public MyDeterministicPlusFunction() {
       INSTANCE_COUNT.get().incrementAndGet();
diff --git a/site/_docs/adapter.md b/site/_docs/adapter.md
index 3c6f5a5..feb357b 100644
--- a/site/_docs/adapter.md
+++ b/site/_docs/adapter.md
@@ -107,14 +107,14 @@ as implemented by Avatica's
 To make a connection to a single schema based on a built-in schema type, you don't need to specify
 a model. For example,
 
-  jdbc:calcite:schemaType=JDBC; schema.jdbcUser=SCOTT; schema.jdbcPassword=TIGER; schema.jdbcUrl=jdbc:hsqldb:res:foodmart
+  `jdbc:calcite:schemaType=JDBC; schema.jdbcUser=SCOTT; schema.jdbcPassword=TIGER; schema.jdbcUrl=jdbc:hsqldb:res:foodmart`
 
 creates a connection with a schema mapped via the JDBC schema adapter to the foodmart database.
 
 Similarly, you can connect to a single schema based on a user-defined schema adapter.
 For example,
 
-  jdbc:calcite:schemaFactory=org.apache.calcite.adapter.cassandra.CassandraSchemaFactory; schema.host=localhost; schema.keyspace=twissandra
+  `jdbc:calcite:schemaFactory=org.apache.calcite.adapter.cassandra.CassandraSchemaFactory; schema.host=localhost; schema.keyspace=twissandra`
 
 makes a connection to the Cassandra adapter, equivalent to writing the following model file:
 
@@ -156,6 +156,8 @@ adding some DDL commands:
 * `CREATE` and `DROP TABLE` (including `CREATE TABLE ... AS SELECT`)
 * `CREATE` and `DROP MATERIALIZED VIEW`
 * `CREATE` and `DROP VIEW`
+* `CREATE` and `DROP FUNCTION`
+* `CREATE` and `DROP TYPE`
 
 Commands are described in the [SQL reference](reference.html#ddl-extensions).
 
diff --git a/site/_docs/reference.md b/site/_docs/reference.md
index b2590c7..b85bd7a 100644
--- a/site/_docs/reference.md
+++ b/site/_docs/reference.md
@@ -1371,9 +1371,9 @@ collectionsTypeName:
 
 rowTypeName:
       ROW '('
-        fieldName1 fieldType1 [ [ NULL | NOT NULL ] ]
-        [ , fieldName2 fieldType2 [ [ NULL | NOT NULL ] ] ]*
-        ')'
+      fieldName1 fieldType1 [ NULL | NOT NULL ]
+      [ , fieldName2 fieldType2 [ NULL | NOT NULL ] ]*
+      ')'
 
 char:
       CHARACTER | CHAR
@@ -1408,47 +1408,71 @@ timeZone:
 {% endhighlight %}
 
 #### Implicit Type Conversion
-Calcite automatically converts a value from one datatype to another when such a conversion makes sense. The table below is a matrix of Calcite type conversions. The table shows all possible conversions, without regard to the context in which it is made. The rules governing these details follow the table.
-
-| FROM-TO     | NULL | BOOLEAN | TINYINT | SMALLINT | INT | BIGINT | DECIMAL | FLOAT/REAL | DOUBLE | INTERVAL | DATE | TIME | TIMESTAMP | (VAR)CHAR | (VAR)BINARY
-|:----------- |:---- |:------- |:------- |:-------- |:--- |:------ |:------- |:---------- |:------ |:-------- |:---- |:---- |:--------- |:--------- |:-----------
-| NULL        | i    | i       | i       | i        | i   | i      | i       | i          | i      | i        | i    | i    | i         | i         | i
-| BOOLEAN     | x    | i       | e       | e        | e   | e      | e       | e          | e      | x        | x    | x    | x         | i         | x
-| TINYINT     | x    | e       | i       | i        | i   | i      | i       | i          | i      | e        | x    | x    | e         | i         | x
-| SMALLINT    | x    | e       | i       | i        | i   | i      | i       | i          | i      | e        | x    | x    | e         | i         | x
-| INT         | x    | e       | i       | i        | i   | i      | i       | i          | i      | e        | x    | x    | e         | i         | x
-| BIGINT      | x    | e       | i       | i        | i   | i      | i       | i          | i      | e        | x    | x    | e         | i         | x
-| DECIMAL     | x    | e       | i       | i        | i   | i      | i       | i          | i      | e        | x    | x    | e         | i         | x
-| FLOAT/REAL  | x    | e       | i       | i        | i   | i      | i       | i          | i      | x        | x    | x    | e         | i         | x
-| DOUBLE      | x    | e       | i       | i        | i   | i      | i       | i          | i      | x        | x    | x    | e         | i         | x
-| INTERVAL    | x    | x       | e       | e        | e   | e      | e       | x          | x      | i        | x    | x    | x         | e         | x
-| DATE        | x    | x       | x       | x        | x   | x      | x       | x          | x      | x        | i    | x    | i         | i         | x
-| TIME        | x    | x       | x       | x        | x   | x      | x       | x          | x      | x        | x    | i    | e         | i         | x
-| TIMESTAMP   | x    | x       | e       | e        | e   | e      | e       | e          | e      | x        | i    | e    | i         | i         | x
-| (VAR)CHAR   | x    | e       | i       | i        | i   | i      | i       | i          | i      | i        | i    | i    | i         | i         | i
-| (VAR)BINARY | x    | x       | x       | x        | x   | x      | x       | x          | x      | x        | e    | e    | e         | i         | i
+
+Calcite automatically converts a value from one datatype to another
+when such a conversion makes sense. The table below is a matrix of
+Calcite type conversions. The table shows all possible conversions,
+without regard to the context in which it is made. The rules governing
+these details follow the table.
+
+| FROM - TO           | NULL | BOOLEAN | TINYINT | SMALLINT | INT | BIGINT | DECIMAL | FLOAT or REAL | DOUBLE | INTERVAL | DATE | TIME | TIMESTAMP | CHAR or VARCHAR | BINARY or VARBINARY
+|:------------------- |:---- |:------- |:------- |:-------- |:--- |:------ |:------- |:------------- |:------ |:-------- |:---- |:---- |:--------- |:--------------- |:-----------
+| NULL                | i    | i       | i       | i        | i   | i      | i       | i             | i      | i        | i    | i    | i         | i               | i
+| BOOLEAN             | x    | i       | e       | e        | e   | e      | e       | e             | e      | x        | x    | x    | x         | i               | x
+| TINYINT             | x    | e       | i       | i        | i   | i      | i       | i             | i      | e        | x    | x    | e         | i               | x
+| SMALLINT            | x    | e       | i       | i        | i   | i      | i       | i             | i      | e        | x    | x    | e         | i               | x
+| INT                 | x    | e       | i       | i        | i   | i      | i       | i             | i      | e        | x    | x    | e         | i               | x
+| BIGINT              | x    | e       | i       | i        | i   | i      | i       | i             | i      | e        | x    | x    | e         | i               | x
+| DECIMAL             | x    | e       | i       | i        | i   | i      | i       | i             | i      | e        | x    | x    | e         | i               | x
+| FLOAT/REAL          | x    | e       | i       | i        | i   | i      | i       | i             | i      | x        | x    | x    | e         | i               | x
+| DOUBLE              | x    | e       | i       | i        | i   | i      | i       | i             | i      | x        | x    | x    | e         | i               | x
+| INTERVAL            | x    | x       | e       | e        | e   | e      | e       | x             | x      | i        | x    | x    | x         | e               | x
+| DATE                | x    | x       | x       | x        | x   | x      | x       | x             | x      | x        | i    | x    | i         | i               | x
+| TIME                | x    | x       | x       | x        | x   | x      | x       | x             | x      | x        | x    | i    | e         | i               | x
+| TIMESTAMP           | x    | x       | e       | e        | e   | e      | e       | e             | e      | x        | i    | e    | i         | i               | x
+| CHAR or VARCHAR     | x    | e       | i       | i        | i   | i      | i       | i             | i      | i        | i    | i    | i         | i               | i
+| BINARY or VARBINARY | x    | x       | x       | x        | x   | x      | x       | x             | x      | x        | e    | e    | e         | i               | i
 
 i: implicit cast / e: explicit cast / x: not allowed
 
 ##### Conversion Contexts and Strategies
-* Set Operation(UNION/EXCEPT/INTERSECT): Compare every branch row data type and find the common type of each fields pair;
-* Arithmetic Expression: For binary arithmetic(`+`, `-`, `&`, `^`, `/`, `%`), promote string operand to data type of the other numeric operand;
-For binary comparison(`=`, `<`, `<=`, `<>`, `>`, `>=`),  
-  - If operands are STRING and TIMESTAMP, promotes to TIMESTAMP
-  - Make `1=true` and `0=false` always evaluates true
-  - Find common type for both operands if there is NUMERIC type operand
-* IN Expression: If with subquery, compare type of LHS and RHS, find the common type, if it is struct type, find wider type for every field;
-If without subquery and RHS is a node list, compare every node to find the common type;
-* CASE WHEN Expression(or COALESCE): Find then and else operands common wider type;
-* Datetime String +/- INTERVAL: Promote string to timestamp;
-* Builtin Function: Look up the families registered in the checker, find the family default type if checker rules allow it;
-* User Defined Function: Try to coerce based on the declared argument types of the `eval()` method.
+
+* Set operation (`UNION`, `EXCEPT`, `INTERSECT`): Compare every branch
+  row data type and find the common type of each fields pair;
+* Binary arithmetic expression (`+`, `-`, `&`, `^`, `/`, `%`): promote
+  string operand to data type of the other numeric operand;
+* Binary comparison (`=`, `<`, `<=`, `<>`, `>`, `>=`):
+  if operands are `STRING` and `TIMESTAMP`, promote to `TIMESTAMP`;
+  make `1 = true` and `0 = false` always evaluate to `TRUE`;
+  if there is numeric type operand, find common type for both operands.
+* `IN` sub-query: compare type of LHS and RHS, and find the common type;
+  if it is struct type, find wider type for every field;
+* `IN` expression list: compare every expression to find the common type;
+* `CASE WHEN` expression or `COALESCE`: find the common wider type of the `THEN`
+  and `ELSE` operands;
+* Character + `INTERVAL` or character - `INTERVAL`: Promote character to
+  `TIMESTAMP`;
+* Built-in function: Look up the type families registered in the checker,
+  find the family default type if checker rules allow it;
+* User-defined function (UDF): Coerce based on the declared argument types
+  of the `eval()` method.
 
 ##### Strategies for Finding Common Type
-- If the operator has expected data types, just take them as the desired one. (e.g. the UDF would have `eval()` method which has reflection argument types);
-- If there is no expected data type but the data type families are registered, try to coerce the arguments to the family's default data type, i.e. the String family will have a VARCHAR type;
-- If neither expected data type nor families are specified, try to find the tightest common type of the node types, i.e. INT and DOUBLE will return DOUBLE, the numeric precision does not lose for this case;
-- If no tightest common type is found, try to find a wider type, i.e. STRING and INT will return INT, we allow some precision loss when widening decimal to fractional, or promote to STRING type.
+
+* If the operator has expected data types, just take them as the
+  desired one. (e.g. the UDF would have `eval()` method which has
+  reflection argument types);
+* If there is no expected data type but the data type families are
+  registered, try to coerce the arguments to the family's default data
+  type, i.e. the String family will have a `VARCHAR` type;
+* If neither expected data type nor families are specified, try to
+  find the tightest common type of the node types, i.e. `INTEGER` and
+  `DOUBLE` will return `DOUBLE`, the numeric precision does not lose
+  for this case;
+* If no tightest common type is found, try to find a wider type,
+  i.e. `VARCHAR` and `INTEGER` will return `INTEGER`,
+  we allow some precision loss when widening decimal to fractional,
+  or promote to `VARCHAR` type.
 
 ### Value constructors
 


[calcite] 03/05: [CALCITE-3321] BigQuery does not have correct casing rules (Lindsey Meyer)

Posted by za...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch branch-1.21
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit 6fabfd609800824d84fb13703f4d70ac1798c9aa
Author: Lindsey Meyer <la...@users.noreply.github.com>
AuthorDate: Tue Sep 3 16:34:17 2019 -0700

    [CALCITE-3321] BigQuery does not have correct casing rules (Lindsey Meyer)
    
    Close apache/calcite#1438
---
 .../java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java     | 6 +++++-
 core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
index 9475296..8581c68 100644
--- a/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
+++ b/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
@@ -16,6 +16,7 @@
  */
 package org.apache.calcite.sql.dialect;
 
+import org.apache.calcite.avatica.util.Casing;
 import org.apache.calcite.config.NullCollation;
 import org.apache.calcite.sql.SqlCall;
 import org.apache.calcite.sql.SqlDialect;
@@ -45,7 +46,10 @@ public class BigQuerySqlDialect extends SqlDialect {
               .withLiteralQuoteString("'")
               .withLiteralEscapedQuoteString("\\'")
               .withIdentifierQuoteString("`")
-              .withNullCollation(NullCollation.LOW));
+              .withNullCollation(NullCollation.LOW)
+              .withUnquotedCasing(Casing.UNCHANGED)
+              .withQuotedCasing(Casing.UNCHANGED)
+              .withCaseSensitive(false));
 
   private static final List<String> RESERVED_KEYWORDS =
       ImmutableList.copyOf(
diff --git a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
index c9f8cb5..5a15928 100644
--- a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
@@ -8885,6 +8885,11 @@ public class SqlParserTest {
         "select unquotedColumn from \"doubleQuotedTable\"",
         is("SELECT \"unquotedcolumn\"\n"
             + "FROM \"doublequotedtable\""));
+    // BigQuery leaves quoted and unquoted identifers unchanged
+    checkDialect(SqlDialect.DatabaseProduct.BIG_QUERY.getDialect(),
+        "select unquotedColumn from `doubleQuotedTable`",
+        is("SELECT unquotedColumn\n"
+            + "FROM doubleQuotedTable"));
   }
 
   @Test public void testParenthesizedSubQueries() {


[calcite] 05/05: [CALCITE-3303] Release Calcite 1.21.0

Posted by za...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch branch-1.21
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit 358027602b24c45a6cec686544ef37b3da594e9b
Author: Stamatis Zampetakis <za...@gmail.com>
AuthorDate: Wed Aug 28 12:07:49 2019 +0200

    [CALCITE-3303] Release Calcite 1.21.0
    
    1. Update docs and pom to 1.21.0.
    2. Add release notes for 1.21.0.
---
 README                |   2 +-
 pom.xml               |   2 +-
 site/_docs/history.md | 355 +++++++++++++++++++++++++++++++++++++++++++++++++-
 site/_docs/howto.md   |   8 +-
 4 files changed, 358 insertions(+), 9 deletions(-)

diff --git a/README b/README
index eb2e2c1..a121fec 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Apache Calcite release 1.20.0
+Apache Calcite release 1.21.0
 
 This is a source or binary distribution of Apache Calcite.
 
diff --git a/pom.xml b/pom.xml
index 105c141..4060b06 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@ limitations under the License.
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <top.dir>${project.basedir}</top.dir>
     <version.major>1</version.major>
-    <version.minor>20</version.minor>
+    <version.minor>21</version.minor>
 
     <!-- Don't fail the build for vulnerabilities below this threshold. -->
     <failBuildOnCVSS>8</failBuildOnCVSS>
diff --git a/site/_docs/history.md b/site/_docs/history.md
index 3df8a35..eab5fb4 100644
--- a/site/_docs/history.md
+++ b/site/_docs/history.md
@@ -28,12 +28,361 @@ For a full list of releases, see
 Downloads are available on the
 [downloads page]({{ site.baseurl }}/downloads/).
 
-## 1.21.0
+## <a href="https://github.com/apache/calcite/releases/tag/calcite-1.21.0">1.21.0</a> / 2019-09-06
+{: #v1-21-0}
+
+This release comes two months after 1.20.0. It includes more than 100 resolved
+issues, comprising a large number of new features as well as general improvements
+and bug-fixes. Among others, it is worth highlighting the following.
+
+* Added support for implicit type coercion in various contexts
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-2302">CALCITE-2302</a>).
+* Pig Latin scrips can now be transformed into algebraic plans
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-3122">CALCITE-3122</a>).
+* The basic features of MATCH_RECOGNIZE are now implemented
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-1935">CALCITE-1935</a>).
+* Correlated ANY/SOME/ALL sub-queries are now supported
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-3031">CALCITE-3031</a>).
+* The parser has been enhanced to handle ROW, ARRAY, and COLLECTION types
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-3250">CALCITE-3250</a>,
+  <a href="https://issues.apache.org/jira/browse/CALCITE-3233">CALCITE-3233</a>,
+  <a href="https://issues.apache.org/jira/browse/CALCITE-3231">CALCITE-3231</a>).
+* New join algorithms for the Enumerable convention have been added
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-2979">CALCITE-2979</a>,
+  <a href="https://issues.apache.org/jira/browse/CALCITE-2973">CALCITE-2973</a>
+  <a href="https://issues.apache.org/jira/browse/CALCITE-3284">CALCITE-3284</a>).
+
+Compatibility: This release is tested
+on Linux, macOS, Microsoft Windows;
+using Oracle JDK 8, 9, 10, 11, 12, 13 and OpenJDK 8, 9, 10, 11, 12, 13;
+Guava versions 19.0 to 27.1-jre;
+Apache Druid version 0.14.0-incubating;
+other software versions as specified in `pom.xml`.
 
 #### Breaking Changes
 
-* core parser config.fmpp#dataTypeParserMethods should return `SqlTypeNameSpec`
-instead of `SqlIdentifier`.
+* Core parser config.fmpp#dataTypeParserMethods should return `SqlTypeNameSpec`
+  instead of `SqlIdentifier`.
+* The description of converter rules has slightly changed
+  (<a href="https://issues.apache.org/jira/browse/CALCITE-3115">CALCITE-3115</a>).
+  In some rare cases this may lead to a `Rule description ... is not valid`
+  exception. The exception can easily disappear by changing the name of the
+  `Convention` which causes the problem.
+
+#### New features
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2973">CALCITE-2973</a>]
+  [<a href="https://issues.apache.org/jira/browse/CALCITE-3284">CALCITE-3284</a>]
+  Allow joins (hash, semi, anti) that have equi conditions to be executed using a
+  hash join algorithm (Lai Zhou)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2302">CALCITE-2302</a>]
+  Implicit type cast support
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3122">CALCITE-3122</a>]
+  Convert Pig Latin scripts into Calcite relational algebra and Calcite SQL
+  (Khai Tran)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2979">CALCITE-2979</a>]
+  Add a block-based nested loop join algorithm (Khawla Mouhoubi)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3263">CALCITE-3263</a>]
+  Add `MD5`, `SHA1` SQL functions (Shuming Li)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3204">CALCITE-3204</a>]
+  Implement `jps` command for OS adapter (Qianjin Xu)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3260">CALCITE-3260</a>]
+  Add Expressions.evaluate(Node), a public API for evaluating linq4j expressions
+  (Wang Yanlin)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3280">CALCITE-3280</a>]
+  Add `REGEXP_REPLACE` function in Oracle, MySQL libraries (Shuming Li)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3111">CALCITE-3111</a>]
+  Add `RelBuilder.correlate` method, and allow custom implementations of
+  `Correlate` in `RelDecorrelator` (Juhwan Kim)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3252">CALCITE-3252</a>]
+  Add `CONVERT_TIMEZONE`, `TO_DATE` and `TO_TIMESTAMP` non-standard SQL functions
+  (Lindsey Meyer)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3235">CALCITE-3235</a>]
+  Add `CONCAT` function for Redshift (Ryan Fu)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3250">CALCITE-3250</a>]
+  Support nested collection type for `SqlDataTypeSpec`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1935">CALCITE-1935</a>]
+  Implement `MATCH_RECOGNIZE` (Julian Feinauer, Zhiqiang-He)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2843">CALCITE-2843</a>]
+  Support PostgreSQL cast operator (`::`) (Muhammad Gelbana)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3233">CALCITE-3233</a>]
+  Support `ROW` type for `SqlDataTypeSpec`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3231">CALCITE-3231</a>]
+  Support `ARRAY` type for `SqlDataTypeSpec`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2624">CALCITE-2624</a>]
+  Add a rule to copy a sort below a join operator (Khawla Mouhoubi)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3031">CALCITE-3031</a>]
+  Support for correlated ANY/SOME/ALL sub-query (Vineet Garg)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2510">CALCITE-2510</a>]
+  Implement `CHR` function (Sergey Tsvetkov, Chunwei Lei)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3176">CALCITE-3176</a>]
+  File adapter for parsing JSON files
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3144">CALCITE-3144</a>]
+  Add rule, `AggregateCaseToFilterRule`, that converts `SUM(CASE WHEN b THEN x
+  END)` to `SUM(x) FILTER (WHERE b)`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2995">CALCITE-2995</a>]
+  Implement `DAYNAME`,`MONTHNAME` functions; add `locale` connection property
+  (xuqianjin)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2460">CALCITE-2460</a>]
+  [CALCITE-2459] Add `TO_BASE64`, `FROM_BASE64` SQL functions (Wenhui Tang)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3063">CALCITE-3063</a>]
+  Parse and process PostgreSQL posix regular expressions
+
+#### Bug-fixes, API changes and minor enhancements
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3321">CALCITE-3321</a>]
+  Set casing rules for BigQuery SQL dialect (Lindsey Meyer)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3115">CALCITE-3115</a>]
+  Cannot add `JdbcRule` instances that have different `JdbcConvention` to same
+  `VolcanoPlanner`'s `RuleSet` (Wenhui Tang, Igor Guzenko)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3309">CALCITE-3309</a>]
+  Refactor `generatePredicate` method from `EnumerableNestedLoopJoin`,
+  `EnumerableHashJoin`, and `EnumerableBatchNestedLoopJoin` into a single location
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3310">CALCITE-3310</a>]
+  Approximate and exact aggregate calls are recognized as the same during
+  SQL-to-RelNode conversion
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3292">CALCITE-3292</a>]
+  SqlToRelConverter#substituteSubQuery fails with NullPointerException when
+  converting `SqlUpdate` (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3297">CALCITE-3297</a>]
+  `PigToSqlAggregateRule` should be applied on multi-set projection to produce an
+  optimal plan (Igor Guzenko)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3295">CALCITE-3295</a>]
+  Add aggregate call name in serialized json string for relnode (Wang Yanlin)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3296">CALCITE-3296</a>]
+  Decorrelator shouldn't give empty value when fetch and offset values are null
+  in `Sort` rel (Juhwan Kim)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3283">CALCITE-3283</a>]
+  `RelSubset` does not contain its best `RelNode` (Xiening Dai)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3210">CALCITE-3210</a>]
+  JDBC adapter should generate `CAST(NULL AS type)` rather than `NULL`
+  conditionally (Wang Weidong)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3220">CALCITE-3220</a>]
+  JDBC adapter now transforms TRIM to TRIM, LTRIM or RTRIM when target is Hive
+  (Jacky Woo)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3228">CALCITE-3228</a>]
+  Error while applying rule ProjectScanRule: interpreter
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3223">CALCITE-3223</a>]
+  Materialized view fails to match when there is non-`RexInputRef` in the
+  projects (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3257">CALCITE-3257</a>]
+  `RelMetadataQuery` cache is not invalidated when log trace is enabled
+  (Xiening Dai)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3138">CALCITE-3138</a>]
+  `RelStructuredTypeFlattener` doesn't restructure `ROW` type fields (Igor Guzenko)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3251">CALCITE-3251</a>]
+  `BinaryExpression` evaluate method support full numeric types in `Primitive`
+  (xy2953396112)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3259">CALCITE-3259</a>]
+  Align 'Property' in the serialized XML string of `RelXmlWriter` (Wang Yanlin)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3167">CALCITE-3167</a>]
+  Make `equals` and `hashCode` methods final in `AbstractRelNode`, and remove
+  overriding methods in `EnumerableTableScan` (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3089">CALCITE-3089</a>]
+  Deprecate `EquiJoin`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3267">CALCITE-3267</a>]
+  Remove method `SqlDataTypeSpec#deriveType(RelDataTypefactory)`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3214">CALCITE-3214</a>]
+  Add UnionToUnionRule for materialization matching (refine rule name) (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3214">CALCITE-3214</a>]
+  Add UnionToUnionRule for materialization matching (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3249">CALCITE-3249</a>]
+  Substitution#getRexShuttle does not consider RexLiteral (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3229">CALCITE-3229</a>]
+  `UnsupportedOperationException` for `UPDATE` with `IN` query
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3236">CALCITE-3236</a>]
+  Handle issues found in static code analysis (DonnyZone)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3238">CALCITE-3238</a>]
+  Support Time Zone suffix of DateTime types for `SqlDataTypeSpec`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3159">CALCITE-3159</a>]
+  Remove `DISTINCT` flag from calls to `MIN`, `MAX`, `BIT_OR`, `BIT_AND`
+  aggregate functions (xuqianjin)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3237">CALCITE-3237</a>]
+  `IndexOutOfBoundsException` when generating deeply nested Java code from linq4j
+  (Sahith Nallapareddy)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3234">CALCITE-3234</a>]
+  For boolean properties, empty string should mean "true"
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3226">CALCITE-3226</a>]
+  `RelBuilder` doesn't keep the alias when `scan` from an expanded view (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3198">CALCITE-3198</a>]
+  Enhance `RexSimplify` to handle `(x <> a or x <> b)`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3101">CALCITE-3101</a>]
+  Don't push non-equi join conditions into `Project` below `Join`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3227">CALCITE-3227</a>]
+  `IndexOutOfBoundsException` when checking candidate parent match's input
+  ordinal in `VolcanoRuleCall`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3177">CALCITE-3177</a>]
+  Ensure correct deserialization of relational algebra
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3218">CALCITE-3218</a>]
+  Syntax error while parsing `DATEADD` function (which is valid on Redshift)
+  (Lindsey Meyer)
+* Deprecate `RexBuilder.constantNull()`, because it produces untyped `NULL`
+  literals that make planning difficult
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3191">CALCITE-3191</a>]
+  In JDBC adapter for MySQL, implement `Values` by generating `SELECT` without
+  `FROM`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3147">CALCITE-3147</a>]
+  In JDBC adapter, accommodate the idiosyncrasies of how BigQuery (standard SQL)
+  quotes character literals and identifiers
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3131">CALCITE-3131</a>]
+  In `LatticeSuggester`, record whether columns are used as "dimensions" or
+  "measures"
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3175">CALCITE-3175</a>]
+  `AssertionError` while serializing to JSON a `RexLiteral` with `Enum` type
+  (Wang Yanlin)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3225">CALCITE-3225</a>]
+  `JoinToMultiJoinRule` should not match semi- or anti-LogicalJoin
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3215">CALCITE-3215</a>]
+  Simplification may have not fully simplified IS `NOT NULL` expressions
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3192">CALCITE-3192</a>]
+  Simplification may weaken OR conditions containing inequalities
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3211">CALCITE-3211</a>]
+  List of `MutableRel` may fail to be identified by `SubstitutionVisitor` during
+  matching (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3207">CALCITE-3207</a>]
+  Fail to convert `Join` with `LIKE` condition to SQL statement (wojustme)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2496">CALCITE-2496</a>]
+  Return 0 in case of `EXTRACT(MILLI/MICRO/NANOSECOND FROM date)`
+  (Sergey Nuyanzin, Chunwei Lei)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3109">CALCITE-3109</a>]
+  Improvements on algebraic operators to express recursive queries (`RepeatUnion`
+  and `TableSpool`)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3209">CALCITE-3209</a>]
+  When calling `MutableMultiRel.setInput`, exception thrown (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3195">CALCITE-3195</a>]
+  Handle a UDF that throws checked exceptions in the Enumerable code generator
+  (DonnyZone)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3118">CALCITE-3118</a>]
+  `VolcanoRuleCall` should look at `RelSubset` rather than `RelSet` when checking
+  child ordinal of a parent operand (Botong Huang)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3201">CALCITE-3201</a>]
+  `SqlValidator` throws exception for SQL insert target table with virtual columns
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3182">CALCITE-3182</a>]
+  Trim unused fields for plan of materialized-view before matching (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3174">CALCITE-3174</a>]
+  `IS NOT DISTINCT FROM` condition pushed from `Filter` to `Join` is not
+  collapsed (Bohdan Kazydub)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3166">CALCITE-3166</a>]
+  Make `RelBuilder` configurable
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3113">CALCITE-3113</a>]
+  Equivalent `MutableAggregate`s with different row types should match with each
+  other (Jin Xing)
+* <a href="https://issues.apache.org/jira/browse/CALCITE-3187">CALCITE-3187</a>:
+  Make decimal type inference overridable (Praveen Kumar)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3145">CALCITE-3145</a>]
+  `RelBuilder.aggregate` throws `IndexOutOfBoundsException` if `groupKey` is
+  non-empty and there are duplicate aggregate functions
+* Change type of `SqlStdOperatorTable.GROUPING` field to public class
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3196">CALCITE-3196</a>]
+  In `Frameworks`, add `interface BasePrepareAction` (a functional interface) and
+  deprecate `abstract class PrepareAction`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3183">CALCITE-3183</a>]
+  During field trimming, Filter is copied with wrong traitSet (Juhwan Kim)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3189">CALCITE-3189</a>]
+  Multiple fixes for Oracle SQL dialect
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3165">CALCITE-3165</a>]
+  Project#accept(RexShuttle shuttle) does not update rowType
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3188">CALCITE-3188</a>]
+  IndexOutOfBoundsException in ProjectFilterTransposeRule when executing SELECT
+  COUNT
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3160">CALCITE-3160</a>]
+  Failed to materialize when the aggregate function uses group key (DonnyZone)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3170">CALCITE-3170</a>]
+  ANTI join on conditions push down generates wrong plan
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3169">CALCITE-3169</a>]
+  decorrelateRel method should return when meeting SEMI/ANTI join in
+  RelDecorrelator
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3171">CALCITE-3171</a>]
+  SemiJoin on conditions push down throws IndexOutOfBoundsException
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3172">CALCITE-3172</a>]
+  RelBuilder#empty does not keep aliases
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3121">CALCITE-3121</a>]
+  VolcanoPlanner hangs due to sub-query with dynamic star
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3152">CALCITE-3152</a>]
+  Unify throws in SQL parser
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3125">CALCITE-3125</a>]
+  Remove completely `class CorrelateJoinType`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3133">CALCITE-3133</a>]
+  Remove completely `class SemiJoinType`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3126">CALCITE-3126</a>]
+  Remove deprecated SemiJoin usage completely
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3146">CALCITE-3146</a>]
+  Support the detection of nested aggregations for `JdbcAggregate` in
+  `SqlImplementor` (Wenhui Tang)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3155">CALCITE-3155</a>]
+  Empty `LogicalValues` can not be converted to UNION_ALL without operands which
+  can not be unparsed (Musbah EL FIL)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3151">CALCITE-3151</a>]
+  RexCall's Monotonicity is not considered in determining a Calc's collation
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2801">CALCITE-2801</a>]
+  Check input type in `AggregateUnionAggregateRule` when remove the bottom
+  `Aggregate` (Hequn Cheng)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3149">CALCITE-3149</a>]
+  RelDataType CACHE in RelDataTypeFactoryImpl can't be garbage collected
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3060">CALCITE-3060</a>]
+  `MutableProject` should be generated based on INVERSE_SURJECTION mapping
+  (DonnyZone)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3148">CALCITE-3148</a>]
+  Validator throws `IndexOutOfBoundsException` for `SqlInsert` when source and
+  sink have non-equal number of fields
+
+#### Build and test suite
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3322">CALCITE-3322</a>]
+  Remove duplicate test case in `RelMetadataTest`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3314">CALCITE-3314</a>]
+  CVSS dependency-check-maven fails for calcite-pig, calcite-piglet,
+  calcite-spark
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3315">CALCITE-3315</a>]
+  Multiple failures in Druid IT tests due to implicit casts
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3307">CALCITE-3307</a>]
+  `PigRelExTest`, `PigRelOpTest` and `PigScriptTest` fail on Windows
+* In `SqlFunctionsTest`, replace `assertEquals` and `assertNull` with `assertThat`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3258">CALCITE-3258</a>]
+  Upgrade jackson-databind from 2.9.9 to 2.9.9.3, and kafka-clients from 2.0.0
+  to 2.1.1
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3222">CALCITE-3222</a>]
+  Fix code style issues introduced by [CALCITE-3031] (Vineet Garg)
+* More compiler fixes, and cosmetic changes
+* Fix compiler warnings
+* Update stale tests in DruidAdapter
+* Following
+  [<a href="https://issues.apache.org/jira/browse/CALCITE-2804">CALCITE-2804</a>],
+  fix incorrect expected Druid query in test case
+  `DruidAdapterIT#testCastToTimestamp` (Justin Szeluga)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3153">CALCITE-3153</a>]
+  Improve testing in `TpcdsTest` using `assertEqual` instead of printing results
+* Fix javadoc error
+* Fix compilation warnings after Mongo java driver upgrade
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3179">CALCITE-3179</a>]
+  Bump Jackson from 2.9.8 to 2.9.9 (Fokko Driesprong)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3157">CALCITE-3157</a>]
+  Mongo java driver upgrade: 3.5.0 -> 3.10.2
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3156">CALCITE-3156</a>]
+  Mongo adapter. Replace fongo with Mongo Java Server for tests
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3168">CALCITE-3168</a>]
+  Add test for invalid literal of SQL parser
+
+#### Web site and documentation
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3303">CALCITE-3303</a>]
+  Release Calcite 1.21.0
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3311">CALCITE-3311</a>]
+  Add doc to site for implicit type coercion
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3262">CALCITE-3262</a>]
+  Refine doc of SubstitutionVisitor.java (Jin Xing)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-2835">CALCITE-2835</a>]
+  Markdown errors on the Geode adapter page
+* Site: Update Apache links on homepage to HTTPS
+* Update favicon for new logo
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3136">CALCITE-3136</a>]
+  Fix the default rule description of ConverterRule (TANG Wen-hui)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-3184">CALCITE-3184</a>]
+  Add the new logo to the website
+* Update example announcement
+* Add committer names to 1.20.0 release notes
+* Add 1.20.0 release date
+* Add 1.20.0 release announcement
 
 ## <a href="https://github.com/apache/calcite/releases/tag/calcite-1.20.0">1.20.0</a> / 2019-06-24
 {: #v1-20-0}
diff --git a/site/_docs/howto.md b/site/_docs/howto.md
index 55767e2..7dc9752 100644
--- a/site/_docs/howto.md
+++ b/site/_docs/howto.md
@@ -38,8 +38,8 @@ Unpack the source distribution `.tar.gz` file,
 then build using the included maven wrapper:
 
 {% highlight bash %}
-$ tar xvfz calcite-1.20.0-source.tar.gz
-$ cd calcite-1.20.0
+$ tar xvfz calcite-1.21.0-source.tar.gz
+$ cd calcite-1.21.0
 $ ./mvnw install
 {% endhighlight %}
 
@@ -481,7 +481,7 @@ must:
  * resolve the issue (do not close it as this will be done by the release
 manager);
  * select "Fixed" as resolution cause;
- * mark the appropriate version (e.g., 1.20.0) in the "Fix version" field;
+ * mark the appropriate version (e.g., 1.21.0) in the "Fix version" field;
  * add a comment (e.g., "Fixed in ...") with a hyperlink pointing to the commit
 which resolves the issue (in GitHub or GitBox), and also thank the contributor
 for their contribution.
@@ -906,7 +906,7 @@ Merge the release branch back into `master` (e.g. `git merge --ff-only branch-X.
 After 24 hours, announce the release by sending an email to
 [announce@apache.org](https://mail-archives.apache.org/mod_mbox/www-announce/).
 You can use
-[the 1.20.0 announcement](https://mail-archives.apache.org/mod_mbox/www-announce/201906.mbox/%3CCA%2BEpF8tcJcZ41rVuwJODJmyRy-qAxZUQm9OxKsoDi07c2SKs_A%40mail.gmail.com%3E)
+[the 1.21.0 announcement](https://mail-archives.apache.org/mod_mbox/www-announce/201906.mbox/%3CCA%2BEpF8tcJcZ41rVuwJODJmyRy-qAxZUQm9OxKsoDi07c2SKs_A%40mail.gmail.com%3E)
 as a template. Be sure to include a brief description of the project.
 
 ## Publishing the web site (for Calcite committers)


[calcite] 01/05: Remove the useless JdbcConvention out in descriptionPrefix for JdbcToEnumerableConverterRule (Wenhui Tang)

Posted by za...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch branch-1.21
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit 5c25c386dd70172f98d870ce72455fab897eb70a
Author: wenhuitang <we...@yeah.net>
AuthorDate: Mon Sep 2 20:28:22 2019 +0800

    Remove the useless JdbcConvention out in descriptionPrefix for JdbcToEnumerableConverterRule (Wenhui Tang)
    
    Close apache/calcite#1435
---
 .../org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverterRule.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverterRule.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverterRule.java
index e685922..6ac2816 100644
--- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverterRule.java
+++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverterRule.java
@@ -35,7 +35,7 @@ public class JdbcToEnumerableConverterRule extends ConverterRule {
       RelBuilderFactory relBuilderFactory) {
     super(RelNode.class, (Predicate<RelNode>) r -> true, out,
         EnumerableConvention.INSTANCE, relBuilderFactory,
-        "JdbcToEnumerableConverterRule:" + out);
+        "JdbcToEnumerableConverterRule");
   }
 
   @Override public RelNode convert(RelNode rel) {