You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2016/10/31 07:32:54 UTC

[1/8] calcite git commit: [CALCITE-1354] Release notes for avatica-1.9.0

Repository: calcite
Updated Branches:
  refs/heads/master 08eb16bb5 -> aa8fe0828


[CALCITE-1354] Release notes for avatica-1.9.0


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/82fb4b20
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/82fb4b20
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/82fb4b20

Branch: refs/heads/master
Commit: 82fb4b202c3fc84a8c7144ac54e97b6d85336a85
Parents: 8024072
Author: Julian Hyde <jh...@apache.org>
Authored: Mon Oct 24 13:38:16 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Oct 26 16:56:22 2016 -0700

----------------------------------------------------------------------
 avatica/README                | 18 ++++++++
 avatica/pom.xml               |  2 +-
 avatica/site/_docs/history.md | 86 +++++++++++++++++++++++++++++++++++++-
 avatica/site/_docs/howto.md   | 43 ++++++-------------
 4 files changed, 116 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/82fb4b20/avatica/README
----------------------------------------------------------------------
diff --git a/avatica/README b/avatica/README
new file mode 100644
index 0000000..451e39f
--- /dev/null
+++ b/avatica/README
@@ -0,0 +1,18 @@
+Apache Calcite Avatica release 1.9.0
+
+This is a source or binary distribution of Avatica, a framework for
+building database drivers. Avatica is a sub-project of Apache Calcite.
+
+Changes since the previous release are described in the
+site/_docs/history.md file.
+
+The LICENSE and NOTICE files contain license information.
+
+If this is a source distribution, you can find instructions how to
+build the release in the "Building from a source distribution" section
+in site/_docs/howto.md.
+
+README.md contains examples of running Avatica.
+
+Further information about Avatica is available at its web site,
+http://calcite.apache.org/avatica.

http://git-wip-us.apache.org/repos/asf/calcite/blob/82fb4b20/avatica/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/pom.xml b/avatica/pom.xml
index 1a2391b..faf4ef0 100644
--- a/avatica/pom.xml
+++ b/avatica/pom.xml
@@ -52,7 +52,7 @@ limitations under the License.
     <top.dir>${project.basedir}</top.dir>
     <avatica.release.version>${project.version}</avatica.release.version>
     <version.major>1</version.major>
-    <version.minor>8</version.minor>
+    <version.minor>9</version.minor>
     <!-- This list is in alphabetical order. -->
     <build-helper-maven-plugin.version>1.9</build-helper-maven-plugin.version>
     <checksum-maven-plugin.version>1.2</checksum-maven-plugin.version>

http://git-wip-us.apache.org/repos/asf/calcite/blob/82fb4b20/avatica/site/_docs/history.md
----------------------------------------------------------------------
diff --git a/avatica/site/_docs/history.md b/avatica/site/_docs/history.md
index 214c740..6e5184f 100644
--- a/avatica/site/_docs/history.md
+++ b/avatica/site/_docs/history.md
@@ -28,6 +28,90 @@ For a full list of releases, see
 Downloads are available on the
 [downloads page]({{ site.baseurl }}/downloads/).
 
