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/03/17 23:29:36 UTC

[1/3] calcite git commit: [CALCITE-1158] Make AggregateRemoveRule extensible

Repository: calcite
Updated Branches:
  refs/heads/branch-1.7 [created] 02366e8ae


[CALCITE-1158] Make AggregateRemoveRule extensible

Close apache/calcite#212


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

Branch: refs/heads/branch-1.7
Commit: 68a17fc91bcec738907e980c9ea3f97e44e875cf
Parents: 0ad58ed
Author: Jesus Camacho Rodriguez <jc...@apache.org>
Authored: Wed Mar 16 13:13:32 2016 +0100
Committer: Julian Hyde <jh...@apache.org>
Committed: Thu Mar 17 15:15:54 2016 -0700

----------------------------------------------------------------------
 .../apache/calcite/rel/rules/AggregateRemoveRule.java    | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/68a17fc9/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java
index b98ba64..9a21613 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java
@@ -19,6 +19,7 @@ package org.apache.calcite.rel.rules;
 import org.apache.calcite.plan.RelOptRule;
 import org.apache.calcite.plan.RelOptRuleCall;
 import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Aggregate;
 import org.apache.calcite.rel.logical.LogicalAggregate;
 import org.apache.calcite.rel.metadata.RelMetadataQuery;
 import org.apache.calcite.runtime.SqlFunctions;
