Re: [PR] [CALCITE-3933] Incorrect SQL Emitted for Unicode for Several Dialects [calcite]
zhougit86 commented on code in PR #3474: URL: https://github.com/apache/calcite/pull/3474#discussion_r1363200390 ## core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java: ## @@ -537,7 +537,19 @@ public interface SqlConformance { */ boolean isValueAllowed(); - /** + /** Review Comment: modified -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-3933] Incorrect SQL Emitted for Unicode for Several Dialects [calcite]
zhougit86 commented on code in PR #3474: URL: https://github.com/apache/calcite/pull/3474#discussion_r1363200139 ## testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java: ## @@ -1792,13 +1792,12 @@ void checkPeriodPredicate(Checker checker) { expr("cast('foo' as bar)") .ok("CAST('foo' AS `BAR`)"); } - + @Test void testParsingNonIsoCharacter() { String sql = "select 'ק' "; - sql(sql).ok("SELECT u&'\\05e7'"); Review Comment: the CALCITE-6001 mentioned 'This means that when converting a query like: select 'ק' as result; you will get the following the error: Failed to encode 'ק' in character set 'ISO-8859-1'.' I justed it according to this behavior ## testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java: ## @@ -1792,13 +1792,12 @@ void checkPeriodPredicate(Checker checker) { expr("cast('foo' as bar)") .ok("CAST('foo' AS `BAR`)"); } - + @Test void testParsingNonIsoCharacter() { String sql = "select 'ק' "; - sql(sql).ok("SELECT u&'\\05e7'"); Review Comment: the CALCITE-6001 mentioned 'This means that when converting a query like: select 'ק' as result; you will get the following the error: Failed to encode 'ק' in character set 'ISO-8859-1'.' I justed it according to this behavior ## core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java: ## @@ -1486,6 +1486,9 @@ private static String toSql(RelNode root, SqlDialect dialect, assertThat(toSql(root), isLinux(expectedSql)); } + Review Comment: removed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5763] Discontinue support for Guava < 20.0 [calcite]
asfgit closed pull request #3470: [CALCITE-5763] Discontinue support for Guava < 20.0 URL: https://github.com/apache/calcite/pull/3470 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[calcite] branch main updated: [CALCITE-5763] Increase minimum Guava version to 21.0, maximum version to 32.1.3-jre, and stop building on Guava 19.0
This is an automated email from the ASF dual-hosted git repository. jhyde pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/calcite.git The following commit(s) were added to refs/heads/main by this push: new c6031ca155 [CALCITE-5763] Increase minimum Guava version to 21.0, maximum version to 32.1.3-jre, and stop building on Guava 19.0 c6031ca155 is described below commit c6031ca15579b88bd392a56f4588fdd9a29d1071 Author: Julian Hyde AuthorDate: Sat Oct 14 11:26:36 2023 -0700 [CALCITE-5763] Increase minimum Guava version to 21.0, maximum version to 32.1.3-jre, and stop building on Guava 19.0 Calcite previously built on Guava 19.0; after this change, we build on the latest Guava (32.1.3-jre) and on various versions including the oldest supported Guava (21.0). We choose 21.0 as the minimum supported Guava version because it includes various changes to support JDK 8, including stream, Supplier, and functions. Revert [CALCITE-5428] Reduce minimum Guava version to 16.0.1 Code changes that are possible now we are on Guava 21.0: * Replace Guava Supplier with Java Supplier, and remove redundant '::get' calls; * Replace Util.toImmutableList with ImmutableList.toImmutableList; * Replace Util.throwIfUnchecked with Throwables.throwIfUnchecked; * Replace RangeSetTest.unionRangeSet with ImmutableRangetSet.unionOf. Add an autostyle rule to require a static import of ImuutableList.toImmutableList. Cassandra requires Guava 23 or higher, for the method ImmutableSet.builderWithExpectedSize, so disable the Cassandra test on lower Guava versions. Close apache/calcite#3470 --- .github/workflows/main.yml | 22 +-- build.gradle.kts | 1 + .../apache/calcite/test/CassandraExtension.java| 6 ++- .../apache/calcite/adapter/clone/ArrayTable.java | 3 +- .../calcite/adapter/jdbc/JdbcCatalogSchema.java| 4 +- .../org/apache/calcite/adapter/jdbc/JdbcTable.java | 2 +- .../calcite/config/CalciteSystemProperty.java | 18 ++--- .../ProfilerLatticeStatisticProvider.java | 2 +- .../calcite/plan/RelOptMaterializations.java | 2 +- .../plan/visualizer/RuleMatchVisualizer.java | 5 ++- .../calcite/prepare/CalciteCatalogReader.java | 8 ++-- .../apache/calcite/rel/metadata/MetadataDef.java | 3 +- .../calcite/rel/metadata/RelMetadataQuery.java | 2 +- .../apache/calcite/rel/rel2sql/SqlImplementor.java | 6 ++- .../rules/AggregateExpandWithinDistinctRule.java | 4 +- .../rel/rules/AggregateExtractProjectRule.java | 7 ++-- .../rel/rules/MaterializedViewFilterScanRule.java | 2 +- .../calcite/rel/rules/SortRemoveRedundantRule.java | 2 +- .../java/org/apache/calcite/rex/RexAnalyzer.java | 8 ++-- .../java/org/apache/calcite/rex/RexBuilder.java| 8 ++-- .../main/java/org/apache/calcite/rex/RexUtil.java | 4 +- .../apache/calcite/runtime/AutomatonBuilder.java | 5 ++- .../main/java/org/apache/calcite/runtime/Hook.java | 15 +++- .../java/org/apache/calcite/runtime/PairList.java | 2 +- .../java/org/apache/calcite/sql/SqlDialect.java| 2 +- .../main/java/org/apache/calcite/sql/SqlHint.java | 5 ++- .../java/org/apache/calcite/sql/SqlIdentifier.java | 4 +- .../apache/calcite/sql/util/SqlOperatorTables.java | 3 +- .../calcite/sql/validate/DelegatingScope.java | 4 +- .../apache/calcite/sql2rel/SqlToRelConverter.java | 9 +++-- .../java/org/apache/calcite/tools/Frameworks.java | 2 +- .../java/org/apache/calcite/tools/RelBuilder.java | 10 +++-- .../java/org/apache/calcite/util/Compatible.java | 12 -- .../main/java/org/apache/calcite/util/Util.java| 43 -- .../calcite/materialize/LatticeSuggesterTest.java | 4 +- .../org/apache/calcite/profile/ProfilerTest.java | 5 ++- .../org/apache/calcite/test/RelMetadataTest.java | 4 +- .../java/org/apache/calcite/util/RangeSetTest.java | 18 ++--- .../java/org/apache/calcite/util/UtilTest.java | 2 +- gradle.properties | 4 +- .../apache/calcite/linq4j/EnumerableDefaults.java | 2 +- site/_docs/history.md | 4 +- .../apache/calcite/sql/test/SqlTestFactory.java| 4 +- .../org/apache/calcite/test/CalciteAssert.java | 14 ++- .../java/org/apache/calcite/test/Matchers.java | 4 +- .../java/org/apache/calcite/util/TestUtil.java | 2 +- 46 files changed, 148 insertions(+), 154 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54258956d9..4c8a54841c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -117,11 +117,11 @@ jobs: linux-jdk8-oldest-guava-tz: if: github.event.action != 'labeled' -name: 'Linux (JDK 8), Oldest Guava, America/New_York Timezone' +
Re: [PR] [CALCITE-5923] Some test cases in SqlOperatorTest violates the test fixture's design principle [calcite]
herunkang2018 commented on code in PR #3364: URL: https://github.com/apache/calcite/pull/3364#discussion_r1362949840 ## build.gradle.kts: ## @@ -818,6 +818,7 @@ allprojects { passProperty("user.language", "TR") passProperty("user.country", "tr") passProperty("user.timezone", "UTC") +passProperty("calcite.avatica.version", props.string("calcite.avatica.version")) Review Comment: @zabetak Thanks for the code, it looks better and more reasonable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5923] Some test cases in SqlOperatorTest violates the test fixture's design principle [calcite]
herunkang2018 commented on code in PR #3364: URL: https://github.com/apache/calcite/pull/3364#discussion_r1362949840 ## build.gradle.kts: ## @@ -818,6 +818,7 @@ allprojects { passProperty("user.language", "TR") passProperty("user.country", "tr") passProperty("user.timezone", "UTC") +passProperty("calcite.avatica.version", props.string("calcite.avatica.version")) Review Comment: Thanks for the code, it looks better and more reasonable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-6052] SqlImplementor writes REAL, FLOAT, and DOUBLE literals as DECIMAL literals [calcite]
mihaibudiu commented on PR #3472: URL: https://github.com/apache/calcite/pull/3472#issuecomment-1767319045 I have added more test cases. I have also tried to also fix a bug in the reference manual where the line for `CONTAINS_SUBSTR` is not rendered, but I don't know how to test that). I will rename the commit when I squash. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-6035] Unparse 'WITHIN GROUP' for BigQuery dialect to match BigQuery documentation [calcite]
tanclary commented on code in PR #3466: URL: https://github.com/apache/calcite/pull/3466#discussion_r1362758103 ## core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java: ## @@ -292,6 +295,17 @@ private static void unparseItem(SqlWriter writer, SqlCall call, int leftPrec) { writer.endList(frame); } + private static void unparseWithinGroup(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { +assert call.operandCount() == 2; +call.operand(0).unparse(writer, 0, 0); +writer.keyword("OVER"); Review Comment: so I think you're more familiar with these clauses than me, is it guaranteed that the WITHIN GROUP translates to BQ's OVER in every case? are they really just synonyms for each other, I mean ## core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java: ## @@ -1294,6 +1294,18 @@ private static String toSql(RelNode root, SqlDialect dialect, .withPostgresql().ok(expectedPostgresql); } + @Test void testPercentileContWithinGroupClauseBigQuery() { +final String query = "select percentile_cont(0.5) WITHIN GROUP (ORDER BY `product_class_id`)\n" ++ "from `foodmart`.`product`"; +final String expected = "SELECT PERCENTILE_CONT(0.5) OVER (ORDER BY product_class_id NULLS LAST)\n" ++ "FROM foodmart.product"; +final SqlParser.Config parserConfig = Review Comment: May want to fix the style errors -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-3933] Incorrect SQL Emitted for Unicode for Several Dialects [calcite]
julianhyde commented on code in PR #3474: URL: https://github.com/apache/calcite/pull/3474#discussion_r1362750967 ## testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java: ## @@ -1792,13 +1792,12 @@ void checkPeriodPredicate(Checker checker) { expr("cast('foo' as bar)") .ok("CAST('foo' AS `BAR`)"); } - + @Test void testParsingNonIsoCharacter() { String sql = "select 'ק' "; - sql(sql).ok("SELECT u&'\\05e7'"); Review Comment: why remove this test? The `u&` is valid standard SQL and is still valid Calcite SQL -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5923] Some test cases in SqlOperatorTest violates the test fixture's design principle [calcite]
sonarcloud[bot] commented on PR #3364: URL: https://github.com/apache/calcite/pull/3364#issuecomment-1766928720 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_calcite=3364) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3364=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3364=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3364=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=CODE_SMELL) [5 Code Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=CODE_SMELL) [![36.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '36.4%')](https://sonarcloud.io/component_measures?id=apache_calcite=3364=new_coverage=list) [36.4% Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3364=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3364=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3364=new_duplicated_lines_density=list) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-3933] Incorrect SQL Emitted for Unicode for Several Dialects [calcite]
mihaibudiu commented on code in PR #3474: URL: https://github.com/apache/calcite/pull/3474#discussion_r1362553094 ## core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java: ## @@ -7133,6 +7136,19 @@ private void checkLiteral2(String expression, String expected) { sql(query).ok(expected); } + @Test void testBigQueryUnicode() { Review Comment: would this need a JavaDoc comment indicating the solved issue? ## core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java: ## @@ -1486,6 +1486,9 @@ private static String toSql(RelNode root, SqlDialect dialect, assertThat(toSql(root), isLinux(expectedSql)); } + Review Comment: are these necessary? ## core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java: ## @@ -537,7 +537,19 @@ public interface SqlConformance { */ boolean isValueAllowed(); - /** + /** Review Comment: indentation seems to be off here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5923] Some test cases in SqlOperatorTest violates the test fixture's design principle [calcite]
zabetak commented on code in PR #3364: URL: https://github.com/apache/calcite/pull/3364#discussion_r1362525701 ## core/src/main/java/org/apache/calcite/util/Bug.java: ## @@ -208,6 +208,12 @@ public abstract class Bug { * MILLISECOND and MICROSECOND units in INTERVAL literal is fixed. */ public static final boolean CALCITE_5422_FIXED = false; + /** Whether + * https://issues.apache.org/jira/browse/CALCITE-5678;>[CALCITE-5678] + * Calcite should reject date literals not satisfying Gregorian calendar, + * per SQL standard is fixed. */ + public static final boolean CALCITE_5678_FIXED = false; Review Comment: What do you think of https://github.com/apache/calcite/pull/3364/commits/f7caa3fb33fb33c1ef16293003ac4439dae9d571 ? Let's see if all tests run as expected. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5918] Add MAP function (enabled in Spark library) [calcite]
sonarcloud[bot] commented on PR #3459: URL: https://github.com/apache/calcite/pull/3459#issuecomment-1766408159 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_calcite=3459) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3459=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3459=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3459=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=CODE_SMELL) [15 Code Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=CODE_SMELL) [![97.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png '97.7%')](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_coverage=list) [97.7% Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_duplicated_lines_density=list) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5918] Add MAP function (enabled in Spark library) [calcite]
chucheng92 commented on PR #3459: URL: https://github.com/apache/calcite/pull/3459#issuecomment-1766388440 I have rebased to the main to use [CALCITE-5570](https://issues.apache.org/jira/browse/CALCITE-5570), it supports the form like 'cast(null as map)' -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5918] Add MAP function (enabled in Spark library) [calcite]
chucheng92 commented on code in PR #3459: URL: https://github.com/apache/calcite/pull/3459#discussion_r1358161626 ## testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java: ## @@ -6703,11 +6704,53 @@ private static void checkIf(SqlOperatorFixture f) { // test operands not in same type family. f.checkFails("^map_concat(map[1, null], array[1])^", "Parameters must be of the same type", false); + +// 2. check with map function, map(k, v ...) +final SqlOperatorFixture f1 = fixture() +.setFor(SqlLibraryOperators.MAP_CONCAT) +.withLibrary(SqlLibrary.SPARK); +f1.checkScalar("map_concat(map('foo', 1), map('bar', 2))", "{foo=1, bar=2}", +"(CHAR(3) NOT NULL, INTEGER NOT NULL) MAP NOT NULL"); +f1.checkScalar("map_concat(map('foo', 1), map('bar', 2), map('foo', 2))", "{foo=2, bar=2}", +"(CHAR(3) NOT NULL, INTEGER NOT NULL) MAP NOT NULL"); +f1.checkScalar("map_concat(map(null, 1), map(null, 2))", "{null=2}", +"(NULL, INTEGER NOT NULL) MAP NOT NULL"); +f1.checkScalar("map_concat(map(1, 2), map(1, null))", "{1=null}", +"(INTEGER NOT NULL, INTEGER) MAP NOT NULL"); +// test zero arg, but it should return empty map. +f1.checkScalar("map_concat()", "{}", +"(VARCHAR NOT NULL, VARCHAR NOT NULL) MAP"); + +// test concat with empty map, in fact, spark will return MAP(CHAR, INTEGER), because +// it will add a cast 'cast(map() as map)' to convert UNKNOWN type, +// but currently calcite not support cast to map type. +f1.checkScalar("map_concat(map('foo', 1), map())", "{foo=1}", +"(UNKNOWN NOT NULL, UNKNOWN NOT NULL) MAP NOT NULL"); + +// after calcite supports cast(null as map), cast(map() as map) +// it should add these tests. +if (TODO) { Review Comment: I get your point. but I have noticed that CALCITE-5570 has supported cast to map. So these cases can work now. I have removed the IF(TODO). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5918] Add MAP function (enabled in Spark library) [calcite]
chucheng92 commented on code in PR #3459: URL: https://github.com/apache/calcite/pull/3459#discussion_r1358161626 ## testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java: ## @@ -6703,11 +6704,53 @@ private static void checkIf(SqlOperatorFixture f) { // test operands not in same type family. f.checkFails("^map_concat(map[1, null], array[1])^", "Parameters must be of the same type", false); + +// 2. check with map function, map(k, v ...) +final SqlOperatorFixture f1 = fixture() +.setFor(SqlLibraryOperators.MAP_CONCAT) +.withLibrary(SqlLibrary.SPARK); +f1.checkScalar("map_concat(map('foo', 1), map('bar', 2))", "{foo=1, bar=2}", +"(CHAR(3) NOT NULL, INTEGER NOT NULL) MAP NOT NULL"); +f1.checkScalar("map_concat(map('foo', 1), map('bar', 2), map('foo', 2))", "{foo=2, bar=2}", +"(CHAR(3) NOT NULL, INTEGER NOT NULL) MAP NOT NULL"); +f1.checkScalar("map_concat(map(null, 1), map(null, 2))", "{null=2}", +"(NULL, INTEGER NOT NULL) MAP NOT NULL"); +f1.checkScalar("map_concat(map(1, 2), map(1, null))", "{1=null}", +"(INTEGER NOT NULL, INTEGER) MAP NOT NULL"); +// test zero arg, but it should return empty map. +f1.checkScalar("map_concat()", "{}", +"(VARCHAR NOT NULL, VARCHAR NOT NULL) MAP"); + +// test concat with empty map, in fact, spark will return MAP(CHAR, INTEGER), because +// it will add a cast 'cast(map() as map)' to convert UNKNOWN type, +// but currently calcite not support cast to map type. +f1.checkScalar("map_concat(map('foo', 1), map())", "{foo=1}", +"(UNKNOWN NOT NULL, UNKNOWN NOT NULL) MAP NOT NULL"); + +// after calcite supports cast(null as map), cast(map() as map) +// it should add these tests. +if (TODO) { Review Comment: I get your point. but the form such as `cast(map() as map)` may not necessarily be a bug, and there is currently no JIRA to track it, so it is kept as a TODO for the time being. WDYT? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] Feature/bigquery unicode [calcite]
zhougit86 closed pull request #3473: Feature/bigquery unicode URL: https://github.com/apache/calcite/pull/3473 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] Feature/bigquery unicode [calcite]
zhougit86 opened a new pull request, #3473: URL: https://github.com/apache/calcite/pull/3473 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] [CALCITE-3933] Incorrect SQL Emitted for Unicode for Several Dialects [calcite]
zhougit86 opened a new pull request, #3474: URL: https://github.com/apache/calcite/pull/3474 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5763] Discontinue support for Guava < 20.0 [calcite]
sonarcloud[bot] commented on PR #3470: URL: https://github.com/apache/calcite/pull/3470#issuecomment-1765926860 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_calcite=3470) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [13 Code Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![71.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '71.7%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [71.7% Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5763] Discontinue support for Guava < 20.0 [calcite]
sonarcloud[bot] commented on PR #3470: URL: https://github.com/apache/calcite/pull/3470#issuecomment-1765888303 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_calcite=3470) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [12 Code Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![71.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '71.7%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [71.7% Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5763] Discontinue support for Guava < 20.0 [calcite]
sonarcloud[bot] commented on PR #3470: URL: https://github.com/apache/calcite/pull/3470#issuecomment-1765869445 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_calcite=3470) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [12 Code Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![71.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '71.7%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [71.7% Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [CALCITE-5763] Discontinue support for Guava < 20.0 [calcite]
sonarcloud[bot] commented on PR #3470: URL: https://github.com/apache/calcite/pull/3470#issuecomment-1765794284 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_calcite=3470) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3470=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [4 Code Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3470=false=CODE_SMELL) [![23.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '23.1%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [23.1% Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3470=new_duplicated_lines_density=list) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org