calcite.git
22 hours ago[CALCITE-5061] Improve recursive application of the field trimming main
rubenada [Fri, 13 May 2022 14:23:34 +0000 (15:23 +0100)] 
[CALCITE-5061] Improve recursive application of the field trimming

30 hours ago[CALCITE-5149] Refine RelMdColumnUniqueness for Aggregate by considering intersect...
chunwei.lcw [Thu, 12 May 2022 09:43:07 +0000 (17:43 +0800)] 
[CALCITE-5149] Refine RelMdColumnUniqueness for Aggregate by considering intersect keys between target keys and group keys

2 days ago[CALCITE-5137] EnumerableUncollect throws NPE if input has ((List) null)
dssysolyatin [Sat, 7 May 2022 19:20:09 +0000 (22:20 +0300)] 
[CALCITE-5137] EnumerableUncollect throws NPE if input has ((List) null)

2 days ago[CALCITE-5142] Upgrade Calcite to Avatica 1.21.0
Benchao Li [Sun, 8 May 2022 12:41:30 +0000 (20:41 +0800)] 
[CALCITE-5142] Upgrade Calcite to Avatica 1.21.0

3 days ago[CALCITE-5081] Group keys of Aggregate are wrongly changed during decorrelation
Benchao Li [Sun, 24 Apr 2022 00:31:30 +0000 (08:31 +0800)] 
[CALCITE-5081] Group keys of Aggregate are wrongly changed during decorrelation

6 days ago[CALCITE-5138] Join on condition generates wrong plan when the condition is sub-query
NobiGo [Sun, 8 May 2022 02:45:01 +0000 (10:45 +0800)] 
[CALCITE-5138] Join on condition generates wrong plan when the condition is sub-query

6 days ago[CALCITE-5140] Spark, Piglet tests fail in GitHub CI with OpenJ9
Benchao Li [Wed, 11 May 2022 14:10:07 +0000 (22:10 +0800)] 
[CALCITE-5140] Spark, Piglet tests fail in GitHub CI with OpenJ9

Close apache/calcite#2802

7 days ago[CALCITE-5125] Extend "||" operator to work with arrays
dssysolyatin [Fri, 29 Apr 2022 13:24:40 +0000 (16:24 +0300)] 
[CALCITE-5125] Extend "||" operator to work with arrays

Close apache/calcite#2787

8 days ago[CALCITE-5131] Remove redundant type cast
chunwei.lcw [Sat, 7 May 2022 01:46:42 +0000 (09:46 +0800)] 
[CALCITE-5131] Remove redundant type cast

10 days ago[CALCITE-5139] Improve Join print plan to add the CorrelationId info
NobiGo [Sun, 8 May 2022 03:28:07 +0000 (11:28 +0800)] 
[CALCITE-5139] Improve Join print plan to add the CorrelationId info

12 days ago[CALCITE-5095] Support Java 18 and Guava 31.1-jre
Benchao Li [Mon, 18 Apr 2022 03:33:11 +0000 (11:33 +0800)] 
[CALCITE-5095] Support Java 18 and Guava 31.1-jre

Update Travis URL.

Close apache/calcite#2773

13 days ago[CALCITE-5111] jekyll-cache directory should be ignored by git
Benchao Li [Mon, 25 Apr 2022 14:33:24 +0000 (22:33 +0800)] 
[CALCITE-5111] jekyll-cache directory should be ignored by git

13 days agoRemove useless explicit type cast when using SqlValidator
chunwei.lcw [Fri, 29 Apr 2022 02:51:10 +0000 (10:51 +0800)] 
Remove useless explicit type cast when using SqlValidator

13 days ago[CALCITE-5003] MergeUnion on types with different collators produces wrong result
rubenada [Fri, 29 Apr 2022 08:41:10 +0000 (09:41 +0100)] 
[CALCITE-5003] MergeUnion on types with different collators produces wrong result

3 weeks ago[CALCITE-5117] Optimize the EXISTS sub-query by Metadata RowCount
nobigo [Wed, 27 Apr 2022 01:35:40 +0000 (09:35 +0800)] 
[CALCITE-5117]  Optimize the EXISTS sub-query by Metadata RowCount

3 weeks ago[CALCITE-4861] Optimization of chained CAST calls can lead to unexpected behavior
Benchao Li [Sun, 17 Apr 2022 07:24:18 +0000 (15:24 +0800)] 
[CALCITE-4861] Optimization of chained CAST calls can lead to unexpected behavior

3 weeks ago[CALCITE-5110] Geode adapter's java doc url is invalid
Benchao Li [Mon, 25 Apr 2022 14:21:23 +0000 (22:21 +0800)] 
[CALCITE-5110] Geode adapter's java doc url is invalid

3 weeks agoUse theirs from source commit when cherry-picking to site branch
Francis Chuang [Tue, 26 Apr 2022 23:56:42 +0000 (09:56 +1000)] 
Use theirs from source commit when cherry-picking to site branch

3 weeks ago[CALCITE-5115] Upgrade jackson-databind from 2.9.10.1 to 2.13.2.1, and jackson from...
Julian Hyde [Tue, 26 Apr 2022 21:22:15 +0000 (14:22 -0700)] 
[CALCITE-5115] Upgrade jackson-databind from 2.9.10.1 to 2.13.2.1, and jackson from 2.10.0 to 2.13.2.1