+## <a href="https://github.com/apache/calcite/releases/tag/calcite-avatica-1.9.0">1.9.0</a> / 2016-11-01
+{: #v1-9-0}
+
+Apache Calcite Avatica 1.9.0 includes various improvements to make it
+more robust and secure, while maintaining API and protocol
+compatibility with previous versions. We now include non-shaded and
+shaded artifacts, to make it easier to embed Avatica in your
+application. There is improved support for the JDBC API, including
+better type conversions and support for canceling statements. The
+transport is upgraded to use protobuf-3.1.0 (previously 3.0 beta).
+
+Compatibility: This release is tested
+on Linux, macOS, Microsoft Windows;
+using Oracle JDK 1.7, 1.8;
+Guava versions 14.0 to 19.0;
+other software versions as specified in `pom.xml`.
+
+Features and bug fixes
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1471">CALCITE-1471</a>]
+  `HttpServerSpnegoWithJaasTest.testAuthenticatedClientsAllowed` fails on Windows
+  (Aaron Mihalik)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1464">CALCITE-1464</a>]
+  Upgrade Jetty version to 9.2.19v20160908
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1463">CALCITE-1463</a>]
+  In `standalone-server` jar, relocate dependencies rather than excluding them
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1355">CALCITE-1355</a>]
+  Upgrade to protobuf-java 3.1.0
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1462">CALCITE-1462</a>]
+  Remove Avatica pom cruft
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1458">CALCITE-1458</a>]
+  Add column values to the deprecated protobuf attribute
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1433">CALCITE-1433</a>]
+  Add missing dependencies to `avatica-server`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1433">CALCITE-1433</a>]
+  Fix missing avatica `test-jar` dependency
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1423">CALCITE-1423</a>]
+  Add method `ByteString.indexOf(ByteString, int)`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1408">CALCITE-1408</a>]
+  `ResultSet.getXxx` methods should throw `SQLDataException` if cannot convert to
+  the requested type (Laurent Goujon)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1410">CALCITE-1410</a>]
+  Fix JDBC metadata classes (Laurent Goujon)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1224">CALCITE-1224</a>]
+  Publish non-shaded and shaded versions of Avatica client artifacts
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1407">CALCITE-1407</a>]
+  `MetaImpl.fieldMetaData` wrongly uses 1-based column ordinals
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1361">CALCITE-1361</a>]
+  Remove entry from `AvaticaConnection.flagMap` when session closed
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1399">CALCITE-1399</a>]
+  Make the jcommander `SerializationConverter` public
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1394">CALCITE-1394</a>]
+  Javadoc warnings due to `CoreMatchers.containsString` and `mockito-all`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1390">CALCITE-1390</a>]
+  Avatica JDBC driver wrongly modifies `Properties` object
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1371">CALCITE-1371</a>]
+  `PreparedStatement` does not process Date type correctly (Billy (Yiming) Liu)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1301">CALCITE-1301</a>]
+  Add `cancel` flag to `AvaticaStatement`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1315">CALCITE-1315</a>]
+  Retry the request on `NoHttpResponseException`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1300">CALCITE-1300</a>]
+  Retry on HTTP-503 in hc-based `AvaticaHttpClient`
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1263">CALCITE-1263</a>]
+  Case-insensitive match and null default value for `enum` properties
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1282">CALCITE-1282</a>]
+  Adds an API method to set extra allowed Kerberos realms
+
+Tests
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1226">CALCITE-1226</a>]
+  Disable `AvaticaSpnegoTest` due to intermittent failures
+
+Web site and documentation
+
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1369">CALCITE-1369</a>]
+  Add list of Avatica clients to the web site
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1229">CALCITE-1229</a>]
+  Restore API and Test API links to site
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1287">CALCITE-1287</a>]
+  TCK test for binary columns
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1285">CALCITE-1285</a>]
+  Fix client URL template in example config file
+
 ## <a href="https://github.com/apache/calcite/releases/tag/calcite-avatica-1.8.0">1.8.0</a> / 2016-06-04
 {: #v1-8-0}
 
@@ -128,8 +212,6 @@ Web site and documentation
 * [<a href='https://issues.apache.org/jira/browse/CALCITE-1202'>CALCITE-1202</a>]
   Lock version of Jekyll used by website
 
-
-
 ## <a href="https://github.com/apache/calcite/releases/tag/calcite-avatica-1.7.1">1.7.1</a> / 2016-03-18
 {: #v1-7-1}
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/82fb4b20/avatica/site/_docs/howto.md
----------------------------------------------------------------------
diff --git a/avatica/site/_docs/howto.md b/avatica/site/_docs/howto.md
index fbc7b59..24689b5 100644
--- a/avatica/site/_docs/howto.md
+++ b/avatica/site/_docs/howto.md
@@ -39,8 +39,8 @@ Unpack the source distribution `.tar.gz` or `.zip` file,
 then build using maven:
 
 {% highlight bash %}
-$ tar xvfz calcite-1.6.0-source.tar.gz
-$ cd calcite-1.6.0
+$ tar xvfz apache-calcite-avatica-1.9.0-src.tar.gz
+$ cd apache-calcite-avatica-1.9.0-src
 $ mvn install
 {% endhighlight %}
 
@@ -58,26 +58,10 @@ then build using maven:
 
 {% highlight bash %}
 $ git clone git://github.com/apache/calcite.git
-$ cd calcite
+$ cd calcite/avatica
 $ mvn install
 {% endhighlight %}
 
-Calcite includes a number of machine-generated codes. By default, these are
-regenerated on every build, but this has the negative side-effect of causing
-a re-compilation of the entire project when the non-machine-generated code
-has not changed. To make sure incremental compilation still works as intended,
-provide the `skipGenerate` command line option with your maven command.
-If you invoke the `clean` lifecycle phase, you must not specify the
-`skipGenerate` option as it will not recompile the necessary code for the build
-to succeed.
-
-{% highlight bash %}
-$ mvn clean
-$ mvn package
-... hacks ...
-$ mvn package -DskipGenerate
-{% endhighlight %}
-
 [Running tests](#running-tests) describes how to run more or fewer
 tests.
 
@@ -122,11 +106,11 @@ objects.
 Typically, the code generated by the Protocol Buffers library doesn't
 need to be re-generated only every build, only when the schema changes.
 
-First, install Protobuf 3.0:
+First, install Protobuf 3.1:
 
 {% highlight bash %}
-$ wget https://github.com/google/protobuf/releases/download/v3.0.0-beta-1/protobuf-java-3.0.0-beta-1.tar.gz
-$ tar xf protobuf-java-3.0.0-beta-1.tar.gz && cd protobuf-3.0.0-beta-1
+$ wget https://github.com/google/protobuf/releases/download/v3.1.0/protobuf-java-3.1.0.tar.gz
+$ tar xf protobuf-java-3.1.0.tar.gz && cd protobuf-3.1.0
 $ ./configure
 $ make
 $ sudo make install
@@ -216,11 +200,12 @@ Before you start:
   a fix version assigned (most likely the version we are
   just about to release)
 
-Create a release branch named after the release, e.g. `branch-1.1`, and push it to Apache.
+Create a release branch named after the release, e.g.
+`branch-avatica-1.9`, and push it to Apache.
 
 {% highlight bash %}
-$ git checkout -b branch-X.Y
-$ git push -u origin branch-X.Y
+$ git checkout -b branch-avatica-X.Y
+$ git push -u origin branch-avatica-X.Y
 {% endhighlight %}
 
 We will use the branch for the entire the release process. Meanwhile,
@@ -265,11 +250,9 @@ Check the artifacts:
   `README`, `README.md`
   * Check that the version in `README` is correct
 * For each .jar, verify that the `META-INF` directory contains the correct
-  contents for `DEPENDENCIES`, `LICENSE`, `NOTICE` and `git.properties` per the
+  contents for `DEPENDENCIES`, `LICENSE` and `NOTICE` per the
   source/classes contained. Refer to the ASF licensing documentation on
   what is required.
-* In each .jar, check that `org-apache-calcite-jdbc.properties` is
-  present and does not contain un-substituted `${...}` variables
 * Check PGP, per [this](https://httpd.apache.org/dev/verification.html)
 
 If something is not correct, you can invoke the `release:clean` mojo to remove the
@@ -312,8 +295,8 @@ popd
 
 # Move the files into a directory
 cd target
-mkdir ~/dist/dev/calcite/apache-calcite-X.Y.Z-rcN
-mv apache-calcite-* ~/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN
+mkdir ~/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN
+mv apache-calcite-avatica-* ~/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN
 
 # Check in
 cd ~/dist/dev/calcite


[5/8] calcite git commit: Fix a test case broken in [CALCITE-1453]

Posted by jh...@apache.org.
Fix a test case broken in [CALCITE-1453]


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/01d4760c
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/01d4760c
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/01d4760c

Branch: refs/heads/master
Commit: 01d4760c6c6d57e177121b88aabe1ef56a9c7bd7
Parents: 9f664b9
Author: Julian Hyde <jh...@apache.org>
Authored: Fri Oct 28 14:48:11 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Sun Oct 30 21:19:57 2016 -0700

----------------------------------------------------------------------
 core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/01d4760c/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java b/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
index fa12f0c..2e252c1 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
@@ -767,7 +767,7 @@ public class SqlFunctionsTest {
       fail("'ge' on non-numeric different type is not possible");
     } catch (IllegalArgumentException e) {
       assertThat(e.getMessage(),
-          is("Invalid types for arithmetic: class java.lang.String >= "
+          is("Invalid types for comparison: class java.lang.String >= "
               + "class java.lang.Long"));
     }
   }


[8/8] calcite git commit: [CALCITE-1125] MINUS as a synonym for EXCEPT (enabled in Oracle10 conformance) (Chandni Singh)

Posted by jh...@apache.org.
[CALCITE-1125] MINUS as a synonym for EXCEPT (enabled in Oracle10 conformance) (Chandni Singh)

Close apache/calcite#321


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/aa8fe082
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/aa8fe082
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/aa8fe082

Branch: refs/heads/master
Commit: aa8fe0828d319614bce2fc1a519ad907f25d904e
Parents: 1b95bd8
Author: Chandni Singh <ch...@capitalone.com>
Authored: Thu Oct 27 22:21:23 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Sun Oct 30 21:28:10 2016 -0700

----------------------------------------------------------------------
 core/src/main/codegen/templates/Parser.jj       | 50 +++++++------
 .../apache/calcite/runtime/CalciteResource.java |  3 +
 .../sql/validate/SqlAbstractConformance.java    |  4 ++
 .../calcite/sql/validate/SqlConformance.java    | 10 +++
 .../sql/validate/SqlConformanceEnum.java        | 10 +++
 .../sql/validate/SqlDelegatingConformance.java  |  4 ++
 .../calcite/runtime/CalciteResource.properties  |  1 +
 .../calcite/sql/parser/SqlParserTest.java       | 74 ++++++++++++++------
 .../apache/calcite/sql/test/SqlAdvisorTest.java |  3 +
 site/_docs/reference.md                         | 14 ++--
 10 files changed, 129 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/codegen/templates/Parser.jj
----------------------------------------------------------------------
diff --git a/core/src/main/codegen/templates/Parser.jj b/core/src/main/codegen/templates/Parser.jj
index 74a4e5a..aac7ab3 100644
--- a/core/src/main/codegen/templates/Parser.jj
+++ b/core/src/main/codegen/templates/Parser.jj
@@ -4712,30 +4712,39 @@ SqlNode JdbcFunctionCall() :
  */
 SqlBinaryOperator BinaryQueryOperator() :
 {
-    SqlBinaryOperator op;
 }
 {
-    /* If both the ALL or DISTINCT keywords are missing, DISTINCT is implicit */
+    // If both the ALL or DISTINCT keywords are missing, DISTINCT is implicit.
     (
-        <UNION> { op = SqlStdOperatorTable.UNION; }
-        [
-            <ALL> { op = SqlStdOperatorTable.UNION_ALL; }
-            | <DISTINCT> { op = SqlStdOperatorTable.UNION; }
-        ]
-        |
-        <INTERSECT> { op = SqlStdOperatorTable.INTERSECT; }
-        [
-            <ALL> { op = SqlStdOperatorTable.INTERSECT_ALL; }
-            | <DISTINCT> { op = SqlStdOperatorTable.INTERSECT; }
-        ]
+        <UNION>
+        (
+            <ALL> { return SqlStdOperatorTable.UNION_ALL; }
+        |   <DISTINCT> { return SqlStdOperatorTable.UNION; }
+        |   { return SqlStdOperatorTable.UNION; }
+        )
+    |
+        <INTERSECT>
+        (
+            <ALL> { return SqlStdOperatorTable.INTERSECT_ALL; }
+        |   <DISTINCT> { return SqlStdOperatorTable.INTERSECT; }
+        |   { return SqlStdOperatorTable.INTERSECT; }
+        )
+    |
+        (
+            <EXCEPT>
         |
-        <EXCEPT> { op = SqlStdOperatorTable.EXCEPT; }
-        [
-            <ALL> { op = SqlStdOperatorTable.EXCEPT_ALL; }
-            | <DISTINCT> { op = SqlStdOperatorTable.EXCEPT; }
-        ]
+            <SET_MINUS> {
+                if (!this.conformance.isMinusAllowed()) {
+                    throw new ParseException(RESOURCE.minusNotAllowed().str());
+                }
+            }
+        )
+        (
+            <ALL> { return SqlStdOperatorTable.EXCEPT_ALL; }
+        |   <DISTINCT> { return SqlStdOperatorTable.EXCEPT; }
+        |   { return SqlStdOperatorTable.EXCEPT; }
+        )
     )
-    { return op; }
 }
 
 /**
@@ -4933,7 +4942,7 @@ SqlPostfixOperator PostfixRowOperator() :
     | < CHARACTER_SET_CATALOG: "CHARACTER_SET_CATALOG" >
     | < CHARACTER_SET_NAME: "CHARACTER_SET_NAME" >
     | < CHARACTER_SET_SCHEMA: "CHARACTER_SET_SCHEMA" >
-    | < CHARACTERISTICS: "CHARACTERISTICTS" >
+    | < CHARACTERISTICS: "CHARACTERISTICS" >
     | < CHARACTERS: "CHARACTERS" >
     | < CHECK: "CHECK" >
     | < CLASS_ORIGIN: "CLASS_ORIGIN" >
@@ -5303,6 +5312,7 @@ SqlPostfixOperator PostfixRowOperator() :
     | < SESSION_USER: "SESSION_USER" >
     | < SET: "SET" >
     | < SETS: "SETS" >
+    | < SET_MINUS: "MINUS">
     | < SIMILAR: "SIMILAR" >
     | < SIMPLE: "SIMPLE" >
     | < SIZE: "SIZE" >

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java b/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
index 9a3cb8d..3d94482 100644
--- a/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
+++ b/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
@@ -619,6 +619,9 @@ public interface CalciteResource {
   @BaseMessage("Cannot stream results of a query with no streaming inputs: ''{0}''. At least one input should be convertible to a stream")
   ExInst<SqlValidatorException> cannotStreamResultsForNonStreamingInputs(String inputs);
 
+  @BaseMessage("MINUS is not allowed under the current SQL conformance level")
+  ExInst<CalciteException> minusNotAllowed();
+
   @BaseMessage("SELECT must have a FROM clause")
   ExInst<SqlValidatorException> selectMissingFrom();
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java
index a36770c..1b8b363 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java
@@ -42,6 +42,10 @@ public abstract class SqlAbstractConformance implements SqlConformance {
   public boolean isBangEqualAllowed() {
     return SqlConformanceEnum.DEFAULT.isBangEqualAllowed();
   }
+
+  @Override public boolean isMinusAllowed() {
+    return SqlConformanceEnum.DEFAULT.isMinusAllowed();
+  }
 }
 
 // End SqlAbstractConformance.java

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
index 22ac06c..af48e64 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java
@@ -118,6 +118,16 @@ public interface SqlConformance {
    * false otherwise.
    */
   boolean isBangEqualAllowed();
+
+  /**
+   * Whether {@code MINUS} is allowed as an alternative to {@code EXCEPT} in
+   * the parser.
+   *
+   * <p>Among the built-in conformance levels, true in
+   * {@link SqlConformanceEnum#ORACLE_10};
+   * false otherwise.
+   */
+  boolean isMinusAllowed();
 }
 
 // End SqlConformance.java

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java
index 5458893..f16bd36 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java
@@ -97,6 +97,16 @@ public enum SqlConformanceEnum implements SqlConformance {
       return false;
     }
   }
+
+  @Override public boolean isMinusAllowed() {
+    switch (this) {
+    case ORACLE_10:
+      return true;
+    default:
+      return false;
+    }
+  }
+
 }
 
 // End SqlConformanceEnum.java

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/java/org/apache/calcite/sql/validate/SqlDelegatingConformance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlDelegatingConformance.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlDelegatingConformance.java
index 47d56d3..3722c2f 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlDelegatingConformance.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlDelegatingConformance.java
@@ -48,6 +48,10 @@ public class SqlDelegatingConformance extends SqlAbstractConformance {
   @Override public boolean isBangEqualAllowed() {
     return delegate.isBangEqualAllowed();
   }
+
+  @Override public boolean isMinusAllowed() {
+    return delegate.isMinusAllowed();
+  }
 }
 
 // End SqlDelegatingConformance.java

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
----------------------------------------------------------------------
diff --git a/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties b/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
index 8297cf2..c2cdd06 100644
--- a/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
+++ b/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
@@ -202,5 +202,6 @@ TableNotFound=Table ''{0}'' not found
 StarRequiresRecordType=Not a record type. The ''*'' operator requires a record
 FilterMustBeBoolean=FILTER expression must be of type BOOLEAN
 CannotStreamResultsForNonStreamingInputs=Cannot stream results of a query with no streaming inputs: ''{0}''. At least one input should be convertible to a stream
+MinusNotAllowed=MINUS is not allowed under the current SQL conformance level
 SelectMissingFrom=SELECT must have a FROM clause
 # End CalciteResource.properties

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
----------------------------------------------------------------------
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 72812a5..b5ce24b 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
@@ -23,6 +23,8 @@ import org.apache.calcite.sql.SqlKind;
 import org.apache.calcite.sql.SqlNode;
 import org.apache.calcite.sql.SqlSetOption;
 import org.apache.calcite.sql.pretty.SqlPrettyWriter;
+import org.apache.calcite.sql.validate.SqlConformance;
+import org.apache.calcite.sql.validate.SqlConformanceEnum;
 import org.apache.calcite.test.DiffTestCase;
 import org.apache.calcite.test.SqlValidatorTestCase;
 import org.apache.calcite.util.Bug;
@@ -303,6 +305,7 @@ public class SqlParserTest {
       "MERGE",                                          "2003", "2011", "c",
       "METHOD",                                   "99", "2003", "2011", "c",
       "MIN",                                "92",               "2011", "c",
+      "MINUS",                                                          "c",
       "MINUTE",                             "92", "99", "2003", "2011", "c",
       "MINUTES",                                                "2011",
       "MOD",                                                    "2011", "c",
@@ -515,6 +518,7 @@ public class SqlParserTest {
   Quoting quoting = Quoting.DOUBLE_QUOTE;
   Casing unquotedCasing = Casing.TO_UPPER;
   Casing quotedCasing = Casing.UNCHANGED;
+  SqlConformance conformance = SqlConformanceEnum.DEFAULT;
 
   //~ Constructors -----------------------------------------------------------
 
@@ -545,27 +549,16 @@ public class SqlParserTest {
             .setQuoting(quoting)
             .setUnquotedCasing(unquotedCasing)
             .setQuotedCasing(quotedCasing)
+            .setConformance(conformance)
             .build());
   }
 
-  protected SqlNode parseStmt(String sql) throws SqlParseException {
-    return getSqlParser(sql).parseStmt();
-  }
-
   protected void checkExp(
       String sql,
       String expected) {
     getTester().checkExp(sql, expected);
   }
 
-  protected SqlNode parseExpression(String sql) throws SqlParseException {
-    return getSqlParser(sql).parseExpression();
-  }
-
-  protected SqlAbstractParserImpl.Metadata getParserMetadata() {
-    return getSqlParser("").getMetadata();
-  }
-
   protected void checkExpSame(String sql) {
     checkExp(sql, sql);
   }
@@ -1826,6 +1819,45 @@ public class SqlParserTest {
             + "FROM `A`)");
   }
 
+  /** Tests MINUS, which is equivalent to EXCEPT but only supported in some
+   * conformance levels (e.g. ORACLE). */
+  @Test public void testSetMinus() {
+    final String pattern =
+        "MINUS is not allowed under the current SQL conformance level";
+    final String sql = "select col1 from table1 MINUS select col1 from table2";
+    sql(sql).fails(pattern);
+
+    conformance = SqlConformanceEnum.ORACLE_10;
+    final String expected = "(SELECT `COL1`\n"
+        + "FROM `TABLE1`\n"
+        + "EXCEPT\n"
+        + "SELECT `COL1`\n"
+        + "FROM `TABLE2`)";
+    sql(sql).ok(expected);
+
+    final String sql2 =
+        "select col1 from table1 MINUS ALL select col1 from table2";
+    final String expected2 = "(SELECT `COL1`\n"
+        + "FROM `TABLE1`\n"
+        + "EXCEPT ALL\n"
+        + "SELECT `COL1`\n"
+        + "FROM `TABLE2`)";
+    sql(sql2).ok(expected2);
+  }
+
+  /** MINUS is a <b>reserved</b> keyword in Calcite in all conformances, even
+   * in the default conformance, where it is not allowed as an alternative to
+   * EXCEPT. (It is reserved in Oracle but not in any version of the SQL
+   * standard.) */
+  @Test public void testMinusIsReserved() {
+    sql("select ^minus^ from t")
+        .fails("(?s).*Encountered \"minus from\" at .*");
+    sql("select ^minus^ select")
+        .fails("(?s).*Encountered \"minus select\" at .*");
+    sql("select * from t ^as^ minus where x < y")
+        .fails("(?s).*Encountered \"as minus\" at .*");
+  }
+
   @Test public void testIntersect() {
     check(
         "select * from a intersect select * from a",
@@ -6603,7 +6635,7 @@ public class SqlParserTest {
   }
 
   @Test public void testMetadata() {
-    SqlAbstractParserImpl.Metadata metadata = getParserMetadata();
+    SqlAbstractParserImpl.Metadata metadata = getSqlParser("").getMetadata();
     assertTrue(metadata.isReservedFunctionName("ABS"));
     assertFalse(metadata.isReservedFunctionName("FOO"));
 
@@ -6649,7 +6681,8 @@ public class SqlParserTest {
    * non-reserved keyword list in the parser.
    */
   @Test public void testNoUnintendedNewReservedKeywords() {
-    final SqlAbstractParserImpl.Metadata metadata = getParserMetadata();
+    final SqlAbstractParserImpl.Metadata metadata =
+        getSqlParser("").getMetadata();
 
     final SortedSet<String> reservedKeywords = new TreeSet<>();
     final SortedSet<String> keywords92 = keywords("92");
@@ -6699,7 +6732,8 @@ public class SqlParserTest {
         }
         if (line.equals("{% comment %} start {% endcomment %}")) {
           ++stage;
-          SqlAbstractParserImpl.Metadata metadata = getParserMetadata();
+          SqlAbstractParserImpl.Metadata metadata =
+              getSqlParser("").getMetadata();
           int z = 0;
           for (String s : metadata.getTokens()) {
             if (z++ > 0) {
@@ -7008,7 +7042,7 @@ public class SqlParserTest {
     protected SqlNode parseStmtAndHandleEx(String sql) {
       final SqlNode sqlNode;
       try {
-        sqlNode = parseStmt(sql);
+        sqlNode = getSqlParser(sql).parseStmt();
       } catch (SqlParseException e) {
         throw new RuntimeException("Error while parsing SQL: " + sql, e);
       }
@@ -7029,7 +7063,7 @@ public class SqlParserTest {
     protected SqlNode parseExpressionAndHandleEx(String sql) {
       final SqlNode sqlNode;
       try {
-        sqlNode = parseExpression(sql);
+        sqlNode = getSqlParser(sql).parseExpression();
       } catch (SqlParseException e) {
         throw new RuntimeException("Error while parsing expression: " + sql, e);
       }
@@ -7042,7 +7076,7 @@ public class SqlParserTest {
       SqlParserUtil.StringAndPos sap = SqlParserUtil.findPos(sql);
       Throwable thrown = null;
       try {
-        final SqlNode sqlNode = parseStmt(sap.sql);
+        final SqlNode sqlNode = getSqlParser(sap.sql).parseStmt();
         Util.discard(sqlNode);
       } catch (Throwable ex) {
         thrown = ex;
@@ -7054,7 +7088,7 @@ public class SqlParserTest {
     public void checkNode(String sql, Matcher<SqlNode> matcher) {
       SqlParserUtil.StringAndPos sap = SqlParserUtil.findPos(sql);
       try {
-        final SqlNode sqlNode = parseStmt(sap.sql);
+        final SqlNode sqlNode = getSqlParser(sap.sql).parseStmt();
         assertThat(sqlNode, matcher);
       } catch (SqlParseException e) {
         throw Throwables.propagate(e);
@@ -7071,7 +7105,7 @@ public class SqlParserTest {
       SqlParserUtil.StringAndPos sap = SqlParserUtil.findPos(sql);
       Throwable thrown = null;
       try {
-        final SqlNode sqlNode = parseExpression(sap.sql);
+        final SqlNode sqlNode = getSqlParser(sap.sql).parseExpression();
         Util.discard(sqlNode);
       } catch (Throwable ex) {
         thrown = ex;

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/core/src/test/java/org/apache/calcite/sql/test/SqlAdvisorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/sql/test/SqlAdvisorTest.java b/core/src/test/java/org/apache/calcite/sql/test/SqlAdvisorTest.java
index 44aa38c..7856e1d 100644
--- a/core/src/test/java/org/apache/calcite/sql/test/SqlAdvisorTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/test/SqlAdvisorTest.java
@@ -253,6 +253,7 @@ public class SqlAdvisorTest extends SqlValidatorTestCase {
   private static final List<String> WHERE_KEYWORDS =
       Arrays.asList(
           "KEYWORD(EXCEPT)",
+          "KEYWORD(MINUS)",
           "KEYWORD(FETCH)",
           "KEYWORD(OFFSET)",
           "KEYWORD(LIMIT)",
@@ -288,6 +289,7 @@ public class SqlAdvisorTest extends SqlValidatorTestCase {
           "KEYWORD(HAVING)",
           "KEYWORD(LEFT)",
           "KEYWORD(EXCEPT)",
+          "KEYWORD(MINUS)",
           "KEYWORD(JOIN)",
           "KEYWORD(WINDOW)",
           "KEYWORD(.)",
@@ -299,6 +301,7 @@ public class SqlAdvisorTest extends SqlValidatorTestCase {
   private static final List<String> SETOPS =
       Arrays.asList(
           "KEYWORD(EXCEPT)",
+          "KEYWORD(MINUS)",
           "KEYWORD(INTERSECT)",
           "KEYWORD(ORDER)",
           "KEYWORD(UNION)");

http://git-wip-us.apache.org/repos/asf/calcite/blob/aa8fe082/site/_docs/reference.md
----------------------------------------------------------------------
diff --git a/site/_docs/reference.md b/site/_docs/reference.md
index de724cd..120d13b 100644
--- a/site/_docs/reference.md
+++ b/site/_docs/reference.md
@@ -92,9 +92,10 @@ query:
   |   {
           select
       |   selectWithoutFrom
-      |   query UNION [ ALL ] query
-      |   query EXCEPT query
-      |   query INTERSECT query
+      |   query UNION [ ALL | DISTINCT ] query
+      |   query EXCEPT [ ALL | DISTINCT ] query
+      |   query MINUS [ ALL | DISTINCT ] query
+      |   query INTERSECT [ ALL | DISTINCT ] query
       }
       [ ORDER BY orderItem [, orderItem ]* ]
       [ LIMIT { count | ALL } ]
@@ -203,6 +204,10 @@ may refer to tables in the FROM clause of an enclosing query.
 but is not standard SQL and is only allowed in certain
 [conformance levels]({{ site.apiRoot }}/org/apache/calcite/sql/validate/SqlConformance.html#isFromRequired--).
 
+MINUS is equivalent to EXCEPT,
+but is not standard SQL and is only allowed in certain
+[conformance levels]({{ site.apiRoot }}/org/apache/calcite/sql/validate/SqlConformance.html#isMinusAllowed--).
+
 ## Keywords
 
 The following is a list of SQL keywords.
@@ -266,7 +271,7 @@ CENTURY,
 CHAIN,
 **CHAR**,
 **CHARACTER**,
-CHARACTERISTICTS,
+CHARACTERISTICS,
 CHARACTERS,
 **CHARACTER_LENGTH**,
 CHARACTER_SET_CATALOG,
@@ -490,6 +495,7 @@ MESSAGE_TEXT,
 MICROSECOND,
 MILLENNIUM,
 **MIN**,
+**MINUS**,
 **MINUTE**,
 MINVALUE,
 **MOD**,


[2/8] calcite git commit: [CALCITE-1453] Support ANY type with binary comparison and arithmetic operators (Jungtaek Lim)

Posted by jh...@apache.org.
[CALCITE-1453] Support ANY type with binary comparison and arithmetic operators (Jungtaek Lim)

ANY type is represented as Object. There's not enough overloaded
backup methods for comparison and arithmetic operators so if one or
both parameters have ANY type, Calcite cannot find the matched method.

This patch adds overloaded methods for comparison and arithmetic
operators whose parameters are (Object, Object). And if either
parameter is ANY, it boxes primitive type parameter so that it can be
matched to Object, Object.

Newly added overloaded methods are smart that they can handle
different Number types for parameters. However, the implementation has
some downsides:
1. requires converting to BigDecimal
2. the result of arithmetic is also BigDecimal

Close apache/calcite#311


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/80240720
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/80240720
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/80240720

Branch: refs/heads/master
Commit: 80240720ec7de7b68dec8741d2322d9cd7f989ed
Parents: 08eb16b
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Tue Oct 18 11:10:16 2016 +0900
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Oct 26 16:56:22 2016 -0700

----------------------------------------------------------------------
 .../calcite/adapter/enumerable/RexImpTable.java |  48 ++-
 .../apache/calcite/runtime/SqlFunctions.java    | 213 +++++++++++--
 .../org/apache/calcite/sql/SqlDataTypeSpec.java |   3 +-
 .../apache/calcite/test/CollectionTypeTest.java |  82 +++--
 .../apache/calcite/test/SqlFunctionsTest.java   | 304 ++++++++++++++++++-
 5 files changed, 580 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/80240720/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
index 811103e..5984fca 100644
--- a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
+++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
@@ -1636,6 +1636,7 @@ public class RexImpTable {
             SqlStdOperatorTable.LESS_THAN_OR_EQUAL,
             SqlStdOperatorTable.GREATER_THAN,
             SqlStdOperatorTable.GREATER_THAN_OR_EQUAL);
+    public static final String METHOD_POSTFIX_FOR_ANY_TYPE = "Any";
 
     private final ExpressionType expressionType;
     private final String backupMethodName;
@@ -1664,16 +1665,21 @@ public class RexImpTable {
       //   ignore_null
       //     return x == null ? y : y == null ? x : x OP y
       if (backupMethodName != null) {
-        final Primitive primitive =
-            Primitive.ofBoxOr(expressions.get(0).getType());
+        // If one or both operands have ANY type, use the late-binding backup
+        // method.
+        if (anyAnyOperands(call)) {
+          return callBackupMethodAnyType(translator, call, expressions);
+        }
+
+        final Type type0 = expressions.get(0).getType();
+        final Type type1 = expressions.get(1).getType();
         final SqlBinaryOperator op = (SqlBinaryOperator) call.getOperator();
+        final Primitive primitive = Primitive.ofBoxOr(type0);
         if (primitive == null
-            || expressions.get(1).getType() == BigDecimal.class
+            || type1 == BigDecimal.class
             || COMPARISON_OPERATORS.contains(op)
             && !COMP_OP_TYPES.contains(primitive)) {
-          return Expressions.call(
-              SqlFunctions.class,
-              backupMethodName,
+          return Expressions.call(SqlFunctions.class, backupMethodName,
               expressions);
         }
       }
@@ -1684,6 +1690,36 @@ public class RexImpTable {
           Expressions.makeBinary(expressionType, expressions.get(0),
               expressions.get(1)));
     }
+
+    /** Returns whether any of a call's operands have ANY type. */
+    private boolean anyAnyOperands(RexCall call) {
+      for (RexNode operand : call.operands) {
+        if (operand.getType().getSqlTypeName() == SqlTypeName.ANY) {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    private Expression callBackupMethodAnyType(RexToLixTranslator translator,
+        RexCall call, List<Expression> expressions) {
+      final String backupMethodNameForAnyType =
+          backupMethodName + METHOD_POSTFIX_FOR_ANY_TYPE;
+
+      // one or both of parameter(s) is(are) ANY type
+      final Expression expression0 = maybeBox(expressions.get(0));
+      final Expression expression1 = maybeBox(expressions.get(1));
+      return Expressions.call(SqlFunctions.class, backupMethodNameForAnyType,
+          expression0, expression1);
+    }
+
+    private Expression maybeBox(Expression expression) {
+      final Primitive primitive = Primitive.of(expression.getType());
+      if (primitive != null) {
+        expression = Expressions.box(expression, primitive);
+      }
+      return expression;
+    }
   }
 
   /** Implementor for unary operators. */

http://git-wip-us.apache.org/repos/asf/calcite/blob/80240720/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
index 268b911..87b5528 100644
--- a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
+++ b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
@@ -348,118 +348,206 @@ public class SqlFunctions {
 
   // =
 
-  /** SQL = operator applied to Object values (including String; neither
-   * side may be null). */
+  /** SQL <code>=</code> operator applied to BigDecimal values (neither may be
+   * null). */
+  public static boolean eq(BigDecimal b0, BigDecimal b1) {
+    return b0.stripTrailingZeros().equals(b1.stripTrailingZeros());
+  }
+
+  /** SQL <code>=</code> operator applied to Object values (including String;
+   * neither side may be null). */
   public static boolean eq(Object b0, Object b1) {
     return b0.equals(b1);
   }
 
-  /** SQL = operator applied to BigDecimal values (neither may be null). */
-  public static boolean eq(BigDecimal b0, BigDecimal b1) {
-    return b0.stripTrailingZeros().equals(b1.stripTrailingZeros());
+  /** SQL <code>=</code> operator applied to Object values (at least one operand
+   * has ANY type; neither may be null). */
+  public static boolean eqAny(Object b0, Object b1) {
+    if (b0.getClass().equals(b1.getClass())) {
+      // The result of SqlFunctions.eq(BigDecimal, BigDecimal) makes more sense
+      // than BigDecimal.equals(BigDecimal). So if both of types are BigDecimal,
+      // we just use SqlFunctions.eq(BigDecimal, BigDecimal).
+      if (BigDecimal.class.isInstance(b0)) {
+        return eq((BigDecimal) b0, (BigDecimal) b1);
+      } else {
+        return b0.equals(b1);
+      }
+    } else if (allAssignable(Number.class, b0, b1)) {
+      return eq(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+    // We shouldn't rely on implementation even though overridden equals can
+    // handle other types which may create worse result: for example,
+    // a.equals(b) != b.equals(a)
+    return false;
+  }
+
+  /** Returns whether two objects can both be assigned to a given class. */
+  private static boolean allAssignable(Class clazz, Object o0, Object o1) {
+    return clazz.isInstance(o0) && clazz.isInstance(o1);
   }
 
   // <>
 
-  /** SQL &lt;&gt; operator applied to Object values (including String;
-   * neither side may be null). */
+  /** SQL <code>&lt;gt;</code> operator applied to BigDecimal values. */
+  public static boolean ne(BigDecimal b0, BigDecimal b1) {
+    return b0.compareTo(b1) != 0;
+  }
+
+  /** SQL <code>&lt;gt;</code> operator applied to Object values (including
+   * String; neither side may be null). */
   public static boolean ne(Object b0, Object b1) {
-    return !b0.equals(b1);
+    return !eq(b0, b1);
   }
 
-  /** SQL &lt;&gt; operator applied to BigDecimal values. */
-  public static boolean ne(BigDecimal b0, BigDecimal b1) {
-    return b0.compareTo(b1) != 0;
+  /** SQL <code>&lt;gt;</code> operator applied to Object values (at least one
+   *  operand has ANY type, including String; neither may be null). */
+  public static boolean neAny(Object b0, Object b1) {
+    return !eqAny(b0, b1);
   }
 
   // <
 
-  /** SQL &lt; operator applied to boolean values. */
+  /** SQL <code>&lt;</code> operator applied to boolean values. */
   public static boolean lt(boolean b0, boolean b1) {
     return compare(b0, b1) < 0;
   }
 
-  /** SQL &lt; operator applied to String values. */
+  /** SQL <code>&lt;</code> operator applied to String values. */
   public static boolean lt(String b0, String b1) {
     return b0.compareTo(b1) < 0;
   }
 
-  /** SQL &lt; operator applied to ByteString values. */
+  /** SQL <code>&lt;</code> operator applied to ByteString values. */
   public static boolean lt(ByteString b0, ByteString b1) {
     return b0.compareTo(b1) < 0;
   }
 
-  /** SQL &lt; operator applied to BigDecimal values. */
+  /** SQL <code>&lt;</code> operator applied to BigDecimal values. */
   public static boolean lt(BigDecimal b0, BigDecimal b1) {
     return b0.compareTo(b1) < 0;
   }
 
+  /** SQL <code>&lt;</code> operator applied to Object values. */
+  public static boolean ltAny(Object b0, Object b1) {
+    if (b0.getClass().equals(b1.getClass())
+        && b0 instanceof Comparable) {
+      //noinspection unchecked
+      return ((Comparable) b0).compareTo(b1) < 0;
+    } else if (allAssignable(Number.class, b0, b1)) {
+      return lt(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notComparable("<", b0, b1);
+  }
+
   // <=
 
-  /** SQL &le; operator applied to boolean values. */
+  /** SQL <code>&le;</code> operator applied to boolean values. */
   public static boolean le(boolean b0, boolean b1) {
     return compare(b0, b1) <= 0;
   }
 
-  /** SQL &le; operator applied to String values. */
+  /** SQL <code>&le;</code> operator applied to String values. */
   public static boolean le(String b0, String b1) {
     return b0.compareTo(b1) <= 0;
   }
 
-  /** SQL &le; operator applied to ByteString values. */
+  /** SQL <code>&le;</code> operator applied to ByteString values. */
   public static boolean le(ByteString b0, ByteString b1) {
     return b0.compareTo(b1) <= 0;
   }
 
-  /** SQL &le; operator applied to BigDecimal values. */
+  /** SQL <code>&le;</code> operator applied to BigDecimal values. */
   public static boolean le(BigDecimal b0, BigDecimal b1) {
     return b0.compareTo(b1) <= 0;
   }
 
+  /** SQL <code>&le;</code> operator applied to Object values (at least one
+   * operand has ANY type; neither may be null). */
+  public static boolean leAny(Object b0, Object b1) {
+    if (b0.getClass().equals(b1.getClass())
+        && b0 instanceof Comparable) {
+      //noinspection unchecked
+      return ((Comparable) b0).compareTo(b1) <= 0;
+    } else if (allAssignable(Number.class, b0, b1)) {
+      return le(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notComparable("<=", b0, b1);
+  }
+
   // >
 
-  /** SQL &gt; operator applied to boolean values. */
+  /** SQL <code>&gt;</code> operator applied to boolean values. */
   public static boolean gt(boolean b0, boolean b1) {
     return compare(b0, b1) > 0;
   }
 
-  /** SQL &gt; operator applied to String values. */
+  /** SQL <code>&gt;</code> operator applied to String values. */
   public static boolean gt(String b0, String b1) {
     return b0.compareTo(b1) > 0;
   }
 
-  /** SQL &gt; operator applied to ByteString values. */
+  /** SQL <code>&gt;</code> operator applied to ByteString values. */
   public static boolean gt(ByteString b0, ByteString b1) {
     return b0.compareTo(b1) > 0;
   }
 
-  /** SQL &gt; operator applied to BigDecimal values. */
+  /** SQL <code>&gt;</code> operator applied to BigDecimal values. */
   public static boolean gt(BigDecimal b0, BigDecimal b1) {
     return b0.compareTo(b1) > 0;
   }
 
+  /** SQL <code>&gt;</code> operator applied to Object values (at least one
+   * operand has ANY type; neither may be null). */
+  public static boolean gtAny(Object b0, Object b1) {
+    if (b0.getClass().equals(b1.getClass())
+        && b0 instanceof Comparable) {
+      //noinspection unchecked
+      return ((Comparable) b0).compareTo(b1) > 0;
+    } else if (allAssignable(Number.class, b0, b1)) {
+      return gt(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notComparable(">", b0, b1);
+  }
+
   // >=
 
-  /** SQL &ge; operator applied to boolean values. */
+  /** SQL <code>&ge;</code> operator applied to boolean values. */
   public static boolean ge(boolean b0, boolean b1) {
     return compare(b0, b1) >= 0;
   }
 
-  /** SQL &ge; operator applied to String values. */
+  /** SQL <code>&ge;</code> operator applied to String values. */
   public static boolean ge(String b0, String b1) {
     return b0.compareTo(b1) >= 0;
   }
 
-  /** SQL &ge; operator applied to ByteString values. */
+  /** SQL <code>&ge;</code> operator applied to ByteString values. */
   public static boolean ge(ByteString b0, ByteString b1) {
     return b0.compareTo(b1) >= 0;
   }
 
-  /** SQL &ge; operator applied to BigDecimal values. */
+  /** SQL <code>&ge;</code> operator applied to BigDecimal values. */
   public static boolean ge(BigDecimal b0, BigDecimal b1) {
     return b0.compareTo(b1) >= 0;
   }
 
+  /** SQL <code>&ge;</code> operator applied to Object values (at least one
+   * operand has ANY type; neither may be null). */
+  public static boolean geAny(Object b0, Object b1) {
+    if (b0.getClass().equals(b1.getClass())
+        && b0 instanceof Comparable) {
+      //noinspection unchecked
+      return ((Comparable) b0).compareTo(b1) >= 0;
+    } else if (allAssignable(Number.class, b0, b1)) {
+      return ge(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notComparable(">=", b0, b1);
+  }
+
   // +
 
   /** SQL <code>+</code> operator applied to int values. */
@@ -503,6 +591,20 @@ public class SqlFunctions {
     return (b0 == null || b1 == null) ? null : b0.add(b1);
   }
 
+  /** SQL <code>+</code> operator applied to Object values (at least one operand
+   * has ANY type; either may be null). */
+  public static Object plusAny(Object b0, Object b1) {
+    if (b0 == null || b1 == null) {
+      return null;
+    }
+
+    if (allAssignable(Number.class, b0, b1)) {
+      return plus(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notArithmetic("+", b0, b1);
+  }
+
   // -
 
   /** SQL <code>-</code> operator applied to int values. */
@@ -546,6 +648,20 @@ public class SqlFunctions {
     return (b0 == null || b1 == null) ? null : b0.subtract(b1);
   }
 
+  /** SQL <code>-</code> operator applied to Object values (at least one operand
+   * has ANY type; either may be null). */
+  public static Object minusAny(Object b0, Object b1) {
+    if (b0 == null || b1 == null) {
+      return null;
+    }
+
+    if (allAssignable(Number.class, b0, b1)) {
+      return minus(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notArithmetic("-", b0, b1);
+  }
+
   // /
 
   /** SQL <code>/</code> operator applied to int values. */
@@ -591,6 +707,20 @@ public class SqlFunctions {
         : b0.divide(b1, MathContext.DECIMAL64);
   }
 
+  /** SQL <code>/</code> operator applied to Object values (at least one operand
+   * has ANY type; either may be null). */
+  public static Object divideAny(Object b0, Object b1) {
+    if (b0 == null || b1 == null) {
+      return null;
+    }
+
+    if (allAssignable(Number.class, b0, b1)) {
+      return divide(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notArithmetic("/", b0, b1);
+  }
+
   public static int divide(int b0, BigDecimal b1) {
     return BigDecimal.valueOf(b0)
         .divide(b1, BigDecimal.ROUND_HALF_DOWN).intValue();
@@ -644,6 +774,32 @@ public class SqlFunctions {
     return (b0 == null || b1 == null) ? null : b0.multiply(b1);
   }
 
+  /** SQL <code>*</code> operator applied to Object values (at least one operand
+   * has ANY type; either may be null). */
+  public static Object multiplyAny(Object b0, Object b1) {
+    if (b0 == null || b1 == null) {
+      return null;
+    }
+
+    if (allAssignable(Number.class, b0, b1)) {
+      return multiply(toBigDecimal((Number) b0), toBigDecimal((Number) b1));
+    }
+
+    throw notArithmetic("*", b0, b1);
+  }
+
+  private static IllegalArgumentException notArithmetic(String op, Object b0,
+      Object b1) {
+    return new IllegalArgumentException("Invalid types for arithmetic: "
+        + b0.getClass() + " " + op + " " + b1.getClass());
+  }
+
+  private static IllegalArgumentException notComparable(String op, Object b0,
+      Object b1) {
+    return new IllegalArgumentException("Invalid types for comparison: "
+        + b0.getClass() + " " + op + " " + b1.getClass());
+  }
+
   // EXP
 
   /** SQL <code>EXP</code> operator applied to double values. */
@@ -1431,7 +1587,8 @@ public class SqlFunctions {
     return (int) (localTimestamp(root) % DateTimeUtils.MILLIS_PER_DAY);
   }
 
-  /** SQL TRANSLATE(string, search_chars, replacement_chars) function. */
+  /** SQL {@code TRANSLATE(string, search_chars, replacement_chars)}
+   * function. */
   public static String translate3(String s, String search, String replacement) {
     return org.apache.commons.lang3.StringUtils.replaceChars(s, search, replacement);
   }

http://git-wip-us.apache.org/repos/asf/calcite/blob/80240720/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
index d4bfc6c..c53b832 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java
@@ -18,7 +18,6 @@ package org.apache.calcite.sql;
 
 import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rel.type.RelDataTypeFactory;
-import org.apache.calcite.runtime.SqlFunctions;
 import org.apache.calcite.sql.parser.SqlParserPos;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.sql.type.SqlTypeUtil;
@@ -162,7 +161,7 @@ public class SqlDataTypeSpec extends SqlNode {
   /** Returns a copy of this data type specification with a given
    * nullability. */
   public SqlDataTypeSpec withNullable(Boolean nullable) {
-    if (SqlFunctions.eq(nullable, this.nullable)) {
+    if (Objects.equals(nullable, this.nullable)) {
       return this;
     }
     return new SqlDataTypeSpec(collectionsTypeName, typeName, precision, scale,

http://git-wip-us.apache.org/repos/asf/calcite/blob/80240720/core/src/test/java/org/apache/calcite/test/CollectionTypeTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/CollectionTypeTest.java b/core/src/test/java/org/apache/calcite/test/CollectionTypeTest.java
index 7219aeb..2a2c52b 100644
--- a/core/src/test/java/org/apache/calcite/test/CollectionTypeTest.java
+++ b/core/src/test/java/org/apache/calcite/test/CollectionTypeTest.java
@@ -168,24 +168,52 @@ public class CollectionTypeTest {
 
     final Statement statement = connection.createStatement();
 
-    // Since the value type is ANY, we need to wrap the value to CAST in order to
-    // compare with literal. if it doesn't, Exception is thrown at Runtime.
-    // This is only occurred with primitive type because of providing overloaded methods
-    try {
-      final String sql = "select \"ID\", \"MAPFIELD\"['c'] AS \"MAPFIELD_C\","
-          + " \"NESTEDMAPFIELD\", \"ARRAYFIELD\" "
-          + "from \"s\".\"nested\" "
-          + "where \"NESTEDMAPFIELD\"['a']['b'] = 2 AND \"ARRAYFIELD\"[2] = 200";
-      statement.executeQuery(sql);
+    // placing literal earlier than ANY type is intended: do not modify
+    final String sql = "select \"ID\", \"MAPFIELD\"['c'] AS \"MAPFIELD_C\","
+        + " \"NESTEDMAPFIELD\", \"ARRAYFIELD\" "
+        + "from \"s\".\"nested\" "
+        + "where \"NESTEDMAPFIELD\"['a']['b'] = 2 AND 200.0 = \"ARRAYFIELD\"[2]";
 
-      fail("Without CAST, comparing result of ITEM() and primitive type should throw Exception "
-          + "in Runtime");
-    } catch (SQLException e) {
-      Throwable e2 = e.getCause();
-      assertThat(e2, is(instanceOf(RuntimeException.class)));
-      Throwable e3 = e2.getCause();
-      assertThat(e3, is(instanceOf(NoSuchMethodException.class)));
-    }
+    final ResultSet resultSet = statement.executeQuery(sql);
+    final List<String> resultStrings = CalciteAssert.toList(resultSet);
+    assertThat(resultStrings.size(), is(1));
+
+    // JDBC doesn't support Map / Nested Map so just relying on string representation
+    String expectedRow = "ID=2; MAPFIELD_C=4; NESTEDMAPFIELD={a={b=2, c=4}}; "
+        + "ARRAYFIELD=[100, 200, 300]";
+    assertThat(resultStrings.get(0), is(expectedRow));
+  }
+
+
+  @Test public void testArithmeticToAnyTypeWithoutCast() throws Exception {
+    Connection connection = setupConnectionWithNestedAnyTypeTable();
+
+    final Statement statement = connection.createStatement();
+
+    // placing literal earlier than ANY type is intended: do not modify
+    final String sql = "select \"ID\", \"MAPFIELD\"['c'] AS \"MAPFIELD_C\","
+        + " \"NESTEDMAPFIELD\", \"ARRAYFIELD\" "
+        + "from \"s\".\"nested\" "
+        + "where \"NESTEDMAPFIELD\"['a']['b'] + 1.0 = 3 "
+        + "AND \"NESTEDMAPFIELD\"['a']['b'] * 2.0 = 4 "
+        + "AND \"NESTEDMAPFIELD\"['a']['b'] > 1"
+        + "AND \"NESTEDMAPFIELD\"['a']['b'] >= 2"
+        + "AND 100.1 <> \"ARRAYFIELD\"[2] - 100.0"
+        + "AND 100.0 = \"ARRAYFIELD\"[2] / 2"
+        + "AND 99.9 < \"ARRAYFIELD\"[2] / 2"
+        + "AND 100.0 <= \"ARRAYFIELD\"[2] / 2"
+        + "AND '200' <> \"STRINGARRAYFIELD\"[1]"
+        + "AND '200' = \"STRINGARRAYFIELD\"[2]"
+        + "AND '100' < \"STRINGARRAYFIELD\"[2]";
+
+    final ResultSet resultSet = statement.executeQuery(sql);
+    final List<String> resultStrings = CalciteAssert.toList(resultSet);
+    assertThat(resultStrings.size(), is(1));
+
+    // JDBC doesn't support Map / Nested Map so just relying on string representation
+    String expectedRow = "ID=2; MAPFIELD_C=4; NESTEDMAPFIELD={a={b=2, c=4}}; "
+        + "ARRAYFIELD=[100, 200, 300]";
+    assertThat(resultStrings.get(0), is(expectedRow));
   }
 
   @Test public void testAccessNonExistKeyFromMapWithAnyType() throws Exception {
@@ -313,6 +341,7 @@ public class CollectionTypeTest {
 
   private static Object[][] setupNestedRecords() {
     List<Integer> ints = Arrays.asList(100, 200, 300);
+    List<String> strings = Arrays.asList("100", "200", "300");
 
     Object[][] records = new Object[5][];
 
@@ -322,7 +351,7 @@ public class CollectionTypeTest {
       map.put("c", i * i);
       Map<String, Map<String, Integer>> mm = new HashMap<>();
       mm.put("a", map);
-      records[i] = new Object[] {i, map, mm, ints};
+      records[i] = new Object[] {i, map, mm, ints, strings};
     }
 
     return records;
@@ -333,24 +362,28 @@ public class CollectionTypeTest {
   public static class NestedCollectionTable implements ScannableTable {
     public RelDataType getRowType(RelDataTypeFactory typeFactory) {
 
-      RelDataType nullableKeyType = typeFactory
+      RelDataType nullableVarcharType = typeFactory
           .createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.VARCHAR), true);
-      RelDataType nullableValueType = typeFactory
+      RelDataType nullableIntegerType = typeFactory
           .createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.INTEGER), true);
       RelDataType nullableMapType = typeFactory
-          .createTypeWithNullability(typeFactory.createMapType(nullableKeyType, nullableValueType),
+          .createTypeWithNullability(
+              typeFactory.createMapType(nullableVarcharType, nullableIntegerType),
               true);
       return typeFactory.builder()
           .add("ID", SqlTypeName.INTEGER)
           .add("MAPFIELD",
               typeFactory.createTypeWithNullability(
-                typeFactory.createMapType(nullableKeyType, nullableValueType), true))
+                typeFactory.createMapType(nullableVarcharType, nullableIntegerType), true))
           .add("NESTEDMAPFIELD", typeFactory
               .createTypeWithNullability(
-                  typeFactory.createMapType(nullableKeyType, nullableMapType), true))
+                  typeFactory.createMapType(nullableVarcharType, nullableMapType), true))
           .add("ARRAYFIELD", typeFactory
               .createTypeWithNullability(
-                  typeFactory.createArrayType(nullableValueType, -1L), true))
+                  typeFactory.createArrayType(nullableIntegerType, -1L), true))
+          .add("STRINGARRAYFIELD", typeFactory
+              .createTypeWithNullability(
+                  typeFactory.createArrayType(nullableVarcharType, -1L), true))
           .build();
     }
 
@@ -380,6 +413,7 @@ public class CollectionTypeTest {
           .add("MAPFIELD", SqlTypeName.ANY)
           .add("NESTEDMAPFIELD", SqlTypeName.ANY)
           .add("ARRAYFIELD", SqlTypeName.ANY)
+          .add("STRINGARRAYFIELD", SqlTypeName.ANY)
           .build();
     }
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/80240720/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java b/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
index e6b6d44..fa12f0c 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlFunctionsTest.java
@@ -599,20 +599,304 @@ public class SqlFunctionsTest {
     assertThat(floorDiv(-11, 3), equalTo(-4L));
     assertThat(floorDiv(0, 3), equalTo(0L));
     assertThat(floorDiv(1, 3), equalTo(0L));
-    assertThat(floorDiv(-1, 3), equalTo(-1L));
+    assertThat(floorDiv(-1, 3), is(-1L));
   }
 
   @Test public void testFloorMod() {
-    assertThat(floorMod(13, 3), equalTo(1L));
-    assertThat(floorMod(12, 3), equalTo(0L));
-    assertThat(floorMod(11, 3), equalTo(2L));
-    assertThat(floorMod(-13, 3), equalTo(2L));
-    assertThat(floorMod(-12, 3), equalTo(0L));
-    assertThat(floorMod(-11, 3), equalTo(1L));
-    assertThat(floorMod(0, 3), equalTo(0L));
-    assertThat(floorMod(1, 3), equalTo(1L));
-    assertThat(floorMod(-1, 3), equalTo(2L));
+    assertThat(floorMod(13, 3), is(1L));
+    assertThat(floorMod(12, 3), is(0L));
+    assertThat(floorMod(11, 3), is(2L));
+    assertThat(floorMod(-13, 3), is(2L));
+    assertThat(floorMod(-12, 3), is(0L));
+    assertThat(floorMod(-11, 3), is(1L));
+    assertThat(floorMod(0, 3), is(0L));
+    assertThat(floorMod(1, 3), is(1L));
+    assertThat(floorMod(-1, 3), is(2L));
+  }
+
+  @Test public void testEqWithAny() {
+    // Non-numeric same type equality check
+    assertThat(SqlFunctions.eqAny("hello", "hello"), is(true));
+
+    // Numeric types equality check
+    assertThat(SqlFunctions.eqAny(1, 1L), is(true));
+    assertThat(SqlFunctions.eqAny(1, 1.0D), is(true));
+    assertThat(SqlFunctions.eqAny(1L, 1.0D), is(true));
+    assertThat(SqlFunctions.eqAny(new BigDecimal(1L), 1), is(true));
+    assertThat(SqlFunctions.eqAny(new BigDecimal(1L), 1L), is(true));
+    assertThat(SqlFunctions.eqAny(new BigDecimal(1L), 1.0D), is(true));
+    assertThat(SqlFunctions.eqAny(new BigDecimal(1L), new BigDecimal(1.0D)),
+        is(true));
+
+    // Non-numeric different type equality check
+    assertThat(SqlFunctions.eqAny("2", 2), is(false));
+  }
+
+  @Test public void testNeWithAny() {
+    // Non-numeric same type inequality check
+    assertThat(SqlFunctions.neAny("hello", "world"), is(true));
+
+    // Numeric types inequality check
+    assertThat(SqlFunctions.neAny(1, 2L), is(true));
+    assertThat(SqlFunctions.neAny(1, 2.0D), is(true));
+    assertThat(SqlFunctions.neAny(1L, 2.0D), is(true));
+    assertThat(SqlFunctions.neAny(new BigDecimal(2L), 1), is(true));
+    assertThat(SqlFunctions.neAny(new BigDecimal(2L), 1L), is(true));
+    assertThat(SqlFunctions.neAny(new BigDecimal(2L), 1.0D), is(true));
+    assertThat(SqlFunctions.neAny(new BigDecimal(2L), new BigDecimal(1.0D)),
+        is(true));
+
+    // Non-numeric different type inequality check
+    assertThat(SqlFunctions.neAny("2", 2), is(true));
+  }
+
+  @Test public void testLtWithAny() {
+    // Non-numeric same type "less then" check
+    assertThat(SqlFunctions.ltAny("apple", "banana"), is(true));
+
+    // Numeric types "less than" check
+    assertThat(SqlFunctions.ltAny(1, 2L), is(true));
+    assertThat(SqlFunctions.ltAny(1, 2.0D), is(true));
+    assertThat(SqlFunctions.ltAny(1L, 2.0D), is(true));
+    assertThat(SqlFunctions.ltAny(new BigDecimal(1L), 2), is(true));
+    assertThat(SqlFunctions.ltAny(new BigDecimal(1L), 2L), is(true));
+    assertThat(SqlFunctions.ltAny(new BigDecimal(1L), 2.0D), is(true));
+    assertThat(SqlFunctions.ltAny(new BigDecimal(1L), new BigDecimal(2.0D)),
+        is(true));
+
+    // Non-numeric different type but both implements Comparable
+    // "less than" check
+    try {
+      assertThat(SqlFunctions.ltAny("1", 2L), is(false));
+      fail("'lt' on non-numeric different type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for comparison: class java.lang.String < "
+              + "class java.lang.Long"));
+    }
   }
+
+  @Test public void testLeWithAny() {
+    // Non-numeric same type "less or equal" check
+    assertThat(SqlFunctions.leAny("apple", "banana"), is(true));
+    assertThat(SqlFunctions.leAny("apple", "apple"), is(true));
+
+    // Numeric types "less or equal" check
+    assertThat(SqlFunctions.leAny(1, 2L), is(true));
+    assertThat(SqlFunctions.leAny(1, 1L), is(true));
+    assertThat(SqlFunctions.leAny(1, 2.0D), is(true));
+    assertThat(SqlFunctions.leAny(1, 1.0D), is(true));
+    assertThat(SqlFunctions.leAny(1L, 2.0D), is(true));
+    assertThat(SqlFunctions.leAny(1L, 1.0D), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), 2), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), 1), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), 2L), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), 1L), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), 2.0D), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), 1.0D), is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), new BigDecimal(2.0D)),
+        is(true));
+    assertThat(SqlFunctions.leAny(new BigDecimal(1L), new BigDecimal(1.0D)),
+        is(true));
+
+    // Non-numeric different type but both implements Comparable
+    // "less or equal" check
+    try {
+      assertThat(SqlFunctions.leAny("2", 2L), is(false));
+      fail("'le' on non-numeric different type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for comparison: class java.lang.String <= "
+              + "class java.lang.Long"));
+    }
+  }
+
+  @Test public void testGtWithAny() {
+    // Non-numeric same type "greater then" check
+    assertThat(SqlFunctions.gtAny("banana", "apple"), is(true));
+
+    // Numeric types "greater than" check
+    assertThat(SqlFunctions.gtAny(2, 1L), is(true));
+    assertThat(SqlFunctions.gtAny(2, 1.0D), is(true));
+    assertThat(SqlFunctions.gtAny(2L, 1.0D), is(true));
+    assertThat(SqlFunctions.gtAny(new BigDecimal(2L), 1), is(true));
+    assertThat(SqlFunctions.gtAny(new BigDecimal(2L), 1L), is(true));
+    assertThat(SqlFunctions.gtAny(new BigDecimal(2L), 1.0D), is(true));
+    assertThat(SqlFunctions.gtAny(new BigDecimal(2L), new BigDecimal(1.0D)),
+        is(true));
+
+    // Non-numeric different type but both implements Comparable
+    // "greater than" check
+    try {
+      assertThat(SqlFunctions.gtAny("2", 1L), is(false));
+      fail("'gt' on non-numeric different type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for comparison: class java.lang.String > "
+              + "class java.lang.Long"));
+    }
+  }
+
+  @Test public void testGeWithAny() {
+    // Non-numeric same type "greater or equal" check
+    assertThat(SqlFunctions.geAny("banana", "apple"), is(true));
+    assertThat(SqlFunctions.geAny("apple", "apple"), is(true));
+
+    // Numeric types "greater or equal" check
+    assertThat(SqlFunctions.geAny(2, 1L), is(true));
+    assertThat(SqlFunctions.geAny(1, 1L), is(true));
+    assertThat(SqlFunctions.geAny(2, 1.0D), is(true));
+    assertThat(SqlFunctions.geAny(1, 1.0D), is(true));
+    assertThat(SqlFunctions.geAny(2L, 1.0D), is(true));
+    assertThat(SqlFunctions.geAny(1L, 1.0D), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(2L), 1), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(1L), 1), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(2L), 1L), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(1L), 1L), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(2L), 1.0D), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(1L), 1.0D), is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(2L), new BigDecimal(1.0D)),
+        is(true));
+    assertThat(SqlFunctions.geAny(new BigDecimal(1L), new BigDecimal(1.0D)),
+        is(true));
+
+    // Non-numeric different type but both implements Comparable
+    // "greater or equal" check
+    try {
+      assertThat(SqlFunctions.geAny("2", 2L), is(false));
+      fail("'ge' on non-numeric different type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for arithmetic: class java.lang.String >= "
+              + "class java.lang.Long"));
+    }
+  }
+
+  @Test public void testPlusAny() {
+    // null parameters
+    assertNull(SqlFunctions.plusAny(null, null));
+    assertNull(SqlFunctions.plusAny(null, 1));
+    assertNull(SqlFunctions.plusAny(1, null));
+
+    // Numeric types
+    assertThat(SqlFunctions.plusAny(2, 1L), is((Object) new BigDecimal(3)));
+    assertThat(SqlFunctions.plusAny(2, 1.0D), is((Object) new BigDecimal(3)));
+    assertThat(SqlFunctions.plusAny(2L, 1.0D), is((Object) new BigDecimal(3)));
+    assertThat(SqlFunctions.plusAny(new BigDecimal(2L), 1),
+        is((Object) new BigDecimal(3)));
+    assertThat(SqlFunctions.plusAny(new BigDecimal(2L), 1L),
+        is((Object) new BigDecimal(3)));
+    assertThat(SqlFunctions.plusAny(new BigDecimal(2L), 1.0D),
+        is((Object) new BigDecimal(3)));
+    assertThat(SqlFunctions.plusAny(new BigDecimal(2L), new BigDecimal(1.0D)),
+        is((Object) new BigDecimal(3)));
+
+    // Non-numeric type
+    try {
+      SqlFunctions.plusAny("2", 2L);
+      fail("'plus' on non-numeric type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for arithmetic: class java.lang.String + "
+              + "class java.lang.Long"));
+    }
+  }
+
+  @Test public void testMinusAny() {
+    // null parameters
+    assertNull(SqlFunctions.minusAny(null, null));
+    assertNull(SqlFunctions.minusAny(null, 1));
+    assertNull(SqlFunctions.minusAny(1, null));
+
+    // Numeric types
+    assertThat(SqlFunctions.minusAny(2, 1L), is((Object) new BigDecimal(1)));
+    assertThat(SqlFunctions.minusAny(2, 1.0D), is((Object) new BigDecimal(1)));
+    assertThat(SqlFunctions.minusAny(2L, 1.0D), is((Object) new BigDecimal(1)));
+    assertThat(SqlFunctions.minusAny(new BigDecimal(2L), 1),
+        is((Object) new BigDecimal(1)));
+    assertThat(SqlFunctions.minusAny(new BigDecimal(2L), 1L),
+        is((Object) new BigDecimal(1)));
+    assertThat(SqlFunctions.minusAny(new BigDecimal(2L), 1.0D),
+        is((Object) new BigDecimal(1)));
+    assertThat(SqlFunctions.minusAny(new BigDecimal(2L), new BigDecimal(1.0D)),
+        is((Object) new BigDecimal(1)));
+
+    // Non-numeric type
+    try {
+      SqlFunctions.minusAny("2", 2L);
+      fail("'minus' on non-numeric type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for arithmetic: class java.lang.String - "
+              + "class java.lang.Long"));
+    }
+  }
+
+  @Test public void testMultiplyAny() {
+    // null parameters
+    assertNull(SqlFunctions.multiplyAny(null, null));
+    assertNull(SqlFunctions.multiplyAny(null, 1));
+    assertNull(SqlFunctions.multiplyAny(1, null));
+
+    // Numeric types
+    assertThat(SqlFunctions.multiplyAny(2, 1L), is((Object) new BigDecimal(2)));
+    assertThat(SqlFunctions.multiplyAny(2, 1.0D),
+        is((Object) new BigDecimal(2)));
+    assertThat(SqlFunctions.multiplyAny(2L, 1.0D),
+        is((Object) new BigDecimal(2)));
+    assertThat(SqlFunctions.multiplyAny(new BigDecimal(2L), 1),
+        is((Object) new BigDecimal(2)));
+    assertThat(SqlFunctions.multiplyAny(new BigDecimal(2L), 1L),
+        is((Object) new BigDecimal(2)));
+    assertThat(SqlFunctions.multiplyAny(new BigDecimal(2L), 1.0D),
+        is((Object) new BigDecimal(2)));
+    assertThat(SqlFunctions.multiplyAny(new BigDecimal(2L), new BigDecimal(1.0D)),
+        is((Object) new BigDecimal(2)));
+
+    // Non-numeric type
+    try {
+      SqlFunctions.multiplyAny("2", 2L);
+      fail("'multiply' on non-numeric type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for arithmetic: class java.lang.String * "
+              + "class java.lang.Long"));
+    }
+  }
+
+  @Test public void testDivideAny() {
+    // null parameters
+    assertNull(SqlFunctions.divideAny(null, null));
+    assertNull(SqlFunctions.divideAny(null, 1));
+    assertNull(SqlFunctions.divideAny(1, null));
+
+    // Numeric types
+    assertThat(SqlFunctions.divideAny(5, 2L),
+        is((Object) new BigDecimal("2.5")));
+    assertThat(SqlFunctions.divideAny(5, 2.0D),
+        is((Object) new BigDecimal("2.5")));
+    assertThat(SqlFunctions.divideAny(5L, 2.0D),
+        is((Object) new BigDecimal("2.5")));
+    assertThat(SqlFunctions.divideAny(new BigDecimal(5L), 2),
+        is((Object) new BigDecimal(2.5)));
+    assertThat(SqlFunctions.divideAny(new BigDecimal(5L), 2L),
+        is((Object) new BigDecimal(2.5)));
+    assertThat(SqlFunctions.divideAny(new BigDecimal(5L), 2.0D),
+        is((Object) new BigDecimal(2.5)));
+    assertThat(SqlFunctions.divideAny(new BigDecimal(5L), new BigDecimal(2.0D)),
+        is((Object) new BigDecimal(2.5)));
+
+    // Non-numeric type
+    try {
+      SqlFunctions.divideAny("5", 2L);
+      fail("'divide' on non-numeric type is not possible");
+    } catch (IllegalArgumentException e) {
+      assertThat(e.getMessage(),
+          is("Invalid types for arithmetic: class java.lang.String / "
+              + "class java.lang.Long"));
+    }
+  }
+
 }
 
 // End SqlFunctionsTest.java


[6/8] calcite git commit: [CALCITE-1270] Upgrade Calcite to avatica-1.9, sqlline-1.2.0

Posted by jh...@apache.org.
[CALCITE-1270] Upgrade Calcite to avatica-1.9, sqlline-1.2.0

[CALCITE-1475] Jackson shading causes JsonIgnore to be ignored when serializing response as JSON

Add types for enum properties (leveraging recent API changes in Avatica).

Calcite changes corresponding to [CALCITE-1301] Add cancel flag to AvaticaStatement.

Depend on avatica-core rather than avatica (fixes [CALCITE-1475]) (Josh Elser).


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/b22733c7
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/b22733c7
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/b22733c7

Branch: refs/heads/master
Commit: b22733c7c52def566abf84dd020258ae0194b21d
Parents: 01d4760
Author: Julian Hyde <jh...@apache.org>
Authored: Sat May 28 22:58:55 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Sun Oct 30 21:20:40 2016 -0700

----------------------------------------------------------------------
 cassandra/pom.xml                               |  2 +-
 core/pom.xml                                    | 14 +++++++++-
 .../config/CalciteConnectionConfigImpl.java     |  8 ++----
 .../config/CalciteConnectionProperty.java       | 28 +++++++++++++++-----
 .../calcite/jdbc/CalciteConnectionImpl.java     | 14 +++++-----
 .../apache/calcite/jdbc/CalciteMetaImpl.java    | 10 +++----
 .../apache/calcite/jdbc/CalciteResultSet.java   | 24 +----------------
 .../org/apache/calcite/model/JsonSchema.java    |  1 -
 .../apache/calcite/runtime/CalciteResource.java |  2 --
 .../calcite/runtime/CalciteResource.properties  |  1 -
 .../java/org/apache/calcite/test/JdbcTest.java  | 10 +++----
 druid/pom.xml                                   | 10 ++++++-
 elasticsearch/pom.xml                           | 16 ++++++++---
 example/csv/pom.xml                             | 12 ++++++---
 mongodb/pom.xml                                 |  4 ---
 piglet/pom.xml                                  |  2 +-
 pom.xml                                         | 12 +++------
 splunk/pom.xml                                  |  2 +-
 18 files changed, 88 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/cassandra/pom.xml b/cassandra/pom.xml
index d5481d4..f4b7541 100644
--- a/cassandra/pom.xml
+++ b/cassandra/pom.xml
@@ -38,7 +38,7 @@ limitations under the License.
          in dependencyManagement in the root POM, not here. -->
     <dependency>
       <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
+      <artifactId>avatica-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.calcite</groupId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 635810a..14d8872 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -39,7 +39,7 @@ limitations under the License.
          in dependencyManagement in the root POM, not here. -->
     <dependency>
       <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
+      <artifactId>avatica-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.calcite</groupId>
@@ -60,6 +60,18 @@ limitations under the License.
       <artifactId>commons-lang3</artifactId>
     </dependency>
     <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java b/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java
index f3dbd2a..5262059 100644
--- a/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java
+++ b/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java
@@ -127,12 +127,8 @@ public class CalciteConnectionConfigImpl extends ConnectionConfigImpl
   }
 
   public JsonSchema.Type schemaType() {
-    // Avatica won't allow enum properties whose default is null, so we use
-    // NONE, which is equivalent to null.
-    final JsonSchema.Type type =
-        CalciteConnectionProperty.SCHEMA_TYPE.wrap(properties)
-            .getEnum(JsonSchema.Type.class);
-    return type == null || type == JsonSchema.Type.NONE ? null : type;
+    return CalciteConnectionProperty.SCHEMA_TYPE.wrap(properties)
+        .getEnum(JsonSchema.Type.class);
   }
 
   public boolean spark() {

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
index 2086f87..e17740d 100644
--- a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
+++ b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java
@@ -17,6 +17,8 @@
 package org.apache.calcite.config;
 
 import org.apache.calcite.avatica.ConnectionProperty;
+import org.apache.calcite.avatica.util.Casing;
+import org.apache.calcite.avatica.util.Quoting;
 import org.apache.calcite.model.JsonSchema;
 import org.apache.calcite.sql.validate.SqlConformanceEnum;
 
@@ -44,7 +46,7 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
   /** How NULL values should be sorted if neither NULLS FIRST nor NULLS LAST are
    * specified. The default, HIGH, sorts NULL values the same as Oracle. */
   DEFAULT_NULL_COLLATION("defaultNullCollation", Type.ENUM, NullCollation.HIGH,
-      true),
+      true, NullCollation.class),
 
   /** How many rows the Druid adapter should fetch at a time when executing
    * "select" queries. */
@@ -62,15 +64,15 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
 
   /** How identifiers are quoted.
    *  If not specified, value from {@link #LEX} is used. */
-  QUOTING("quoting", Type.ENUM, null, false),
+  QUOTING("quoting", Type.ENUM, null, false, Quoting.class),
 
   /** How identifiers are stored if they are quoted.
    *  If not specified, value from {@link #LEX} is used. */
-  QUOTED_CASING("quotedCasing", Type.ENUM, null, false),
+  QUOTED_CASING("quotedCasing", Type.ENUM, null, false, Casing.class),
 
   /** How identifiers are stored if they are not quoted.
    *  If not specified, value from {@link #LEX} is used. */
-  UNQUOTED_CASING("unquotedCasing", Type.ENUM, null, false),
+  UNQUOTED_CASING("unquotedCasing", Type.ENUM, null, false, Casing.class),
 
   /** Whether identifiers are matched case-sensitively.
    *  If not specified, value from {@link #LEX} is used. */
@@ -91,10 +93,9 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
    *
    * <p>Value may be null, "MAP", "JDBC", or "CUSTOM"
    * (implicit if {@link #SCHEMA_FACTORY} is specified).
-   * The value "NONE" is converted to null.
    *
    * <p>Ignored if {@link #MODEL} is specified. */
-  SCHEMA_TYPE("schemaType", Type.ENUM, JsonSchema.Type.NONE, false),
+  SCHEMA_TYPE("schemaType", Type.ENUM, null, false, JsonSchema.Type.class),
 
   /** Specifies whether Spark should be used as the engine for processing that
    * cannot be pushed to the source system. If false (the default), Calcite
@@ -120,6 +121,7 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
   private final Type type;
   private final Object defaultValue;
   private final boolean required;
+  private final Class valueClass;
 
   private static final Map<String, CalciteConnectionProperty> NAME_TO_PROPS;
 
@@ -137,11 +139,19 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
 
   CalciteConnectionProperty(String camelName, Type type, Object defaultValue,
       boolean required) {
+    this(camelName, type, defaultValue, required, null);
+  }
+
+  CalciteConnectionProperty(String camelName, Type type, Object defaultValue,
+      boolean required, Class valueClass) {
     this.camelName = camelName;
     this.type = type;
     this.defaultValue = defaultValue;
     this.required = required;
-    assert defaultValue == null || type.valid(defaultValue);
+    this.valueClass = type.deduceValueClass(defaultValue, valueClass);
+    if (!type.valid(defaultValue, this.valueClass)) {
+      throw new AssertionError(camelName);
+    }
   }
 
   public String camelName() {
@@ -156,6 +166,10 @@ public enum CalciteConnectionProperty implements ConnectionProperty {
     return type;
   }
 
+  public Class valueClass() {
+    return valueClass;
+  }
+
   public boolean required() {
     return required;
   }

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java
index 5eebb38..98a1994 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java
@@ -219,6 +219,12 @@ abstract class CalciteConnectionImpl
     }
   }
 
+  @Override public AtomicBoolean getCancelFlag(Meta.StatementHandle handle)
+      throws NoSuchStatementException {
+    final CalciteServerStatement serverStatement = server.getStatement(handle);
+    return ((CalciteServerStatementImpl) serverStatement).cancelFlag;
+  }
+
   // CalciteConnection methods
 
   public SchemaPlus getRootSchema() {
@@ -289,14 +295,6 @@ abstract class CalciteConnectionImpl
     return signature.enumerable(dataContext);
   }
 
-  /** Returns the flag that is used to request or check cancel for a particular
-   * statement. */
-  AtomicBoolean getCancelFlag(Meta.StatementHandle handle)
-      throws NoSuchStatementException {
-    final CalciteServerStatement serverStatement = server.getStatement(handle);
-    return ((CalciteServerStatementImpl) serverStatement).cancelFlag;
-  }
-
   public DataContext createDataContext(Map<String, Object> parameterValues) {
     if (config().spark()) {
       return new SlimDataContext();

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
index 168f356..daf6e8b 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
@@ -178,7 +178,7 @@ public class CalciteMetaImpl extends MetaImpl {
       } catch (NoSuchFieldException e) {
         throw new RuntimeException(e);
       }
-      columns.add(columnMetaData(name, index, field.getType()));
+      columns.add(columnMetaData(name, index, field.getType(), false));
       fields.add(field);
       fieldNames.add(fieldName);
     }
@@ -463,16 +463,16 @@ public class CalciteMetaImpl extends MetaImpl {
               typeSystem.getLiteral(sqlTypeName, true),
               typeSystem.getLiteral(sqlTypeName, false),
               // All types are nullable
-              DatabaseMetaData.typeNullable,
+              (short) DatabaseMetaData.typeNullable,
               typeSystem.isCaseSensitive(sqlTypeName),
               // Making all type searchable; we may want to
               // be specific and declare under SqlTypeName
-              DatabaseMetaData.typeSearchable,
+              (short) DatabaseMetaData.typeSearchable,
               false,
               false,
               typeSystem.isAutoincrement(sqlTypeName),
-              sqlTypeName.getMinScale(),
-              typeSystem.getMaxScale(sqlTypeName),
+              (short) sqlTypeName.getMinScale(),
+              (short) typeSystem.getMaxScale(sqlTypeName),
               typeSystem.getNumTypeRadix(sqlTypeName)));
     }
     return allTypeList.build();

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/jdbc/CalciteResultSet.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteResultSet.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteResultSet.java
index e62417a..e022a66 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/CalciteResultSet.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteResultSet.java
@@ -22,7 +22,6 @@ import org.apache.calcite.avatica.AvaticaStatement;
 import org.apache.calcite.avatica.ColumnMetaData;
 import org.apache.calcite.avatica.Handler;
 import org.apache.calcite.avatica.Meta;
-import org.apache.calcite.avatica.NoSuchStatementException;
 import org.apache.calcite.avatica.util.Cursor;
 import org.apache.calcite.linq4j.Enumerator;
 import org.apache.calcite.linq4j.Linq4j;
@@ -30,7 +29,6 @@ import org.apache.calcite.rel.RelCollation;
 import org.apache.calcite.runtime.ArrayEnumeratorCursor;
 import org.apache.calcite.runtime.ObjectEnumeratorCursor;
 
-import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 
 import java.sql.ResultSet;
@@ -38,27 +36,19 @@ import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.util.List;
 import java.util.TimeZone;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static org.apache.calcite.util.Static.RESOURCE;
 
 /**
  * Implementation of {@link ResultSet}
  * for the Calcite engine.
  */
 public class CalciteResultSet extends AvaticaResultSet {
-  private final AtomicBoolean cancelFlag;
 
+  /** Creates a CalciteResultSet. */
   CalciteResultSet(AvaticaStatement statement,
       CalcitePrepare.CalciteSignature calciteSignature,
       ResultSetMetaData resultSetMetaData, TimeZone timeZone,
       Meta.Frame firstFrame) {
     super(statement, null, calciteSignature, resultSetMetaData, timeZone, firstFrame);
-    try {
-      cancelFlag = getCalciteConnection().getCancelFlag(statement.handle);
-    } catch (NoSuchStatementException e) {
-      throw Throwables.propagate(e);
-    }
   }
 
   @Override protected CalciteResultSet execute() throws SQLException {
@@ -78,18 +68,6 @@ public class CalciteResultSet extends AvaticaResultSet {
     return this;
   }
 
-  @Override protected void cancel() {
-    cancelFlag.compareAndSet(false, true);
-  }
-
-  @Override public boolean next() throws SQLException {
-    final boolean next = super.next();
-    if (cancelFlag.get()) {
-      throw new SQLException(RESOURCE.statementCanceled().str());
-    }
-    return next;
-  }
-
   @Override public ResultSet create(ColumnMetaData.AvaticaType elementType,
       Iterable<Object> iterable) {
     final List<ColumnMetaData> columnMetaDataList;

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/model/JsonSchema.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/model/JsonSchema.java b/core/src/main/java/org/apache/calcite/model/JsonSchema.java
index 94ab89d..f9517e8 100644
--- a/core/src/main/java/org/apache/calcite/model/JsonSchema.java
+++ b/core/src/main/java/org/apache/calcite/model/JsonSchema.java
@@ -106,7 +106,6 @@ public abstract class JsonSchema {
 
   /** Built-in schema types. */
   public enum Type {
-    NONE,
     MAP,
     JDBC,
     CUSTOM

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java b/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
index f9cdf50..9a3cb8d 100644
--- a/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
+++ b/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java
@@ -622,8 +622,6 @@ public interface CalciteResource {
   @BaseMessage("SELECT must have a FROM clause")
   ExInst<SqlValidatorException> selectMissingFrom();
 
-  @BaseMessage("Statement canceled")
-  Inst statementCanceled();
 }
 
 // End CalciteResource.java

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
----------------------------------------------------------------------
diff --git a/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties b/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
index b21e5a5..8297cf2 100644
--- a/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
+++ b/core/src/main/resources/org/apache/calcite/runtime/CalciteResource.properties
@@ -203,5 +203,4 @@ StarRequiresRecordType=Not a record type. The ''*'' operator requires a record
 FilterMustBeBoolean=FILTER expression must be of type BOOLEAN
 CannotStreamResultsForNonStreamingInputs=Cannot stream results of a query with no streaming inputs: ''{0}''. At least one input should be convertible to a stream
 SelectMissingFrom=SELECT must have a FROM clause
-StatementCanceled=Statement canceled
 # End CalciteResource.properties

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/core/src/test/java/org/apache/calcite/test/JdbcTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/JdbcTest.java b/core/src/test/java/org/apache/calcite/test/JdbcTest.java
index 678846c..0eede43 100644
--- a/core/src/test/java/org/apache/calcite/test/JdbcTest.java
+++ b/core/src/test/java/org/apache/calcite/test/JdbcTest.java
@@ -5373,11 +5373,11 @@ public class JdbcTest {
 
               // columns
               assertEquals(
-                  "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=empid; DATA_TYPE=4; TYPE_NAME=JavaType(int) NOT NULL; COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=0; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=1; IS_NULLABLE=NO; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=null; IS_GENERATEDCOLUMN=null\n"
-                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=deptno; DATA_TYPE=4; TYPE_NAME=JavaType(int) NOT NULL; COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=0; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=2; IS_NULLABLE=NO; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=null; IS_GENERATEDCOLUMN=null\n"
-                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=name; DATA_TYPE=12; TYPE_NAME=JavaType(class java.lang.String); COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=1; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=3; IS_NULLABLE=YES; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=null; IS_GENERATEDCOLUMN=null\n"
-                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=salary; DATA_TYPE=7; TYPE_NAME=JavaType(float) NOT NULL; COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=0; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=4; IS_NULLABLE=NO; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=null; IS_GENERATEDCOLUMN=null\n"
-                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=commission; DATA_TYPE=4; TYPE_NAME=JavaType(class java.lang.Integer); COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=1; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=5; IS_NULLABLE=YES; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=null; IS_GENERATEDCOLUMN=null\n",
+                  "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=empid; DATA_TYPE=4; TYPE_NAME=JavaType(int) NOT NULL; COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=0; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=1; IS_NULLABLE=NO; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=; IS_GENERATEDCOLUMN=\n"
+                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=deptno; DATA_TYPE=4; TYPE_NAME=JavaType(int) NOT NULL; COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=0; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=2; IS_NULLABLE=NO; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=; IS_GENERATEDCOLUMN=\n"
+                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=name; DATA_TYPE=12; TYPE_NAME=JavaType(class java.lang.String); COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=1; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=3; IS_NULLABLE=YES; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=; IS_GENERATEDCOLUMN=\n"
+                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=salary; DATA_TYPE=7; TYPE_NAME=JavaType(float) NOT NULL; COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=0; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=4; IS_NULLABLE=NO; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=; IS_GENERATEDCOLUMN=\n"
+                      + "TABLE_CAT=null; TABLE_SCHEM=adhoc; TABLE_NAME=V; COLUMN_NAME=commission; DATA_TYPE=4; TYPE_NAME=JavaType(class java.lang.Integer); COLUMN_SIZE=-1; BUFFER_LENGTH=null; DECIMAL_DIGITS=null; NUM_PREC_RADIX=10; NULLABLE=1; REMARKS=null; COLUMN_DEF=null; SQL_DATA_TYPE=null; SQL_DATETIME_SUB=null; CHAR_OCTET_LENGTH=-1; ORDINAL_POSITION=5; IS_NULLABLE=YES; SCOPE_CATALOG=null; SCOPE_SCHEMA=null; SCOPE_TABLE=null; SOURCE_DATA_TYPE=null; IS_AUTOINCREMENT=; IS_GENERATEDCOLUMN=\n",
                   CalciteAssert.toString(
                       metaData.getColumns(
                           null, "adhoc", "V", null)));

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/druid/pom.xml
----------------------------------------------------------------------
diff --git a/druid/pom.xml b/druid/pom.xml
index d74c87e..16a7db1 100644
--- a/druid/pom.xml
+++ b/druid/pom.xml
@@ -38,7 +38,7 @@ limitations under the License.
          in dependencyManagement in the root POM, not here. -->
     <dependency>
       <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
+      <artifactId>avatica-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.calcite</groupId>
@@ -57,6 +57,14 @@ limitations under the License.
     </dependency>
 
     <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/elasticsearch/pom.xml b/elasticsearch/pom.xml
index 197b365..940e4af 100644
--- a/elasticsearch/pom.xml
+++ b/elasticsearch/pom.xml
@@ -40,10 +40,6 @@ limitations under the License.
       <artifactId>guava</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.calcite</groupId>
       <artifactId>calcite-core</artifactId>
       <type>jar</type>
@@ -55,6 +51,14 @@ limitations under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>
@@ -77,6 +81,10 @@ limitations under the License.
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
   </dependencies>
 
   <build>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/example/csv/pom.xml
----------------------------------------------------------------------
diff --git a/example/csv/pom.xml b/example/csv/pom.xml
index 0b30e69..ad6a1ef 100644
--- a/example/csv/pom.xml
+++ b/example/csv/pom.xml
@@ -36,10 +36,6 @@ limitations under the License.
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.calcite</groupId>
       <artifactId>calcite-core</artifactId>
     </dependency>
@@ -49,6 +45,14 @@ limitations under the License.
     </dependency>
 
     <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/mongodb/pom.xml
----------------------------------------------------------------------
diff --git a/mongodb/pom.xml b/mongodb/pom.xml
index 9661673..a0d80bd 100644
--- a/mongodb/pom.xml
+++ b/mongodb/pom.xml
@@ -37,10 +37,6 @@ limitations under the License.
     <!-- Sorted by groupId, artifactId; calcite dependencies first. Put versions
          in dependencyManagement in the root POM, not here. -->
     <dependency>
-      <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.calcite</groupId>
       <artifactId>calcite-core</artifactId>
       <type>jar</type>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/piglet/pom.xml
----------------------------------------------------------------------
diff --git a/piglet/pom.xml b/piglet/pom.xml
index f56ab85..8a3fb23 100644
--- a/piglet/pom.xml
+++ b/piglet/pom.xml
@@ -38,7 +38,7 @@ limitations under the License.
          in dependencyManagement in the root POM, not here. -->
     <dependency>
       <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
+      <artifactId>avatica-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.calcite</groupId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a9ff6a6..e5f80e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,7 @@ limitations under the License.
 
     <!-- This list is in alphabetical order. -->
     <airlift-tpch.version>0.1</airlift-tpch.version>
-    <avatica.version>1.8.0</avatica.version>
+    <avatica.version>1.9.0</avatica.version>
     <build-helper-maven-plugin.version>1.9</build-helper-maven-plugin.version>
     <cassandra-driver-core.version>3.0.0</cassandra-driver-core.version>
     <checksum-maven-plugin.version>1.2</checksum-maven-plugin.version>
@@ -107,14 +107,13 @@ limitations under the License.
     <oracle-jdbc6-driver.version>11.2.0.2.0</oracle-jdbc6-driver.version>
     <pentaho-aggdesigner.version>5.1.5-jhyde</pentaho-aggdesigner.version>
     <postgresql.version>9.3-1102-jdbc3</postgresql.version>
-    <protobuf.version>3.0.0-beta-1</protobuf.version>
     <quidem.version>0.7</quidem.version>
     <scala.version>2.10.3</scala.version>
     <scott-data-hsqldb.version>0.1</scott-data-hsqldb.version>
     <servlet.version>3.0.1</servlet.version>
     <slf4j.version>1.7.13</slf4j.version>
     <spark.version>1.6.1</spark.version>
-    <sqlline.version>1.1.9</sqlline.version>
+    <sqlline.version>1.2.0</sqlline.version>
     <xalan.version>2.7.1</xalan.version>
     <xerces.version>2.9.1</xerces.version>
   </properties>
@@ -156,7 +155,7 @@ limitations under the License.
       <!-- Sorted by groupId, artifactId; calcite (and avatica) dependencies first. -->
       <dependency>
         <groupId>org.apache.calcite.avatica</groupId>
-        <artifactId>avatica</artifactId>
+        <artifactId>avatica-core</artifactId>
         <version>${avatica.version}</version>
       </dependency>
       <dependency>
@@ -228,11 +227,6 @@ limitations under the License.
         <version>${guava.version}</version>
       </dependency>
       <dependency>
-        <groupId>com.google.protobuf</groupId>
-        <artifactId>protobuf-java</artifactId>
-        <version>${protobuf.version}</version>
-      </dependency>
-      <dependency>
         <groupId>com.oracle</groupId>
         <artifactId>ojdbc6</artifactId>
         <version>${oracle-jdbc6-driver.version}</version>

http://git-wip-us.apache.org/repos/asf/calcite/blob/b22733c7/splunk/pom.xml
----------------------------------------------------------------------
diff --git a/splunk/pom.xml b/splunk/pom.xml
index 68a4eae..4e42782 100644
--- a/splunk/pom.xml
+++ b/splunk/pom.xml
@@ -38,7 +38,7 @@ limitations under the License.
          in dependencyManagement in the root POM, not here. -->
     <dependency>
       <groupId>org.apache.calcite.avatica</groupId>
-      <artifactId>avatica</artifactId>
+      <artifactId>avatica-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.calcite</groupId>


[4/8] calcite git commit: [maven-release-plugin] prepare for next development iteration

Posted by jh...@apache.org.
[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/9f664b9c
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/9f664b9c
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/9f664b9c

Branch: refs/heads/master
Commit: 9f664b9c872ca56924ddd44de4cad03435b16e2b
Parents: e32d778
Author: Julian Hyde <jh...@apache.org>
Authored: Wed Oct 26 17:12:00 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Oct 26 17:12:00 2016 -0700

----------------------------------------------------------------------
 avatica/core/pom.xml                       | 2 +-
 avatica/metrics-dropwizardmetrics3/pom.xml | 2 +-
 avatica/metrics/pom.xml                    | 2 +-
 avatica/noop-driver/pom.xml                | 2 +-
 avatica/pom.xml                            | 4 ++--
 avatica/server/pom.xml                     | 2 +-
 avatica/shaded/core/pom.xml                | 2 +-
 avatica/standalone-server/pom.xml          | 2 +-
 avatica/tck/pom.xml                        | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/core/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/core/pom.xml b/avatica/core/pom.xml
index 3650e8e..2629375 100644
--- a/avatica/core/pom.xml
+++ b/avatica/core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>avatica-core</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/metrics-dropwizardmetrics3/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/metrics-dropwizardmetrics3/pom.xml b/avatica/metrics-dropwizardmetrics3/pom.xml
index 2c9189c..fda6b3e 100644
--- a/avatica/metrics-dropwizardmetrics3/pom.xml
+++ b/avatica/metrics-dropwizardmetrics3/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>avatica-metrics-dropwizardmetrics3</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/metrics/pom.xml b/avatica/metrics/pom.xml
index 7b93abd..5f9bb53 100644
--- a/avatica/metrics/pom.xml
+++ b/avatica/metrics/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>avatica-metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/noop-driver/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/noop-driver/pom.xml b/avatica/noop-driver/pom.xml
index 8372ef9..346b3d4 100644
--- a/avatica/noop-driver/pom.xml
+++ b/avatica/noop-driver/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>avatica-noop-driver</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/pom.xml b/avatica/pom.xml
index f3303c6..9483e97 100644
--- a/avatica/pom.xml
+++ b/avatica/pom.xml
@@ -29,7 +29,7 @@ limitations under the License.
   <groupId>org.apache.calcite.avatica</groupId>
   <artifactId>avatica-parent</artifactId>
   <packaging>pom</packaging>
-  <version>1.9.0</version>
+  <version>1.10.0-SNAPSHOT</version>
 
   <!-- More project information. -->
   <name>Apache Calcite Avatica Project</name>
@@ -97,7 +97,7 @@ limitations under the License.
     <connection>scm:git:https://git-wip-us.apache.org/repos/asf/calcite.git</connection>
     <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/calcite.git</developerConnection>
     <url>https://github.com/apache/calcite</url>
-    <tag>calcite-avatica-1.9.0-rc1</tag>
+    <tag>HEAD</tag>
   </scm>
 
   <modules>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/server/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/server/pom.xml b/avatica/server/pom.xml
index 567debf..76a017c 100644
--- a/avatica/server/pom.xml
+++ b/avatica/server/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>avatica-server</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/shaded/core/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/shaded/core/pom.xml b/avatica/shaded/core/pom.xml
index 483210f..9834d57 100644
--- a/avatica/shaded/core/pom.xml
+++ b/avatica/shaded/core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
     <relativePath>../../pom.xml</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/standalone-server/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/standalone-server/pom.xml b/avatica/standalone-server/pom.xml
index bee15c7..f299858 100644
--- a/avatica/standalone-server/pom.xml
+++ b/avatica/standalone-server/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
   <artifactId>avatica-standalone-server</artifactId>
   <name>Avatica Standalone Server</name>

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f664b9c/avatica/tck/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/tck/pom.xml b/avatica/tck/pom.xml
index d0fdb19..e1d6f90 100644
--- a/avatica/tck/pom.xml
+++ b/avatica/tck/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0</version>
+    <version>1.10.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>avatica-tck</artifactId>


[3/8] calcite git commit: [maven-release-plugin] prepare release calcite-avatica-1.9.0-rc1

Posted by jh...@apache.org.
[maven-release-plugin] prepare release calcite-avatica-1.9.0-rc1


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/e32d778e
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/e32d778e
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/e32d778e

Branch: refs/heads/master
Commit: e32d778e85ce81fd3d820621c0e2d66836bc011d
Parents: 82fb4b2
Author: Julian Hyde <jh...@apache.org>
Authored: Wed Oct 26 17:11:26 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Oct 26 17:11:26 2016 -0700

----------------------------------------------------------------------
 avatica/core/pom.xml                       | 2 +-
 avatica/metrics-dropwizardmetrics3/pom.xml | 2 +-
 avatica/metrics/pom.xml                    | 2 +-
 avatica/noop-driver/pom.xml                | 2 +-
 avatica/pom.xml                            | 4 ++--
 avatica/server/pom.xml                     | 2 +-
 avatica/shaded/core/pom.xml                | 2 +-
 avatica/standalone-server/pom.xml          | 2 +-
 avatica/tck/pom.xml                        | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/core/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/core/pom.xml b/avatica/core/pom.xml
index 2dc0bcc..3650e8e 100644
--- a/avatica/core/pom.xml
+++ b/avatica/core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
 
   <artifactId>avatica-core</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/metrics-dropwizardmetrics3/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/metrics-dropwizardmetrics3/pom.xml b/avatica/metrics-dropwizardmetrics3/pom.xml
index f9dcb2f..2c9189c 100644
--- a/avatica/metrics-dropwizardmetrics3/pom.xml
+++ b/avatica/metrics-dropwizardmetrics3/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
 
   <artifactId>avatica-metrics-dropwizardmetrics3</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/metrics/pom.xml b/avatica/metrics/pom.xml
index 30e0a5e..7b93abd 100644
--- a/avatica/metrics/pom.xml
+++ b/avatica/metrics/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
 
   <artifactId>avatica-metrics</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/noop-driver/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/noop-driver/pom.xml b/avatica/noop-driver/pom.xml
index 3ecfb0d..8372ef9 100644
--- a/avatica/noop-driver/pom.xml
+++ b/avatica/noop-driver/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
 
   <artifactId>avatica-noop-driver</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/pom.xml b/avatica/pom.xml
index faf4ef0..f3303c6 100644
--- a/avatica/pom.xml
+++ b/avatica/pom.xml
@@ -29,7 +29,7 @@ limitations under the License.
   <groupId>org.apache.calcite.avatica</groupId>
   <artifactId>avatica-parent</artifactId>
   <packaging>pom</packaging>
-  <version>1.9.0-SNAPSHOT</version>
+  <version>1.9.0</version>
 
   <!-- More project information. -->
   <name>Apache Calcite Avatica Project</name>
@@ -97,7 +97,7 @@ limitations under the License.
     <connection>scm:git:https://git-wip-us.apache.org/repos/asf/calcite.git</connection>
     <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/calcite.git</developerConnection>
     <url>https://github.com/apache/calcite</url>
-    <tag>HEAD</tag>
+    <tag>calcite-avatica-1.9.0-rc1</tag>
   </scm>
 
   <modules>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/server/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/server/pom.xml b/avatica/server/pom.xml
index 7cc600d..567debf 100644
--- a/avatica/server/pom.xml
+++ b/avatica/server/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
 
   <artifactId>avatica-server</artifactId>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/shaded/core/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/shaded/core/pom.xml b/avatica/shaded/core/pom.xml
index 45bfbc9..483210f 100644
--- a/avatica/shaded/core/pom.xml
+++ b/avatica/shaded/core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
     <relativePath>../../pom.xml</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/standalone-server/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/standalone-server/pom.xml b/avatica/standalone-server/pom.xml
index ab36a00..bee15c7 100644
--- a/avatica/standalone-server/pom.xml
+++ b/avatica/standalone-server/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
   <artifactId>avatica-standalone-server</artifactId>
   <name>Avatica Standalone Server</name>

http://git-wip-us.apache.org/repos/asf/calcite/blob/e32d778e/avatica/tck/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/tck/pom.xml b/avatica/tck/pom.xml
index 13db75b..d0fdb19 100644
--- a/avatica/tck/pom.xml
+++ b/avatica/tck/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
   <parent>
     <groupId>org.apache.calcite.avatica</groupId>
     <artifactId>avatica-parent</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.0</version>
   </parent>
 
   <artifactId>avatica-tck</artifactId>


[7/8] calcite git commit: Site: Change PMC chair

Posted by jh...@apache.org.
Site: Change PMC chair


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/1b95bd82
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/1b95bd82
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/1b95bd82

Branch: refs/heads/master
Commit: 1b95bd826f4a707113c2134e57ad63e5e3ca628b
Parents: b22733c
Author: Julian Hyde <jh...@apache.org>
Authored: Thu Oct 27 19:22:31 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Sun Oct 30 21:26:53 2016 -0700

----------------------------------------------------------------------
 site/_data/contributors.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/1b95bd82/site/_data/contributors.yml
----------------------------------------------------------------------
diff --git a/site/_data/contributors.yml b/site/_data/contributors.yml
index c97fdcc..fb3e09b 100644
--- a/site/_data/contributors.yml
+++ b/site/_data/contributors.yml
@@ -50,7 +50,7 @@
   apacheId: jcamacho
   githubId: jcamachor
   org: Hortonworks
-  role: PMC
+  role: PMC Chair
 - name: Jinfeng Ni
   apacheId: jni
   githubId: jinfengni
@@ -70,7 +70,7 @@
   apacheId: jhyde
   githubId: julianhyde
   org: Hortonworks
-  role: PMC Chair
+  role: PMC
   homepage: http://people.apache.org/~jhyde
 - name: Maryann Xue
   apacheId: maryannxue