[calcite] branch main updated: Prepare for next development iteration
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/main by this push: new b64cb1325c Prepare for next development iteration b64cb1325c is described below commit b64cb1325cfe1a5143ea3ca534f991b6f881c3c5 Author: Jess Balint AuthorDate: Tue Feb 7 13:47:25 2023 -0600 Prepare for next development iteration --- gradle.properties| 2 +- site/_posts/2023-02-07-release_1.33.0.md | 65 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 82caf95bd4..7ae2caa477 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true # This is version for Calcite itself # Note: it should not include "-SNAPSHOT" as it is automatically added by build.gradle.kts # Release version can be generated by using -Prelease or -Prc= arguments -calcite.version=1.33.0 +calcite.version=1.34.0 # This is a version to be used from Maven repository. It can be overridden by localAvatica below calcite.avatica.version=1.23.0 diff --git a/site/_posts/2023-02-07-release_1.33.0.md b/site/_posts/2023-02-07-release_1.33.0.md new file mode 100644 index 00..3d595242ff --- /dev/null +++ b/site/_posts/2023-02-07-release_1.33.0.md @@ -0,0 +1,65 @@ +--- +layout: news_item +date: "2023-02-07 12:00:00 +" +author: jbalint +version: 1.33.0 +categories: [release] +tag: v1-33-0 +sha: 5ad825c +--- + + +The [Apache Calcite PMC]({{ site.baseurl }}) +is pleased to announce +[Apache Calcite release 1.33.0]({{ site.baseurl }}/docs/history.html#v1-33-0). + +This release comes five months after [1.32.0](#v1-32-0), +contains contributions from 33 contributors, and resolves 107 issues. + +Among others, it is worth highlighting the following improvements: + + +* Many improvements to the BigQuery dialect as part of [https://issues.apache.org/jira/browse/CALCITE-5180";>CALCITE-5180] + * [https://issues.apache.org/jira/browse/CALCITE-5269";>CALCITE-5269] +Implement BigQuery `TIME_TRUNC` and `TIMESTAMP_TRUNC` functions + * [https://issues.apache.org/jira/browse/CALCITE-5360";>CALCITE-5360] +Implement `TIMESTAMP_ADD` function (compatible with BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5389";>CALCITE-5389] +Add `STARTS_WITH` and `ENDS_WITH` functions (for `BIG_QUERY` compatibility) + * [https://issues.apache.org/jira/browse/CALCITE-5404";>CALCITE-5404] +Implement BigQuery's `POW()` and `TRUNC()` math functions + * [https://issues.apache.org/jira/browse/CALCITE-5423";>CALCITE-5423] +Implement `TIMESTAMP_DIFF` function (compatible with BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5430";>CALCITE-5430] +Implement `IFNULL()` for BigQuery dialect + * [https://issues.apache.org/jira/browse/CALCITE-5432";>CALCITE-5432] +Implement BigQuery `TIME_ADD`/`TIME_DIFF` + * [https://issues.apache.org/jira/browse/CALCITE-5436";>CALCITE-5436] +Implement `DATE_SUB`, `TIME_SUB`, `TIMESTAMP_SUB` (compatible w/ BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5447";>CALCITE-5447] +Add `DATE_TRUNC` for BigQuery +* [https://issues.apache.org/jira/browse/CALCITE-5105";>CALCITE-5105] + Add `MEASURE` type and `AGGREGATE` aggregate function +* [https://issues.apache.org/jira/browse/CALCITE-5155";>CALCITE-5155] + Custom time frames +* [https://issues.apache.org/jira/browse/CALCITE-5280";>CALCITE-5280] + Implement geometry aggregate functions +* [https://issues.apache.org/jira/browse/CALCITE-5314";>CALCITE-5314] + Prune empty parts of a query by exploiting stats/metadata
[calcite] branch calcite_1.33.0-post created (now e6393a7e8f)
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a change to branch calcite_1.33.0-post in repository https://gitbox.apache.org/repos/asf/calcite.git at e6393a7e8f Prepare for next development iteration This branch includes the following new commits: new e6393a7e8f Prepare for next development iteration The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[calcite] 01/01: Prepare for next development iteration
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch calcite_1.33.0-post in repository https://gitbox.apache.org/repos/asf/calcite.git commit e6393a7e8fafc3981a35d4a26d3dd4ca66c772f6 Author: Jess Balint AuthorDate: Tue Feb 7 13:47:25 2023 -0600 Prepare for next development iteration --- gradle.properties| 2 +- site/_posts/2023-02-07-release_1.33.0.md | 65 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 82caf95bd4..7ae2caa477 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true # This is version for Calcite itself # Note: it should not include "-SNAPSHOT" as it is automatically added by build.gradle.kts # Release version can be generated by using -Prelease or -Prc= arguments -calcite.version=1.33.0 +calcite.version=1.34.0 # This is a version to be used from Maven repository. It can be overridden by localAvatica below calcite.avatica.version=1.23.0 diff --git a/site/_posts/2023-02-07-release_1.33.0.md b/site/_posts/2023-02-07-release_1.33.0.md new file mode 100644 index 00..3d595242ff --- /dev/null +++ b/site/_posts/2023-02-07-release_1.33.0.md @@ -0,0 +1,65 @@ +--- +layout: news_item +date: "2023-02-07 12:00:00 +" +author: jbalint +version: 1.33.0 +categories: [release] +tag: v1-33-0 +sha: 5ad825c +--- + + +The [Apache Calcite PMC]({{ site.baseurl }}) +is pleased to announce +[Apache Calcite release 1.33.0]({{ site.baseurl }}/docs/history.html#v1-33-0). + +This release comes five months after [1.32.0](#v1-32-0), +contains contributions from 33 contributors, and resolves 107 issues. + +Among others, it is worth highlighting the following improvements: + + +* Many improvements to the BigQuery dialect as part of [https://issues.apache.org/jira/browse/CALCITE-5180";>CALCITE-5180] + * [https://issues.apache.org/jira/browse/CALCITE-5269";>CALCITE-5269] +Implement BigQuery `TIME_TRUNC` and `TIMESTAMP_TRUNC` functions + * [https://issues.apache.org/jira/browse/CALCITE-5360";>CALCITE-5360] +Implement `TIMESTAMP_ADD` function (compatible with BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5389";>CALCITE-5389] +Add `STARTS_WITH` and `ENDS_WITH` functions (for `BIG_QUERY` compatibility) + * [https://issues.apache.org/jira/browse/CALCITE-5404";>CALCITE-5404] +Implement BigQuery's `POW()` and `TRUNC()` math functions + * [https://issues.apache.org/jira/browse/CALCITE-5423";>CALCITE-5423] +Implement `TIMESTAMP_DIFF` function (compatible with BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5430";>CALCITE-5430] +Implement `IFNULL()` for BigQuery dialect + * [https://issues.apache.org/jira/browse/CALCITE-5432";>CALCITE-5432] +Implement BigQuery `TIME_ADD`/`TIME_DIFF` + * [https://issues.apache.org/jira/browse/CALCITE-5436";>CALCITE-5436] +Implement `DATE_SUB`, `TIME_SUB`, `TIMESTAMP_SUB` (compatible w/ BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5447";>CALCITE-5447] +Add `DATE_TRUNC` for BigQuery +* [https://issues.apache.org/jira/browse/CALCITE-5105";>CALCITE-5105] + Add `MEASURE` type and `AGGREGATE` aggregate function +* [https://issues.apache.org/jira/browse/CALCITE-5155";>CALCITE-5155] + Custom time frames +* [https://issues.apache.org/jira/browse/CALCITE-5280";>CALCITE-5280] + Implement geometry aggregate functions +* [https://issues.apache.org/jira/browse/CALCITE-5314";>CALCITE-5314] + Prune empty parts of a query by exploiting stats/metadata
[calcite] branch main updated: [CALCITE-5481] Release Calcite 1.33.0
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/main by this push: new 5ad825c97e [CALCITE-5481] Release Calcite 1.33.0 5ad825c97e is described below commit 5ad825c97edc0ee275a9a7257d6d6f62f12c49af Author: Jess Balint AuthorDate: Thu Feb 2 19:32:45 2023 -0600 [CALCITE-5481] Release Calcite 1.33.0 --- NOTICE| 2 +- README| 2 +- site/_docs/history.md | 305 -- site/_docs/howto.md | 4 +- 4 files changed, 302 insertions(+), 11 deletions(-) diff --git a/NOTICE b/NOTICE index fb342f9c90..f4562f0e62 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Calcite -Copyright 2012-2022 The Apache Software Foundation +Copyright 2012-2023 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/README b/README index 7c6c274edb..f561c53fa8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Apache Calcite release 1.32.0 +Apache Calcite release 1.33.0 This is a source or binary distribution of Apache Calcite. diff --git a/site/_docs/history.md b/site/_docs/history.md index 586abb1d33..8ac7f4bacd 100644 --- a/site/_docs/history.md +++ b/site/_docs/history.md @@ -29,11 +29,10 @@ Downloads are available on the [downloads page]({{ site.baseurl }}/downloads/). + +## https://github.com/apache/calcite/releases/tag/calcite-1.33.0";>1.33.0 / 2023-02-06 +{: #v1-33-0} + +This release comes five months after [1.32.0](#v1-32-0), +contains contributions from 33 contributors, and resolves 107 issues. + +Among others, it is worth highlighting the following improvements: + +* Many improvements to the BigQuery dialect as part of [https://issues.apache.org/jira/browse/CALCITE-5180";>CALCITE-5180] + * [https://issues.apache.org/jira/browse/CALCITE-5269";>CALCITE-5269] +Implement BigQuery `TIME_TRUNC` and `TIMESTAMP_TRUNC` functions + * [https://issues.apache.org/jira/browse/CALCITE-5360";>CALCITE-5360] +Implement `TIMESTAMP_ADD` function (compatible with BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5389";>CALCITE-5389] +Add `STARTS_WITH` and `ENDS_WITH` functions (for `BIG_QUERY` compatibility) + * [https://issues.apache.org/jira/browse/CALCITE-5404";>CALCITE-5404] +Implement BigQuery's `POW()` and `TRUNC()` math functions + * [https://issues.apache.org/jira/browse/CALCITE-5423";>CALCITE-5423] +Implement `TIMESTAMP_DIFF` function (compatible with BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5430";>CALCITE-5430] +Implement `IFNULL()` for BigQuery dialect + * [https://issues.apache.org/jira/browse/CALCITE-5432";>CALCITE-5432] +Implement BigQuery `TIME_ADD`/`TIME_DIFF` + * [https://issues.apache.org/jira/browse/CALCITE-5436";>CALCITE-5436] +Implement `DATE_SUB`, `TIME_SUB`, `TIMESTAMP_SUB` (compatible w/ BigQuery) + * [https://issues.apache.org/jira/browse/CALCITE-5447";>CALCITE-5447] +Add `DATE_TRUNC` for BigQuery +* [https://issues.apache.org/jira/browse/CALCITE-5105";>CALCITE-5105] + Add `MEASURE` type and `AGGREGATE` aggregate function +* [https://issues.apache.org/jira/browse/CALCITE-5155";>CALCITE-5155] + Custom time frames +* [https://issues.apache.org/jira/browse/CALCITE-5280";>CALCITE-5280] + Implement geometry aggregate functions +* [https://issues.apache.org/jira/browse/CALCITE-5314";>CALCITE-5314] + Prune empty parts of a query by exploiting stats/metadata + + +Contributors to this release: +Aitozi, +Aleksey Plekhanov, +Alessandro Solimando, +Benchao Li, +Bertil Chapuis, +Christophe Le Saec, +Dmitry Sysolyatin, +Francis Chuang, +Gian Merlino, +Greg Hart, +Hanumath Maduri, +Istvan Toth, +Jake Xie, +James Turton, +Jasmin Trada, +Jess Balint (release manager), +Julian Hyde, +Kevin Risden, +Krisztian Kasa, +Liya Fan, +Mou Wu, +Oliver Lee, +Scott Reynolds, +Sergey Nuyanzin, +Stamatis Zampetakis, +TJ Banghart, +Tanner Clary, +Thomas Rebele, +Tim Nieradzik, +Volodymyr Vysotskyi, +Xurenhe, +Zhengqiang Duan, +Zou Dan. + Breaking Changes {: #breaking-1-33-0} * [https://issues.apache.org/jira/browse/CALCITE-5293";>CALCITE-5293] - Support general set operators in PruneEmptyRules. The default configuration of PruneEmptyRules for Set operators has changed: the rules matching scope has increased. + Support general set operators in `PruneEmptyRules`. The default configuration of `PruneEmptyRules` for Set operators has changed: the rules matching scope has increased. Compatibility: This release is tested on Linux, macOS, Microsoft Windows; @@ -56,20 +152,215 @@ other software versions as specified in gradle.properties. New
svn commit: r59936 - /dev/calcite/apache-calcite-1.33.0-rc0/ /release/calcite/apache-calcite-1.33.0/
Author: jbalint Date: Mon Feb 6 21:29:21 2023 New Revision: 59936 Log: Promoting Apache Calcite calcite-1.33.0-rc0 -> calcite-1.33.0 to release area Added: release/calcite/apache-calcite-1.33.0/ release/calcite/apache-calcite-1.33.0/apache-calcite-1.33.0-src.tar.gz - copied unchanged from r59874, dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz release/calcite/apache-calcite-1.33.0/apache-calcite-1.33.0-src.tar.gz.asc - copied unchanged from r59874, dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc release/calcite/apache-calcite-1.33.0/apache-calcite-1.33.0-src.tar.gz.sha512 - copied unchanged from r59874, dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Removed: dev/calcite/apache-calcite-1.33.0-rc0/
[calcite] 01/01: [CALCITE-5481] Release Calcite 1.33.0
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to annotated tag calcite-1.33.0-rc0 in repository https://gitbox.apache.org/repos/asf/calcite.git commit 96b05ee12f936ed057265072ff6a2de8ea0a249e Author: Jess Balint AuthorDate: Thu Feb 2 19:32:45 2023 -0600 [CALCITE-5481] Release Calcite 1.33.0 --- NOTICE| 2 +- README| 2 +- site/_docs/history.md | 289 -- site/_docs/howto.md | 4 +- 4 files changed, 287 insertions(+), 10 deletions(-) diff --git a/NOTICE b/NOTICE index fb342f9c90..f4562f0e62 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Calcite -Copyright 2012-2022 The Apache Software Foundation +Copyright 2012-2023 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/README b/README index 7c6c274edb..f561c53fa8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Apache Calcite release 1.32.0 +Apache Calcite release 1.33.0 This is a source or binary distribution of Apache Calcite. diff --git a/site/_docs/history.md b/site/_docs/history.md index 586abb1d33..9d48be69fc 100644 --- a/site/_docs/history.md +++ b/site/_docs/history.md @@ -29,11 +29,10 @@ Downloads are available on the [downloads page]({{ site.baseurl }}/downloads/). + +## https://github.com/apache/calcite/releases/tag/calcite-1.33.0";>1.33.0 / 2023-02-04 +{: #v1-33-0} + +This release comes five months after [1.32.0](#v1-32-0), +contains contributions from 33 contributors, and resolves 107 issues. + +Among others, it is worth highlighting the following improvements: + +* Many improvements to the BigQuery dialect as part of [https://issues.apache.org/jira/browse/CALCITE-5180";>CALCITE-5180] +* [https://issues.apache.org/jira/browse/CALCITE-5105";>CALCITE-5105] + Add MEASURE type and AGGREGATE aggregate function +* [https://issues.apache.org/jira/browse/CALCITE-5155";>CALCITE-5155] + Custom time frames +* [https://issues.apache.org/jira/browse/CALCITE-5314";>CALCITE-5314] + Prune empty parts of a query by exploiting stats/metadata + + +Contributors to this release: +Aitozi, +Aleksey Plekhanov, +Alessandro Solimando, +Benchao Li, +Bertil Chapuis, +Christophe Le Saec, +Dmitry Sysolyatin, +Francis Chuang, +Gian Merlino, +Greg Hart, +Hanumath Maduri, +Istvan Toth, +Jake Xie, +James Turton, +Jasmin Trada, +Jess Balint (release manager), +Julian Hyde, +Kevin Risden, +Krisztian Kasa, +Liya Fan, +Mou Wu, +Oliver Lee, +Scott Reynolds, +Sergey Nuyanzin, +Stamatis Zampetakis, +TJ Banghart, +Tanner Clary, +Thomas Rebele, +Tim Nieradzik, +Volodymyr Vysotskyi, +Xurenhe, +Zhengqiang Duan, +Zou Dan. + Breaking Changes {: #breaking-1-33-0} @@ -56,20 +132,221 @@ other software versions as specified in gradle.properties. New features {: #new-features-1-33-0} +* [https://issues.apache.org/jira/browse/CALCITE-2884";>CALCITE-2884] + Implement JSON_INSERT, JSON_REPLACE, JSON_SET +* [https://issues.apache.org/jira/browse/CALCITE-5105";>CALCITE-5105] + Add MEASURE type and AGGREGATE aggregate function +* [https://issues.apache.org/jira/browse/CALCITE-5155";>CALCITE-5155] + Custom time frames +* [https://issues.apache.org/jira/browse/CALCITE-5283";>CALCITE-5283] + Add ARG_MIN, ARG_MAX (aka MIN_BY, MAX_BY) aggregate functions +* [https://issues.apache.org/jira/browse/CALCITE-5362";>CALCITE-5362] + Implement geometry measurement functions +* [https://issues.apache.org/jira/browse/CALCITE-5393";>CALCITE-5393] + VALUE as an synonym for VALUES keyword (enabled in MySQL conformance) + Dependency version upgrade {: #dependency-1-33-0} +* [https://issues.apache.org/jira/browse/CALCITE-5341";>CALCITE-5341] + Upgrade Calcite to Avatica 1.23.0 +* [https://issues.apache.org/jira/browse/CALCITE-5351";>CALCITE-5351] + Bump jackson to 2.13.4 and jackson databind to 2.13.4.2 to avoid CVEs +* [https://issues.apache.org/jira/browse/CALCITE-5356";>CALCITE-5356] + Update junit4 to 4.13.2 and junit5 to 5.9.1 +* [https://issues.apache.org/jira/browse/CALCITE-5374";>CALCITE-5374] + Upgrade jackson version to 2.14.0 + Bug-fixes, API changes and minor enhancements {: #fixes-1-33-0} +* [https://issues.apache.org/jira/browse/CALCITE-4186";>CALCITE-4186] + Add ST_CoveredBy spatial function +* [https://issues.apache.org/jira/browse/CALCITE-4351";>CALCITE-4351] + RelMdUtil#numDistinctVals always returns 0 for large inputs +* [https://issues.apache.org/jira/browse/CALCITE-4632";>CALCITE-4632] + Exception in RelToSqlConverter: "Cannot convert x to DECIMAL(n, m) due to overflow" +* [https://issues.apache.org/jira/browse/CALCITE-4804";>CALCITE-4804] + Support Snapshot operator serialization and deserialization +* [https://issues.apache.org/
[calcite] annotated tag calcite-1.33.0-rc0 created (now 593c491795)
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a change to annotated tag calcite-1.33.0-rc0 in repository https://gitbox.apache.org/repos/asf/calcite.git at 593c491795 (tag) tagging 96b05ee12f936ed057265072ff6a2de8ea0a249e (commit) replaces calcite-1.31.0 by Jess Balint on Thu Feb 2 20:26:25 2023 -0600 - Log - --- This annotated tag includes the following new commits: new 96b05ee12f [CALCITE-5481] Release Calcite 1.33.0 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
svn commit: r59874 - in /dev/calcite/apache-calcite-1.33.0-rc0: apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 03:29:33 2023 New Revision: 59874 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == (empty)
svn commit: r59873 - in /dev/calcite/apache-calcite-1.33.0-rc0: apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 02:43:11 2023 New Revision: 59873 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == (empty)
svn commit: r59872 - in /dev/calcite/apache-calcite-1.33.0-rc0: apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 02:33:24 2023 New Revision: 59872 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == (empty)
svn commit: r59870 - in /dev/calcite/apache-calcite-1.33.0-rc0: apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 02:32:00 2023 New Revision: 59870 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == (empty)
svn commit: r59869 - in /dev/calcite/apache-calcite-1.33.0-rc0: apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 02:29:44 2023 New Revision: 59869 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == (empty)
svn commit: r59868 - in /dev/calcite/apache-calcite-1.33.0-rc0: apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 02:27:42 2023 New Revision: 59868 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == (empty) Modified: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == (empty)
svn commit: r59867 - in /dev/calcite/apache-calcite-1.33.0-rc0: ./ apache-calcite-1.33.0-src.tar.gz apache-calcite-1.33.0-src.tar.gz.asc apache-calcite-1.33.0-src.tar.gz.sha512
Author: jbalint Date: Fri Feb 3 02:25:13 2023 New Revision: 59867 Log: Uploading release candidate Apache Calcite calcite-1.33.0-rc0 to dev area Added: dev/calcite/apache-calcite-1.33.0-rc0/ dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Added: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz == Binary files dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz (added) and dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz Fri Feb 3 02:25:13 2023 differ Added: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc == --- dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc (added) +++ dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.asc Fri Feb 3 02:25:13 2023 @@ -0,0 +1,17 @@ +-BEGIN PGP SIGNATURE- +Version: BCPG v1.68 + +iQIzBAABCAAdFiEE7D5w31M2PHaqp77AwJuk5bCouwQFAmPccIEACgkQwJuk5bCo +uwRjMA/+JMuI+WrF79egboFB7vHJsNqJCaeFapKlQs/pxqpp0K+PmNARao8+1kLs +lhk0G5wH6iJAeTau/xBSqXHyuFXO51JAcC/UbnID9t1hp1AMKQI5fA+rb3EhxBpH +srmzVcmP5vDYEeNKdmPdGuveIdnqmv0It5oucfB5tPNL6oxNfitj7QpG50DjhnEE +HeDL2MZQntQG0nb5glLRb+YcIvSLhFj4iszntTrtJ3Z6GlgyFqBTPpv2QmmDKmw7 +WvcZEDKExfZ2mqCJwKxi9qvo0LtY+cthk6UB+VTjUwT02J5EiWpnDeAydGvf+wlf +b2pYKRnTCIjI3Xx7mnaPFUtc1G7SdI9cUNMcoRZbjxwIqUygigCA0tzkFNR4bAaP +7gLzHDBYb4tHjY8AESTJ2TMZBJJdTueRAVijfkPeQ/ldoYWBvsHEbACy3jqvBOoo +JCPzTqSBXl+KVv6O9KQYYj3m/SFJTbiYBHsUwjg1DUVUQ186RxsJF0IDCTXFkgI4 +bDjhz7g3hAiY9XpzcVvSzKJelt6yG9l+p5l+2Yv110LMOV4CbWRdHSRooAdVs4nc +c+jTFPkSsr0cATMKAAIJjhlN7cBi0SEu1wjwkqKnDq+KO5QzGsQbyqKwU6d+fHGg +Wd6amRSjJnLlFZJBjkFjgO0TtKWRSduiSJ3l5qWuVhkbgQer1a0= +=ZU1p +-END PGP SIGNATURE- Added: dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 == --- dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 (added) +++ dev/calcite/apache-calcite-1.33.0-rc0/apache-calcite-1.33.0-src.tar.gz.sha512 Fri Feb 3 02:25:13 2023 @@ -0,0 +1 @@ +a4acc084344b48c1e9a61a70fbe8009c8093cafdb8c4f05d646681a5ea15ab79ab90b4c2fc7e410f952239a167001f4021e97c2c0be8f29edb7255015cb8a7c6 *apache-calcite-1.33.0-src.tar.gz
[calcite] branch main updated: [CALCITE-5259] Add getParameterRowType method to Planner interface
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/main by this push: new 531dc3d3fa [CALCITE-5259] Add getParameterRowType method to Planner interface 531dc3d3fa is described below commit 531dc3d3fab1f882dd609f419683177df6c57c77 Author: dssysolyatin AuthorDate: Thu Sep 1 12:25:42 2022 +0300 [CALCITE-5259] Add getParameterRowType method to Planner interface --- core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java | 9 + core/src/main/java/org/apache/calcite/tools/Planner.java | 8 2 files changed, 17 insertions(+) diff --git a/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java index a16c5a8a27..a845129135 100644 --- a/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java +++ b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java @@ -237,6 +237,15 @@ public class PlannerImpl implements Planner, ViewExpander { return Pair.of(validatedNode, type); } + @Override public RelDataType getParameterRowType() { +if (state.ordinal() < State.STATE_4_VALIDATED.ordinal()) { + throw new RuntimeException("Need to call #validate() first"); +} + +return requireNonNull(validator, "validator") +.getParameterRowType(requireNonNull(validatedSqlNode, "validatedSqlNode")); + } + @SuppressWarnings("deprecation") @Override public final RelNode convert(SqlNode sql) { return rel(sql).rel; diff --git a/core/src/main/java/org/apache/calcite/tools/Planner.java b/core/src/main/java/org/apache/calcite/tools/Planner.java index 11de3da0d8..afaf160c74 100644 --- a/core/src/main/java/org/apache/calcite/tools/Planner.java +++ b/core/src/main/java/org/apache/calcite/tools/Planner.java @@ -78,6 +78,14 @@ public interface Planner extends AutoCloseable { */ Pair validateAndGetType(SqlNode sqlNode) throws ValidationException; + /** + * Returns a record type that contains the name and type of each parameter. + * Returns a record type with no fields if there are no parameters. + * + * @return Record type + */ + RelDataType getParameterRowType(); + /** * Converts a SQL parse tree into a tree of relational expressions. *
[calcite] 01/02: [CALCITE-5217] Add support for INTERVAL qualifier for Firebolt
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git commit bae84c7e17e038169fefb7119bfd43af6707f8da Author: Aymeric AuthorDate: Sat Jul 23 09:50:04 2022 +0100 [CALCITE-5217] Add support for INTERVAL qualifier for Firebolt --- .../apache/calcite/sql/dialect/FireboltSqlDialect.java| 15 +++ .../apache/calcite/rel/rel2sql/RelToSqlConverterTest.java | 10 ++ 2 files changed, 25 insertions(+) diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java index 25a4859fd8..d76e902a27 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java @@ -23,6 +23,7 @@ import org.apache.calcite.sql.SqlAlienSystemTypeNameSpec; import org.apache.calcite.sql.SqlCall; import org.apache.calcite.sql.SqlDataTypeSpec; import org.apache.calcite.sql.SqlDialect; +import org.apache.calcite.sql.SqlIntervalLiteral; import org.apache.calcite.sql.SqlKind; import org.apache.calcite.sql.SqlLiteral; import org.apache.calcite.sql.SqlNode; @@ -200,4 +201,18 @@ public class FireboltSqlDialect extends SqlDialect { } } } + + @Override public void unparseSqlIntervalLiteral(SqlWriter writer, + SqlIntervalLiteral literal, int leftPrec, int rightPrec) { +SqlIntervalLiteral.IntervalValue interval = +literal.getValueAs(SqlIntervalLiteral.IntervalValue.class); +writer.keyword("INTERVAL"); +writer.print("'"); +if (interval.getSign() == -1) { + writer.print("-"); +} +writer.literal(interval.getIntervalLiteral()); +writer.print(interval.getIntervalQualifier().toString()); +writer.print("'"); + } } diff --git a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java index 5ef9e02126..05ef6e03c4 100644 --- a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java +++ b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java @@ -4004,6 +4004,16 @@ class RelToSqlConverterTest { sql(sql2).withBigQuery().throws_("Only INT64 is supported as the interval value for BigQuery."); } + @Test void testUnparseSqlIntervalQualifierFirebolt() { +final String sql = "select * from \"employee\" where \"hire_date\" + " ++ "INTERVAL '10' HOUR > TIMESTAMP '2005-10-17 00:00:00' "; + +final String expect = "SELECT *\n" ++ "FROM \"foodmart\".\"employee\"\n" ++ "WHERE (\"hire_date\" + INTERVAL '10 HOUR')" ++ " > TIMESTAMP '2005-10-17 00:00:00'"; +sql(sql).withFirebolt().ok(expect); + } @Test void testFloorMysqlWeek() { String query = "SELECT floor(\"hire_date\" TO WEEK) FROM \"employee\""; String expected = "SELECT STR_TO_DATE(DATE_FORMAT(`hire_date` , '%x%v-1'), '%x%v-%w')\n"
[calcite] 02/02: [CALCITE-5217] Improve support for INTERVAL qualifier for Firebolt
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git commit 35c879044c3a1178760009fae0dd583e79856371 Author: Aymeric AuthorDate: Wed Jul 27 17:04:23 2022 +0100 [CALCITE-5217] Improve support for INTERVAL qualifier for Firebolt --- .../calcite/sql/dialect/FireboltSqlDialect.java| 44 -- .../calcite/rel/rel2sql/RelToSqlConverterTest.java | 22 --- 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java index d76e902a27..0f005bd307 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/FireboltSqlDialect.java @@ -16,14 +16,17 @@ */ package org.apache.calcite.sql.dialect; +import org.apache.calcite.avatica.util.TimeUnit; import org.apache.calcite.avatica.util.TimeUnitRange; import org.apache.calcite.config.NullCollation; import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeSystem; import org.apache.calcite.sql.SqlAlienSystemTypeNameSpec; import org.apache.calcite.sql.SqlCall; import org.apache.calcite.sql.SqlDataTypeSpec; import org.apache.calcite.sql.SqlDialect; import org.apache.calcite.sql.SqlIntervalLiteral; +import org.apache.calcite.sql.SqlIntervalQualifier; import org.apache.calcite.sql.SqlKind; import org.apache.calcite.sql.SqlLiteral; import org.apache.calcite.sql.SqlNode; @@ -202,17 +205,52 @@ public class FireboltSqlDialect extends SqlDialect { } } + /** Firebolt interval syntax: sign INTERVAL int64 time_unit. */ @Override public void unparseSqlIntervalLiteral(SqlWriter writer, SqlIntervalLiteral literal, int leftPrec, int rightPrec) { SqlIntervalLiteral.IntervalValue interval = literal.getValueAs(SqlIntervalLiteral.IntervalValue.class); writer.keyword("INTERVAL"); writer.print("'"); -if (interval.getSign() == -1) { - writer.print("-"); +try { + Long.parseLong(interval.getIntervalLiteral()); +} catch (NumberFormatException e) { + throw new RuntimeException("Only INT64 is supported as the interval value for Firebolt."); } writer.literal(interval.getIntervalLiteral()); -writer.print(interval.getIntervalQualifier().toString()); +unparseSqlIntervalQualifier(writer, interval.getIntervalQualifier(), +RelDataTypeSystem.DEFAULT); writer.print("'"); } + + @Override public void unparseSqlIntervalQualifier( + SqlWriter writer, SqlIntervalQualifier qualifier, RelDataTypeSystem typeSystem) { +final String start = validate(qualifier.timeUnitRange.startUnit).name(); +if (qualifier.timeUnitRange.endUnit == null) { + writer.keyword(start); +} else { + throw new RuntimeException("Range time unit is not supported for Firebolt."); +} + } + + private static TimeUnit validate(TimeUnit timeUnit) { +switch (timeUnit) { +case MICROSECOND: +case MILLISECOND: +case SECOND: +case MINUTE: +case HOUR: +case DAY: +case WEEK: +case MONTH: +case YEAR: +case DECADE: +case CENTURY: +case MILLENNIUM: + return timeUnit; +default: + throw new RuntimeException("Time unit " + timeUnit + " is not supported for Firebolt."); +} + } + } diff --git a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java index 05ef6e03c4..0cbda44c6b 100644 --- a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java +++ b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java @@ -4005,15 +4005,27 @@ class RelToSqlConverterTest { } @Test void testUnparseSqlIntervalQualifierFirebolt() { -final String sql = "select * from \"employee\" where \"hire_date\" + " -+ "INTERVAL '10' HOUR > TIMESTAMP '2005-10-17 00:00:00' "; +final String sql0 = "select * from \"employee\" where \"hire_date\" - " ++ "INTERVAL '19800' SECOND(5) > TIMESTAMP '2005-10-17 00:00:00' "; +final String expect0 = "SELECT *\n" ++ "FROM \"foodmart\".\"employee\"\n" ++ "WHERE (\"hire_date\" - INTERVAL '19800 SECOND ')" ++ " > TIMESTAMP '2005-10-17 00:00:00'"; +sql(sql0).withFirebolt().ok(expect0); -final String expect = "SELECT *\n" +final String sql1 = "select * from \"employee\" w
[calcite] branch main updated (52922f9a67 -> 35c879044c)
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git from 52922f9a67 Upgrade jackson to 2.14.1 new bae84c7e17 [CALCITE-5217] Add support for INTERVAL qualifier for Firebolt new 35c879044c [CALCITE-5217] Improve support for INTERVAL qualifier for Firebolt The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../calcite/sql/dialect/FireboltSqlDialect.java| 53 ++ .../calcite/rel/rel2sql/RelToSqlConverterTest.java | 22 + 2 files changed, 75 insertions(+)
[calcite] branch main updated: [CALCITE-5239] Site: JDBC Adapter's current limitations is incorrect
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/main by this push: new dc56fcc912 [CALCITE-5239] Site: JDBC Adapter's current limitations is incorrect dc56fcc912 is described below commit dc56fcc912261a09021a74f13de35b426f3d0d8b Author: Benchao Li AuthorDate: Wed Aug 17 15:46:36 2022 +0800 [CALCITE-5239] Site: JDBC Adapter's current limitations is incorrect --- site/_docs/tutorial.md | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/site/_docs/tutorial.md b/site/_docs/tutorial.md index bf9f23acb2..01a3ea87dc 100644 --- a/site/_docs/tutorial.md +++ b/site/_docs/tutorial.md @@ -573,7 +573,7 @@ public class CsvProjectTableScanRule return new CsvProjectTableScanRule(this); } } -} +} {% endhighlight %} The default instance of the rule resides in the `CsvRules` holder class: @@ -665,9 +665,7 @@ set. To load the data set, follow https://mondrian.pentaho.com/documentation/installation.php#2_Set_up_test_data";>Mondrian's installation instructions.) -Current limitations: The JDBC adapter currently only pushes -down table scan operations; all other processing (filtering, joins, -aggregations and so forth) occurs within Calcite. Our goal is to push +The JDBC adapter will push down as much processing as possible to the source system, translating syntax, data types and built-in functions as we go. If a Calcite query is based on tables from a single JDBC database, in principle the whole
[calcite] branch main updated: [CALCITE-5013] Unparse SqlSetOperator should be retained parentheses when generating SQL for UNION ... LIMIT
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/main by this push: new b2fb233426 [CALCITE-5013] Unparse SqlSetOperator should be retained parentheses when generating SQL for UNION ... LIMIT b2fb233426 is described below commit b2fb2334260fc8c8bd6ab147da24b10f6c772ea8 Author: xiejiajun AuthorDate: Sat Feb 19 15:12:04 2022 +0800 [CALCITE-5013] Unparse SqlSetOperator should be retained parentheses when generating SQL for UNION ... LIMIT Co-authored-by: Julian Hyde --- .../java/org/apache/calcite/sql/SqlSelect.java | 12 ++- .../calcite/sql/fun/SqlInternalOperators.java | 32 .../calcite/rel/rel2sql/RelToSqlConverterTest.java | 78 ++ .../apache/calcite/sql/parser/SqlParserTest.java | 95 ++ 4 files changed, 216 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSelect.java b/core/src/main/java/org/apache/calcite/sql/SqlSelect.java index 4ce27f0668..6f51cb3f4d 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSelect.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSelect.java @@ -16,6 +16,7 @@ */ package org.apache.calcite.sql; +import org.apache.calcite.sql.fun.SqlInternalOperators; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.calcite.sql.validate.SqlValidator; import org.apache.calcite.sql.validate.SqlValidatorScope; @@ -249,7 +250,16 @@ public class SqlSelect extends SqlCall { // Override SqlCall, to introduce a sub-query frame. @Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { -if (!writer.inQuery()) { +if (!writer.inQuery() +|| getFetch() != null +&& (leftPrec > SqlInternalOperators.FETCH.getLeftPrec() +|| rightPrec > SqlInternalOperators.FETCH.getLeftPrec()) +|| getOffset() != null +&& (leftPrec > SqlInternalOperators.OFFSET.getLeftPrec() +|| rightPrec > SqlInternalOperators.OFFSET.getLeftPrec()) +|| getOrderList() != null +&& (leftPrec > SqlOrderBy.OPERATOR.getLeftPrec() +|| rightPrec > SqlOrderBy.OPERATOR.getRightPrec())) { // If this SELECT is the topmost item in a sub-query, introduce a new // frame. (The topmost item in the sub-query might be a UNION or // ORDER. In this case, we don't need a wrapper frame.) diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlInternalOperators.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlInternalOperators.java index c3f12806f9..a6cfc789e9 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlInternalOperators.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlInternalOperators.java @@ -24,6 +24,7 @@ import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlNodeList; import org.apache.calcite.sql.SqlOperator; import org.apache.calcite.sql.SqlOperatorTable; +import org.apache.calcite.sql.SqlSyntax; import org.apache.calcite.sql.SqlWriter; import org.apache.calcite.sql.type.InferTypes; import org.apache.calcite.sql.type.OperandTypes; @@ -119,4 +120,35 @@ public abstract class SqlInternalOperators { public static final SqlInternalOperator GROUP_BY_DISTINCT = new SqlRollupOperator("GROUP BY DISTINCT", SqlKind.GROUP_BY_DISTINCT); + /** Fetch operator is ONLY used for its precedence during unparsing. */ + public static final SqlOperator FETCH = + SqlBasicOperator.create("FETCH") + .withPrecedence(SqlStdOperatorTable.UNION.getLeftPrec() - 2, true); + + /** Offset operator is ONLY used for its precedence during unparsing. */ + public static final SqlOperator OFFSET = + SqlBasicOperator.create("OFFSET") + .withPrecedence(SqlStdOperatorTable.UNION.getLeftPrec() - 2, true); + + /** Subject to change. */ + private static class SqlBasicOperator extends SqlOperator { +@Override public SqlSyntax getSyntax() { + return SqlSyntax.SPECIAL; +} + +/** Private constructor. Use {@link #create}. */ +private SqlBasicOperator(String name, int leftPrecedence, int rightPrecedence) { + super(name, SqlKind.OTHER, leftPrecedence, rightPrecedence, + ReturnTypes.BOOLEAN, InferTypes.RETURN_TYPE, OperandTypes.ANY); +} + +static SqlBasicOperator create(String name) { + return new SqlBasicOperator(name, 0, 0); +} + +SqlBasicOperator withPrecedence(int prec, boolean leftAssoc) { + return new SqlBasicOperator(getName(), leftPrec(prec, leftAssoc), + rightPrec(prec, leftAssoc)); +} + } } diff --git a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConvert
[calcite] branch master updated (8844146 -> d85b2a6)
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/calcite.git. from 8844146 [CALCITE-4989] Nested JSON_OBJECT creation does not produce proper json add d85b2a6 [CALCITE-5064] Dialect factory returns ANSI SQL dialect for BigQuery No new revisions were added by this update. Summary of changes: core/src/main/java/org/apache/calcite/sql/SqlDialect.java| 3 ++- .../main/java/org/apache/calcite/sql/SqlDialectFactoryImpl.java | 9 ++--- 2 files changed, 8 insertions(+), 4 deletions(-)
[calcite] branch master updated: [CALCITE-4968] Use TOP N for MsSQL instead of FETCH without OFFSET
This is an automated email from the ASF dual-hosted git repository. jbalint pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/master by this push: new cc40a48 [CALCITE-4968] Use TOP N for MsSQL instead of FETCH without OFFSET cc40a48 is described below commit cc40a48cb8ca16f91bfdc66eaed6151805355d4b Author: Volodymyr Vysotskyi AuthorDate: Fri Dec 31 21:27:40 2021 +0200 [CALCITE-4968] Use TOP N for MsSQL instead of FETCH without OFFSET --- .../calcite/sql/dialect/MssqlSqlDialect.java | 6 +++--- .../calcite/sql/dialect/SybaseSqlDialect.java | 7 +-- .../calcite/rel/rel2sql/RelToSqlConverterTest.java | 22 +++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/MssqlSqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/MssqlSqlDialect.java index 9630916..b59bb29 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/MssqlSqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/MssqlSqlDialect.java @@ -116,21 +116,21 @@ public class MssqlSqlDialect extends SqlDialect { @Override public void unparseOffsetFetch(SqlWriter writer, @Nullable SqlNode offset, @Nullable SqlNode fetch) { -if (!top) { +if (!top && offset != null) { super.unparseOffsetFetch(writer, offset, fetch); } } @Override public void unparseTopN(SqlWriter writer, @Nullable SqlNode offset, @Nullable SqlNode fetch) { -if (top) { +if (top || offset == null) { // Per Microsoft: // "For backward compatibility, the parentheses are optional in SELECT // statements. We recommend that you always use parentheses for TOP in // SELECT statements. Doing so provides consistency with its required // use in INSERT, UPDATE, MERGE, and DELETE statements." // - // Note that "fetch" is ignored. + // Note that "offset" is ignored. writer.keyword("TOP"); writer.keyword("("); requireNonNull(fetch, "fetch"); diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/SybaseSqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/SybaseSqlDialect.java index b611d07..f62e1d8 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/SybaseSqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/SybaseSqlDialect.java @@ -48,12 +48,15 @@ public class SybaseSqlDialect extends SqlDialect { @Nullable SqlNode fetch) { // Parentheses are not required, but we use them to be consistent with // Microsoft SQL Server, which recommends them but does not require them. -// -// Note that "fetch" is ignored. writer.keyword("TOP"); writer.keyword("("); requireNonNull(fetch, "fetch"); fetch.unparse(writer, -1, -1); writer.keyword(")"); +if (offset != null) { + writer.keyword("START"); + writer.keyword("AT"); + offset.unparse(writer, -1, -1); +} } } diff --git a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java index 89f48a6..b651de7 100644 --- a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java +++ b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java @@ -2652,10 +2652,9 @@ class RelToSqlConverterTest { final String expectedMssql10 = "SELECT TOP (100) [product_id]\n" + "FROM [foodmart].[product]\n" + "ORDER BY CASE WHEN [product_id] IS NULL THEN 1 ELSE 0 END, [product_id]"; -final String expectedMssql = "SELECT [product_id]\n" +final String expectedMssql = "SELECT TOP (100) [product_id]\n" + "FROM [foodmart].[product]\n" -+ "ORDER BY CASE WHEN [product_id] IS NULL THEN 1 ELSE 0 END, [product_id]\n" -+ "FETCH NEXT 100 ROWS ONLY"; ++ "ORDER BY CASE WHEN [product_id] IS NULL THEN 1 ELSE 0 END, [product_id]"; final String expectedSybase = "SELECT TOP (100) product_id\n" + "FROM foodmart.product\n" + "ORDER BY product_id"; @@ -3588,6 +3587,23 @@ class RelToSqlConverterTest { .withMssql().ok(expected); } + @Test void testFetchMssql() { +String query = "SELECT * FROM \"employee\" LIMIT 1"; +String expected = "SELECT TOP (1) *\nFROM [foodmart].[employee]"; +sql(query) +.withMssql().ok(expected); + } + + @Test void testFetchOffset() { +String query = "SELECT * FROM \"employee\" LIMIT 1 OFFSET 1"; +String expect
calcite git commit: [CALCITE-1665] HAVING support in RelToSqlConverter (Zhiqiang He)
Repository: calcite Updated Branches: refs/heads/master 69e9fe7c2 -> 60777142e [CALCITE-1665] HAVING support in RelToSqlConverter (Zhiqiang He) Close apache/calcite#388 Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/60777142 Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/60777142 Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/60777142 Branch: refs/heads/master Commit: 60777142e0b7be9302e22c1dd934020c6e64be69 Parents: 69e9fe7 Author: Zhiqiang-He Authored: Mon Mar 6 14:24:01 2017 +0800 Committer: Jess Balint Committed: Fri Mar 10 08:20:46 2017 -0600 -- .../calcite/rel/rel2sql/RelToSqlConverter.java | 22 ++-- .../calcite/rel/rel2sql/SqlImplementor.java | 5 ++ .../java/org/apache/calcite/sql/SqlSelect.java | 4 ++ .../rel/rel2sql/RelToSqlConverterTest.java | 55 +--- 4 files changed, 74 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/calcite/blob/60777142/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java -- diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java index eefe8b1..1231dbc 100644 --- a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java +++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java @@ -133,11 +133,23 @@ public class RelToSqlConverter extends SqlImplementor /** @see #dispatch */ public Result visit(Filter e) { -Result x = visitChild(0, e.getInput()); -final Builder builder = -x.builder(e, Clause.WHERE); -builder.setWhere(builder.context.toSql(null, e.getCondition())); -return builder.result(); +final RelNode input = e.getInput(); +Result x = visitChild(0, input); +if (input instanceof Aggregate) { + final Builder builder; + if (((Aggregate) input).getInput() instanceof Project) { +builder = x.builder(e); +builder.clauses.add(Clause.HAVING); + } else { +builder = x.builder(e, Clause.HAVING); + } + builder.setHaving(builder.context.toSql(null, e.getCondition())); + return builder.result(); +} else { + final Builder builder = x.builder(e, Clause.WHERE); + builder.setWhere(builder.context.toSql(null, e.getCondition())); + return builder.result(); +} } /** @see #dispatch */ http://git-wip-us.apache.org/repos/asf/calcite/blob/60777142/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java -- diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java index e9c148f..f3287f0 100644 --- a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java +++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java @@ -1106,6 +1106,11 @@ public abstract class SqlImplementor { select.setGroupBy(nodeList); } +public void setHaving(SqlNode node) { + assert clauses.contains(Clause.HAVING); + select.setHaving(node); +} + public void setOrderBy(SqlNodeList nodeList) { assert clauses.contains(Clause.ORDER_BY); select.setOrderBy(nodeList); http://git-wip-us.apache.org/repos/asf/calcite/blob/60777142/core/src/main/java/org/apache/calcite/sql/SqlSelect.java -- diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSelect.java b/core/src/main/java/org/apache/calcite/sql/SqlSelect.java index ea89b37..4854696 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSelect.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSelect.java @@ -160,6 +160,10 @@ public class SqlSelect extends SqlCall { return having; } + public void setHaving(SqlNode having) { +this.having = having; + } + public final SqlNodeList getSelectList() { return selectList; } http://git-wip-us.apache.org/repos/asf/calcite/blob/60777142/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java -- diff --git a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java index b6d4780..34b9303 100644 --- a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java +++ b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java @@ -186,10 +186,53 @@ public class RelToSqlConverterTest { String query = "select
calcite git commit: [CALCITE-1636] JDBC adapter generates wrong SQL for self join with sub-query
Repository: calcite Updated Branches: refs/heads/master 79adbf3b5 -> f7d29063b [CALCITE-1636] JDBC adapter generates wrong SQL for self join with sub-query Close apache/calcite#373 Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/f7d29063 Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/f7d29063 Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/f7d29063 Branch: refs/heads/master Commit: f7d29063b3a323b21968125f5aea16a0d33a39e6 Parents: 79adbf3 Author: Zhiqiang-He Authored: Wed Feb 15 20:20:04 2017 +0800 Committer: Jess Balint Committed: Sun Feb 19 10:39:26 2017 -0600 -- .../calcite/rel/rel2sql/RelToSqlConverter.java | 7 +++--- .../calcite/rel/rel2sql/SqlImplementor.java | 23 .../rel/rel2sql/RelToSqlConverterTest.java | 17 +++ 3 files changed, 39 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/calcite/blob/f7d29063/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java -- diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java index 007dbed..c2fe284 100644 --- a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java +++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java @@ -101,11 +101,10 @@ public class RelToSqlConverter extends SqlImplementor /** @see #dispatch */ public Result visit(Join e) { -final Result leftResult = visitChild(0, e.getLeft()); -final Result rightResult = visitChild(1, e.getRight()); +final Result leftResult = visitChild(0, e.getLeft()).resetAlias(); +final Result rightResult = visitChild(1, e.getRight()).resetAlias(); final Context leftContext = leftResult.qualifiedContext(); -final Context rightContext = -rightResult.qualifiedContext(); +final Context rightContext = rightResult.qualifiedContext(); SqlNode sqlCondition = null; SqlLiteral condType = JoinConditionType.ON.symbol(POS); JoinType joinType = joinType(e.getJoinType()); http://git-wip-us.apache.org/repos/asf/calcite/blob/f7d29063/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java -- diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java index 6e6fed4..206716b 100644 --- a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java +++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java @@ -426,7 +426,7 @@ public abstract class SqlImplementor { && !aliases.isEmpty() && (!dialect.hasImplicitTableAlias() || aliases.size() > 1)) { - return new Result(node, clauses, alias4, aliases); + return new Result(node, clauses, alias4, rel.getRowType(), aliases); } final String alias5; if (alias2 == null @@ -436,7 +436,7 @@ public abstract class SqlImplementor { } else { alias5 = null; } -return new Result(node, clauses, alias5, +return new Result(node, clauses, alias5, rel.getRowType(), ImmutableMap.of(alias4, rel.getRowType())); } @@ -448,7 +448,7 @@ public abstract class SqlImplementor { collectAliases(builder, join, Iterables.concat(leftResult.aliases.values(), rightResult.aliases.values()).iterator()); -return new Result(join, Expressions.list(Clause.FROM), null, +return new Result(join, Expressions.list(Clause.FROM), null, null, builder.build()); } @@ -873,13 +873,15 @@ public abstract class SqlImplementor { public class Result { final SqlNode node; private final String neededAlias; +private final RelDataType neededType; private final Map aliases; final Expressions.FluentList clauses; public Result(SqlNode node, Collection clauses, String neededAlias, -Map aliases) { +RelDataType neededType, Map aliases) { this.node = node; this.neededAlias = neededAlias; + this.neededType = neededType; this.aliases = aliases; this.clauses = Expressions.list(clauses); } @@ -1031,6 +1033,19 @@ public abstract class SqlImplementor { public Context qualifiedContext() { return aliasContext(aliases, true); } + +/** + * In join, when the left and right nodes have been generated, + * update their alias with 'neededAlias' if not null. + */ +public Result resetAlias() { + if (neededAlias == null) { +return this; + } else { +return new Result(node, clauses, needed