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/22 05:45:09 UTC

[1/3] calcite git commit: Document Cassandra adapter (Michael Mior)

Repository: calcite
Updated Branches:
  refs/heads/master cfd2071a4 -> 4b93fa826


Document Cassandra adapter (Michael Mior)

Close apache/calcite#213


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

Branch: refs/heads/master
Commit: 00e755db100c4bccfb2976a03c4f75a2adfc69be
Parents: cfd2071
Author: Michael Mior <mm...@uwaterloo.ca>
Authored: Mon Mar 21 13:43:41 2016 -0400
Committer: Julian Hyde <jh...@apache.org>
Committed: Mon Mar 21 20:19:21 2016 -0700

----------------------------------------------------------------------
 site/_docs/cassandra.md | 99 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/00e755db/site/_docs/cassandra.md
----------------------------------------------------------------------
diff --git a/site/_docs/cassandra.md b/site/_docs/cassandra.md
new file mode 100644
index 0000000..dcff107
--- /dev/null
+++ b/site/_docs/cassandra.md
@@ -0,0 +1,99 @@
+---
+layout: docs
+title: Cassandra adapter
+permalink: /docs/cassandra.html
+---
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+For instructions on downloading and building Calcite, start with the
+[tutorial](/docs/tutorial.html). Once you've managed to compile the
+project, you can return here to start querying Cassandra with Calcite.
+First, we need a [model definition](/docs/model.html). The model gives
+Calcite the necessary parameters to create an instance of the Cassandra
+adapter. Note that while models can contain definitions of
+[materializations](/docs/model.html#materialization), the adapter will
+attempt to automatically populate any materialized views
+[defined in Cassandra](http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views).
+
+A basic example of a model file is given below:
+
+{% highlight json %}
+{
+  version: '1.0',
+  defaultSchema: 'twissandra',
+  schemas: [
+    {
+      name: 'twissandra',
+      type: 'custom',
+      factory: 'org.apache.calcite.adapter.cassandra.CassandraSchemaFactory',
+      operand: {
+        host: 'localhost',
+        keyspace: 'twissandra'
+      }
+    }
+  ]
+}
+{% endhighlight %}
+
+Assuming this file is stored as `model.json`, you can connect to Cassandra via [`sqlline`](https://github.com/julianhyde/sqlline) as follows:
+
+{% highlight bash %}
+$ ./sqlline
+sqlline> !connect jdbc:calcite:model=model.json admin admin
+{% endhighlight %}
+
+`sqlline` will now accept SQL queries which access your CQL tables.
+However, you're not restricted to issuing queries supported by
+[CQL](https://cassandra.apache.org/doc/cql3/CQL-2.2.html).
+Calcite allows you to perform complex operations such as aggregations
+or joins. The adapter will attempt to compile the query into the most
+efficient CQL possible by exploiting filtering and sorting directly in
+Cassandra where possible.
+
+For example, in the example dataset there is a CQL table named `timeline`
+with `username` as the partition key and `time` as the clustering key.
+
+We can issue a simple query to fetch the most recent tweet ID of the
+user by writing standard SQL:
+
+{% highlight sql %}
+sqlline> SELECT "tweet_id" FROM "timeline" WHERE "username"='JmuhsAaMdw' ORDER BY "time" DESC LIMIT 1;
++----------+
+| tweet_id |
++----------+
+| f3d3d4dc-d05b-11e5-b58b-90e2ba530b12 |
++----------+
+{% endhighlight %}
+
+While executing this query, the Cassandra adapter is able to recognize
+that `username` is the partition key and can be filtered by Cassandra.
+It also recognizes the clustering key `time` and pushes the ordering to
+Cassandra as well.
+
+The final CQL query given to Cassandra is below:
+
+{% highlight sql %}
+SELECT username, time, tweet_id FROM "timeline" WHERE username = 'JmuhsAaMdw' ORDER BY time DESC ALLOW FILTERING;
+{% endhighlight %}
+
+There is still significant work to do in improving the flexibility and
+performance of the adapter, but if you're looking for a quick way to
+gain additional insights into data stored in Cassandra, Calcite should
+prove useful.


[2/3] calcite git commit: Add news item for release 1.7.0 and Cassandra adapter

Posted by jh...@apache.org.
Add news item for release 1.7.0 and Cassandra adapter

Also:
* Fix up release notes;
* Make documentation links relative to site base URL;
* Link to Cassandra from Adapters page;
* Trim trailing spaces.


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

Branch: refs/heads/master
Commit: 83266054098220d33be02be38a8a230ca6d6fd38
Parents: 00e755d
Author: Julian Hyde <jh...@apache.org>
Authored: Wed Mar 16 14:53:42 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Mon Mar 21 20:19:36 2016 -0700

----------------------------------------------------------------------
 site/_docs/adapter.md                       |  2 +-
 site/_docs/cassandra.md                     | 39 +++++++++------
 site/_docs/history.md                       | 10 ++--
 site/_docs/howto.md                         |  2 +-
 site/_docs/stream.md                        |  6 +--
 site/_posts/2016-03-22-cassandra-adapter.md | 42 ++++++++++++++++
 site/_posts/2016-03-22-release-1.7.0.md     | 64 ++++++++++++++++++++++++
 7 files changed, 141 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_docs/adapter.md
----------------------------------------------------------------------
diff --git a/site/_docs/adapter.md b/site/_docs/adapter.md
index 13320b9..93ea1c9 100644
--- a/site/_docs/adapter.md
+++ b/site/_docs/adapter.md
@@ -27,7 +27,7 @@ limitations under the License.
 A schema adapter allows Calcite to read particular kind of data,
 presenting the data as tables within a schema.
 
-* Cassandra adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/cassandra/package-summary.html">calcite-cassandra</a>)
+* [Cassandra adapter](cassandra.html) (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/cassandra/package-summary.html">calcite-cassandra</a>)
 * CSV adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/csv/package-summary.html">example/csv</a>)
 * JDBC adapter (part of <a href="{{ site.apiRoot }}/org/apache/calcite/adapter/jdbc/package-summary.html">calcite-core</a>)
 * MongoDB adapter (<a href="{{ site.apiRoot }}/org/apache/calcite/adapter/mongodb/package-summary.html">calcite-mongodb</a>)

http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_docs/cassandra.md
----------------------------------------------------------------------
diff --git a/site/_docs/cassandra.md b/site/_docs/cassandra.md
index dcff107..58a139c 100644
--- a/site/_docs/cassandra.md
+++ b/site/_docs/cassandra.md
@@ -23,13 +23,16 @@ limitations under the License.
 -->
 
 For instructions on downloading and building Calcite, start with the
-[tutorial](/docs/tutorial.html). Once you've managed to compile the
-project, you can return here to start querying Cassandra with Calcite.
-First, we need a [model definition](/docs/model.html). The model gives
-Calcite the necessary parameters to create an instance of the Cassandra
-adapter. Note that while models can contain definitions of
-[materializations](/docs/model.html#materialization), the adapter will
-attempt to automatically populate any materialized views
+[tutorial]({{ site.baseurl }}/docs/tutorial.html).
+
+Once you've managed to compile the project, you can return here to
+start querying Cassandra with Calcite.  First, we need a
+[model definition]({{ site.baseurl }}/docs/model.html).
+The model gives Calcite the necessary parameters to create an instance
+of the Cassandra adapter. Note that while models can contain
+definitions of
+[materializations]({{ site.baseurl }}/docs/model.html#materialization),
+the adapter will attempt to automatically populate any materialized views
 [defined in Cassandra](http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views).
 
 A basic example of a model file is given below:
@@ -52,7 +55,9 @@ A basic example of a model file is given below:
 }
 {% endhighlight %}
 
-Assuming this file is stored as `model.json`, you can connect to Cassandra via [`sqlline`](https://github.com/julianhyde/sqlline) as follows:
+Assuming this file is stored as `model.json`, you can connect to
+Cassandra via [`sqlline`](https://github.com/julianhyde/sqlline) as
+follows:
 
 {% highlight bash %}
 $ ./sqlline
@@ -74,12 +79,15 @@ We can issue a simple query to fetch the most recent tweet ID of the
 user by writing standard SQL:
 
 {% highlight sql %}
-sqlline> SELECT "tweet_id" FROM "timeline" WHERE "username"='JmuhsAaMdw' ORDER BY "time" DESC LIMIT 1;
-+----------+
-| tweet_id |
-+----------+
+sqlline> SELECT "tweet_id"
+         FROM "timeline"
+         WHERE "username" = 'JmuhsAaMdw'
+         ORDER BY "time" DESC LIMIT 1;
++--------------------------------------+
+| tweet_id                             |
++--------------------------------------+
 | f3d3d4dc-d05b-11e5-b58b-90e2ba530b12 |
-+----------+
++--------------------------------------+
 {% endhighlight %}
 
 While executing this query, the Cassandra adapter is able to recognize
@@ -90,7 +98,10 @@ Cassandra as well.
 The final CQL query given to Cassandra is below:
 
 {% highlight sql %}
-SELECT username, time, tweet_id FROM "timeline" WHERE username = 'JmuhsAaMdw' ORDER BY time DESC ALLOW FILTERING;
+SELECT username, time, tweet_id
+FROM "timeline"
+WHERE username = 'JmuhsAaMdw'
+ORDER BY time DESC ALLOW FILTERING;
 {% endhighlight %}
 
 There is still significant work to do in improving the flexibility and

http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_docs/history.md
----------------------------------------------------------------------
diff --git a/site/_docs/history.md b/site/_docs/history.md
index 544d465..fcd20c2 100644
--- a/site/_docs/history.md
+++ b/site/_docs/history.md
@@ -32,8 +32,8 @@ Downloads are available on the
 {: #v1-7-0}
 
 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
+[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).
@@ -42,13 +42,13 @@ 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
+CQL tables 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.
+materialized view even if the view is not mentioned in the query.
 
-We have started work on an
+This release adds 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

http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_docs/howto.md
----------------------------------------------------------------------
diff --git a/site/_docs/howto.md b/site/_docs/howto.md
index 3ff83f7..531fca2 100644
--- a/site/_docs/howto.md
+++ b/site/_docs/howto.md
@@ -209,7 +209,7 @@ log4j.logger.org.apache.calcite.plan.hep.HepPlanner=TRACE
 
 ## CSV adapter
 
-See the [tutorial](/docs/tutorial.html).
+See the [tutorial]({{ site.baseurl }}/docs/tutorial.html).
 
 ## MongoDB adapter
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_docs/stream.md
----------------------------------------------------------------------
diff --git a/site/_docs/stream.md b/site/_docs/stream.md
index f66fbce..63bdfcb 100644
--- a/site/_docs/stream.md
+++ b/site/_docs/stream.md
@@ -867,9 +867,9 @@ SELECT STREAM * FROM Orders WHERE units > 1000;
 
 These look similar, and in both cases the next step(s) in the pipeline
 can read from `LargeOrders` without worrying how it was populated.
-There is a difference in efficiency: the `INSERT` statement does the 
+There is a difference in efficiency: the `INSERT` statement does the
 same work no matter how many consumers there are; the view does work
-proportional to the number of consumers, and in particular, does no 
+proportional to the number of consumers, and in particular, does no
 work if there are no consumers.
 
 Other forms of DML make sense for streams. For example, the following
@@ -971,7 +971,7 @@ negative cases) and the TCK tests it.
 * Fix the `UPSERT` example to remove records for products that have not
   occurred in the last hour.
 * DML that outputs to multiple streams; perhaps an extension to the standard
-  `REPLACE` statement. 
+  `REPLACE` statement.
 
 # Functions
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_posts/2016-03-22-cassandra-adapter.md
----------------------------------------------------------------------
diff --git a/site/_posts/2016-03-22-cassandra-adapter.md b/site/_posts/2016-03-22-cassandra-adapter.md
new file mode 100644
index 0000000..f33c976
--- /dev/null
+++ b/site/_posts/2016-03-22-cassandra-adapter.md
@@ -0,0 +1,42 @@
+---
+layout: news_item
+date: "2016-03-22 13:00:00 +0000"
+author: jhyde
+categories: ["new features"]
+---
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+A new Apache Calcite adapter allows you to access
+[Apache Cassandra](http://cassandra.apache.org/) via industry-standard SQL.
+
+You can map a Cassandra keyspace into Calcite as a schema, Cassandra
+CQL tables 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 the view is not mentioned in the query.
+
+Read more about the adapter [here]({{ site.baseurl }}/docs/cassandra.html).
+
+The Cassandra adapter is available as part of
+[Apache Calcite version 1.7.0]({{ site.baseurl }}/docs/history.html#v1-7-0),
+which has just been released. Calcite also has
+[adapters]({{ site.baseurl }}/docs/adapter.html)
+for CSV and JSON files, and JDBC data source, MongoDB, Spark and Splunk.

http://git-wip-us.apache.org/repos/asf/calcite/blob/83266054/site/_posts/2016-03-22-release-1.7.0.md
----------------------------------------------------------------------
diff --git a/site/_posts/2016-03-22-release-1.7.0.md b/site/_posts/2016-03-22-release-1.7.0.md
new file mode 100644
index 0000000..81fa624
--- /dev/null
+++ b/site/_posts/2016-03-22-release-1.7.0.md
@@ -0,0 +1,64 @@
+---
+layout: news_item
+date: "2016-03-22 12:00:00 +0000"
+author: jhyde
+version: 1.7.0
+categories: [release]
+tag: v1-7-0
+sha: 8eebfc6
+---
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+Apache Calcite 1.7.0 is the first 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/cassandra.html) for
+[Apache Cassandra](http://cassandra.apache.org/).
+You can map a Cassandra keyspace into Calcite as a schema, Cassandra
+CQL tables 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 the view is not mentioned in the query.
+
+This release adds 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
+own chosen logging framework. This work was done in
+[[CALCITE-669](https://issues.apache.org/jira/browse/CALCITE-669)].
+
+For users experienced with configuring JUL in Calcite previously, there are some
+differences as some the JUL logging levels do not exist in SLF4J: `FINE`,
+`FINER`, and `FINEST`, specifically. To deal with this, `FINE` was mapped
+to SLF4J's `DEBUG` level, while `FINER` and `FINEST` were mapped to SLF4J's `TRACE`.


[3/3] calcite git commit: [CALCITE-746] Allow apache-rat to be run outside of release process

Posted by jh...@apache.org.
[CALCITE-746] Allow apache-rat to be run outside of release process

Moved apache-rat-plugin's configuration outside of the apache-release
profile, so you can run rat any time. Type:

  mvn apache-rat:check

Rat will still be invoked automatically during the verify phase of a
release, i.e. when apache-release profile is enabled.

Removed site/.sass-cache from the rat exclusions, so you will be
reminded if .sass-cache is being included in the release by mistake.
The solution is to remove that directory manually before making the release.


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

Branch: refs/heads/master
Commit: 4b93fa82633da350309d214af52e4606fa18e5ab
Parents: 8326605
Author: Julian Hyde <jh...@apache.org>
Authored: Fri Mar 18 14:12:06 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Mon Mar 21 21:11:08 2016 -0700

----------------------------------------------------------------------
 avatica/pom.xml     | 85 ++++++++++++++++++++++--------------------
 pom.xml             | 96 +++++++++++++++++++++++++-----------------------
 site/_docs/howto.md |  2 +
 3 files changed, 98 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/4b93fa82/avatica/pom.xml
----------------------------------------------------------------------
diff --git a/avatica/pom.xml b/avatica/pom.xml
index c5ab7e1..cbcfea7 100644
--- a/avatica/pom.xml
+++ b/avatica/pom.xml
@@ -264,6 +264,52 @@ limitations under the License.
   <build>
     <plugins>
       <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <!-- The following files have file formats that do not
+                 admit comments, and therefore cannot contain
+                 license notices. -->
+            <exclude>src/main/resources/META-INF/services/java.sql.Driver</exclude>
+            <exclude>src/main/resources/META-INF/services/org.apache.calcite.avatica.metrics.MetricsSystemFactory</exclude>
+
+            <!-- Do not exclude site/target; it should not exist
+                 in any sandbox from which you are making a
+                 release. Also, do not exclude site/.sass-cache. -->
+
+            <!-- Files generated by Jekyll. -->
+            <exclude>site/_includes/anchor_links.html</exclude>
+            <exclude>site/_includes/docs_contents.html</exclude>
+            <exclude>site/_includes/docs_contents_mobile.html</exclude>
+            <exclude>site/_includes/docs_option.html</exclude>
+            <exclude>site/_includes/docs_ul.html</exclude>
+            <exclude>site/_includes/footer.html</exclude>
+            <exclude>site/_includes/header.html</exclude>
+            <exclude>site/_includes/news_contents.html</exclude>
+            <exclude>site/_includes/news_contents_mobile.html</exclude>
+            <exclude>site/_includes/news_item.html</exclude>
+            <exclude>site/_includes/primary-nav-items.html</exclude>
+            <exclude>site/_includes/section_nav.html</exclude>
+            <exclude>site/_includes/top.html</exclude>
+            <exclude>site/_layouts/default.html</exclude>
+            <exclude>site/_layouts/docs.html</exclude>
+            <exclude>site/_layouts/external.html</exclude>
+            <exclude>site/_layouts/news.html</exclude>
+            <exclude>site/_layouts/news_item.html</exclude>
+            <exclude>site/_layouts/page.html</exclude>
+            <exclude>site/_sass/**</exclude>
+            <exclude>site/css/screen.scss</exclude>
+            <exclude>site/fonts/**</exclude>
+            <exclude>site/js/**</exclude>
+
+            <!-- Images -->
+            <exclude>site/img/*.png</exclude>
+            <exclude>site/favicon.ico</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-source-plugin</artifactId>
         <executions>
@@ -573,45 +619,6 @@ limitations under the License.
           <plugin>
             <groupId>org.apache.rat</groupId>
             <artifactId>apache-rat-plugin</artifactId>
-            <configuration>
-              <excludes>
-                <!-- The following files have file formats that do not
-                     admit comments, and therefore cannot contain
-                     license notices. -->
-                <exclude>src/main/resources/META-INF/services/java.sql.Driver</exclude>
-                <exclude>src/main/resources/META-INF/services/org.apache.calcite.avatica.metrics.MetricsSystemFactory</exclude>
-
-                <!-- Files generated by Jekyll. -->
-                <exclude>site/.sass-cache/**</exclude>
-                <exclude>site/_includes/anchor_links.html</exclude>
-                <exclude>site/_includes/docs_contents.html</exclude>
-                <exclude>site/_includes/docs_contents_mobile.html</exclude>
-                <exclude>site/_includes/docs_option.html</exclude>
-                <exclude>site/_includes/docs_ul.html</exclude>
-                <exclude>site/_includes/footer.html</exclude>
-                <exclude>site/_includes/header.html</exclude>
-                <exclude>site/_includes/news_contents.html</exclude>
-                <exclude>site/_includes/news_contents_mobile.html</exclude>
-                <exclude>site/_includes/news_item.html</exclude>
-                <exclude>site/_includes/primary-nav-items.html</exclude>
-                <exclude>site/_includes/section_nav.html</exclude>
-                <exclude>site/_includes/top.html</exclude>
-                <exclude>site/_layouts/default.html</exclude>
-                <exclude>site/_layouts/docs.html</exclude>
-                <exclude>site/_layouts/external.html</exclude>
-                <exclude>site/_layouts/news.html</exclude>
-                <exclude>site/_layouts/news_item.html</exclude>
-                <exclude>site/_layouts/page.html</exclude>
-                <exclude>site/_sass/**</exclude>
-                <exclude>site/css/screen.scss</exclude>
-                <exclude>site/fonts/**</exclude>
-                <exclude>site/js/**</exclude>
-
-                <!-- Images -->
-                <exclude>site/img/*.png</exclude>
-                <exclude>site/favicon.ico</exclude>
-              </excludes>
-            </configuration>
             <executions>
               <execution>
                 <phase>verify</phase>

http://git-wip-us.apache.org/repos/asf/calcite/blob/4b93fa82/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8b85be9..c854151 100644
--- a/pom.xml
+++ b/pom.xml
@@ -408,6 +408,56 @@ limitations under the License.
   <build>
     <plugins>
       <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <!-- The following files have file formats that do not
+                 admit comments, and therefore cannot contain
+                 license notices. -->
+            <exclude>src/main/resources/META-INF/services/java.sql.Driver</exclude>
+            <exclude>**/src/test/resources/**/*.csv</exclude>
+            <exclude>**/src/test/resources/bug/archers.json</exclude>
+
+            <!-- Exclude all of avatica, RAT is run in Avatica -->
+            <exclude>avatica/**</exclude>
+
+            <!-- Do not exclude site/target; it should not exist
+                 in any sandbox from which you are making a
+                 release. Also, do not exclude site/.sass-cache. -->
+
+            <!-- Files generated by Jekyll. -->
+            <exclude>site/_includes/anchor_links.html</exclude>
+            <exclude>site/_includes/docs_contents.html</exclude>
+            <exclude>site/_includes/docs_contents_mobile.html</exclude>
+            <exclude>site/_includes/docs_option.html</exclude>
+            <exclude>site/_includes/docs_ul.html</exclude>
+            <exclude>site/_includes/footer.html</exclude>
+            <exclude>site/_includes/header.html</exclude>
+            <exclude>site/_includes/news_contents.html</exclude>
+            <exclude>site/_includes/news_contents_mobile.html</exclude>
+            <exclude>site/_includes/news_item.html</exclude>
+            <exclude>site/_includes/primary-nav-items.html</exclude>
+            <exclude>site/_includes/section_nav.html</exclude>
+            <exclude>site/_includes/top.html</exclude>
+            <exclude>site/_layouts/default.html</exclude>
+            <exclude>site/_layouts/docs.html</exclude>
+            <exclude>site/_layouts/external.html</exclude>
+            <exclude>site/_layouts/news.html</exclude>
+            <exclude>site/_layouts/news_item.html</exclude>
+            <exclude>site/_layouts/page.html</exclude>
+            <exclude>site/_sass/**</exclude>
+            <exclude>site/css/screen.scss</exclude>
+            <exclude>site/fonts/**</exclude>
+            <exclude>site/js/**</exclude>
+
+            <!-- Images -->
+            <exclude>site/img/*.png</exclude>
+            <exclude>site/favicon.ico</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-source-plugin</artifactId>
         <executions>
@@ -730,52 +780,6 @@ limitations under the License.
           <plugin>
             <groupId>org.apache.rat</groupId>
             <artifactId>apache-rat-plugin</artifactId>
-            <configuration>
-              <excludes>
-                <!-- The following files have file formats that do not
-                     admit comments, and therefore cannot contain
-                     license notices. -->
-                <exclude>src/main/resources/META-INF/services/java.sql.Driver</exclude>
-                <exclude>**/src/test/resources/**/*.csv</exclude>
-                <exclude>**/src/test/resources/bug/archers.json</exclude>
-                <!-- Exclude all of avatica, RAT is run in Avatica -->
-                <exclude>avatica/**</exclude>
-
-                <!-- Files generated by Jekyll. -->
-                <exclude>site/.sass-cache/**</exclude>
-                <exclude>site/_includes/anchor_links.html</exclude>
-                <exclude>site/_includes/docs_contents.html</exclude>
-                <exclude>site/_includes/docs_contents_mobile.html</exclude>
-                <exclude>site/_includes/docs_option.html</exclude>
-                <exclude>site/_includes/docs_ul.html</exclude>
-                <exclude>site/_includes/footer.html</exclude>
-                <exclude>site/_includes/header.html</exclude>
-                <exclude>site/_includes/news_contents.html</exclude>
-                <exclude>site/_includes/news_contents_mobile.html</exclude>
-                <exclude>site/_includes/news_item.html</exclude>
-                <exclude>site/_includes/primary-nav-items.html</exclude>
-                <exclude>site/_includes/section_nav.html</exclude>
-                <exclude>site/_includes/top.html</exclude>
-                <exclude>site/_layouts/default.html</exclude>
-                <exclude>site/_layouts/docs.html</exclude>
-                <exclude>site/_layouts/external.html</exclude>
-                <exclude>site/_layouts/news.html</exclude>
-                <exclude>site/_layouts/news_item.html</exclude>
-                <exclude>site/_layouts/page.html</exclude>
-                <exclude>site/_sass/**</exclude>
-                <exclude>site/css/screen.scss</exclude>
-                <exclude>site/fonts/**</exclude>
-                <exclude>site/js/**</exclude>
-
-                <!-- Images -->
-                <exclude>site/img/*.png</exclude>
-                <exclude>site/favicon.ico</exclude>
-
-                <!-- Do not exclude site/target; it should not exist
-                     in any sandbox from which you are making a
-                     release. -->
-              </excludes>
-            </configuration>
             <executions>
               <execution>
                 <phase>verify</phase>

http://git-wip-us.apache.org/repos/asf/calcite/blob/4b93fa82/site/_docs/howto.md
----------------------------------------------------------------------
diff --git a/site/_docs/howto.md b/site/_docs/howto.md
index 531fca2..ddaba57 100644
--- a/site/_docs/howto.md
+++ b/site/_docs/howto.md
@@ -431,6 +431,8 @@ Before you start:
 * Make sure build and tests succeed, including with `-P it,it-oracle`.
 * Make sure that `mvn javadoc:javadoc javadoc:test-javadoc` succeeds
   (i.e. gives no errors; warnings are OK)
+* Make sure that `mvn apache-rat:check` succeeds. (It will be run as part of
+  the release, but it's better to trouble-shoot early.)
 * 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