3 weeks ago[CALCITE-5112] Upgrade Jetty from 9.4.15.v20190215 to 9.4.46.v20220331
Julian Hyde [Tue, 26 Apr 2022 04:56:32 +0000 (21:56 -0700)] 
[CALCITE-5112] Upgrade Jetty from 9.4.15.v20190215 to 9.4.46.v20220331

3 weeks agoRemove branch setting in release configuration
Michael Mior [Tue, 26 Apr 2022 15:41:16 +0000 (11:41 -0400)] 
Remove branch setting in release configuration

3 weeks ago[CALCITE-4147] Rename master branch to main
Michael Mior [Wed, 17 Feb 2021 14:20:33 +0000 (09:20 -0500)] 
[CALCITE-4147] Rename master branch to main

3 weeks ago[CALCITE-5107] Support SQL hint for Filter, SetOp, Sort, Window, Values
godfreyhe [Thu, 21 Apr 2022 10:58:08 +0000 (18:58 +0800)] 
[CALCITE-5107] Support SQL hint for Filter, SetOp, Sort, Window, Values

close apache/calcite#2775

3 weeks ago[CALCITE-5015] Fix typo in PartiallyOrderedSet
Innovimax [Sun, 20 Feb 2022 17:50:37 +0000 (18:50 +0100)] 
[CALCITE-5015] Fix typo in PartiallyOrderedSet

Close apache/calcite#2726

3 weeks ago[CALCITE-5091] RelMdRowCount can return more accurate rowCount when fetch is determin...
xiejiajun [Wed, 20 Apr 2022 13:37:13 +0000 (21:37 +0800)] 
[CALCITE-5091] RelMdRowCount can return more accurate rowCount when fetch is deterministic and offset is dynamic

3 weeks ago[CALCITE-5085] Firebolt dialect implementation
raghavsharma [Fri, 11 Feb 2022 08:27:50 +0000 (13:57 +0530)] 
[CALCITE-5085] Firebolt dialect implementation

Close apache/calcite#2764

3 weeks ago[CALCITE-5108] Make website GDPR-compliant
Francis Chuang [Fri, 22 Apr 2022 01:10:31 +0000 (11:10 +1000)] 
[CALCITE-5108] Make website GDPR-compliant

- Add privacy policy to the footer
- Remove embeded youtube videos

3 weeks agoSite: Remove missing avatar for Ted Dunning
Francis Chuang [Thu, 21 Apr 2022 09:27:30 +0000 (19:27 +1000)] 
Site: Remove missing avatar for Ted Dunning

3 weeks ago[CALCITE-5106] Upgrade to Jekyll 4 and remove unnecessary dependencies from gemfile...
Francis Chuang [Thu, 21 Apr 2022 09:26:15 +0000 (19:26 +1000)] 
[CALCITE-5106] Upgrade to Jekyll 4 and remove unnecessary dependencies from gemfile for site

jekyll_oembed was also replaced with jekyll-spaceship as the former is no longer maintained

4 weeks agoRemove instructions for syncing site and master and fix formatting issue in howto
Francis Chuang [Thu, 21 Apr 2022 04:30:34 +0000 (14:30 +1000)] 
Remove instructions for syncing site and master and fix formatting issue in howto

4 weeks ago[CALCITE-5102] Update github-pages gem for site build
Francis Chuang [Thu, 21 Apr 2022 04:18:57 +0000 (14:18 +1000)] 
[CALCITE-5102] Update github-pages gem for site build

4 weeks agoComment out release notes for unreleased version and update howto with instructions...
Francis Chuang [Wed, 20 Apr 2022 22:42:30 +0000 (08:42 +1000)] 
Comment out release notes for unreleased version and update howto with instructions to uncomment them during a release

4 weeks ago[CALCITE-5048] Query with parameterized LIMIT and correlated sub-query throws Asserti...
xiejiajun [Tue, 5 Apr 2022 01:04:07 +0000 (09:04 +0800)] 
[CALCITE-5048] Query with parameterized LIMIT and correlated sub-query throws AssertionError "not a literal"

