Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ADEBB200C2A for ; Wed, 1 Mar 2017 20:32:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AC582160B70; Wed, 1 Mar 2017 19:32:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7499A160B56 for ; Wed, 1 Mar 2017 20:32:38 +0100 (CET) Received: (qmail 47374 invoked by uid 500); 1 Mar 2017 19:32:37 -0000 Mailing-List: contact commits-help@calcite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@calcite.apache.org Delivered-To: mailing list commits@calcite.apache.org Received: (qmail 47365 invoked by uid 99); 1 Mar 2017 19:32:37 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2017 19:32:37 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id ACB203A0112 for ; Wed, 1 Mar 2017 19:32:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1785020 - /calcite/site/docs/ Date: Wed, 01 Mar 2017 19:32:36 -0000 To: commits@calcite.apache.org From: jhyde@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170301193236.ACB203A0112@svn01-us-west.apache.org> archived-at: Wed, 01 Mar 2017 19:32:40 -0000 Author: jhyde Date: Wed Mar 1 19:32:35 2017 New Revision: 1785020 URL: http://svn.apache.org/viewvc?rev=1785020&view=rev Log: Site changes for [CALCITE-1598], [CALCITE-1661], [CALCITE-1615], [CALCITE-884], [CALCITE-1652] Added: calcite/site/docs/file_adapter.html calcite/site/docs/pig_adapter.html Modified: calcite/site/docs/adapter.html calcite/site/docs/algebra.html calcite/site/docs/avatica_json_reference.html calcite/site/docs/avatica_overview.html calcite/site/docs/avatica_protobuf_reference.html calcite/site/docs/avatica_roadmap.html calcite/site/docs/cassandra_adapter.html calcite/site/docs/druid_adapter.html calcite/site/docs/elasticsearch_adapter.html calcite/site/docs/history.html calcite/site/docs/howto.html calcite/site/docs/index.html calcite/site/docs/lattice.html calcite/site/docs/model.html calcite/site/docs/powered_by.html calcite/site/docs/reference.html calcite/site/docs/stream.html calcite/site/docs/tutorial.html Modified: calcite/site/docs/adapter.html URL: http://svn.apache.org/viewvc/calcite/site/docs/adapter.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/adapter.html (original) +++ calcite/site/docs/adapter.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,6 +878,10 @@ + + + + @@ -862,6 +926,10 @@ + + + + @@ -887,14 +955,22 @@ presenting the data as tables within a s
  • CSV adapter (example/csv)
  • Druid adapter (calcite-druid)
  • Elasticsearch adapter (calcite-elasticsearch)
  • +
  • File adapter (calcite-file)
  • JDBC adapter (part of calcite-core)
  • MongoDB adapter (calcite-mongodb)
  • +
  • Pig adapter (calcite-pig)
  • Solr cloud adapter (solr-sql)
  • Spark adapter (calcite-spark)
  • Splunk adapter (calcite-splunk)
  • Eclipse Memory Analyzer (MAT) adapter (mat-calcite-plugin)
  • +

    Other language interfaces

    + + +

    Engines

    Many projects and products use Apache Calcite for SQL parsing, @@ -935,6 +1011,10 @@ as implemented by Avatica’s + approximateDecimal + Whether approximate results from aggregate functions on DECIMAL types are acceptable + + approximateDistinctCount Whether approximate results from COUNT(DISTINCT ...) aggregate functions are acceptable Modified: calcite/site/docs/algebra.html URL: http://svn.apache.org/viewvc/calcite/site/docs/algebra.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/algebra.html (original) +++ calcite/site/docs/algebra.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/avatica_json_reference.html URL: http://svn.apache.org/viewvc/calcite/site/docs/avatica_json_reference.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/avatica_json_reference.html (original) +++ calcite/site/docs/avatica_json_reference.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/avatica_overview.html URL: http://svn.apache.org/viewvc/calcite/site/docs/avatica_overview.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/avatica_overview.html (original) +++ calcite/site/docs/avatica_overview.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/avatica_protobuf_reference.html URL: http://svn.apache.org/viewvc/calcite/site/docs/avatica_protobuf_reference.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/avatica_protobuf_reference.html (original) +++ calcite/site/docs/avatica_protobuf_reference.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/avatica_roadmap.html URL: http://svn.apache.org/viewvc/calcite/site/docs/avatica_roadmap.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/avatica_roadmap.html (original) +++ calcite/site/docs/avatica_roadmap.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/cassandra_adapter.html URL: http://svn.apache.org/viewvc/calcite/site/docs/cassandra_adapter.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/cassandra_adapter.html (original) +++ calcite/site/docs/cassandra_adapter.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/druid_adapter.html URL: http://svn.apache.org/viewvc/calcite/site/docs/druid_adapter.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/druid_adapter.html (original) +++ calcite/site/docs/druid_adapter.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/elasticsearch_adapter.html URL: http://svn.apache.org/viewvc/calcite/site/docs/elasticsearch_adapter.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/elasticsearch_adapter.html (original) +++ calcite/site/docs/elasticsearch_adapter.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Added: calcite/site/docs/file_adapter.html URL: http://svn.apache.org/viewvc/calcite/site/docs/file_adapter.html?rev=1785020&view=auto ============================================================================== --- calcite/site/docs/file_adapter.html (added) +++ calcite/site/docs/file_adapter.html Wed Mar 1 19:32:35 2017 @@ -0,0 +1,1483 @@ + + + + + File adapter + + + + + + + + + + +

    + +
    + + +
    +
    + + +
    +
    + +
    + +
    + + +
    +
    +

    File adapter

    + + +

    Overview

    + +

    The file adapter is able to read files in a variety of formats, +and can also read files over various protocols, such as HTTP.

    + +

    For example if you define:

    + +
      +
    • States - http://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States
    • +
    • Cities - http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population
    • +
    + +

    You can then write a query like:

    + +
    select
    +	count(*) "City Count",
    +	sum(100 * c."Population" / s."Population") "Pct State Population"
    +from "Cities" c, "States" s
    +where c."State" = s."State" and s."State" = 'California';
    + +

    And learn that California has 69 cities of 100k or more +comprising almost 1/2 of the state’s population:

    + +

    ++---------------------+----------------------+ +| City Count | Pct State Population | ++---------------------+----------------------+ +| 69 | 48.574217177106576 | ++---------------------+----------------------+ +

    + +

    A simple example

    + +

    Let’s start with a simple example. First, we need a +model definition, +as follows.

    + +
    {
    +  "version": "1.0",
    +  "defaultSchema": "SALES",
    +  "schemas": [ {
    +    "name": "SALES",
    +    "type": "custom",
    +    "factory": "org.apache.calcite.adapter.file.FileSchemaFactory",
    +    "operand": {
    +      "tables": {
    +        "name": "EMPS",
    +        "url": "file:file/src/test/resources/sales/EMPS.html"
    +      }, {
    +        "name": "DEPTS"
    +        "url": "file:file/src/test/resources/sales/DEPTS.html"
    +      }
    +    }
    +  ]
    +}
    + +

    Schemas are defined as a list of tables, each containing minimally a +table name and a url. If a page has more than one table, you can +include in a table definition selector and index fields to specify the +desired table. If there is no table specification, the file adapter +chooses the largest table on the page.

    + +

    EMPS.html contains a single HTML table:

    + +
    <html>
    +  <body>
    +    <table>
    +      <thead>
    +        <tr>
    +          <th>EMPNO</th>
    +          <th>NAME</th>
    +          <th>DEPTNO</th>
    +        </tr>
    +      </thead>
    +      <tbody>
    +        <tr>
    +          <td>100</td>
    +          <td>Fred</td>
    +          <td>30</td>
    +        </tr>
    +        <tr>
    +          <td>110</td>
    +          <td>Eric</td>
    +          <td>20</td>
    +        </tr>
    +        <tr>
    +          <td>110</td>
    +          <td>John</td>
    +          <td>40</td>
    +        </tr>
    +        <tr>
    +          <td>120</td>
    +          <td>Wilma</td>
    +          <td>20</td>
    +        </tr>
    +        <tr>
    +          <td>130</td>
    +          <td>Alice</td>
    +          <td>40</td>
    +        </tr>
    +      </tbody>
    +    </table>
    +  </body>
    +</html>
    + +

    The model file is stored as file/src/test/resources/sales.json, +so you can connect via sqlline +as follows:

    + +
    $ ./sqlline
    +sqlline> !connect jdbc:calcite:model=file/src/test/resources/sales.json admin admin
    +sqlline> select * from sales.emps;
    ++-------+--------+------+
    +| EMPNO | DEPTNO | NAME |
    ++-------+--------+------+
    +| 100   | 30     | Fred |
    +| 110   | 20     | Eric |
    +| 110   | 40     | John |
    +| 120   | 20     | Wilma |
    +| 130   | 40     | Alice |
    ++-------+--------+------+
    +5 rows selected 
    + +

    Mapping tables

    + +

    Now for a more complex example. This time we connect to Wikipedia via +HTTP, read pages for US states and cities, and extract data from HTML +tables on those pages. The tables have more complex formats, and the +file adapter helps us locate and parse data in those tables.

    + +

    Tables can be simply defined for immediate gratification:

    + +
    {
    +	tableName: "RawCities",
    +	url: "http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population"
    +}
    + +

    And subsequently refined for better usability / querying:

    + +
    {
    +	tableName: "Cities",
    +	url: "http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population",
    +	path: "#mw-content-text > table.wikitable.sortable",
    +	index: 0,
    +	fieldDefs: [
    +	  {th: "2012 rank", name: "Rank", type: "int", pattern: "(\\d+)", matchGroup: 0},
    +	  {th: "City", selector: "a", selectedElement: 0},
    +	  {th: "State[5]", name: "State", selector: "a:eq(0)"},
    +	  {th: "2012 estimate", name: "Population", type: "double"},
    +	  {th: "2010 Census", skip: "true"},
    +	  {th: "Change", skip: "true"},
    +	  {th: "2012 land area", name: "Land Area (sq mi)", type: "double", selector: ":not(span)"},
    +	  {th: "2012 population density", skip: "true"},
    +	  {th: "ANSI", skip: "true"}
    +	]
    +}
    + +

    Connect and execute queries, as follows.

    + +
    $ ./sqlline
    +sqlline> !connect jdbc:calcite:model=file/src/test/resources/wiki.json admin admin
    +sqlline> select * from wiki."RawCities";
    +sqlline> select * from wiki."Cities";
    + +

    Note that Cities is easier to consume than RawCities, +because its table definition has a field list.

    + +

    The file adapter uses Jsoup for HTML DOM +navigation; selectors for both tables and fields follow the +Jsoup selector specification.

    + +

    Field definitions may be used to rename or skip source fields, to +select and condition the cell contents and to set a data type.

    + +

    Parsing cell contents

    + +

    The file adapter can select DOM nodes within a cell, replace text +within the selected element, match within the selected text, and +choose a data type for the resulting database column. Processing +steps are applied in the order described and replace and match +patterns are based on +Java regular expressions.

    + +

    Further examples

    + +

    There are more examples in the form of a script:

    + +
    $ ./sqlline -f file/src/test/resources/webjoin.sql
    + +

    (When running webjoin.sql you will see a number of warning messages for +each query containing a join. These are expected and do not affect +query results. These messages will be suppressed in the next release.)

    + +

    Future improvements

    + +

    We are continuing to enhance the adapter, and would welcome +contributions of new parsing capabilities (for example parsing JSON +files) and being able to form URLs dynamically to push down filters.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + + +
    + +
    +
    + + + + + + + + + Modified: calcite/site/docs/history.html URL: http://svn.apache.org/viewvc/calcite/site/docs/history.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/history.html (original) +++ calcite/site/docs/history.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,6 +878,10 @@ + + + + @@ -862,6 +926,10 @@ + + + + @@ -891,6 +959,26 @@ Guava versions 14.0 to 21.0; Druid version 0.9.1.1; other software versions as specified in pom.xml.

    +

    New features

    + +
      +
    • [CALCITE-884] +File adapter (Henry Olson) +
        +
      • Allow multiple Calcite columns to be derived from one HTML column, +e.g. Location → Lat, Lon
      • +
      • Improved pattern match: added matchSeq to allow selection of +nth match
      • +
      • Add replace patterns to cell parsing logic
      • +
      • Add handling for tables without &lt;TH&gt; elements
      • +
      • Unit tests using local files; URL tests are contingent on network +access
      • +
      • Ability to parse HTML from local files
      • +
      • Derived from CSV adapter
      • +
      +
    • +
    +

    1.11.0 / 2017-01-09

    Nearly three months after the previous release, there is a long list @@ -942,7 +1030,7 @@ Guava versions 14.0 to 19.0; Druid version 0.9.1.1; other software versions as specified in pom.xml.

    -

    New features

    +

    New features

    • [CALCITE-1551] @@ -1207,7 +1295,7 @@ using Oracle JDK 1.7, 1.8; Guava versions 14.0 to 19.0; other software versions as specified in pom.xml.

      -

      New features

      +

      New features

      • [CALCITE-1208] @@ -1364,7 +1452,7 @@ using Oracle JDK 1.7, 1.8; Guava versions 14.0 to 19.0; other software versions as specified in pom.xml.

        -

        New features

        +

        New features

        • [CALCITE-1177] @@ -1561,7 +1649,7 @@ using Oracle JDK 1.7, 1.8; Guava versions 12.0.1 to 19.0; other software versions as specified in pom.xml.

          -

          New features

          +

          New features

          • [CALCITE-1124] @@ -1728,7 +1816,7 @@ on Linux, Mac OS X, Microsoft Windows; using Oracle JDK 1.7, 1.8; other software versions as specified in pom.xml.

            -

            New features

            +

            New features

            • [CALCITE-816] @@ -1971,7 +2059,7 @@ multi-sets. You can follow this example language, and immediately taking advantage of Calcite’s back-ends and optimizer rules. It’s all just algebra, after all!

              -

              New features

              +

              New features

              • [CALCITE-911] @@ -2222,7 +2310,7 @@ this release includes improvements to la and adds a builder API so that you can easily create relational algebra expressions.

                -

                New features

                +

                New features

                • [CALCITE-748] @@ -2409,7 +2497,7 @@ and filtered aggregate functions and various improvements to Avatica.

                  -

                  New features

                  +

                  New features

                  • [CALCITE-505] @@ -2538,7 +2626,7 @@ distribution among relational expression and [CALCITE-307] improve implicit and explicit conversions in SQL.

                    -

                    New features

                    +

                    New features

                    • [CALCITE-366] @@ -2681,7 +2769,7 @@ later.

                      RelNode. We strongly suggest that you use these rather than calling constructors directly.

                      -

                      New features

                      +

                      New features

                      • SQL @@ -2807,7 +2895,7 @@ improvements to the algorithms that impl including an interpreter that can evaluate queries without compilation; and fixes about 30 bugs.

                        -

                        New features

                        +

                        New features

                        • SQL @@ -3069,7 +3157,7 @@ packages and lots of classes, in what we have an existing application, it’s worth upgrading to this first, before you move on to 1.0.

                          -

                          New features

                          +

                          New features

                          • [CALCITE-436] @@ -3120,7 +3208,7 @@ Push predicates through New features +

                            New features

                            • [CALCITE-430] @@ -3277,7 +3365,7 @@ most recently.
                            • This is the first release under the Apache incubator process.

                              -

                              New features

                              +

                              New features

                              • [CALCITE-371] @@ -3409,7 +3497,7 @@ Add unit test for 0.8 / 2014-06-27 -

                                New features

                                +

                                New features

                                • [CALCITE-310] @@ -3490,7 +3578,7 @@ Window functions throw exception without

                                  0.7 / 2014-05-13

                                  -

                                  New features

                                  +

                                  New features

                                  • Implement table functions.
                                  • @@ -3575,7 +3663,7 @@ Suspicious map.get in VolcanoPlanner.rer

                                    0.6 / 2014-04-11

                                    -

                                    New features

                                    +

                                    New features

                                    • [CALCITE-214] @@ -3700,7 +3788,7 @@ and obsolete our copy of the resource fr

                                      0.5 / 2014-03-14

                                      -

                                      New features

                                      +

                                      New features

                                      • Allow quoting, quotedCasing, unquotedCasing, and caseSensitive Modified: calcite/site/docs/howto.html URL: http://svn.apache.org/viewvc/calcite/site/docs/howto.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/howto.html (original) +++ calcite/site/docs/howto.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/index.html URL: http://svn.apache.org/viewvc/calcite/site/docs/index.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/index.html (original) +++ calcite/site/docs/index.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/lattice.html URL: http://svn.apache.org/viewvc/calcite/site/docs/lattice.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/lattice.html (original) +++ calcite/site/docs/lattice.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/model.html URL: http://svn.apache.org/viewvc/calcite/site/docs/model.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/model.html (original) +++ calcite/site/docs/model.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Added: calcite/site/docs/pig_adapter.html URL: http://svn.apache.org/viewvc/calcite/site/docs/pig_adapter.html?rev=1785020&view=auto ============================================================================== --- calcite/site/docs/pig_adapter.html (added) +++ calcite/site/docs/pig_adapter.html Wed Mar 1 19:32:35 2017 @@ -0,0 +1,1345 @@ + + + + + Pig adapter + + + + + + + + + + +
                                        + +
                                        + + +
                                        +
                                        + + +
                                        +
                                        + +
                                        + +
                                        + + +
                                        +
                                        +

                                        Pig adapter

                                        + + +

                                        Overview

                                        + +

                                        The Pig adapter allows you to write queries in SQL and execute them using +Apache Pig.

                                        + +

                                        A simple example

                                        + +

                                        Let’s start with a simple example. First, we need a +model definition, +as follows.

                                        + +
                                        {
                                        +  "version": "1.0",
                                        +  "defaultSchema": "SALES",
                                        +  "schemas": [ {
                                        +    "name": "PIG",
                                        +    "type": "custom",
                                        +    "factory": "org.apache.calcite.adapter.pig.PigSchemaFactory",
                                        +    "tables": [ {
                                        +      "name": "t",
                                        +      "type": "custom",
                                        +      "factory": "org.apache.calcite.adapter.pig.PigTableFactory",
                                        +      "operand": {
                                        +        "file": "data.txt",
                                        +        "columns": ["tc0", "tc1"]
                                        +      }
                                        +    }, {
                                        +      "name": "s",
                                        +      "type": "custom",
                                        +      "factory": "org.apache.calcite.adapter.pig.PigTableFactory",
                                        +      "operand": {
                                        +        "file": "data2.txt",
                                        +        "columns": ["sc0", "sc1"]
                                        +      }
                                        +    } ]
                                        +  } ]
                                        +}
                                        + +

                                        Now, if you write the SQL query

                                        + +
                                        select *
                                        +from "t"
                                        +join "s" on "tc1" = "sc0"
                                        + +

                                        the Pig adapter will generate the Pig Latin script

                                        + +
                                        t = LOAD 'data.txt' USING PigStorage() AS (tc0:chararray, tc1:chararray);
                                        +s = LOAD 'data2.txt' USING PigStorage() AS (sc0:chararray, sc1:chararray);
                                        +t = JOIN t BY tc1, s BY sc0;
                                        + +

                                        which is then executed using Pig’s runtime, typically MapReduce on +Apache Hadoop.

                                        + +

                                        Relationship to Piglet

                                        + +

                                        Calcite has another component called +Piglet. +It allows you to write queries in a subset of Pig Latin, +and execute them using any applicable Calcite adapter. +So, Piglet is basically the opposite of the Pig adapter.

                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                        +
                                        + +
                                        + +
                                        + + +
                                        + +
                                        +
                                        + + + + + + + + + Modified: calcite/site/docs/powered_by.html URL: http://svn.apache.org/viewvc/calcite/site/docs/powered_by.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/powered_by.html (original) +++ calcite/site/docs/powered_by.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/reference.html URL: http://svn.apache.org/viewvc/calcite/site/docs/reference.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/reference.html (original) +++ calcite/site/docs/reference.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,6 +878,10 @@ + + + + @@ -862,6 +926,10 @@ + + + + @@ -3042,8 +3110,8 @@ passed to the aggregate function.

                                        - GROUPING(expression) - Returns 1 if expression is rolled up in the current row’s grouping set, 0 otherwise + GROUPING(expression [, expression ] * ) + Returns a bit vector of the given grouping expressions GROUP_ID() @@ -3051,7 +3119,80 @@ passed to the aggregate function.

                                        GROUPING_ID(expression [, expression ] * ) - Returns a bit vector of the given grouping expressions + Synonym for GROUPING + + + + +

                                        Grouped window functions

                                        + +

                                        Grouped window functions occur in the GROUP BY clause and define a key value +that represents a window containing several rows.

                                        + +

                                        In some window functions, a row may belong to more than one window. +For example, if a query is grouped using +HOP(t, INTERVAL '2' HOUR, INTERVAL '1' HOUR), a row with timestamp ‘10:15:00’ + will occur in both the 10:00 - 11:00 and 11:00 - 12:00 totals.

                                        + + + + + + + + + + + + + + + + + + + + + + +
                                        Operator syntaxDescription
                                        HOP(dateTime, slide, size [, time ])Indicates a hopping window for dateTime, covering rows within the interval of size, shifting every slide, and optionally aligned at time
                                        SESSION(dateTime, interval [, time ])Indicates a session window of interval for dateTime, optionally aligned at time
                                        TUMBLE(dateTime, interval [, time ])Indicates a tumbling window of interval for dateTime, optionally aligned at time
                                        + +

                                        Grouped auxiliary functions

                                        + +

                                        Grouped auxiliary functions allow you to access properties of a window defined +by a grouped window function.

                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                        Operator syntaxDescription
                                        HOP_END(expression, slide, size [, time ])Returns the value of expression at the end of the window defined by a HOP function call
                                        HOP_START(expression, slide, size [, time ])Returns the value of expression at the beginning of the window defined by a HOP function call
                                        SESSION_END(expression, interval [, time])Returns the value of expression at the end of the window defined by a SESSION function call
                                        SESSION_START(expression, interval [, time])Returns the value of expression at the beginning of the window defined by a SESSION function call
                                        TUMBLE_END(expression, interval [, time ])Returns the value of expression at the end of the window defined by a TUMBLE function call
                                        TUMBLE_START(expression, interval [, time ])Returns the value of expression at the beginning of the window defined by a TUMBLE function call
                                        Modified: calcite/site/docs/stream.html URL: http://svn.apache.org/viewvc/calcite/site/docs/stream.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/stream.html (original) +++ calcite/site/docs/stream.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + + Modified: calcite/site/docs/tutorial.html URL: http://svn.apache.org/viewvc/calcite/site/docs/tutorial.html?rev=1785020&r1=1785019&r2=1785020&view=diff ============================================================================== --- calcite/site/docs/tutorial.html (original) +++ calcite/site/docs/tutorial.html Wed Mar 1 19:32:35 2017 @@ -130,6 +130,10 @@ + + + + @@ -174,6 +178,10 @@ + + + + @@ -218,6 +226,10 @@ + + + + @@ -269,6 +281,10 @@ + + + + @@ -313,6 +329,10 @@ + + + + @@ -357,6 +377,10 @@ + + + + @@ -408,6 +432,10 @@ + + + + @@ -452,6 +480,10 @@ + + + + @@ -496,6 +528,10 @@ + + + + @@ -540,6 +576,10 @@ + + + + @@ -591,6 +631,10 @@ + + + + @@ -635,6 +679,10 @@ + + + + @@ -679,6 +727,10 @@ + + + + @@ -730,6 +782,10 @@ + + + + @@ -774,6 +830,10 @@ + + + + @@ -818,12 +878,20 @@ + + + + + + + +