diff --git a/.mailmap b/.mailmap index 061550ae5f29..965a3b9fcaeb 100644 --- a/.mailmap +++ b/.mailmap @@ -21,7 +21,10 @@ Alan Jin Ali Mansour Amir Gajst Botong Huang +Bowen Yang +Cancai Cai <2356672992@qq.com> Cancai Cai <77189278+caicancai@users.noreply.github.com> +Cancai Cai Charbel Yazbeck Chen Kai Chunhui Shi @@ -42,6 +45,9 @@ Drew Schmitt Dylan Adams Evgeniy Stanilovskiy # aka Eugen Stan, Evgeny Stanilovsky Evgeniy Stanilovskiy +Evgeniy Stanilovsky +Evgeniy Stanilovsky +Fan Luo Feng Guo Feng Zhu # DonnyZone at github Feng Zhu @@ -71,6 +77,7 @@ Jeffery Zhang (张俭) Jerin John Jiajun Xie # aka Jiajun Bernoulli Jiasen Sheng +Jie Cheng <18033291053@163.com> Jin Xing Jin Xing # aka jx158167 Joey Moore @@ -83,8 +90,12 @@ Julian Hyde Kevin Liew Kevin Liew Khawla Mouhoubi +Konstantin Orlov +Konstantin Orlov Konstantin Orlov Krisztian Kasa +Krisztian Kasa +Krisztian Kasa Lei Shen LeoWangLZ # aka Rheet Wong? Liao Xintao @@ -103,9 +114,11 @@ Pavel Gubin Pawel Ruchaj Peng Wang pengzhiwei +Pranava B Praveen Kumar Qi Yu (余启) Rafay Qureshi +Rodrigo Rueda Ruben Quesada Lopez Rui Wang Runkang He (何润康) @@ -120,6 +133,8 @@ Shuo Cheng Slim Bouguerra Stamatis Zampetakis <15013153+zabetak@users.noreply.github.com> Stamatis Zampetakis +suibianwanwan <1597226206@qq.com> +suibianwanwan Taras Ledkov Ted Xu (少杰) Venki Korukanti @@ -141,6 +156,8 @@ Yeong Wei Yingyu Wang Yingyu Wang Yiqun Zhang +YiwenWu +YiwenWu Zhe Hu Zhen Wang Zhen Wang diff --git a/README b/README index 7d17e6ee4aac..123f7d9011b8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Apache Calcite release 1.37.0 +Apache Calcite release 1.38.0 This is a source distribution of Apache Calcite. diff --git a/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java b/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java index f939522fb1d9..961131cf7496 100644 --- a/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java +++ b/file/src/test/java/org/apache/calcite/adapter/file/FileReaderTest.java @@ -83,7 +83,7 @@ private static String resourcePath(String path) { assumeTrue(!r.equals("OpenJDK Runtime Environment") || getJavaMajorVersion() > 10, "Java 10+ should have root certificates (JEP 319). Runtime is " - + r + ", Jave major version is " + getJavaMajorVersion()); + + r + ", Java major version is " + getJavaMajorVersion()); FileReader t = new FileReader(STATES_SOURCE); t.refresh(); diff --git a/release/build.gradle.kts b/release/build.gradle.kts index 26a4b109fbad..9c3b2ab33ab3 100644 --- a/release/build.gradle.kts +++ b/release/build.gradle.kts @@ -26,6 +26,8 @@ import com.github.vlsi.gradle.release.ReleaseExtension import com.github.vlsi.gradle.release.ReleaseParams import com.github.vlsi.gradle.release.dsl.dependencyLicenses import com.github.vlsi.gradle.release.dsl.licensesCopySpec +import java.time.Instant +import java.time.temporal.ChronoUnit plugins { id("com.github.vlsi.stage-vote-release") @@ -54,7 +56,7 @@ https://gitbox.apache.org/repos/asf?p=calcite.git;a=commit;h=$gitSha Its hash is $gitSha Tag: -$sourceCodeTagUrl +https://github.com/apache/calcite/tree/$tag The artifacts to be voted on are located here: $svnStagingUri @@ -71,24 +73,38 @@ https://people.apache.org/keys/committer/$committerId.asc https://www.apache.org/dist/$tlpUrl/KEYS To create the jars and test $componentName: "gradle build" -(requires an appropriate Gradle/JDK installation) +(Requires an appropriate Gradle/JDK installation.) Please vote on releasing this package as $componentName $version. - -The vote is open for the next 72 hours and passes if a majority of at -least three +1 PMC votes are cast. +Everyone is welcome to vote. Your vote should contain the line +'code name (role)', where + * 'code' is +1, 0 or -1 as below; + * 'name' is your ASF id if you have one, else your real name; + * 'role' is 'community', 'committer' or 'PMC member'. [ ] +1 Release this package as Apache Calcite $version [ ] 0 I don't feel strongly about it, but I'm okay with the release [ ] -1 Do not release this package because... +The vote is open for the next $voteDurationHours hours (closing at +$voteEnd) and passes if a majority of +at least three +1 votes by PMC members are cast. + Here is my vote: -+1 (binding) + +1 $committerId (PMC member) + +$userName (release manager) + """.trimIndent() val distributionGroup = "distribution" val baseFolder = "apache-calcite-${rootProject.version}" +val userName = System.getProperty("user.name") +val voteDurationHours = 72L +val voteEnd = + Instant.now().truncatedTo(ChronoUnit.HOURS) + .plus(voteDurationHours, ChronoUnit.HOURS).toString() // This task scans the project for gitignore / gitattributes, and that is reused for building // source/binary artifacts with the appropriate eol/executable file flags @@ -100,7 +116,7 @@ val gitProps by tasks.registering(FindGitAttributes::class) { val getLicenses by tasks.registering(GatherLicenseTask::class) { extraLicenseDir.set(file("$rootDir/src/main/config/licenses")) - // Parts of the web site generated by Jekyll (http://jekyllrb.com/) + // Parts of the website generated by Jekyll (http://jekyllrb.com/) addDependency(":jekyll:", SpdxLicense.MIT) addDependency("font-awesome:font-awesome-code:4.2.0", SpdxLicense.MIT) // git.io/normalize diff --git a/site/_docs/history.md b/site/_docs/history.md index a733d2044e79..3c97d65f3561 100644 --- a/site/_docs/history.md +++ b/site/_docs/history.md @@ -30,39 +30,126 @@ Downloads are available on the + +## 1.38.0 / 2024-10-14 +{: #v1-38-0} + +This release comes 5 months after [1.37.0](#v1-37-0), +contains contributions from 39 contributors, and resolves 165 issues. +Highlights include the +[`AS MEASURE`](https://issues.apache.org/jira/browse/CALCITE-4496) +clause to define measures and use them in +[simple queries](https://issues.apache.org/jira/browse/CALCITE-6519), +[`ASOF` join](https://issues.apache.org/jira/browse/CALCITE-6372), +the +[`EXCLUDE`](https://issues.apache.org/jira/browse/CALCITE-5855) +clause in window aggregates, Postgres-compatible implementations of the +[`TO_DATE`, `TO_TIMESTAMP`](https://issues.apache.org/jira/browse/CALCITE-6449) +and +[`TO_CHAR`](https://issues.apache.org/jira/browse/CALCITE-6358) +functions, and the extension of the type system to allow +[types with negative scale](https://issues.apache.org/jira/browse/CALCITE-6560). + +Contributors to this release: +Aleksey Plekhanov, +Alessandro Solimando, +Barry Kelly, +Bowen Yang, +Cancai Cai, +Clay Johnson, +Cyril de Catheu, +Dawid Wysakowicz, +Evgeniy Stanilovsky, +Fan Luo, +Gian Merlino, +Ian Bertolacci, +Itiel Sadeh, +James Duong, +Jiabao Sun, +Jiajun Xie, +jianhong.hu, +Jie Cheng, +Julian Hyde (release manager), +Konstantin Orlov, +Krisztian Kasa, +Michael Mior, +Mihai Budiu, +Mou Wu, +Niels Pardon, +Nitish Kumar, +Norman Jordan, +Pranava B, +Rodrigo Rueda, +Ruben Quesada Lopez, +Sergey Nuyanzin, +Stamatis Zampetakis, +suibianwanwan, +Tim Grein, +TJ Banghart, +Wegdan Ghazi, +Xiong Duan, +YiwenWu, +Zoltan Haindrich. Compatibility: This release is tested on Linux, macOS, Microsoft Windows; using JDK/OpenJDK versions 8 to 23; Guava versions 21.0 to 33.3.0-jre; other software versions as specified in gradle.properties. -* [a ] - **RexLiteral cannot represent accurately floating point values, - including NaN, Infinity**. This fix changes the way RexLiteral - represents floating point values. Previously floating point values - were encoded into BigDecimal values. This caused precision loss - when representing the results of simplifying expressions whose - results are floating point. With this change RexLiteral uses - internally a Java Double value to represent a SQL DOUBLE, FLOAT, or - REAL value. The result of RexLiteral.getValue() accordingly changes - type in this case. +#### Breaking Changes +{: #breaking-1-38-0} + +*Cast to DECIMAL*. In previous versions of Calcite the casts to +`DECIMAL` types were treated as no-ops. After the fix of +[CALCITE-6322], +calculations that use `DECIMAL` values may produce slightly +different results. + +*Represention of floating point values in `RexLiteral`*. +Previously, floating point values were encoded into `BigDecimal` +values. This caused precision loss +when representing the results of simplifying expressions whose +results are floating point. After the fix of +[CALCITE-2067], +`RexLiteral` stores the value of a SQL `DOUBLE`, `FLOAT` or `REAL` values +using a Java `double`. The result of `RexLiteral.getValue()` accordingly +changes type in this case. *Deprecated methods in `interface RelDataTypeSystem`*. [CALCITE-6598] @@ -78,31 +165,424 @@ override logic to the `getMaxScale` and `getMaxPrecision` methods. #### New features {: #new-features-1-38-0} +* [CALCITE-6603] + Lattice SQL supports generation of specified dialects +* [CALCITE-6560] + Allow types with negative scale +* [CALCITE-6576] + In `SET` clause of `UPDATE` statement, allow column identifiers to be prefixed + with table alias +* [CALCITE-6584] + Validate prefixed column identifiers in `SET` clause of `UPDATE` statement +* [CALCITE-4838] + Add `RoundingMode` in `RelDataTypeSystem` to specify the rounding behavior +* [CALCITE-6020] + Add planner rule, `class ProjectOverSumToSum0Rule`, that converts `SUM` to + `SUM0` +* [CALCITE-6372] + Add `ASOF` join +* [CALCITE-6519] + Support non-aggregate query that uses measure in `ORDER BY` +* [CALCITE-4496] + Measure columns (`SELECT ... AS MEASURE`) +* [CALCITE-5802] + In `RelBuilder`, add method `aggregateRex`, to allow aggregating complex + expressions such as "`1 + SUM(x + 2)`" +* [CALCITE-6444] + Add a function library for Amazon Redshift +* [CALCITE-6427] + Use a higher precision for `DECIMAL` intermediate results for some aggregate + functions like `STDDEV` +* [CALCITE-5855] + Support frame exclusion in window functions, e.g. + `OVER (... EXCLUDE CURRENT ROW)` +* [CALCITE-6365] + Support `RETURNING` clause of `JSON_QUERY` function + +New functions: +* [CALCITE-3592] + Implement `BITNOT` scalar function +* [CALCITE-6527] + Add `DATE_ADD` function (enabled in Spark library) +* [CALCITE-6549] + Add `LOG1P` function (enabled in Spark library) +* [CALCITE-3779] + Implement `BITAND`, `BITOR`, `BITXOR` scalar functions +* [CALCITE-3697] + Implement `BITCOUNT` scalar function +* [CALCITE-5807] + Add `SUBSTRING_INDEX` function (enabled in Spark library) +* [CALCITE-6396] + Add `ADD_MONTHS` function (enabled in Oracle, Spark library) +* [CALCITE-6310] + Add `REGEXP_REPLACE` function (enabled in Postgres library) +* [CALCITE-6472] + Add degree-based trigonometric functions to Postgres function library +* [CALCITE-6312] + Add `LOG` function (enabled in Postgres library) +* [CALCITE-6445] + Add `REVERSE` function (enabled in Spark library) +* [CALCITE-6449] + Enable Postgres implementations of `TO_DATE` and `TO_TIMESTAMP` functions +* [CALCITE-5634] + Enable `GREATEST`, `LEAST` functions in Postgres library +* [CALCITE-6446] + Add `CONCAT_WS` function (enabled in Spark library) +* [CALCITE-6454] + Implement array comparison operators +* [CALCITE-6325] + Add `LOG` function (enabled in MySQL and Spark library) +* [CALCITE-6392] + Support all Postgres 14 date/time patterns for `TO_DATE` and `TO_TIMESTAMP` +* [CALCITE-6441] + Add `BOOLAGG_AND`, `BOOLAGG_OR` aggregate functions (enabled in Snowflake + library) +* [CALCITE-6311] + Support Postgres `DATE_PART` function +* [CALCITE-6424] + Enable `RLIKE` function in MySQL library +* [CALCITE-6397] + Add `NVL2` function (enabled in Oracle, Spark library) +* [CALCITE-6358] + Support all Postgres 14 date/time patterns for `TO_CHAR` function +* [CALCITE-6313] + Add `POWER` function for Postgres +* [CALCITE-6483] + Enable `LEN` and `LENGTH` in the correct function libraries + #### Dependency version upgrade {: #dependency-1-38-0} +* [CALCITE-6587] + Support Java 23 and Guava 33.3.0; also upgrade + Hadoop from 2.7.5 to 2.10.2 +* [CALCITE-5737] + Support JDK 21 and JDK 22; also upgrade + asm from 7.2 to 9.6; + byte-buddy from 1.9.3 to 1.14.15; + forbiddenapis from 3.5.1 to 3.7; + mockito from 2.23.4 to 3.12.4 +* [CALCITE-6174] + Upgrade gradle from 7.6.1 to 8.7 + #### Bug-fixes, API changes and minor enhancements {: #fixes-1-38-0} +* [CALCITE-6620] + `VALUES` created by `RelBuilder` do not have a homogeneous type +* [CALCITE-6617] + `TypeCoercion` is not applied correctly to comparisons +* [CALCITE-6598] + In `interface RelDataTypeSystem`, deprecate methods `getMaxNumericScale` and + `getMaxNumericPrecision` +* [CALCITE-6599] + `RelMdPredicates` should pull up more predicates from `VALUES` when there are + several literals +* [CALCITE-6585] + In the Postgres `TO_CHAR` function, improve caching +* [CALCITE-6593] + `EnumerableHashJoin` throws `NullPointerException` when outer-joining tables + with many fields and unmatching rows +* [CALCITE-6600] + `AggregateJoinTransposeRule` throws `ArrayIndexOutOfBoundsException` when + applied on a `SemiJoin` +* [CALCITE-6595] + Preserve collation on non-distinct aggregate calls in + `AggregateExpandWithinDistinctRule` +* [CALCITE-6596] + Enable function-level cache by default +* [CALCITE-6498] + Elasticsearch multi-field mappings do not work +* [CALCITE-6374] + `LatticeSuggester` throws `NullPointerException` when aggregate call is covered + with `CAST` +* [CALCITE-6226] + Wrong `ISOWEEK` and no `ISOYEAR` in BigQuery `FORMAT_DATE` function +* [CALCITE-6522] + `MAP_KEYS` and `MAP_VALUES` functions should throw if a key value is null +* [CALCITE-6071] + `RexCall` should carry source position information for runtime error reporting +* [CALCITE-6581] + Incorrect `INTERVAL` math for `WEEK` and `QUARTER` +* Check for correlation variables in project when constructing aggregate in + `SqlToRelConverter.createAggImpl` +* [CALCITE-6550] + Improve SQL function overloading +* [CALCITE-6343] + Ensure that `AS` operator doesn't change return type of measures +* [CALCITE-6408] + Not-null `ThreadLocal` +* [CALCITE-6563] + `RelToSqlConverter` should not merge two window functions +* [CALCITE-6569] + `RelToSqlConverter` missing `IGNORE NULLS` for window function +* [CALCITE-6565] + JDBC adapter for MSSQL generates incorrect SQL for `CHAR` without precision +* [CALCITE-6557] + `AggregateMergeRule` throws `AssertionError` "type mismatch" +* [CALCITE-6559] + Query with measure that applies `AVG` to `SMALLINT` throws `AssertionError` + "Cannot add expression of different type to set" +* [CALCITE-4871] + `CAST` a literal to `DECIMAL` type returns wrong result +* [CALCITE-6555] + `RelBuilder.aggregateRex` wrongly thinks aggregate functions of "`GROUP BY ()`" + queries are `NOT NULL` +* [CALCITE-5613] + Assert for number of args for metadata methods at `CacheGeneratorUtil` +* Use `ACCEPT_SUB_QUERY` when parsing operands to square-bracketed array + constructor function +* [CALCITE-6543] + In `RelOptCostImpl`, change the `toString()` method to be consistent with + `VolcanoCost` +* [CALCITE-6547] + Result type inferred for `STDDEV_SAMP` is incorrect +* [CALCITE-6546] + In JDBC adapter for Hive, must generate an alias for a sub-query in the `FROM` + clause +* [CALCITE-4806] + Lossy `CAST` is incorrectly simplified +* [CALCITE-5883] + `ROWS` window aggregates ignore frames when there is no `ORDER BY` clause +* [CALCITE-6540] + `RelOptUtil.pushDownJoinConditions` does not correctly adjust the match + condition of an `ASOF` join +* [CALCITE-6534] + Adjust type when pulling up `Calc` in `JoinUnifyRule` +* [CALCITE-6533] + Division between `INTEGER` and `DECIMAL` produces incorrect result +* [CALCITE-6346] + JdbcAdapter loses cast for dynamic filter arguments +* [CALCITE-6501] + `AssertionError` in `JoinUnifyRule` due to type mismatch +* [CALCITE-6518] + `ClassCastException` during validation when loading multiple libraries +* [CALCITE-6464] + Type inference for `DECIMAL` division seems incorrect +* [CALCITE-6433] + `SUBSTRING` function can return incorrect empty result +* [CALCITE-6481] + Optimize `VALUES - UNION - VALUES` to a single `VALUES` the `IN`-list contains + `CAST` and it is converted to `VALUES` +* [CALCITE-6513] + `FilterProjectTransposeRule` may cause `OutOfMemoryError` when `Project` + expressions are complex +* [CALCITE-6471] + Improve performance of `SqlToRelConverter` by preventing unconditional + conversion of `SqlNode` instances to string for null-check messages +* [CALCITE-6480] + JDBC adapter for Oracle should not generate `CASE WHEN` expression that returns + a `BOOLEAN` value, because Oracle does not support it +* [CALCITE-6506] + Type inference for `IN`-list is incorrect +* [CALCITE-6478] + JSON functions should return `NULL` when input is `NULL` +* [CALCITE-6322] + Casts to `DECIMAL` types are ignored +* [CALCITE-3522] + `SqlValidator.validateLiteral` rejects literals with a `DECIMAL` type that + require more than 64 bits +* [CALCITE-6266] + `SqlValidatorException` with `LATERAL TABLE` and `JOIN` +* [CALCITE-6507] + Random functions are incorrectly considered deterministic +* [CALCITE-6502] + Parser loses position information for `Expression3` +* [CALCITE-6473] + `HAVING` clauses may not contain window functions +* [CALCITE-6482] + Oracle dialect convert `BOOLEAN` literal when version < 23 +* [CALCITE-6495] + Allow `ProjectSetOpTransposeRule` to work with any subclass of `Project` +* [CALCITE-6485] + `AssertionError` when an `IN`-list containing `NULL` has an implicit coercion + type converter +* [CALCITE-6169] + `EnumUtils.convert` does not implement the correct SQL cast semantics +* [CALCITE-6218] + `RelToSqlConverter` fails to convert correlated lateral joins +* [CALCITE-6488] + Ensure collations created by `RelCollations` are canonized once +* [CALCITE-6295] + Support `IS NOT NULL` in Arrow adapter +* [CALCITE-6296] + Support `IS NULL` in Arrow adapter +* [CALCITE-6475] + `RelToSqlConverter` fails when the `IN`-list contains `NULL` and it is + converted to `VALUES` +* [CALCITE-6474] + `Aggregate` with constant key can get a `RowCount` greater than its + `MaxRowCount` +* [CALCITE-6450] + Postgres `CONCAT_WS` function throws exception when parameter type is + `(, )` +* [CALCITE-6462] + `VolcanoPlanner` internal valid may throw exception when log trace is enabled +* [CALCITE-6468] + `RelDecorrelator` throws `AssertionError` if correlated variable is used as + `Aggregate` group key +* [CALCITE-3094] + Code of method grows beyond 64 KB when joining two tables with many fields +* [CALCITE-6453] + Simplify casts which are result of constant reduction +* [CALCITE-6388] + `PsTableFunction` throws `NumberFormatException` when the `user` column has + spaces +* [CALCITE-6435] + `SqlToRelConverter` incorrectly simplifies some `IN` expressions +* [CALCITE-6460] + `SortRemoveConstantKeysRule` fails with `AssertionError` due to mismatched + collation on resulting `Sort` +* [CALCITE-6401] + JDBC adapter cannot push down `JOIN` whose condition includes `IS TRUE`, + `IS NULL`, dynamic parameter, `CAST`, literal comparison +* [CALCITE-6436] + JDBC adapter generates SQL missing parentheses when comparing 3 values with + the same precedence, such as "`(a = b) = c`" +* [CALCITE-6369] + Expanding `*` (star) gives `ArrayIndexOutOfBoundsException` with redundant + columns and `USING` +* [CALCITE-6442] + Validator rejects `FILTER` in `OVER` windows +* [CALCITE-6380] + Casts from `INTERVAL` and `STRING` to `DECIMAL` are incorrect +* [CALCITE-6008] + `ARRAY_AGG` should return `ARRAY NULL` when there are no input rows +* [CALCITE-6414] + JDBC adapter should generate `BOOLOR_AGG`, `BOOLAND_AGG` for `MAX`, `MIN` on + `BOOLEAN` values in Snowflake dialect +* [CALCITE-6434] + JDBC adapter generates wrong SQL for Spark and Hive because it fails to quote + an identifier containing "`$`" +* [CALCITE-6426] + JDBC adapter for StarRocks generates invalid SQL for `INT` and `BIGINT` types +* [CALCITE-6430] + JDBC adapter for Postgres, MySQL and HSQLDB generates incorrect SQL for + `SINGLE_VALUE` when the sub-query returns one not-`NULL` value and `NULL` value +* [CALCITE-6429] + Arrow adapter should default to the Enumerable convention for unsupported + filters +* [CALCITE-6370] + `AS` operator problems with `USING` clause +* [CALCITE-6422] + Query with "`<>`" throws `NullPointerException` during materialized view + matching +* [CALCITE-6423] + JDBC adapter for MySQL generates invalid SQL for `CHAR` without precision +* [CALCITE-6244] + Improve `Expressions#constant` to allow Java records +* [CALCITE-6419] + JDBC adapter for Hive and Spark generates invalid SQL for `VARCHAR` without + precision +* [CALCITE-6417] + JDBC adapter for Hive generates wrong SQL for `MAP` and `ARRAY` value + constructors +* [CALCITE-6416] + Remove unnecessary `SUBSTRING` rewrite in `SparkSqlDialect` +* [CALCITE-6415] + Invalid unparse for `TIMESTAMP` with `HiveSqlDialect` +* [CALCITE-6340] + `RelBuilder` drops traits when aggregating over duplicate projected fields +* [CALCITE-6400] + `MAP_ENTRIES` function should throw if a key value is null +* [CALCITE-6389] + `RexBuilder.removeCastFromLiteral` does not preserve semantics for some types of + literal +* [CALCITE-6382] + Type inference for `SqlLeadLagAggFunction` is incorrect +* [CALCITE-6395] + Significant precision loss when representing `REAL` literals +* [CALCITE-6377] + `TIME` expression causes `IllegalStateException` +* [CALCITE-6361] + `Uncollect.deriveUncollectRowType` throws `AssertionError` if the input value + is not a collection +* [CALCITE-6376] + Selecting 6 columns with `QUALIFY` operation results in exception + #### Build and test suite {: #build-1-38-0} +* [CALCITE-6609] + Remove redundant warning suppression for Guava's `Beta` and `Unstable` APIs +* [CALCITE-6493] + Add MySQL and other professional term restrictions +* [CALCITE-6580] + Remove uses of method `Locale.setDefault` +* Try automatically marking PRs as stale +* [CALCITE-6572] + Add more tests for `NULL` arguments to `TO_CHAR` functions +* Add tests for year month intervals +* Add `cast.iq`, a Quidem test for `CAST` +* [CALCITE-6552] + Enable CheckerFramework in 'server' module +* Remove `FENNEL_VM`; enable some disabled tests +* [CALCITE-6526] + Refactor `DEVELOCITY_ACCESS_KEY` definition in one place +* [CALCITE-5034] + Remove unused remote S3 build cache +* Enable more tests in `RelBuilderExample` +* [CALCITE-6515] + Remove constants describing which bugs have been fixed in Bug +* [CALCITE-6514] + Enable tests about `AssertionError` while translating `IN`-list that contains + `NULL` +* [CALCITE-6496] + Enable tests from `outer.iq` +* [CALCITE-6490] + Missing tests for `SqlFunctions.overlay` +* [CALCITE-6511] + Migrate from Gradle Enterprise Gradle Plugin to Develocity Gradle Plugin +* [CALCITE-6484] + Sonar analysis fails intermittently due to `OutOfMemoryError` +* [CALCITE-6497] + Use helper setup method throughout whole `ElasticsearchAdapterTest` +* Add Steelwheels data set +* [CALCITE-6470] + Run specific JMH benchmarks without modifying sources +* [CALCITE-6466] + Add benchmark for SQL parser instantiation +* Add `testSortRemoveConstantKeyWhenOrderByIsNull` in `RelOptRulesTest` +* Test case for + [CALCITE-4921] + Nested `NATURAL JOIN` or `JOIN` with `USING` can't find common column +* Remove conditional `stream.iq` execution + #### Web site and documentation {: #site-1-38-0} ---> + +* [CALCITE-6531] + Correct Javadoc example in `SqlStaticAggFunction.constant` +* Change Mihai Budiu's role +* [CALCITE-6487] + `TRIM` function documentation refers to `string1` two times +* Improve `OVERLAY` operator docs and fix typo in exception +* Document `MAP` types in grammar +* [CALCITE-6428] + Typo in adapter documentation +* [CALCITE-6383] + `class SameOperandTypeChecker` is incorrectly documented ## 1.37.0 / 2024-05-06 {: #v1-37-0} This release comes 5 months after [1.36.0](#v1-36-0), -contains contributions from 46 contributors, and resolves 138 issues. It's worth highlighting the -introduction of adapter for Apache Arrow ([CALCITE-2040]), -StarRocks dialect ([CALCITE-6257]). -The release also added support for lambda expressions in SQL ([CALCITE-3679]), -'Must-filter' columns ([CALCITE-6219]). -For table function calls it is now possible to use them without `TABLE()` wrapper in `FROM` ([CALCITE-6254]). -Furthermore, there is support for optional `FORMAT` of `CAST` operator from SQL:2016 ([CALCITE-6254]) -and more than 15 new SQL functions in various libraries such as BigQuery, PostgreSQL and Spark. +contains contributions from 46 contributors, and resolves 138 issues. +It's worth highlighting the introduction of adapter for Apache Arrow +([CALCITE-2040]), +StarRocks dialect +([CALCITE-6257]). +The release also added support for lambda expressions in SQL +([CALCITE-3679]), +'must-filter' columns +([CALCITE-6219]). +For table function calls it is now possible to use them without `TABLE()` wrapper +in `FROM` +([CALCITE-6254]). +Furthermore, there is support for optional `FORMAT` of `CAST` operator from SQL:2016 +([CALCITE-6254]) +and more than 15 new SQL functions in various libraries such as BigQuery, +Postgres and Spark. Contributors to this release: abhishekagarwal87, @@ -152,243 +632,267 @@ Zhengqiang Duan, zhujiang, zstan. +Compatibility: This release is tested on Linux, macOS, Microsoft Windows; +using JDK/OpenJDK versions 8 to 19; +Guava versions 21.0 to 32.1.3-jre; +other software versions as specified in gradle.properties. + #### Breaking Changes {: #breaking-1-37-0} -* In the context of [CALCITE-6015] -the visibility of the method `SqlCall.getCallSignature` has been converted from `protected` to `public`. - Any subclass overriding it will need to be adjusted accordingly. +* In the context of + [CALCITE-6015] + the visibility of the method `SqlCall.getCallSignature` has been converted + from `protected` to `public`. + Any subclass overriding it will need to be adjusted accordingly. * [CALCITE-6321] - Add `copy(List)` method to `Window` class + Add `copy(List)` method to `Window` class * As a consequence of the support for lambda expressions - ([CALCITE-3679]) - new methods have been added to `RexVisitor`and `RexBiVisitor`; - any class implementing one of them will have to implement the new methods. - -Compatibility: This release is tested on Linux, macOS, Microsoft Windows; -using JDK/OpenJDK versions 8 to 19; -Guava versions 21.0 to 32.1.3-jre; -other software versions as specified in gradle.properties. + ([CALCITE-3679]) + new methods have been added to `RexVisitor`and `RexBiVisitor`; + any class implementing one of them will have to implement the new methods. #### New features {: #new-features-1-37-0} + * Supporting new functions * [CALCITE-6205] - Add `BITAND_AGG`, `BITOR_AGG` functions (enabled in Snowflake library) + Add `BITAND_AGG`, `BITOR_AGG` functions (enabled in Snowflake library) * [CALCITE-6156] - Add `ENDSWITH`, `STARTSWITH` functions (enabled in Postgres, Snowflake libraries) + Add `ENDSWITH`, `STARTSWITH` functions (enabled in Postgres, Snowflake libraries) * [CALCITE-6116] - Add `EXISTS` function (enabled in Spark library) + Add `EXISTS` function (enabled in Spark library) * [CALCITE-6182] - Add `LENGTH`/`LEN` functions (enabled in Snowflake library) + Add `LENGTH`/`LEN` functions (enabled in Snowflake library) * [CALCITE-6224] - Add `LOG2` function (enabled in MySQL, Spark library) + Add `LOG2` function (enabled in MySQL, Spark library) * [CALCITE-6223] - Add `MAP_CONTAINS_KEY` function (enabled in Spark library) + Add `MAP_CONTAINS_KEY` function (enabled in Spark library) * [CALCITE-6314] - Add `RANDOM` function (enabled in Postgres library) + Add `RANDOM` function (enabled in Postgres library) * [CALCITE-6315] - Support PostgreSQL `TO_CHAR`, `TO_DATE`, `TO_TIMESTAMP` + Support Postgres `TO_CHAR`, `TO_DATE`, `TO_TIMESTAMP` * [CALCITE-6278] - Add `REGEXP`, `REGEXP_LIKE` function (enabled in Spark library) + Add `REGEXP`, `REGEXP_LIKE` function (enabled in Spark library) * [CALCITE-6309] - Add `REGEXP_LIKE` function (enabled in MySQL, Oracle, PostgreSQL and Spark libraries) + Add `REGEXP_LIKE` function (enabled in MySQL, Oracle, Postgres and Spark + libraries) * [CALCITE-6179] - Support `WEEKOFMONTH` function format and add test + Support `WEEKOFMONTH` function format and add test * [CALCITE-6215] - Support century format datetime/timestamp in pg + Support century format datetime/timestamp in pg * [CALCITE-6268] - Support implementing custom `JdbcSchema` + Support implementing custom `JdbcSchema` * [CALCITE-6255] - Support BigQuery-style `JSON_OBJECT` invocation syntax + Support BigQuery-style `JSON_OBJECT` invocation syntax * [CALCITE-6219] - 'Must-filter' columns + 'Must-filter' columns * [CALCITE-2980] - Implement the `FORMAT` clause of the `CAST` operator + Implement the `FORMAT` clause of the `CAST` operator * [CALCITE-3679] - Allow lambda expressions in SQL queries + Allow lambda expressions in SQL queries * [CALCITE-3329] - Implement osquery for OS adapter + Implement osquery for OS adapter * [CALCITE-2040] - Create adapter for Apache Arrow + Create adapter for Apache Arrow * [CALCITE-6257] - StarRocks dialect implementation + StarRocks dialect implementation * [CALCITE-6254] - Support table function calls in `FROM` clause without `TABLE()` wrapper + Support table function calls in `FROM` clause without `TABLE()` wrapper * [CALCITE-6138] - Add parser support for `TIME WITH TIME ZONE` and `TIMESTAMP WITH TIME ZONE` as a data type + Add parser support for `TIME WITH TIME ZONE` and `TIMESTAMP WITH TIME ZONE` as + a data type #### Dependency version upgrade {: #dependency-1-37-0} * [CALCITE-6124] - Bump json-path from 2.7.0 to 2.8.0 + Bump json-path from 2.7.0 to 2.8.0 * [CALCITE-6229] - Bump json-path from 2.8.0 to 2.9.0 + Bump json-path from 2.8.0 to 2.9.0 * [CALCITE-6378] - Bump Redis Docker image from 2.8.19 to 7.2.4 + Bump Redis Docker image from 2.8.19 to 7.2.4 * [CALCITE-6356] - Upgrade Calcite to Avatica 1.25.0 + Upgrade Calcite to Avatica 1.25.0 * [CALCITE-6243] - Upgrade Cassandra to 4.1.3 and DataStax driver for Cassandra to 4.17.0 + Upgrade Cassandra to 4.1.3 and DataStax driver for Cassandra to 4.17.0 * [CALCITE-6181] - Upgrade Janino from 3.1.9 to 3.1.11 + Upgrade Janino from 3.1.9 to 3.1.11 * [CALCITE-6119] - Upgrade testcontainers to 1.19.3 + Upgrade testcontainers to 1.19.3 * [CALCITE-6081] - Remove bouncycastle dependency + Remove bouncycastle dependency #### Bug-fixes, API changes and minor enhancements {: #fixes-1-37-0} * [CALCITE-6355] - `RelToSqlConverter[ORDER BY]` generates an incorrect order by when `NULLS LAST` is used in non-projected field + `RelToSqlConverter[ORDER BY]` generates an incorrect order by when + `NULLS LAST` is used in non-projected field * [CALCITE-6210] - Cast to `VARBINARY` causes an assertion failure + Cast to `VARBINARY` causes an assertion failure * [CALCITE-5289] - Assertion failure in `MultiJoinOptimizeBushyRule` + Assertion failure in `MultiJoinOptimizeBushyRule` * [CALCITE-6345] - Intervals with more than 100 years are not supported + Intervals with more than 100 years are not supported * [CALCITE-6265] - Type coercion is failing for numeric values in prepared statements (follow-up) + Type coercion is failing for numeric values in prepared statements (follow-up) * [CALCITE-6248] - Illegal dates are accepted by casts + Illegal dates are accepted by casts * [CALCITE-6282] - Avatica ignores time precision when returning `TIME` results + Avatica ignores time precision when returning `TIME` results * [CALCITE-6338] - `RelMdCollation#project` can return an incomplete list of collations in the presence of aliasing + `RelMdCollation#project` can return an incomplete list of collations in the + presence of aliasing * [CALCITE-5976] - Function `ARRAY_PREPEND`/`ARRAY_APPEND`/`ARRAY_INSERT` gives exception when inserted element type not equals array component type + Function `ARRAY_PREPEND`/`ARRAY_APPEND`/`ARRAY_INSERT` gives exception when + inserted element type not equals array component type * [CALCITE-6349] - `CoreRules.PROJECT_REDUCE_EXPRESSIONS` crashes on expressions with `ARRAY_REPEAT` + `CoreRules.PROJECT_REDUCE_EXPRESSIONS` crashes on expressions with `ARRAY_REPEAT` * [CALCITE-6333] - `NullPointerException` in `AggregateExpandDistinctAggregatesRule.doRewrite` when rewriting filtered distinct aggregation + `NullPointerException` in `AggregateExpandDistinctAggregatesRule.doRewrite` + when rewriting filtered distinct aggregation * [CALCITE-6285] - Function `ARRAY_INSERT` produces an incorrect result for negative indices + Function `ARRAY_INSERT` produces an incorrect result for negative indices * [CALCITE-6015] - `AssertionError` during optimization of `EXTRACT` expression + `AssertionError` during optimization of `EXTRACT` expression * [CALCITE-6317] - Incorrect constant replacement when group keys are `NULL` + Incorrect constant replacement when group keys are `NULL` * [CALCITE-6348] - `ARRAY_OVERLAP` with a `NULL` argument crashes the compiler + `ARRAY_OVERLAP` with a `NULL` argument crashes the compiler * [CALCITE-6347] - `ARRAY_REPEAT` with a string argument causes a compiler crash + `ARRAY_REPEAT` with a string argument causes a compiler crash * [CALCITE-6127] - The spark array function gives `NullPointerException` when element is row type + The spark array function gives `NullPointerException` when element is row type * [CALCITE-6074] - The size of `REAL`, `DOUBLE`, and `FLOAT` is not consistent + The size of `REAL`, `DOUBLE`, and `FLOAT` is not consistent * [CALCITE-6115] - Interval type specifier with zero fractional second precision does not pass validation + Interval type specifier with zero fractional second precision does not pass + validation * [CALCITE-5955] - BigQuery `PERCENTILE` functions are unparsed incorrectly + BigQuery `PERCENTILE` functions are unparsed incorrectly * [CALCITE-6048] - `ServerTest#testTruncateTable` fails intermittently due to method not found exception + `ServerTest#testTruncateTable` fails intermittently due to method not found + exception * [CALCITE-5811] - Error messages produced for constant out-of-bounds arguments are confusing + Error messages produced for constant out-of-bounds arguments are confusing * [CALCITE-6128] - `RelBuilder.limit` should apply offset and fetch to previous Sort operator, if possible + `RelBuilder.limit` should apply offset and fetch to previous Sort operator, + if possible * [CALCITE-6118] - Missing empty `ARRAY` function usage in reference doc + Missing empty `ARRAY` function usage in reference doc * [CALCITE-6121] - Invalid unparse for `TIMESTAMP` with `SparkSqlDialect` + Invalid unparse for `TIMESTAMP` with `SparkSqlDialect` * [CALCITE-6109] - Linq4j `OptimizeShuttle` should not create new instances of `TernaryExpression` if it does not do any optimization + Linq4j `OptimizeShuttle` should not create new instances of + `TernaryExpression` if it does not do any optimization * [CALCITE-6095] - Arithmetic expression with `VARBINARY` value causes AssertionFailure + Arithmetic expression with `VARBINARY` value causes AssertionFailure * [CALCITE-6150] - JDBC adapter for ClickHouse generates incorrect SQL for certain units in the `EXTRACT` function + JDBC adapter for ClickHouse generates incorrect SQL for certain units in the + `EXTRACT` function * [CALCITE-6117] - Converting `SAFE_CAST` from `RexCall` to `SqlCall` fails to add the type as an argument + Converting `SAFE_CAST` from `RexCall` to `SqlCall` fails to add the type as an + argument * [CALCITE-6211] - `SUBSTRING` with `Integer.MIN_VALUE` as a second parameter raise unexpected exception + `SUBSTRING` with `Integer.MIN_VALUE` as a second parameter raise unexpected + exception * [CALCITE-6213] - The default behavior of `NullCollation` in Presto is `LAST` + The default behavior of `NullCollation` in Presto is `LAST` * [CALCITE-6227] - `ELEMENT(NULL)` causes an assertion failure + `ELEMENT(NULL)` causes an assertion failure * [CALCITE-6168] - `RexExecutor` can throw during compilation + `RexExecutor` can throw during compilation * [CALCITE-5130] - `AssertionError`: "Conversion to relational algebra failed to preserve datatypes" when union `VARCHAR` literal and `CAST(null AS INTEGER)` + `AssertionError`: "Conversion to relational algebra failed to preserve datatypes" + when union `VARCHAR` literal and `CAST(null AS INTEGER)` * [CALCITE-6178] - `WITH RECURSIVE` query when cloned using `SqlShuttle` looses `RECURSIVE` property + `WITH RECURSIVE` query when cloned using `SqlShuttle` looses `RECURSIVE` property * [CALCITE-6332] - Optimization `CoreRules.AGGREGATE_EXPAND_DISTINCT_AGGREGATES_TO_JOIN` produces incorrect results for aggregates with groupSets + Optimization `CoreRules.AGGREGATE_EXPAND_DISTINCT_AGGREGATES_TO_JOIN` produces + incorrect results for aggregates with groupSets * [CALCITE-6353] - Optimization `CoreRules.PROJECT_REDUCE_EXPRESSIONS` crashes while optimizing `ARRAY_CONCAT` expression + Optimization `CoreRules.PROJECT_REDUCE_EXPRESSIONS` crashes while optimizing + `ARRAY_CONCAT` expression * [CALCITE-6262] - `CURRENT_TIMESTAMP(P)` ignores `DataTypeSystem#getMaxPrecision` + `CURRENT_TIMESTAMP(P)` ignores `DataTypeSystem#getMaxPrecision` * [CALCITE-6283] - Function `ARRAY_APPEND` with a `NULL` array argument crashes with `NullPointerException` + Function `ARRAY_APPEND` with a `NULL` array argument crashes with + `NullPointerException` * [CALCITE-6306] - JDBC adapter should not generate `FILTER` (`WHERE`) in MySQL and StarRocks dialect + JDBC adapter should not generate `FILTER` (`WHERE`) in MySQL and StarRocks dialect * [CALCITE-5893] - Wrong `NULL` operand behavior of `ARRAY_CONTAINS`/`ARRAY_EXCEPT`/`ARRAY_INTERSECT` In Spark Library + Wrong `NULL` operand behavior of + `ARRAY_CONTAINS`/`ARRAY_EXCEPT`/`ARRAY_INTERSECT` in Spark library * [CALCITE-6290] - Incorrect return type for BigQuery `TRUNC` + Incorrect return type for BigQuery `TRUNC` * [CALCITE-6252] - BigQuery `FORMAT_DATE` uses the wrong calendar for Julian dates + BigQuery `FORMAT_DATE` uses the wrong calendar for Julian dates * [CALCITE-6214] - Remove `DISTINCT` in aggregate function if field is unique + Remove `DISTINCT` in aggregate function if field is unique * [CALCITE-6258] - Map value constructor is unparsed incorrectly for `PrestoSqlDialect` + Map value constructor is unparsed incorrectly for `PrestoSqlDialect` * [CALCITE-6249] - `RelNode::estimatedRowCount` should not be used in `computeSelfCost` + `RelNode::estimatedRowCount` should not be used in `computeSelfCost` * [CALCITE-6251] - `InnerEnumerator` in `EnumerableDefaults::correlateBatchJoin` is not closed + `InnerEnumerator` in `EnumerableDefaults::correlateBatchJoin` is not closed * [CALCITE-6247] - BigQuery `FORMAT_DATE` function handles incorrectly the `%e` format specifier + BigQuery `FORMAT_DATE` function handles incorrectly the `%e` format specifier * [CALCITE-6238] - Exception while evaluating `ROUND`/`TRUNCATE` functions + Exception while evaluating `ROUND`/`TRUNCATE` functions * [CALCITE-6228] - `ELEMENT` function infers incorrect return type + `ELEMENT` function infers incorrect return type * [CALCITE-5647] - `RelMdPopulationSize` should use `mq.getRowCount(rel)` instead of `rel.estimateRowCount(mq)` + `RelMdPopulationSize` should use `mq.getRowCount(rel)` instead of + `rel.estimateRowCount(mq)` * [CALCITE-6241] - Enable a few existing functions to Spark library + Enable a few existing functions to Spark library * [CALCITE-6094] - `Linq4j.ConstantExpression.write` crashes on special FP values + `Linq4j.ConstantExpression.write` crashes on special FP values * [CALCITE-6190] - Incorrect precision derivation for negative numeric types + Incorrect precision derivation for negative numeric types * [CALCITE-6202] - `sqlsh` does not print error message when query fails + `sqlsh` does not print error message when query fails * [CALCITE-6200] - `RelJson` throw `UnsupportedOperationException` for `RexDynamicParam` + `RelJson` throw `UnsupportedOperationException` for `RexDynamicParam` * [CALCITE-6044] - `RelMetadataQuery` should regard single-row relational expressions as unique + `RelMetadataQuery` should regard single-row relational expressions as unique * [CALCITE-5846] - Preserve filters on non-distinct aggCalls in `AggregateExpandWithinDistinctRule` + Preserve filters on non-distinct aggCalls in `AggregateExpandWithinDistinctRule` * [CALCITE-6100] - The `equalsDeep` of `SqlRowTypeNameSpec` should use `equalsDeep` for fieldTypes rather than reference comparison + The `equalsDeep` of `SqlRowTypeNameSpec` should use `equalsDeep` for fieldTypes + rather than reference comparison * [CALCITE-6183] - The second parameter of `RexProgramBuilder#registerInternal` is always false + The second parameter of `RexProgramBuilder#registerInternal` is always false * [CALCITE-6149] - Unparse for `CAST` Nullable with `ClickHouseSqlDialect` + Unparse for `CAST` Nullable with `ClickHouseSqlDialect` * [CALCITE-5649] - Get row count statistics from `ReflectiveSchema` + Get row count statistics from `ReflectiveSchema` * [CALCITE-6220] - Rewrite `MIN`/`MAX(bool)` as `BOOL_AND`/`BOOL_OR` for Postgres, Redshift + Rewrite `MIN`/`MAX(bool)` as `BOOL_AND`/`BOOL_OR` for Postgres, Redshift * [CALCITE-6321] - Add `copy(List)` method to Window class + Add `copy(List)` method to Window class * [CALCITE-6337] - Distinguish naked measure support between inside and outside aggregation + Distinguish naked measure support between inside and outside aggregation * [CALCITE-6323] - Serialize return type during `RelJson.toJson(RexNode node)` for `SqlKind.SAFE_CAST` + Serialize return type during `RelJson.toJson(RexNode node)` for `SqlKind.SAFE_CAST` * [CALCITE-6111] - Explicit cast from expression to numeric type doesn't check overflow + Explicit cast from expression to numeric type doesn't check overflow * [CALCITE-6162] - Add rule(s) to remove joins with constant single tuple relations + Add rule(s) to remove joins with constant single tuple relations * [CALCITE-6192] - `DEFAULT` expression with `NULL` value throws unexpected exception + `DEFAULT` expression with `NULL` value throws unexpected exception * [CALCITE-6147] - `CAST(CAST(EMPNO AS VARCHAR) AS INT)` should be simplified to `EMPNO` + `CAST(CAST(EMPNO AS VARCHAR) AS INT)` should be simplified to `EMPNO` * [CALCITE-6102] - `SqlWriter` in `SqlInsert`'s unparse start a list but does not end it + `SqlWriter` in `SqlInsert`'s unparse start a list but does not end it * [CALCITE-5607] - Serialize return type during `RelJson.toJson(RexNode node)` for `SqlKind.MINUS` + Serialize return type during `RelJson.toJson(RexNode node)` for `SqlKind.MINUS` * [CALCITE-6269] Fix missing/broken BigQuery date-time format elements * [CALCITE-6231] JDBC adapter generates `UNNEST` when it should generate `UNNEST ... WITH ORDINALITY` * [CALCITE-6208] - Update `JSON_VALUE` return type inference to make explicit array return types be nullable with nullable elements + Update `JSON_VALUE` return type inference to make explicit array return types + be nullable with nullable elements * [CALCITE-6199] Trim unused fields for `SNAPSHOT` and `SAMPLE` if table has `VIRTUAL` column * [CALCITE-6063] @@ -399,37 +903,38 @@ other software versions as specified in gradle.properties. #### Build and test suite {: #build-1-37-0} * [CALCITE-6103] - Use eclipse-temurin image to build and publish javadocs for the website + Use eclipse-temurin image to build and publish javadocs for the website * [CALCITE-6131] - There are duplicate sample tests in `SqlTypeUtilTest` + There are duplicate sample tests in `SqlTypeUtilTest` * [CALCITE-6125] - Automate generation of contributor names in release notes by adding a git mailmap file + Automate generation of contributor names in release notes by adding a git + mailmap file * [CALCITE-6165] - Add `DATE_ADD` test and `DATE_DIFF` test on `SqlOperatorTest` + Add `DATE_ADD` test and `DATE_DIFF` test on `SqlOperatorTest` * [CALCITE-6184] - Add `checkNullTest` on `SqlOperatorTest` + Add `checkNullTest` on `SqlOperatorTest` * [CALCITE-6187] - Linter should disallow tags such as `[MINOR]` in commit messages + Linter should disallow tags such as `[MINOR]` in commit messages * [CALCITE-6273] - Add sqrt negative test in `SqlOperatorTest` + Add sqrt negative test in `SqlOperatorTest` * [CALCITE-6189] - Improve `FormatElementEnumTest` + Improve `FormatElementEnumTest` * [CALCITE-6234] - Add tests on `SqlOperatorTest` for `to_char` function + Add tests on `SqlOperatorTest` for `to_char` function * [CALCITE-6172] - Allow aliased operators to re-use existing tests + Allow aliased operators to re-use existing tests * [CALCITE-6359] - Update GitHub Actions workflows to use docker compose v2 + Update GitHub Actions workflows to use docker compose v2 * [CALCITE-6092] - Skip breaking `CAST` String to `TIME` tests until fixed in Avatica 1.24.0 + Skip breaking `CAST` String to `TIME` tests until fixed in Avatica 1.24.0 * [CALCITE-6384] - Add ASF header to `buildcache.yml`, `gradle-wrapper-validation.yml` + Add ASF header to `buildcache.yml`, `gradle-wrapper-validation.yml` * [CALCITE-6385] - LintTest fails when run in source distribution + LintTest fails when run in source distribution * [CALCITE-6387] - Make Arrow adapter passing tests with jdk17+ + Make Arrow adapter passing tests with jdk17+ * [CALCITE-6390] - Exclude Arrow project on Windows builds + Exclude Arrow project on Windows builds #### Web site and documentation {: #site-1-37-0} @@ -437,26 +942,27 @@ other software versions as specified in gradle.properties. * Site: Troubleshooting/Website publishing improvements in release guide * Site: Remove committer by request process * [CALCITE-6083] - On web site, ensure contributors file is sorted + On web site, ensure contributors file is sorted * [CALCITE-6098] - Update `LICENSE` and `NOTICE` for Jekyll website template + Update `LICENSE` and `NOTICE` for Jekyll website template * [CALCITE-6250] - Limitations of MongoDB adapter are not documented + Limitations of MongoDB adapter are not documented * [CALCITE-6256] - Incorrect rendering of HTML on InnoDB adapter page + Incorrect rendering of HTML on InnoDB adapter page * Add `.gitignore` and `.ratignore` for jenv * [CALCITE-6097] - Gridism CSS dependency is mispelled in `LICENSE` + Gridism CSS dependency is mispelled in `LICENSE` * [CALCITE-6096] - Remove obsolete html5shiv and respond entries from `LICENSE` + Remove obsolete html5shiv and respond entries from `LICENSE` * [CALCITE-6194] - Contributor rules do not give instructions about how to quote commits + Contributor rules do not give instructions about how to quote commits * [CALCITE-6212] - Config `locale = 'en_US'` for javadoc task + Config `locale = 'en_US'` for javadoc task * [CALCITE-6316] - Update Javadoc for `RelWriterTest#testDeserializeMinusDateOperator` + Update Javadoc for `RelWriterTest#testDeserializeMinusDateOperator` * [CALCITE-6105] - Documentation does not specify the behavior of `SPLIT` function for empty string arguments + Documentation does not specify the behavior of `SPLIT` function for empty + string arguments ## 1.36.0 / 2023-11-10 {: #v1-36-0} @@ -464,19 +970,23 @@ other software versions as specified in gradle.properties. This release comes 3 months after [1.35.0](#v1-35-0), contains contributions from 30 contributors, and resolves 125 issues. -Among other new features, it's worth highlighting the adding of 30 new SQL functions in various libraries such as BigQuery and Spark, many improvements hardening `TABLESAMPLE` , and also the following features: +Among other new features, it's worth highlighting the adding of 30 new +SQL functions in various libraries such as BigQuery and Spark, many +improvements hardening `TABLESAMPLE`, and also the following features: * [CALCITE-129] - Support recursive `WITH` queries + Support recursive `WITH` queries * [CALCITE-6022] - Support `CREATE TABLE ... LIKE DDL` in server module + Support `CREATE TABLE ... LIKE DDL` in server module * [CALCITE-5962] - Support parse Spark-style syntax `LEFT ANTI JOIN` in Babel parser + Support parse Spark-style syntax `LEFT ANTI JOIN` in Babel parser * [CALCITE-5184] - Support `LIMIT start, ALL` in MySQL conformance, equivalent to `OFFSET start` + Support `LIMIT start, ALL` in MySQL conformance, equivalent to `OFFSET start` * [CALCITE-5889] - Add a `RelRule` that converts `Minus` into `UNION ALL..GROUP BY...WHERE` + Add a `RelRule` that converts `Minus` into `UNION ALL..GROUP BY...WHERE` -In addition to new features, it's also worth highlighting the integrating of SQL Logic Test suite +In addition to new features, it's also worth highlighting the +integrating of +SQL Logic Test suite. Contributors to this release: Benchao Li (release manager), @@ -510,261 +1020,286 @@ ZhangJian He, Zhengqiang Duan, Zoltan Haindrich. -#### Breaking Changes -{: #breaking-1-36-0} - Compatibility: This release is tested on Linux, macOS, Microsoft Windows; using JDK/OpenJDK versions 8 to 19; Guava versions 21.0 to 32.1.3-jre; other software versions as specified in gradle.properties. +#### Breaking Changes +{: #breaking-1-36-0} + +None. + #### New features {: #new-features-1-36-0} * Supporting new SQL functions in BigQuery, Hive and Spark libraries: - * [CALCITE-5826] + * [CALCITE-5826] Add `FIND_IN_SET` function (enabled in Hive and Spark libraries) - * [CALCITE-5979] + * [CALCITE-5979] Enable `REGEXP_REPLACE` function in BigQuery library - * [CALCITE-6077] + * [CALCITE-6077] Add `FACTORIAL` function (enabled in Hive and Spark libraries) - * [CALCITE-5918] + * [CALCITE-5918] Add `MAP` function (enabled in Spark library) - * [CALCITE-5825] + * [CALCITE-5825] Add `URL_ENCODE` and `URL_DECODE` function (enabled in Spark library) - * [CALCITE-6021] + * [CALCITE-6021] Add `CURRENT_DATETIME` function (enabled in BigQuery library) - * [CALCITE-5993] + * [CALCITE-5993] Add `CODE_POINTS_TO_STRING`, `TO_CODE_POINTS` function (enabled in BigQuery library) - * [CALCITE-5978] + * [CALCITE-5978] Add `REGEXP_INSTR` function (enabled in BigQuery library) - * [CALCITE-5935] + * [CALCITE-5935] Add `CODE_POINTS_TO_BYTES` function (enabled in BigQuery library) - * [CALCITE-5933] + * [CALCITE-5933] Add `SAFE_DIVIDE` function (enabled in BigQuery library) - * [CALCITE-5821] + * [CALCITE-5821] Add `FORMAT_NUMBER` function (enabled in Hive and Spark library) - * [CALCITE-5911] + * [CALCITE-5911] Add `REGEXP_EXTRACT_ALL` function (enabled in BigQuery library) - * [CALCITE-5910] + * [CALCITE-5910] Add `REGEXP_EXTRACT` and `REGEXP_SUBSTR` functions (enabled in BigQuery library) - * [CALCITE-5766] + * [CALCITE-5766] Add `SAFE_NEGATE` function (enabled for BigQuery library) - * [CALCITE-5770] + * [CALCITE-5770] Add `SAFE_SUBTRACT` function (enabled in BigQuery library) - * [CALCITE-5848] + * [CALCITE-5848] Add `BIT_GET` and `GETBIT` functions (enabled in Spark library) - * [CALCITE-5644] + * [CALCITE-5644] Add `CONTAINS_SUBSTR` function (enabled in BigQuery library) - * [CALCITE-5640] + * [CALCITE-5640] Add `SAFE_ADD` function (enabled in BigQuery library) - * [CALCITE-5830] + * [CALCITE-5830] Add `ARRAY_INSERT` function(enabled in Spark library) - * [CALCITE-5873] + * [CALCITE-5873] Add `REGEXP_CONTAINS` function (enabled in BigQuery library) - * [CALCITE-5827] + * [CALCITE-5827] Add `IS_INF` and `IS_NAN` functions (enabled in BigQuery library) - * [CALCITE-5831] + * [CALCITE-5831] Add `SOUNDEX` function (enabled in Spark library) - * [CALCITE-5735] + * [CALCITE-5735] Add `SAFE_MULTIPLY` function (enabled for BigQuery) - * [CALCITE-5820] + * [CALCITE-5820] Add `PARSE_URL` function (enabled in Hive and Spark library) - * [CALCITE-5851] + * [CALCITE-5851] Add `LEVENSHTEIN` function (enabled in Hive and Spark library) * [CALCITE-129] - Support recursive `WITH` queries + Support recursive `WITH` queries * [CALCITE-6011] - Add `FilterWindowTransposeRule` to push a `Filter` past a `Window` + Add `FilterWindowTransposeRule` to push a `Filter` past a `Window` * [CALCITE-6038] - Remove `ORDER BY ... LIMIT n` when input has at most one row, n >= 1, and there is no `OFFSET` clause + Remove `ORDER BY ... LIMIT n` when input has at most one row, n >= 1, and + there is no `OFFSET` clause * [CALCITE-6022] - Support `CREATE TABLE ... LIKE DDL` in server module + Support `CREATE TABLE ... LIKE DDL` in server module * [CALCITE-6031] - Add the planner rule that pushes `Filter` past `Sample` + Add the planner rule that pushes `Filter` past `Sample` * [CALCITE-4189] - Simplify `p OR (p IS NOT TRUE)` to `TRUE` + Simplify `p OR (p IS NOT TRUE)` to `TRUE` * [CALCITE-6009] - Add optimization to remove redundant `LIMIT` that is more than input row count + Add optimization to remove redundant `LIMIT` that is more than input row count * [CALCITE-5570] - Support nested map type for `SqlDataTypeSpec` + Support nested map type for `SqlDataTypeSpec` * [CALCITE-5962] - Support parse Spark-style syntax `LEFT ANTI JOIN` in Babel parser + Support parse Spark-style syntax `LEFT ANTI JOIN` in Babel parser * [CALCITE-5940] - Add a `RelRule` to merge `Limit` + Add a `RelRule` to merge `Limit` * [CALCITE-5971] - Add `SampleToFilterRule` to rewrite bernoulli `Sample` to `Filter` + Add `SampleToFilterRule` to rewrite bernoulli `Sample` to `Filter` * [CALCITE-5994] - Add optimization rule to remove `Sort` when its input's row number is less or equal to one + Add optimization rule to remove `Sort` when its input's row number is less or + equal to one * [CALCITE-5836] - Implement Rel2Sql for `MERGE` + Implement Rel2Sql for `MERGE` * [CALCITE-5889] - Add a `RelRule` that converts `Minus` into `UNION ALL..GROUP BY...WHERE` + Add a `RelRule` that converts `Minus` into `UNION ALL..GROUP BY...WHERE` * [CALCITE-5944] - Add metadata for `Sample` + Add metadata for `Sample` * [CALCITE-5941] - Support `LITERAL_AGG` in `Interpreter` + Support `LITERAL_AGG` in `Interpreter` * [CALCITE-985] - Validate `MERGE` + Validate `MERGE` * [CALCITE-5870] - Allow literals like `DECIMAL '12.3'` (consistent with Postgres) + Allow literals like `DECIMAL '12.3'` (consistent with Postgres) * [CALCITE-5916] - In `RelBuilder`, add `sample()` method (equivalent to SQL `TABLESAMPLE` clause) + In `RelBuilder`, add `sample()` method (equivalent to SQL `TABLESAMPLE` clause) * [CALCITE-5184] - Support `LIMIT start, ALL` in MySQL conformance, equivalent to `OFFSET start` + Support `LIMIT start, ALL` in MySQL conformance, equivalent to `OFFSET start` #### Dependency version upgrade {: #dependency-1-36-0} * [CALCITE-5763] - Increase minimum Guava version to 21.0, maximum version to 32.1.3-jre, and stop building on Guava 19.0 + Increase minimum Guava version to 21.0, maximum version to 32.1.3-jre, and + stop building on Guava 19.0 * [CALCITE-5938] - Update HSQLDB to Version 2.7.2 (using JDK8 JAR, default supports JDK11+) + Update HSQLDB to Version 2.7.2 (using JDK8 JAR, default supports JDK11+) * [CALCITE-6004] - Replace deprecated mongo-java-driver dependency + Replace deprecated mongo-java-driver dependency * [CALCITE-5966] - Upgrade commons-dbcp2 to 2.9.0 + Upgrade commons-dbcp2 to 2.9.0 #### Bug-fixes, API changes and minor enhancements {: #fixes-1-36-0} * [CALCITE-6088] - `SqlItemOperator` fails in `RelToSqlConverter` + `SqlItemOperator` fails in `RelToSqlConverter` * [CALCITE-5863] - Calcite rejects valid query with multiple `ORDER BY` columns and constant `RANGE` bounds in window functions + Calcite rejects valid query with multiple `ORDER BY` columns and constant + `RANGE` bounds in window functions * [CALCITE-5984] - Allow disabling field trimming in `Prepare` via `SqlToRelConverter.Config#isTrimUnusedFields` + Allow disabling field trimming in `Prepare` via + `SqlToRelConverter.Config#isTrimUnusedFields` * [CALCITE-5990] - Explicit cast to numeric type doesn't check overflow + Explicit cast to numeric type doesn't check overflow * [CALCITE-6052] - `SqlImplementor` writes `REAL`, `FLOAT`, or `DOUBLE` literals as `DECIMAL` literals + `SqlImplementor` writes `REAL`, `FLOAT`, or `DOUBLE` literals as `DECIMAL` literals * [CALCITE-6041] - `MAP` sub-query gives `NullPointerException` + `MAP` sub-query gives `NullPointerException` * [CALCITE-6037] - The function category of `ARRAY`/`EXTRACT_VALUE`/`XML_TRANSFORM`/`EXTRACT_XML`/`EXISTSNODE` is incorrect + The function category of + `ARRAY`/`EXTRACT_VALUE`/`XML_TRANSFORM`/`EXTRACT_XML`/`EXISTSNODE` is incorrect * [CALCITE-6024] - A more efficient implementation of `SqlOperatorTable`, backed by an immutable multi-map keyed by upper-case operator name + A more efficient implementation of `SqlOperatorTable`, backed by an immutable + multi-map keyed by upper-case operator name * [CALCITE-5949] - `RexExecutable` should return unchanged original expressions when it fails + `RexExecutable` should return unchanged original expressions when it fails * [CALCITE-6013] - `RelBuilder` should simplify plan by pruning unused measures + `RelBuilder` should simplify plan by pruning unused measures * [CALCITE-6040] - The operand type inference of `SqlMapValueConstructor` is incorrect + The operand type inference of `SqlMapValueConstructor` is incorrect * [CALCITE-6030] - `DATE_PART` is not handled by the `RexToLixTranslator` -* Following [CALCITE-5570] - Support nested map type for `SqlDataTypeSpec` + `DATE_PART` is not handled by the `RexToLixTranslator` +* Following + [CALCITE-5570] + Support nested map type for `SqlDataTypeSpec` * [CALCITE-6050] - Add interface `ImmutablePairList` + Add interface `ImmutablePairList` * [CALCITE-5950] - `DEFAULT` expression is ignored during `INSERT` + `DEFAULT` expression is ignored during `INSERT` * [CALCITE-6006] - `RelToSqlConverter` loses charset information + `RelToSqlConverter` loses charset information * [CALCITE-5948] - Use explicit casting if element type in `ARRAY`/`MAP` does not equal derived component type + Use explicit casting if element type in `ARRAY`/`MAP` does not equal derived + component type * [CALCITE-5989] - Type inference for `RPAD` and `LPAD` functions (BIGQUERY) is incorrect + Type inference for `RPAD` and `LPAD` functions (BIGQUERY) is incorrect * [CALCITE-5982] - Allow implementations of `CalciteMeta` to return extra columns in their responses to `DatabaseMetaData.getTables` and `getColumns` requests + Allow implementations of `CalciteMeta` to return extra columns in their + responses to `DatabaseMetaData.getTables` and `getColumns` requests * [CALCITE-6007] - Sub-query that contains `WITH` and has no alias generates invalid SQL after expansion + Sub-query that contains `WITH` and has no alias generates invalid SQL after + expansion * [CALCITE-6003] - `JSON_ARRAY()` with no arguments does not unparse correctly + `JSON_ARRAY()` with no arguments does not unparse correctly * [CALCITE-6026] - MongoDB: Column is not quoted in `ORDER BY` clause and throws JsonParseException + MongoDB: Column is not quoted in `ORDER BY` clause and throws JsonParseException * [CALCITE-6005] - `POLYGON` string representation is different on Apple silicon + `POLYGON` string representation is different on Apple silicon * [CALCITE-5974] - Elasticsearch adapter throws `ClassCastException` when index mapping sets `dynamic_templates` without `properties` + Elasticsearch adapter throws `ClassCastException` when index mapping sets + `dynamic_templates` without `properties` * [CALCITE-5995] - `JSON_VALUE`, `JSON_EXISTS`, `JSON_QUERY` functions should cache generated objects between calls + `JSON_VALUE`, `JSON_EXISTS`, `JSON_QUERY` functions should cache generated + objects between calls * [CALCITE-5960] - `CAST` throws NullPointerException if `SqlTypeFamily` of targetType is null + `CAST` throws NullPointerException if `SqlTypeFamily` of targetType is null * [CALCITE-5997] - `OFFSET` operator is incorrectly unparsed + `OFFSET` operator is incorrectly unparsed * [CALCITE-5961] - Type inference of `ARRAY_COMPACT` is incorrect + Type inference of `ARRAY_COMPACT` is incorrect * [CALCITE-5999] - `DECIMAL` literals as sometimes unparsed looking as `DOUBLE` literals + `DECIMAL` literals as sometimes unparsed looking as `DOUBLE` literals * [CALCITE-5988] - `SqlImplementor.toSql` cannot emit `VARBINARY` literals + `SqlImplementor.toSql` cannot emit `VARBINARY` literals * [CALCITE-5996] - `TRANSLATE` operator is incorrectly unparsed + `TRANSLATE` operator is incorrectly unparsed * [CALCITE-5862] - Incorrect semantics of `ARRAY` function (Spark library) when elements have Numeric and Character types + Incorrect semantics of `ARRAY` function (Spark library) when elements have + Numeric and Character types * [CALCITE-5931] - Allow round decimals like `1.00` in window ranges + Allow round decimals like `1.00` in window ranges * [CALCITE-5732] - `EnumerableHashJoin` and `EnumerableMergeJoin` on composite key return rows matching condition `NULL = NULL` + `EnumerableHashJoin` and `EnumerableMergeJoin` on composite key return rows + matching condition `NULL = NULL` * [CALCITE-5967] - `UnsupportedOperationException` while implementing a call that requires a special collator + `UnsupportedOperationException` while implementing a call that requires a + special collator * [CALCITE-5952] - `SemiJoinJoinTransposeRule` should check if JoinType supports pushing predicates into its inputs + `SemiJoinJoinTransposeRule` should check if JoinType supports pushing + predicates into its inputs * [CALCITE-5953] - `AggregateCaseToFilterRule` may make inaccurate `SUM` transformations + `AggregateCaseToFilterRule` may make inaccurate `SUM` transformations * [CALCITE-5861] - `ReduceExpressionsRule` rules should constant-fold expressions in window bounds + `ReduceExpressionsRule` rules should constant-fold expressions in window bounds * [CALCITE-5965] - Avoid unnecessary String concatenations in the `RexFieldAccess` constructor to improve the performance + Avoid unnecessary String concatenations in the `RexFieldAccess` constructor to + improve the performance * [CALCITE-5914] - Cache compiled regular expressions in SQL function runtime + Cache compiled regular expressions in SQL function runtime * Refactor: In `ReflectUtil`, add methods isStatic and isPublic * Refactor: In `RexImpTable`, ensure that every method is in BuiltInMethod * [CALCITE-5922] - The SQL generated for the `POSITION` function(with 3 input arguments) by the `SparkSqlDialect` is not recognized by Spark SQL + The SQL generated for the `POSITION` function(with 3 input arguments) by the + `SparkSqlDialect` is not recognized by Spark SQL * [CALCITE-5920] - Reset `PERCENTILE_CONT`/`PERCENTILE_DISC` to reserved keywords + Reset `PERCENTILE_CONT`/`PERCENTILE_DISC` to reserved keywords * [CALCITE-5946] - `TimeString` should allow fractional seconds ending in zero + `TimeString` should allow fractional seconds ending in zero * [CALCITE-5906] - JDBC adapter should generate `TABLESAMPLE` + JDBC adapter should generate `TABLESAMPLE` * [CALCITE-5895] - `TABLESAMPLE (0)` should return no rows + `TABLESAMPLE (0)` should return no rows * [CALCITE-5813] - Type inference for sql functions `REPEAT`, `SPACE`, `XML_TRANSFORM`, and `XML_EXTRACT` is incorrect + Type inference for sql functions `REPEAT`, `SPACE`, `XML_TRANSFORM`, and + `XML_EXTRACT` is incorrect * [CALCITE-5908] - Refactor: Remove unnecessary null checks in `CalciteSchema` + Refactor: Remove unnecessary null checks in `CalciteSchema` * [CALCITE-5843] - Constant expression with nested casts causes a compiler crash + Constant expression with nested casts causes a compiler crash * [CALCITE-5885] - `SqlNode#toSqlString()` does not honor dialect's `supportsCharSet()` flag on nested types + `SqlNode#toSqlString()` does not honor dialect's `supportsCharSet()` flag on + nested types * [CALCITE-5869] - `LEAST_RESTRICTIVE` does not use inner type of `MEASURE` for comparisons + `LEAST_RESTRICTIVE` does not use inner type of `MEASURE` for comparisons * [CALCITE-5903] - `RelMdCollation` does not define collations for `EnumerableLimit` + `RelMdCollation` does not define collations for `EnumerableLimit` * [CALCITE-5882] - Compile-time evaluation of `SPLIT` function returns incorrect result + Compile-time evaluation of `SPLIT` function returns incorrect result * [CALCITE-5879] - `AssertionError` during constant reduction of `SPLIT` expression that returns null + `AssertionError` during constant reduction of `SPLIT` expression that returns null * [CALCITE-5875] - Remove unnecessary null checks in Redis adapter + Remove unnecessary null checks in Redis adapter * [CALCITE-5859] - Compile-time evaluation of `LEFT(NULL, n)` should not throw `RuntimeException` + Compile-time evaluation of `LEFT(NULL, n)` should not throw `RuntimeException` * [CALCITE-5837] - `RexUtil#pullFactors` output's order should be deterministic even when the `RexNode` kind is `OR` + `RexUtil#pullFactors` output's order should be deterministic even when the + `RexNode` kind is `OR` * [CALCITE-5877] - `AssertionError` during `MOD` operation if result scale is greater than maximum numeric scale + `AssertionError` during `MOD` operation if result scale is greater than maximum + numeric scale * [CALCITE-5841] - Improve singleton implementation for `ChinookAvaticaServer` in calcite-plus + Improve singleton implementation for `ChinookAvaticaServer` in calcite-plus * Following [CALCITE-5688] - Eliminate warnings in server parser + Eliminate warnings in server parser #### Build and test suite {: #build-1-36-0} * [CALCITE-5921] - `SqlOperatorFixture.checkFails` and `checkAggFails` don't check runtime failure + `SqlOperatorFixture.checkFails` and `checkAggFails` don't check runtime failure * [CALCITE-5923] - `SqlOperatorTest` using `safeParameters` are not using overridable fixture + `SqlOperatorTest` using `safeParameters` are not using overridable fixture * [CALCITE-6014] - Create a `SqlOperatorFixture` that parses, unparses, and then parses again before executing + Create a `SqlOperatorFixture` that parses, unparses, and then parses again before executing * Incorrect test fixture used by `SqlOperatorTest.testLeastFunc` * [CALCITE-5980] - QuidemTests are not effectively executed on Windows + QuidemTests are not effectively executed on Windows * [CALCITE-5615] - Run SQL Logic Test suite using Calcite's HSQLDB JDBC adapter + Run SQL Logic Test suite using Calcite's HSQLDB JDBC adapter * [CALCITE-5909] - `SqlParserTest.testNoUnintendedNewReservedKeywords` fails in IDE while passes in command line + `SqlParserTest.testNoUnintendedNewReservedKeywords` fails in IDE while passes in command line * Refactor `RelDataTypeSystemTest` to use test fixture * Add various lint checks * Code style: lint @@ -780,16 +1315,16 @@ other software versions as specified in gradle.properties. * Site: Add Mihai Budiu as committer * Site: Add Apache Wayang (incubating) to powered-by page * [CALCITE-5884] - `ARRAY_TO_STRING` function should return `NULL` if its `nullValue` argument is `NULL` + `ARRAY_TO_STRING` function should return `NULL` if its `nullValue` argument is `NULL` * [CALCITE-6075] - Site: Cloning source code from GitHub using git protocol fails + Site: Cloning source code from GitHub using git protocol fails * Add example for `MAP` type in reference docs * [CALCITE-6033] - Correct broken links on adapter page + Correct broken links on adapter page * [CALCITE-6017] - Update the GitHub link of released versions + Update the GitHub link of released versions * [CALCITE-5905] - Documentation for `CREATE TYPE` is incorrect + Documentation for `CREATE TYPE` is incorrect * Remove mentions of binary distribution from README * Update broken link in `RelMetadataProvider` Javadoc * The parameter names of `SqlTypeMappingRules.Builder#add` are misleading @@ -800,7 +1335,8 @@ other software versions as specified in gradle.properties. This release comes 4 months after [1.34.0](#v1-34-0), contains contributions from 36 contributors, and resolves 140 issues. -Among other new features, it adds more than 40 new SQL functions in various libraries such as BigQuery and Spark. +Among other new features, it adds more than 40 new SQL functions in +various libraries such as BigQuery and Spark. It is worth highlighting the following improvements: @@ -812,7 +1348,8 @@ It is worth highlighting the following improvements: * [CALCITE-5425] Should not pushdown Filter through Aggregate without group keys * [CALCITE-5506] - `RelToSqlConverter` should retain the aggregation logic when Project without `RexInputRef` on the Aggregate + `RelToSqlConverter` should retain the aggregation logic when Project without + `RexInputRef` on the Aggregate * Some improvements in simplifying an expression. * [CALCITE-5769] @@ -864,6 +1401,11 @@ Will Noble, Zhe Hu, Zou Dan. +Compatibility: This release is tested on Linux, macOS, Microsoft Windows; +using JDK/OpenJDK versions 8 to 19; +Guava versions 16.0.1 to 31.1-jre; +other software versions as specified in gradle.properties. + #### Breaking Changes {: #breaking-1-35-0} @@ -874,11 +1416,6 @@ Zou Dan. * [CALCITE-5477] Build with Guava 19.0. -Compatibility: This release is tested on Linux, macOS, Microsoft Windows; -using JDK/OpenJDK versions 8 to 19; -Guava versions 16.0.1 to 31.1-jre; -other software versions as specified in gradle.properties. - #### New features {: #new-features-1-35-0} @@ -942,15 +1479,17 @@ other software versions as specified in gradle.properties. * [CALCITE-3959] Add `INSTR` function (enabled in BigQuery, MySQL, Oracle libraries) * [CALCITE-5642] - Add `SHA256`, `SHA512` functions (enabled in BigQuery and PostgreSQL libraries) + Add `SHA256`, `SHA512` functions (enabled in BigQuery and Postgres libraries) * [CALCITE-5585] Add `STRPOS` function (enabled in BigQuery, Postgres libraries) * [CALCITE-5619] - Add `TO_CHAR(, )` function (enabled in MySQL,Oracle,PostgreSQL libraries) + Add `TO_CHAR(, )` function (enabled in MySQL, Oracle, + Postgres libraries) * [CALCITE-4771] Add `TRY_CAST` function (enabled in MSSQL library) * [CALCITE-5761] - Allow `DECADE`, `CENTURY`, and `MILLENNIUM` time units in `DATE_TRUNC`, `TIMESTAMP_TRUNC`, `DATETIME_TRUNC` functions + Allow `DECADE`, `CENTURY`, and `MILLENNIUM` time units in `DATE_TRUNC`, + `TIMESTAMP_TRUNC`, `DATETIME_TRUNC` functions * [CALCITE-5783] Support hint for `TableFunctionScan` * [CALCITE-5593] @@ -974,7 +1513,7 @@ other software versions as specified in gradle.properties. * [CALCITE-5688] Support `TRUNCATE TABLE` DDL statement in server parser * [CALCITE-5711] - Implement the `SINGLE_VALUE` aggregation in PostgreSQL Dialect + Implement the `SINGLE_VALUE` aggregation in Postgres Dialect * [CALCITE-5608] Implement `ASINH`, `ACOSH`, `ATANH` functions * [CALCITE-5602] @@ -984,7 +1523,7 @@ other software versions as specified in gradle.properties. * [CALCITE-5160] `ANY`/`SOME`, `ALL` operators should support collection expressions * [CALCITE-5403] - Babel parser should parse PostgreSQL's `SET`, `RESET`, `BEGIN`, `SHOW`, `ROLLBACK`, `COMMIT` commands + Babel parser should parse Postgres's `SET`, `RESET`, `BEGIN`, `SHOW`, `ROLLBACK`, `COMMIT` commands #### Dependency version upgrade {: #dependency-1-35-0} @@ -1094,7 +1633,7 @@ other software versions as specified in gradle.properties. * [CALCITE-5705] Generalize `RemoveEmptySingleRule` to work with arbitrary relations and pruning configurations * [CALCITE-5668] - When parsing SQL in PostgreSQL dialect, allow unquoted table names to contain dollar sign, letters with diacritical marks and non-Latin letters + When parsing SQL in Postgres dialect, allow unquoted table names to contain dollar sign, letters with diacritical marks and non-Latin letters * [CALCITE-5699] Negated posix regex expressions throw NullPointerException when applied to NULL values * [CALCITE-5691] @@ -1238,6 +1777,11 @@ Command used to generate the release notes (nb: it does not work on MacOS) git log b64cb1325cfe1a5143ea3ca534f991b6f881c3c5..ee9b80b0b68d442991dfaa142722e3488ec73e79 --format="%s" | sed 's|\[\(CALCITE-[0-9]\+\)\]|* [\1]\n|' --> +Compatibility: This release is tested on Linux, macOS, Microsoft Windows; +using JDK/OpenJDK versions 8 to 18; +Guava versions 16.0.1 to 31.1-jre; +other software versions as specified in gradle.properties. + #### Breaking Changes {: #breaking-1-34-0} @@ -1253,11 +1797,6 @@ To keep the old behavior (which is discouraged but still supported), initialize `SqlToRelConverter` using `SqlToRelConverter.config().withExpand(true)` as the value for the `config` argument. -Compatibility: This release is tested on Linux, macOS, Microsoft Windows; -using JDK/OpenJDK versions 8 to 18; -Guava versions 16.0.1 to 31.1-jre; -other software versions as specified in gradle.properties. - #### New features {: #new-features-1-34-0} @@ -1410,18 +1949,17 @@ Xurenhe, Zhengqiang Duan, Zou Dan. +Compatibility: This release is tested on Linux, macOS, Microsoft Windows; +using JDK/OpenJDK versions 8 to 18; +Guava versions 16.0.1 to 31.1-jre; +other software versions as specified in gradle.properties. + #### Breaking Changes {: #breaking-1-33-0} * [CALCITE-5293] 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; -using JDK/OpenJDK versions 8 to 18; -Guava versions 16.0.1 to 31.1-jre; -other software versions as specified in gradle.properties. - #### New features {: #new-features-1-33-0} @@ -1436,7 +1974,7 @@ other software versions as specified in gradle.properties. * [CALCITE-5155] Custom time frames * [CALCITE-5159] - `ARRAY` string constructor, and implicit cast from string literal (enabled in PostgreSQL conformance) + `ARRAY` string constructor, and implicit cast from string literal (enabled in Postgres conformance) * [CALCITE-5269] Implement BigQuery `TIME_TRUNC` and `TIMESTAMP_TRUNC` functions * [CALCITE-5280] @@ -1676,13 +2214,16 @@ Stamatis Zampetakis, TJ Banghart, Zhengqiang Duan. -{: #breaking-1-32-0} - Compatibility: This release is tested on Linux, macOS, Microsoft Windows; using JDK/OpenJDK versions 8 to 18; Guava versions 16.0.1 to 31.1-jre; other software versions as specified in gradle.properties. +#### Breaking Changes +{: #breaking-1-32-0} + +None. + #### New features {: #new-features-1-32-0} @@ -1810,6 +2351,11 @@ xiejiajun, xurenhe, zhangyue. +Compatibility: This release is tested on Linux, macOS, Microsoft Windows; +using JDK/OpenJDK versions 8 to 18; +Guava versions 19.0 to 31.1-jre; +other software versions as specified in gradle.properties. + #### Breaking Changes {: #breaking-1-31-0} @@ -1819,11 +2365,6 @@ zhangyue. * Old behavior: The Project operator is transformed into Calc. * New behavior: The Project operator is not transformed and the rule becomes NOOP. -Compatibility: This release is tested on Linux, macOS, Microsoft Windows; -using JDK/OpenJDK versions 8 to 18; -Guava versions 19.0 to 31.1-jre; -other software versions as specified in gradle.properties. - #### New features {: #new-features-1-31-0} @@ -2722,7 +3263,7 @@ other software versions as specified in gradle.properties. * [CALCITE-4349] `GROUP_CONCAT` aggregate function (MySQL's equivalent of `LISTAGG`) * [CALCITE-4443] - Add `ILIKE` operator (as `LIKE`, but case-insensitive and PostgreSQL-specific) + Add `ILIKE` operator (as `LIKE`, but case-insensitive and Postgres-specific) (Ondřej Štumpf) * [CALCITE-4456] Allows all value expressions in `ROW` @@ -2850,7 +3391,7 @@ other software versions as specified in gradle.properties. * [CALCITE-4199] `RelBuilder` throws `NullPointerException` while implementing `GROUP_ID()` * [CALCITE-4491] - Aggregation of window function produces invalid SQL for PostgreSQL (Dominik + Aggregation of window function produces invalid SQL for Postgres (Dominik Labuda) * [CALCITE-4426] Short-circuit evaluating when comparing two `RelTraitSets` (Jiatao Tao) @@ -3116,7 +3657,7 @@ other software versions as specified in gradle.properties. {: #breaking-1-26-0} * [CALCITE-2082] -Do not store types or type factories inside operators + Do not store types or type factories inside operators #### New features {: #new-features-1-26-0} @@ -3718,7 +4259,7 @@ gradle.properties. `VolcanoPlanner.prunedNodes` info is lost when duplicate `RelNode` is discarded (Botong Huang) * [CALCITE-3866] - "numeric field overflow" when running the generated SQL in PostgreSQL (Wenhui + "numeric field overflow" when running the generated SQL in Postgres (Wenhui Tang) * [CALCITE-3926] `CannotPlanException` when an empty LogicalValues requires a certain collation @@ -3779,7 +4320,7 @@ gradle.properties. * [CALCITE-3324] Set `updateCount` when creating `MetaResultSet` (Robert Yokota) * [CALCITE-3733] - In JDBC adapter, when generating SQL for MYSQL, generate `TIMESTAMP` type as + In JDBC adapter, when generating SQL for MySQL, generate `TIMESTAMP` type as `DATETIME` for `CAST` (Vineet Garg) * [CALCITE-3909] `RelMdMinRowCount` doesn't take into account `UNION` `DISTINCT` @@ -4383,7 +4924,7 @@ other software versions as specified in `pom.xml`. * [CALCITE-1935] Implement `MATCH_RECOGNIZE` (Julian Feinauer, Zhiqiang-He) * [CALCITE-2843] - Support PostgreSQL cast operator (`::`) (Muhammad Gelbana) + Support Postgres cast operator (`::`) (Muhammad Gelbana) * [CALCITE-3233] Support `ROW` type for `SqlDataTypeSpec` * [CALCITE-3231] @@ -4405,7 +4946,7 @@ other software versions as specified in `pom.xml`. * [CALCITE-2460] [CALCITE-2459] Add `TO_BASE64`, `FROM_BASE64` SQL functions (Wenhui Tang) * [CALCITE-3063] - Parse and process PostgreSQL posix regular expressions + Parse and process Postgres posix regular expressions #### Bug-fixes, API changes and minor enhancements {: #fixes-1-21-0} @@ -5056,7 +5597,7 @@ other software versions as specified in `pom.xml`. {: #build-1-19-0} * [CALCITE-2732] - Upgrade PostgreSQL driver version + Upgrade Postgres driver version * [CALCITE-2759] Update `maven-remote-resources-plugin` to 1.6.0 * [CALCITE-2765] @@ -5239,7 +5780,7 @@ other software versions as specified in `pom.xml`. * [CALCITE-2719] In JDBC adapter for MySQL, fix cast to `INTEGER` and `BIGINT` (Piotr Bojko) * [CALCITE-2713] - JDBC adapter may generate casts on PostgreSQL for `VARCHAR` type exceeding max + JDBC adapter may generate casts on Postgres for `VARCHAR` type exceeding max length * [CALCITE-2529] All numbers are in the same type family (Andrew Pilloud) @@ -5721,7 +6262,7 @@ Calcite has been upgraded to use CALCITE-2303] In `EXTRACT` function, support `MICROSECONDS`, `MILLISECONDS`, `EPOCH`, `ISODOW`, `ISOYEAR` and `DECADE` time units (Sergey Nuyanzin) * [CALCITE-2305] - JDBC adapter generates invalid casts on PostgreSQL, because PostgreSQL does not have `TINYINT` and `DOUBLE` types + JDBC adapter generates invalid casts on Postgres, because Postgres does not have `TINYINT` and `DOUBLE` types * [CALCITE-2306] AssertionError in `RexLiteral.getValue3` with null literal of type `DECIMAL` (Godfrey He) * [CALCITE-2309] @@ -7224,10 +7765,10 @@ There are several new SQL features: `UNNEST` with and with a JOIN; a DESCRIBE statement; and a TRANSLATE -function like the one in Oracle and PostgreSQL. +function like the one in Oracle and Postgres. We also added support for SELECT without FROM -(equivalent to the `VALUES` clause, and widely used in MySQL and PostgreSQL), +(equivalent to the `VALUES` clause, and widely used in MySQL and Postgres), and added a [conformance]({{ site.baseurl }}/docs/adapter.html#jdbc-connect-string-parameters) parameter to allow you to selectively enable this and other SQL features. @@ -8344,7 +8885,7 @@ and various improvements to Avatica. * [CALCITE-507] Update HOWTO.md with running integration tests * Add H2 integration test -* Add PostgreSQL integration test +* Add Postgres integration test * [CALCITE-590] Update MongoDB test suite to calcite-test-dataset * Add `CalciteAssert.assertArrayEqual` for more user-friendly asserts diff --git a/site/_docs/howto.md b/site/_docs/howto.md index 02f8e7c12f73..c0d8626d3654 100644 --- a/site/_docs/howto.md +++ b/site/_docs/howto.md @@ -31,7 +31,7 @@ adapters. ## Building from a source distribution -Prerequisite is Java (JDK 8, 11, 17, 21 or 22) +Prerequisite is Java (JDK 8, 11, 17, 21 or 23) and Gradle (version 8.7) on your path. Unpack the source distribution `.tar.gz` file, @@ -39,8 +39,8 @@ Unpack the source distribution `.tar.gz` file, then build using Gradle: {% highlight bash %} -$ tar xvfz apache-calcite-1.37.0-src.tar.gz -$ cd apache-calcite-1.37.0-src +$ tar xvfz apache-calcite-1.38.0-src.tar.gz +$ cd apache-calcite-1.38.0-src $ gradle build {% endhighlight %} @@ -51,7 +51,7 @@ tests (but you should use the `gradle` command rather than ## Building from Git Prerequisites are git -and Java (JDK 8, 11, 17, 21 or 22) on your path. +and Java (JDK 8, 11, 17, 21 or 23) on your path. Create a local copy of the GitHub repository, `cd` to its root directory, @@ -728,7 +728,8 @@ Before you start: * Send an email to [dev@calcite.apache.org](mailto:dev@calcite.apache.org) notifying that RC build process is starting and therefore `main` branch is in code freeze until further notice. * Set up signing keys as described above. -* Make sure you are using JDK 8 (not 9 or 10). +* Make sure you are using JDK 8. (Compiling with JDK 21 causes + [[CALCITE-6616](https://issues.apache.org/jira/browse/CALCITE-6616)].) * Check that `README` and `site/_docs/howto.md` have the correct version number. * Check that `site/_docs/howto.md` has the correct Gradle version. * Check that `NOTICE` has the current copyright year. @@ -792,6 +793,32 @@ The release candidate process does not add commits, so there's no harm if it fails. It might leave `-rc` tag behind which can be removed if required. +Define your credentials in your `~/.gradle/gradle.properties` file. +Replace `jhyde`, `julianhyde` and `xxx` as appropriate, and be sure to +make the file private (permission 600). +``` +useGpgCmd=true +signing.gnupg.executable=gpg +signing.gnupg.useLegacyGpg=false +signing.gnupg.keyName=0xXXXXXXXX +signing.gnupg.passphrase=xxx + +asfSvnUsername=jhyde +asfSvnPassword=xxx +asfGitSourceUsername=julianhyde +asfGitSourcePassword=xxx +asfNexusUsername=jhyde +asfNexusPassword=xxx +asfCommitterId=jhyde + +asfTestSvnPassword=test +asfTestSvnUsername=test +asfTestGitSourceUsername=test +asfTestGitSourcePassword=test +asfTestNexusUsername=test +asfTestNexusPassword=test +``` + If you wish, you can perform a dry-run release with a help of [asflike-release-environment](https://github.com/vlsi/asflike-release-environment); it would perform the same steps, but it would push changes to the mock Nexus, Git, and SVN servers.