4 weeks ago[CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call exists in...
xurenhe [Wed, 9 Feb 2022 08:09:55 +0000 (16:09 +0800)] 
[CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call exists in the aggregate's group

4 weeks ago[CALCITE-5032] RelOptUtil#splitJoinCondition returns wrong when there is no equal...
Benchao Li [Sun, 27 Mar 2022 13:49:16 +0000 (21:49 +0800)] 
[CALCITE-5032] RelOptUtil#splitJoinCondition returns wrong when there is no equal condition

5 weeks ago[CALCITE-4992] Resource leak in Elasticsearch adapter
James Turton [Sun, 20 Mar 2022 13:21:25 +0000 (15:21 +0200)] 
[CALCITE-4992] Resource leak in Elasticsearch adapter

The Elasticsearch adapter was not calling 'close()' on
RestClient instances, which is considered a resource leak.
To solve, this change adds a Guava cache of RestClient
objects in ElasticsearchTransport (one per endpoint), and
the cache closes them after an hour.

Close apache/calcite#2698

5 weeks ago[CALCITE-4401] SqlJoin.toString throws RuntimeException, "No list started"
onTheQT [Tue, 29 Mar 2022 17:02:18 +0000 (22:32 +0530)] 
[CALCITE-4401] SqlJoin.toString throws RuntimeException, "No list started"

To resolve the RuntimeException seen in SqlJoin#toString, add
a "SELECT *" wrap over SqlJoin in SqlJoin#toSqlString. This
prevents SqlJoin#unparse method from calling
SqlPrettyWriter#sep with a null frame, and is a less fragile
fix than to mutate internal frame state.

Extend SqlPrettyWriterFixture with a method
`checkTransformedNode(UnaryOperator<SqlNode> transform)`
that does do the same as `check()` but applies a transform
function that maps from the root to another node in the tree.

Close apache/calcite#2757

5 weeks ago[CALCITE-5083] In RelBuilder.project_, do not unwrap SARGs
Vladimir Ozerov [Mon, 4 Apr 2022 19:38:53 +0000 (22:38 +0300)] 
[CALCITE-5083] In RelBuilder.project_, do not unwrap SARGs

5 weeks ago[CALCITE-5027] Incorrect format for timestamp literals in SqlDialect#quoteTimestampLi...
NobiGo [Thu, 7 Apr 2022 06:29:16 +0000 (14:29 +0800)] 
[CALCITE-5027] Incorrect format for timestamp literals in SqlDialect#quoteTimestampLiteral

5 weeks ago[CALCITE-5088] JsonBuilder should escape backslashes in JSON strings
Julian Hyde [Fri, 8 Apr 2022 06:51:12 +0000 (08:51 +0200)] 
[CALCITE-5088] JsonBuilder should escape backslashes in JSON strings

This would cause JsonParseException when parsing model JSON;
also the cause of "[CALCITE-4893] JsonParseException happens
when externalizing expressions with escape character from
JSON".

In RelWriterTest, add test case from [CALCITE-4893].

5 weeks agoRefactor RelWriterTest
Julian Hyde [Sun, 10 Apr 2022 13:10:46 +0000 (15:10 +0200)] 
Refactor RelWriterTest

(No changes in functionality.)

5 weeks ago[CALCITE-4936] Generalize FilterCalcMergeRule/ProjectCalcMergeRule to accept any...
maksim [Tue, 14 Dec 2021 13:21:33 +0000 (16:21 +0300)] 
[CALCITE-4936] Generalize FilterCalcMergeRule/ProjectCalcMergeRule to accept any Filter/Project/Calc operator

Close apache/calcite#2646

5 weeks ago[CALCITE-5079] Update code demo of tutorial
Ada Wang [Fri, 1 Apr 2022 06:29:47 +0000 (14:29 +0800)] 
[CALCITE-5079] Update code demo of tutorial

6 weeks ago[CALCITE-5021] Double JOIN is created for NOT IN when IN-list that the values all...
NobiGo [Fri, 25 Feb 2022 02:35:13 +0000 (10:35 +0800)] 
[CALCITE-5021] Double JOIN is created for NOT IN when IN-list that the values all non-nullable is converted to Values

6 weeks ago[CALCITE-5036] RelMdPredicates support to analyze constant key for the operator of...
xurenhe [Thu, 10 Mar 2022 12:30:03 +0000 (20:30 +0800)] 
[CALCITE-5036] RelMdPredicates support to analyze constant key for the operator of IS_NOT_DISTINCT_FROM

6 weeks agoPrepare for next development iteration (1.31.0)
liyafan82 [Fri, 25 Mar 2022 03:37:39 +0000 (11:37 +0800)] 
Prepare for next development iteration (1.31.0)

6 weeks agoAdd Apache license header to website publication Github workflows
Francis Chuang [Fri, 1 Apr 2022 01:46:49 +0000 (12:46 +1100)] 
Add Apache license header to website publication Github workflows

6 weeks ago[CALCITE-5075] Build fails due to rat check on Gemfile.lock
rubenada [Thu, 31 Mar 2022 13:36:28 +0000 (14:36 +0100)] 
[CALCITE-5075] Build fails due to rat check on Gemfile.lock

6 weeks agoFix typo documenting rules for triggering a non-release website update
Francis Chuang [Thu, 31 Mar 2022 11:04:22 +0000 (22:04 +1100)] 
Fix typo documenting rules for triggering a non-release website update

7 weeks agoSite: Fix release announcement for 1.30.0
Francis Chuang [Thu, 31 Mar 2022 04:52:26 +0000 (15:52 +1100)] 
Site: Fix release announcement for 1.30.0

7 weeks ago[CALCITE-3129] Automate website builds
Francis Chuang [Wed, 30 Mar 2022 00:16:04 +0000 (11:16 +1100)] 
[CALCITE-3129] Automate website builds

7 weeks ago[CALCITE-5070] Upgrade Jekyll and ruby gems for site generation 2754/head
Francis Chuang [Tue, 29 Mar 2022 22:30:15 +0000 (09:30 +1100)] 
[CALCITE-5070] Upgrade Jekyll and ruby gems for site generation

7 weeks ago[CALCITE-5064] Dialect factory returns ANSI SQL dialect for BigQuery
Volodymyr Vysotskyi [Thu, 24 Mar 2022 20:01:09 +0000 (22:01 +0200)] 
[CALCITE-5064] Dialect factory returns ANSI SQL dialect for BigQuery

Close apache/calcite#2752

7 weeks ago[CALCITE-4989] Nested JSON_OBJECT creation does not produce proper json
Benchao Li [Sat, 26 Mar 2022 08:46:30 +0000 (16:46 +0800)] 
[CALCITE-4989] Nested JSON_OBJECT creation does not produce proper json

fix checkstyle

make jdk11 checker happy

7 weeks ago[CALCITE-5044] JDBC adapter generates integer literal in ORDER BY, which some dialect...
xurenhe [Tue, 15 Mar 2022 11:06:28 +0000 (19:06 +0800)] 
[CALCITE-5044] JDBC adapter generates integer literal in ORDER BY, which some dialects wrongly interpret as a reference to a field

When an ORDER BY field turns out to be an integer literal,
if the target dialect treats ordinals as field references,
RelToRelConverter now generates a character literal
instead. All constants have no effect on the sort, and
therefore the character literal has the desired effect.

Close apache/calcite#2749

7 weeks ago[CALCITE-5050] Metadata (RelMdRowCount) should reflect the fact that an Aggregate...
Jing Zhang [Thu, 17 Mar 2022 13:45:00 +0000 (21:45 +0800)] 
[CALCITE-5050] Metadata (RelMdRowCount) should reflect the fact that an Aggregate with no GROUP BY always returns 1 row

Close apache/calcite#2746

8 weeks ago[CALCITE-5037] Upgrade HSQLDB to 2.5.2
Julian Hyde [Thu, 10 Mar 2022 10:31:27 +0000 (02:31 -0800)] 
[CALCITE-5037] Upgrade HSQLDB to 2.5.2

Upgrade HSQLDB to 2.5.2 (the last version that also supports
Java 8) and allow people to run using HSQLDB 2.6.1 (the most
recent version, which requires Java 11 or higher).

Also upgrade data sets:
 * scott-data-hsqldb from 0.1 to 0.2;
 * foodmart-data-hsqldb from 0.4 to 0.5;
 * chinook-data-hsqldb from 0.1 to 0.2.

The previous versions of those data sets used HSQLDB file
format 1.8, and the newer versions use 2.0 format.

2 months ago[CALCITE-4976] Release Calcite 1.30.0 calcite-1.30.0 calcite-1.30.0-rc3
liyafan82 [Wed, 16 Mar 2022 03:09:56 +0000 (11:09 +0800)] 
[CALCITE-4976] Release Calcite 1.30.0

2 months ago[CALCITE-5040] SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency...
Julian Hyde [Tue, 15 Mar 2022 03:54:04 +0000 (20:54 -0700)] 
[CALCITE-5040] SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency fails

[CALCITE-4872] added an UNKNOWN type that was implemented in some
places by class SqlTypeFactoryImpl.UnknownSqlType, but in others
by BasicSqlType. This would cause
SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency
to succeed or fail non-deterministically, depending on which of the
above had made it into the map of canonical type instances.

This commit solves the problem by removing class
SqlTypeFactoryImpl.UnknownSqlType and always using BasicSqlType.

2 months ago[CALCITE-5019] Avoid multiple scans when table is ProjectableFilterableTable and...
IceMimosa [Wed, 23 Feb 2022 10:06:10 +0000 (18:06 +0800)] 
[CALCITE-5019] Avoid multiple scans when table is ProjectableFilterableTable and projections and filters act on different columns

2 months agoFollowing [CALCITE-1794], update DruidDateTimeUtils and plans in Druid adapter
NobiGo [Thu, 3 Mar 2022 06:02:16 +0000 (14:02 +0800)] 
Following [CALCITE-1794], update DruidDateTimeUtils and plans in Druid adapter

2 months ago[CALCITE-5030] Upgrade jsonpath version from 2.4.0 to 2.7.0
Stamatis Zampetakis [Thu, 3 Mar 2022 11:14:02 +0000 (12:14 +0100)] 
[CALCITE-5030] Upgrade jsonpath version from 2.4.0 to 2.7.0

2 months agoSite: Reorganise website update process in README & howto
Stamatis Zampetakis [Tue, 1 Feb 2022 09:51:30 +0000 (10:51 +0100)] 
Site: Reorganise website update process in README & howto

1. Highlight the role & existence of two repos at the beginning of
README.
2. Provide a high-level overview of the update procedure early on.
3. Move RM related instructions from README to the appropriate howto
sections.
4. Remove git reset/rebase related commands for syncing master & site
branches from the beginning of the release process cause it is too
early to rebase then. Mention rebase later towards the end of the
process.

Close apache/calcite#2708

2 months ago[CALCITE-1794] Expressions with numeric comparisons are not simplified when CAST...
NobiGo [Mon, 21 Feb 2022 08:18:36 +0000 (16:18 +0800)] 
[CALCITE-1794] Expressions with numeric comparisons are not simplified when CAST is present

2 months ago[CALCITE-5025] Upgrade commons-io version from 2.4 to 2.11.0
Scott Reynolds [Sun, 27 Feb 2022 02:51:48 +0000 (18:51 -0800)] 
[CALCITE-5025] Upgrade commons-io version from 2.4 to 2.11.0

commons-io versions before 2.7 suffer from CVE-2021-29425 which allows
to traverse into the parent directory.

Update to a more recent version to avoid the afforementioned security
vulnerability and benefit from the other improvements in this library.

Close apache/calcite#2734

2 months ago[CALCITE-5008] Ignore synthetic and static methods in MetadataDef 2718/head
Roman Puchkovskiy [Thu, 10 Feb 2022 12:17:14 +0000 (16:17 +0400)] 
[CALCITE-5008] Ignore synthetic and static methods in MetadataDef

According to https://www.jacoco.org/jacoco/trunk/doc/faq.html , Jacoco
adds a synthetic static method called $jacocoInit() during
instrumentation.

MetadataDef constructor breaks if it encounters such method on
the class given to it because it does not expect it. But it looks like
it simply should not consider synthetic methods (as well as static
methods) at all.

- extract code for finding handler methods
- reuse it in both places
- add tests concerning synthetic methods

2 months ago[CALCITE-3673] ListTransientTable should not leave tables in the schema
rubenada [Thu, 13 Jan 2022 14:12:29 +0000 (14:12 +0000)] 
[CALCITE-3673] ListTransientTable should not leave tables in the schema
[CALCITE-4054] RepeatUnion containing a Correlate with a transientScan on its RHS causes NPE

2 months ago[CALCITE-5011] CassandraAdapterDataTypesTest fails with initialization error
Alessandro Solimando [Tue, 15 Feb 2022 14:43:44 +0000 (15:43 +0100)] 
[CALCITE-5011] CassandraAdapterDataTypesTest fails with initialization error

Cache Cassandra sessions based on "hostname, port, keyspace, username, password" information.

2 months ago[CALCITE-4912] Confusing javadoc of RexSimplify.simplify
NobiGo [Wed, 16 Feb 2022 06:41:03 +0000 (14:41 +0800)] 
[CALCITE-4912] Confusing javadoc of RexSimplify.simplify

2 months ago[CALCITE-4683] IN-list converted to JOIN throws type mismatch exception
hannerwang [Wed, 26 Jan 2022 11:58:55 +0000 (19:58 +0800)] 
[CALCITE-4683] IN-list converted to JOIN throws type mismatch exception

3 months ago[CALCITE-4323] If a view definition has an ORDER BY clause, retain the sort if the...
xiejiajun [Sat, 8 Jan 2022 08:05:56 +0000 (16:05 +0800)] 
[CALCITE-4323] If a view definition has an ORDER BY clause, retain the sort if the view is used in a query at top level

The goal is for simple queries to retain the sorting. For example, given

  CREATE VIEW v AS
    SELECT *
    FROM emp
    WHERE job = 'CLERK'
    ORDER BY deptno

the query

  SELECT *
  FROM v
  WHERE ename LIKE 'M%'

will be expanded as if the user had written

  SELECT *
  FROM emp
  WHERE ename LIKE 'M%'
  AND job = 'CLERK'
  ORDER BY deptno

But the ORDER BY will be removed from more complex queries
(e.g. those involving GROUP BY, UNION, sub-query) where it
would have no effect.

If the ORDER BY also includes LIMIT or OFFSET, it affects the
rows returned, not just their sort order; such an ORDER BY is
never removed.

Close apache/calcite#2679

3 months agoFix typo in filterable-model.yaml
吴伟杰 [Mon, 31 Jan 2022 17:19:41 +0000 (01:19 +0800)] 
Fix typo in filterable-model.yaml

3 months ago[CALCITE-4995] AssertionError caused by RelFieldTrimmer on SEMI/ANTI join
rubenada [Mon, 31 Jan 2022 13:22:32 +0000 (13:22 +0000)] 
[CALCITE-4995] AssertionError caused by RelFieldTrimmer on SEMI/ANTI join

3 months ago[CALCITE-4988] ((A IS NOT NULL OR B) AND A IS NOT NULL) can't be simplify to (A IS...
NobiGo [Fri, 21 Jan 2022 11:05:22 +0000 (19:05 +0800)] 
[CALCITE-4988] ((A IS NOT NULL OR B) AND A IS NOT NULL) can't be simplify to (A IS NOT NULL) When A is deterministic

3 months ago[CALCITE-5007] Upgrade H2 database version to 2.1.210
Stamatis Zampetakis [Wed, 9 Feb 2022 16:52:19 +0000 (17:52 +0100)] 
[CALCITE-5007] Upgrade H2 database version to 2.1.210

The 1.4.197 version suffers from multiple CVEs such as:
https://nvd.nist.gov/vuln/detail/CVE-2018-14335
https://nvd.nist.gov/vuln/detail/CVE-2018-10054
https://nvd.nist.gov/vuln/detail/CVE-2021-42392
https://nvd.nist.gov/vuln/detail/CVE-2022-23221

In the project, we use H2 only for testing purposes thus the H2
binaries are not present in the runtime classpath thus these CVEs do
not pose a problem for Calcite or its users.

Close apache/calcite#2717

3 months ago[CALCITE-5006] Gradle tasks for launching JDBC integration tests are not working
Stamatis Zampetakis [Wed, 9 Feb 2022 16:30:09 +0000 (17:30 +0100)] 
[CALCITE-5006] Gradle tasks for launching JDBC integration tests are not working

1. Resolve the problem by removing the custom set of testClassesDirs
2. Set correctly the classpath to include JDBC drivers from a custom
configuration.
3. Add a bit of documentation around the JDBC tasks and configs.

Close apache/calcite#2716

3 months ago[CALCITE-4997] Keep APPROX_COUNT_DISTINCT in some SqlDialects
xiejiajun [Tue, 11 Jan 2022 02:49:49 +0000 (10:49 +0800)] 
[CALCITE-4997] Keep APPROX_COUNT_DISTINCT in some SqlDialects

Some engines(Hive,Spark,BigQuery,Oracle,Snowflake) support APPROX_COUNT_DISTINCT function, while others do not.
So we can use the parameter SqlDialect#supportsApproxCountDistinct to control
whether to use APPROX_COUNT_DISTINCT(It is the same as APPROX_DISTINCT for Presto).

3 months ago[CALCITE-4996] In RelJson, add a readExpression method that can convert JSON to a...
Marieke Gueye [Wed, 2 Feb 2022 00:52:40 +0000 (00:52 +0000)] 
[CALCITE-4996] In RelJson, add a readExpression method that can convert JSON to a RexNode expression

Previously `RelJson` was only able to deserialize `RexNode`
expressions that are part of a `RelNode` such as `Project`,
`Filter` or `Join`; references to input fields would always
be converted to a `RexInputRef`, referencing a field of the
input `RelNode`'s output row type.

But if the expression is not part of a `RelNode`, there is no
input `RelNode`. So this change adds `interface
InputTranslator` to specify how references to input fields
are to be translated.

In RuleMatchVisualizer, make method static, to appease lint.

Close apache/calcite#2709

3 months ago[CALCITE-4872] Add UNKNOWN value to enum SqlTypeName, distinct from the NULL type
Will Noble [Fri, 29 Oct 2021 18:24:38 +0000 (11:24 -0700)] 
[CALCITE-4872] Add UNKNOWN value to enum SqlTypeName, distinct from the NULL type

Before this change, the UNKNOWN type would become the NULL type
when switching nullability.

Close apache/calcite#2595

3 months ago[CALCITE-4702] Error when executing query with GROUP BY constant via JDBC adapter
Soumyakanti Das [Wed, 11 Aug 2021 17:00:46 +0000 (10:00 -0700)] 
[CALCITE-4702] Error when executing query with GROUP BY constant via JDBC adapter

Add new method in SqlDialect controlling whether GROUP BY using
literals is supported. Note that the whole Postgres family returns
false by precaution; some literals may be supported by Postgres or some
derivation of it. We agreed the extra complexity needed handle those
special cases was not worth it so we decided to return false for all
kinds of literals.

Introduce a new rule to rewrite the GROUP BY using an inner join with a
dummy table for those dialects that do not support literals.

Add a rule based transformation step at the beginning of the rel to SQL
conversion and ensure callers are passing from there. This allows to
keep the aggregate constant transformation in a single place.

Add tests with GROUP BY and different types of literals.

Close apache/calcite#2482

3 months ago[CALCITE-4994] SQL-to-RelNode conversion is slow if table contains hundreds of fields
Jay Narale [Tue, 25 Jan 2022 09:14:42 +0000 (18:14 +0900)] 
[CALCITE-4994] SQL-to-RelNode conversion is slow if table contains hundreds of fields

If a table contains hundreds or thousands of fields,
SQL-to-RelNode conversion is slow because the operation to
lookup a field within a record type is O(n) in the number of
fields and is called O(n) times. This manifests in the method
SqlToRelConverter.Blackboard.lookupExp.

The solution we adopted is to add a map in RelRecordType
from field names (case-sensitive) to fields (Julian Hyde).

We hope that this map will improve performance in other
parts of the planning process besides SQL-to-RelNode (e.g.
validation and rewrite rules).

If the record has 20 (RelRecordType.THRESHOLD) or fewer
fields, the map is not populated. We believe that this saves
memory and effort for the common case, small to medium-sized
records.

In SqlToRelConverter.Blackboard, change the contract of
method lookupExp. It would previously return null if a field
was not found, whereupon the caller would throw; now the
method throws, and is declared not-nullable. The method
previously returned a Map from field names to field ordinals,
and now returns a Function that can convert a field name to
an expression accessing that field; the new contract is
easier to implement efficiently with available knowledge.

Add a benchmark, RelNodeConversionBenchmark, that
demonstrates improvement for tables with 100 and 1,000
fields (Jay Narale).

Close apache/calcite#2701

Co-authored-by: Julian Hyde <jhyde@apache.org>
3 months agoSite: update PMC Chair
Ruben Quesada Lopez [Sat, 29 Jan 2022 19:04:14 +0000 (19:04 +0000)] 
Site: update PMC Chair

3 months agoSite: Add external resources section in the community page
Jing Zhang [Thu, 27 Jan 2022 09:01:14 +0000 (17:01 +0800)] 
Site: Add external resources section in the community page

Close apache/calcite#2703

3 months agoSite: Add "calcite-clj - Use Calcite with Clojure" in talks section
Eugen Stan [Fri, 28 Jan 2022 10:02:09 +0000 (12:02 +0200)] 
Site: Add "calcite-clj - Use Calcite with Clojure" in talks section

Close apache/calcite#2704

3 months ago[CALCITE-4980] Babel parser support MySQL NULL-safe equal operator '<=>' (xurenhe...
xurenhe [Tue, 25 Jan 2022 08:29:43 +0000 (16:29 +0800)] 
[CALCITE-4980] Babel parser support MySQL NULL-safe equal operator '<=>' (xurenhe&&DuanXiong)

3 months ago[CALCITE-4885] Fluent test fixtures so that dependent projects can write parser,... 2685/head
Julian Hyde [Sat, 13 Nov 2021 08:38:58 +0000 (00:38 -0800)] 
[CALCITE-4885] Fluent test fixtures so that dependent projects can write parser, validator and rules tests

The goal is to be able to write tests from both inside and outside of
Calcite, and without deriving from a particular test class.

We achieve that goal by creating *fixture* objects for each kind of
test. Test configuration (e.g. what SQL query to test) belongs in that
fixture, and is set using wither methods.

Inside the fixture is a *factory* that creates the objects necessary
to run the test (parser, validator, and so forth). The factory
necssarily contains the config for the parser, validator, etc. Tests
configure the factory by calling methods in their fixture.

Also inside a fixture is a *tester* that orchestrates the lifecycle
(parse, validate, SQL-to-rel, check results). The tester is stateless
(necessary state is provided by parameters to its methods, which often
include a `SqlTestFactory`). There is one main implementation of the
tester, but it can be substituted with an radically different
implementations (say one that no-ops, or dumps all SQL expressions to
a file).

Tests that compare actual results with expected results may have a
`DiffRepository` attached to their fixture.

There follows descriptions of other refactorings included in this
change.

The code was deprecated in [CALCITE-4591], [CALCITE-4593],
[CALCITE-4446] to be removed before release 1.28.

Move classes `DiffRepository`, `MockRelOptPlanner`,
`SqlToRelTestBase`, `RelOptTestBase`, `SqlRuntimeTester`,
`SqlOperatorTest` (renaming to `CoreSqlOperatorTest`),
`SqlOperatorBaseTest` (renaming to `SqlOperatorTest`).

Class `Fixtures` is a single place to obtain fixtures to tests of the
parser, validator, operators, planner rules, and more. These fixtures
can be used within Calcite but also by any project that uses Calcite
(the project just needs to use the `testkit` module).

`class FixtureTest` tests `Fixtures` and contains examples.

Add `fixture()` methods, to create fixtures without SQL, to many test
classes including `RelToSqlConverterTest`, `InterpreterTest`,
`SqlParserTest`, `SqlValidatorTest`, `DruidAdapter2IT`,
`DruidAdapterIT`. (Previously many tests would write `sql("?")` to
create tests with dummy SQL.

In `class CalciteAssert`, move method `withRel` from `AssertQuery` to
`AssertThat`, so that tests can provide a `RelNode` without first
providing dummy SQL. Also make the list of hooks (used heavily by
`AssertQuery`) immutable.

In `SqlTester`, remove methods `checkFieldOrigin`, `checkResultType`,
`checkCollation`, `checkCharset`, `checkIntervalConv`,
`checkMonotonic`; all can now be implemented in terms of a new method
`validateAndThen`, and similar methods `validateAndApply` and
`forEachQueryValidateAndThen`.

Obsolete `interface SqlToRelTestBase.Tester`; `SqlToRelFixture` now
uses `SqlTester`.

Move inner `class MockViewExpander` from `SqlToRelTestBase` to
`SqlTestFactory`.

Method `SqlToRelTestBase.assertValid` becomes `Matchers.relIsValid`.

Refactor/rename a few methods, and change 'query' field to 'expression'.

State is now in the fixture (`class SqlParserFixture`) or
`SqlTestFactory`.

Create a fixture (`class SqlParserListFixture`) for list-based parser
tests.

Remove fixture's `transform` field; config is now transformed
immediately, not deferred.

Remove field `LINUXIFY` (thread-local state).

Fields `SqlToRelFixture.expression` and `SqlValidatorFixture.expression`
were each previously called `query` and had the opposite sense;
both are now consistent with `SqlParserFixture.expression`.

Rename method `sql` to `withSql`, `config` to `withConfig`, etc.

Rename method `withDecorrelation` to `withDecorrelate`,
`withLateDecorrelation` to `withLateDecorrelate`
`with(RelOptPlanner)` to `withPlanner`,
`with(HepProgram)` to `withProgram`.

`MaterializedViewTester` is now a utility class for materialized view
tests but is no longer required to be a base class.

Move `interface AbstractMaterializedViewTest.Sql` to top-level
`class MaterializedViewFixture`.

In `class MaterializedViewSubstitutionVisitorTest`, create a fixture
for satisfiability tests.

`RelSupplier` was previously an inner class of `class RelOptTestBase`.

It is used in metadata tests (`RelMetadataFixture`) and planner rule
tests (`RelOptFixture`) but could be used in other tests too.

Add `class RelSuppliers` with utilities and implementations for
`RelSupplier`.

Move `assertXxx` methods into a fixture, `class
SqlAdvisorTest.Fixture`.

Remove inner `class LexConfiguration`; it relied on a mutable tester
in each `SqlValidatorTest` instance, which is no longer there.

Implement methods `toString`, `equals`, `hashCode`.

Move inner `class Sql` to top-level `class SqlPrettyWriterFixture`.

Add `class ConnectionFactories`, utilities for `ConnectionFactory` and
`CalciteAssert.ConnectionPostProcessor`.

Enumerates all possible 'xxx' in JDBC `ResultSet.getXxx` and
`PreparedStatement.setXxx` methods.

Utilities for `interface SqlTester.ResultChecker`.

Move `interface SqlOperatorTest.Fixture` to `SqlOperatorFixture`.

In `class SqlOperatorFixture`, remove `double delta` arguments from
methods that test floating-point values; instead use a `ResultChecker`
created using a `ResultCheckers` method such as `isWithin` or
`isExactly`.

Remove method `withLibrary2`.

Move `class SqlToRelConverterTest.RelValidityChecker` to top-level.

In class `SqlLimitsTest`, move method `checkTypes` to
`class SqlTests`.

In a few cases we would built complex transforms (instances of
`UnaryOperator`) that were applied just before the test ran. Now we
try to apply transforms early, storing a transformed config rather
than a chained transform. It's easier to understand and debug.

Remove method `RelDataTypeSystemImpl.allowExtendedTrim`, which was
added in [CALCITE-2571] but was never used.

Remove some uses of `assert` in `TypeCoercionTest`. (Never use
`assert` in tests!)

Use `Assertions.assertEquals`, `Objects.requireNonNull` via static import.

In `class SqlValidator.Config`, rename method `sqlConformance()` to
`conformance()`, to be consistent with conformance properties
elsewhere.

In `class TryThreadLocal`, add methods `letIn(T, Supplier)` and
`letIn(T, Runnable)`.

Close apache/calcite#2685

3 months ago[CALCITE-4991] Improve RuleEventLogger to also print input rels in FULL_PLAN mode
Alessandro Solimando [Fri, 21 Jan 2022 11:06:48 +0000 (12:06 +0100)] 
[CALCITE-4991] Improve RuleEventLogger to also print input rels in FULL_PLAN mode

3 months ago[CALCITE-4986] Make HepProgram thread-safe
Julian Hyde [Fri, 14 Jan 2022 05:23:28 +0000 (21:23 -0800)] 
[CALCITE-4986] Make HepProgram thread-safe

Before this change, HepProgram used mutable fields for its
working state and was therefore not thread-safe. If two
threads were planning queries simultaneously and are using
the same HepProgram instances they might conflict.

This change moves the mutable state out of HepProgram, so
that HepProgram is fully immutable and therefore thread-safe.
We make other fields final and not-nullable where possible.

Before using a HepProgram, you now need to call the new
HepProgram.prepare() method to create an instance of class
HepState (which contains the state for any program
instruction, including the whole program), then call the
method HepState.execute().

Close apache/calcite#2691

3 months agoCorrected json stream property name
mans2singh [Mon, 10 Jan 2022 23:36:39 +0000 (18:36 -0500)] 
Corrected json stream property name

3 months ago[CALCITE-4967] Support SQL hints for temporal table join
Jing Zhang [Wed, 29 Dec 2021 08:11:10 +0000 (16:11 +0800)] 
[CALCITE-4967] Support SQL hints for temporal table join

close apache/calcite#2664

3 months ago[CALCITE-4965] IS NOT NULL failed in Elasticsearch Adapter
ILuffZhe [Mon, 17 Jan 2022 14:58:41 +0000 (22:58 +0800)] 
[CALCITE-4965] IS NOT NULL failed in Elasticsearch Adapter

4 months ago[CALCITE-4977] Support Snapshot in RelMdColumnOrigins
lmagic233 [Sun, 9 Jan 2022 13:11:51 +0000 (21:11 +0800)] 
[CALCITE-4977] Support Snapshot in RelMdColumnOrigins

4 months agoSite: Add Alessandro Solimando as committer
Alessandro Solimando [Mon, 10 Jan 2022 10:48:29 +0000 (11:48 +0100)] 
Site: Add Alessandro Solimando as committer

4 months ago[CALCITE-4901] JDBC adapter incorrectly adds ORDER BY columns to the SELECT list...
hannerwang [Thu, 30 Dec 2021 04:00:07 +0000 (12:00 +0800)] 
[CALCITE-4901] JDBC adapter incorrectly adds ORDER BY columns to the SELECT list of generated SQL query

Close apache/calcite#2665

4 months agoSite: Fix typo in howto.md
mans2singh [Thu, 6 Jan 2022 00:41:56 +0000 (19:41 -0500)] 
Site: Fix typo in howto.md

4 months ago[CALCITE-4953] Deprecate TableAccessMap class
Stamatis Zampetakis [Sun, 19 Dec 2021 22:17:56 +0000 (00:17 +0200)] 
[CALCITE-4953] Deprecate TableAccessMap class

The TableAccessMap class is not used anywhere in the project, it is
untested, and hasn't received any real update since its addition in the
project in 2012.

Close apache/calcite#2675

4 months agoSite: For tables that display results, center the content horizontally
Guiyanakuang [Wed, 5 Jan 2022 02:12:03 +0000 (10:12 +0800)] 
Site: For tables that display results, center the content horizontally

Close apache/calcite#2632

4 months agoSite: Add syntax highlighting to SQL statements
Guiyanakuang [Fri, 10 Dec 2021 03:27:59 +0000 (11:27 +0800)] 
Site: Add syntax highlighting to SQL statements

Close apache/calcite#2632

4 months agoSite: Improve HTML tables display & update CSV tutorial
Guiyanakuang [Sun, 5 Dec 2021 02:58:32 +0000 (10:58 +0800)] 
Site: Improve HTML tables display & update CSV tutorial

1. Allow code pre-wrap in tables.
2. Display horizontal scrollbar in tables when content is too large
and cannot be wrapped.
3. Update CSV tutorial example based on current code.

Close apache/calcite#2632

4 months agoUpdate javacc official website
Guiyanakuang [Wed, 5 Jan 2022 06:32:33 +0000 (14:32 +0800)] 
Update javacc official website