@@ -26,21 +27,21 @@ import org.apache.calcite.tools.RelBuilder;
 
 /**
  * Planner rule that removes
- * a {@link org.apache.calcite.rel.logical.LogicalAggregate}
+ * a {@link org.apache.calcite.rel.core.Aggregate}
  * if it computes no aggregate functions
  * (that is, it is implementing {@code SELECT DISTINCT})
  * and the underlying relational expression is already distinct.
  */
 public class AggregateRemoveRule extends RelOptRule {
   public static final AggregateRemoveRule INSTANCE =
-      new AggregateRemoveRule();
+      new AggregateRemoveRule(LogicalAggregate.class);
 
   //~ Constructors -----------------------------------------------------------
 
   /**
    * Creates a AggregateRemoveRule.
    */
-  private AggregateRemoveRule() {
+  public AggregateRemoveRule(Class<? extends Aggregate> aggregateClass) {
     // REVIEW jvs 14-Mar-2006: We have to explicitly mention the child here
     // to make sure the rule re-fires after the child changes (e.g. via
     // ProjectRemoveRule), since that may change our information
@@ -48,14 +49,14 @@ public class AggregateRemoveRule extends RelOptRule {
     // distinct to make it correct up-front, we can get rid of the reference
     // to the child here.
     super(
-        operand(LogicalAggregate.class,
+        operand(aggregateClass,
             operand(RelNode.class, any())));
   }
 
   //~ Methods ----------------------------------------------------------------
 
   public void onMatch(RelOptRuleCall call) {
-    final LogicalAggregate aggregate = call.rel(0);
+    final Aggregate aggregate = call.rel(0);
     final RelNode input = call.rel(1);
     if (!aggregate.getAggCallList().isEmpty() || aggregate.indicator) {
       return;


[2/3] calcite git commit: Fix javadoc errors

Posted by jh...@apache.org.
Fix javadoc errors


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

Branch: refs/heads/branch-1.7
Commit: 500e2dc9f916e558a0dfaadde449436c4ed10425
Parents: 68a17fc
Author: Julian Hyde <jh...@apache.org>
Authored: Thu Mar 17 15:03:14 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Thu Mar 17 15:24:04 2016 -0700

----------------------------------------------------------------------
 .../org/apache/calcite/examples/RelBuilderExample.java    |  2 +-
 .../test/java/org/apache/calcite/test/RexProgramTest.java |  4 ++--
 .../concurrent/ConcurrentTestTimedCommandGenerator.java   |  2 +-
 site/_docs/howto.md                                       | 10 ++++++----
 4 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/500e2dc9/core/src/test/java/org/apache/calcite/examples/RelBuilderExample.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/examples/RelBuilderExample.java b/core/src/test/java/org/apache/calcite/examples/RelBuilderExample.java
index 12801e8..fcf6a52 100644
--- a/core/src/test/java/org/apache/calcite/examples/RelBuilderExample.java
+++ b/core/src/test/java/org/apache/calcite/examples/RelBuilderExample.java
@@ -118,7 +118,7 @@ public class RelBuilderExample {
    * SELECT deptno, count(*) AS c, sum(sal) AS s
    * FROM emp
    * GROUP BY deptno
-   * HAVING count(*) > 10</pre>
+   * HAVING count(*) &gt; 10</pre>
    */
   private RelBuilder example3(RelBuilder builder) {
     return builder

http://git-wip-us.apache.org/repos/asf/calcite/blob/500e2dc9/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/RexProgramTest.java b/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
index ed56f90..9907959 100644
--- a/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
@@ -284,10 +284,10 @@ public class RexProgramTest {
    * <li><code>select (x + y) + (x + 1) as a, (x + (x + 1)) as b
    * from t(x, y)</code>
    * <li><code>select (x + y) + (x + 1) as a, (x + x) as b from t(x, y)
-   * where ((x + y) > 1) and ((x + y) > 1)</code>
+   * where ((x + y) &gt; 1) and ((x + y) &gt; 1)</code>
    * <li><code>select (x + y) + (x + 1) as a, (x + x) as b from t(x, y)
    * where not case
-   *           when x + 1 > 5 then true
+   *           when x + 1 &gt; 5 then true
    *           when y is null then null
    *           else false
    *           end</code>

http://git-wip-us.apache.org/repos/asf/calcite/blob/500e2dc9/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestTimedCommandGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestTimedCommandGenerator.java b/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestTimedCommandGenerator.java
index 15e177c..f2ee5a7 100644
--- a/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestTimedCommandGenerator.java
+++ b/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestTimedCommandGenerator.java
@@ -103,7 +103,7 @@ public class ConcurrentTestTimedCommandGenerator
 
   /**
    * TimedIterator is an Iterator that repeats a given collection's elements
-   * until <code>System.currentTimeMillis() >= endTimeMillis</code>.
+   * until <code>System.currentTimeMillis() &ge; endTimeMillis</code>.
    */
   private class TimedIterator<E> implements Iterator<E> {
     private final List<E> commands;

http://git-wip-us.apache.org/repos/asf/calcite/blob/500e2dc9/site/_docs/howto.md
----------------------------------------------------------------------
diff --git a/site/_docs/howto.md b/site/_docs/howto.md
index 5954c33..f1fef65 100644
--- a/site/_docs/howto.md
+++ b/site/_docs/howto.md
@@ -429,10 +429,12 @@ Before you start:
 * Check that `README` and `site/_docs/howto.md` have the correct version number.
 * Set `version.major` and `version.minor` in `pom.xml`.
 * Make sure build and tests succeed, including with `-P it,it-oracle`.
-  Supported configurations are:
-  * JDK 1.7, 1.8;
-  * Linux, Mac OS X, and Windows;
-  * Guava versions 12.0.1, 18.0 (the default) and 19.0 (specify `-Dguava.version=x.y`)
+* Make sure that `mvn javadoc:javadoc javadoc:test-javadoc` succeeds
+  (i.e. gives no errors; warnings are OK)
+* Decide the supported configurations of JDK, operating system and
+  Guava.  These will probably be the same as those described in the
+  release notes of the previous release.  Document them in the release
+  notes.  To test Guava version x.y, specify `-Dguava.version=x.y`
 * Optional extra tests:
   * `-Dcalcite.test.db=mysql`
   * `-Dcalcite.test.db=hsqldb`


[3/3] calcite git commit: Release notes

Posted by jh...@apache.org.
Release notes


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

Branch: refs/heads/branch-1.7
Commit: 02366e8ae8acd5c098bf0fa85163b1b0a3708291
Parents: 500e2dc
Author: Julian Hyde <jh...@apache.org>
Authored: Wed Mar 16 14:53:42 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Thu Mar 17 15:28:47 2016 -0700

----------------------------------------------------------------------
 site/_docs/history.md | 72 ++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 63 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/02366e8a/site/_docs/history.md
----------------------------------------------------------------------
diff --git a/site/_docs/history.md b/site/_docs/history.md
index 073440f..544d465 100644
--- a/site/_docs/history.md
+++ b/site/_docs/history.md
@@ -28,10 +28,35 @@ For a full list of releases, see
 Downloads are available on the
 [downloads page]({{ site.baseurl }}/downloads/).
 
-## 1.7.0 / (Under Development)
+## <a href="https://github.com/apache/calcite/releases/tag/calcite-1.7.0">1.7.0</a> / 2016-03-22
 {: #v1-7-0}
 
-One notable change is that the use of JUL (java.util.logging) has been replaced
+This is the first Apache Calcite release since
+[Avatica became an independent project)({{ site.baseurl }}/avatica/news/2016/03/03/separate-project/).
+Calcite now depends on [Avatica]{{ site.baseurl }}/avatica/) in the
+same way as it does other libraries, via a Maven dependency. To see
+Avatica-related changes, see the
+[release notes for Avatica 1.7.1]({{ site.baseurl }}/avatica/docs/history.html#v1-7-1).
+
+We have [added](https://issues.apache.org/jira/browse/CALCITE-1080)
+an [adapter]({{ site.baseurl }}/docs/adapter.html) for
+[Apache Cassandra](http://cassandra.apache.org/).
+You can map a Cassandra keyspace into Calcite as a schema, Cassandra
+data sets as tables, and execute SQL queries on them, which Calcite
+converts into [CQL](https://cassandra.apache.org/doc/cql/CQL.html).
+Cassandra can define and maintain materialized views but the adapter
+goes further: it can transparently rewrite a query to use a
+materialized view even if view is not mentioned in the query.
+
+We have started work on an
+[Oracle-compatibility mode](https://issues.apache.org/jira/browse/CALCITE-1066).
+If you add `fun=oracle` to your JDBC connect string, you get all of
+the standard operators and functions plus Oracle-specific functions
+`DECODE`, `NVL`, `LTRIM`, `RTRIM`, `GREATEST` and `LEAST`. We look
+forward to adding more functions, and compatibility modes for other
+databases, in future releases.
+
+We've replaced our use of JUL (`java.util.logging`)
 with [SLF4J](http://slf4j.org/). SLF4J provides an API which Calcite can use
 independent of the logging implementation. This ultimately provides additional
 flexibility to users, allowing them to configure Calcite's logging within their
@@ -51,6 +76,8 @@ other software versions as specified in `pom.xml`.
 
 New features
 
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1124">CALCITE-1124</a>]
+  Add `TIMESTAMPADD`, `TIMESTAMPDIFF` functions (Arina Ielchiieva)
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-1066">CALCITE-1066</a>]
   Add Oracle function table, and functions `DECODE`, `NVL`, `LTRIM`, `RTRIM`,
   `GREATEST`, `LEAST`
@@ -62,15 +89,20 @@ New features
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-551">CALCITE-551</a>]
   Sub-query inside aggregate function
 
-Avatica features and bug fixes
-
-* [<a href="https://issues.apache.org/jira/browse/CALCITE-642">CALCITE-642</a>]
-  Add an avatica-metrics API
-  * [<a href="https://issues.apache.org/jira/browse/CALCITE-1085">CALCITE-1085</a>]
-    Use a NoopContext singleton in NoopTimer
-
 Planner rules
 
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1158">CALCITE-1158</a>]
+  Make `AggregateRemoveRule` extensible
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1116">CALCITE-1116</a>]
+  Extend `simplify` for reducing expressions
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1104">CALCITE-1104</a>]
+  Materialized views in Cassandra (Michael Mior)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1130">CALCITE-1130</a>]
+  Add support for operators `IS NULL` and `IS NOT NULL` in
+  `RexImplicationChecker` (Amogh Margoor)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1129">CALCITE-1129</a>]
+  Extend `JoinUnionTransposeRule` to match `Union` instead of `LogicalUnion`
+  (Vasia Kalavri)
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-1109">CALCITE-1109</a>]
   Fix up condition when pushing `Filter` through `Aggregate` (Amogh Margoor)
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-1100">CALCITE-1100</a>]
@@ -84,6 +116,26 @@ Planner rules
 
 Bug fixes, API changes and minor enhancements
 
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1147">CALCITE-1147</a>]
+  Allow multiple providers for the same kind of metadata
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1153">CALCITE-1153</a>]
+  Invalid cast created during SQL Join in Oracle (Chris Atkinson)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1146">CALCITE-1146</a>]
+  Wrong path in CSV example model (wanglan)
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1156">CALCITE-1156</a>]
+  Increase Jetty version to 9.2.15.v20160210
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1064">CALCITE-1064</a>]
+  Address problematic `maven-remote-resources-plugin`
+* In `TimeUnit` add `WEEK`, `QUARTER`, `MICROSECOND` values, and change type of
+  `multiplier`
+* Deprecate `SqlLiteral.SqlSymbol`; `SqlSymbol` can now wrap any enum
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1078">CALCITE-1078</a>]
+  Detach avatica from the core calcite Maven project
+  * [<a href="https://issues.apache.org/jira/browse/CALCITE-1077">CALCITE-1077</a>]
+    Switch Calcite to the released Avatica 1.7.1
+  * Update `groupId` when Calcite POMs reference Avatica modules
+  * [<a href="https://issues.apache.org/jira/browse/CALCITE-1137">CALCITE-1137</a>]
+    Exclude Avatica from Calcite source release
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-1111">CALCITE-1111</a>]
   Upgrade Guava, and test on a range of Guava versions
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-1054">CALCITE-1054</a>]
@@ -126,6 +178,8 @@ Bug fixes, API changes and minor enhancements
 
 Web site and documentation
 
+* [<a href="https://issues.apache.org/jira/browse/CALCITE-1112">CALCITE-1112</a>]
+  "Powered by Calcite" page
 * Add SQL-Gremlin to Adapters page
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-1090">CALCITE-1090</a>]
   Revise Streaming SQL specification