[GitHub] [calcite] tanclary commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


tanclary commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295388897


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   I think it makes sense to have one in both places because If someone were to 
write a query using regex that was valid in the re2 library and not Java, if it 
used Calcite's implementation then the error would get thrown from 
`regexpContains` and the user/developer would be able to reference that comment 
for clarification on the library decision. This comes to mind given the recent 
bugs with split and other functions regarding differing behavior between 
Calcite & BigQuery.



##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   I think it makes sense to have one in both places because If someone were to 
write a query using regex that was valid in the re2 library and not Java, if it 
used Calcite's implementation then the error would get thrown from 
`regexpContains` and the user/developer would be able to reference that comment 
for clarification on the library decision. This comes to mind given the recent 
bugs with `split` and other functions regarding differing behavior between 
Calcite & BigQuery.



-- 
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



[GitHub] [calcite] tanclary commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


tanclary commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295388897


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   I think it makes sense to have one in both place because If someone were to 
write a query using regex that was valid in the re2 library and not Java, if it 
used Calcite's implementation then the error would get thrown from 
`regexpContains` and the user/developer would be able to reference that comment 
for clarification on the library decision.



##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   I think it makes sense to have one in both places because If someone were to 
write a query using regex that was valid in the re2 library and not Java, if it 
used Calcite's implementation then the error would get thrown from 
`regexpContains` and the user/developer would be able to reference that comment 
for clarification on the library decision.



-- 
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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3324: [CALCITE-5862] Incorrect semantics of ARRAY function(Spark library) when elements have Numeric and Character types

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3324:
URL: https://github.com/apache/calcite/pull/3324#issuecomment-1679884977

   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=3324)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3324=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=3324=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3324=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=3324=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=3324=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3324=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=3324=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=3324=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3324=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=3324=false=CODE_SMELL)
 
[![D](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/D-16px.png
 
'D')](https://sonarcloud.io/project/issues?id=apache_calcite=3324=false=CODE_SMELL)
 [6 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3324=false=CODE_SMELL)
   
   
[![93.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png
 
'93.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3324=new_coverage=list)
 [93.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3324=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=3324=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3324=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



[GitHub] [calcite] JiajunBernoulli commented on a diff in pull request #3292: [CALCITE-5807] Add SUBSTRING_INDEX function (enabled in Spark library)

2023-08-15 Thread via GitHub


JiajunBernoulli commented on code in PR #3292:
URL: https://github.com/apache/calcite/pull/3292#discussion_r1295303341


##
site/_docs/reference.md:
##
@@ -2764,6 +2764,7 @@ BigQuery's type system uses confusingly different names 
for types and functions:
 | s | MAP_FROM_ARRAYS(array1, array2)| Returns a map created 
from an *array1* and *array2*. Note that the lengths of two arrays should be 
the same and calcite is using the LAST_WIN strategy
 | s | MAP_FROM_ENTRIES(arrayOfRows)  | Returns a map created 
from an arrays of row with two fields. Note that the number of fields in a row 
must be 2. Note that calcite is using the LAST_WIN strategy
 | s | STR_TO_MAP(string [, stringDelimiter [, keyValueDelimiter]]) | Returns a 
map after splitting the *string* into key/value pairs using delimiters. Default 
delimiters are ',' for *stringDelimiter* and ':' for *keyValueDelimiter*. Note 
that calcite is using the LAST_WIN strategy
+| s | SUBSTRING_INDEX(string, delim, count)  | Returns the substring 
from **string** before **count** occurrences of the delimiter **delim**. If 
**count** is positive, everything to the left of the final delimiter (counting 
from the left) is returned. If **count** is negative, everything to the right 
of the final delimiter (counting from the right) is returned. The function 
substring_index performs a case-sensitive match when searching for **delim**.

Review Comment:
   Why the `*` is double?
   
   Other always `*arg*`.



-- 
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



[GitHub] [calcite] JiajunBernoulli commented on pull request #3368: [MINOR] Fix test for exact integral literal

2023-08-15 Thread via GitHub


JiajunBernoulli commented on PR #3368:
URL: https://github.com/apache/calcite/pull/3368#issuecomment-1679850826

   @arkanovicz ,
   We usually only use `[MINOR]` for document changes or code that users are 
not aware of.
   
   Can you create a JIRA ticket for your PR.


-- 
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-5906] JDBC adapter should generate TABLESAMPLE

2023-08-15 Thread jiajunxie
This is an automated email from the ASF dual-hosted git repository.

jiajunxie 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 51da34bdf9 [CALCITE-5906] JDBC adapter should generate TABLESAMPLE
51da34bdf9 is described below

commit 51da34bdf91e602f32f965b3490bace026d51ef4
Author: shenlang 
AuthorDate: Tue Aug 8 22:44:36 2023 +0800

[CALCITE-5906] JDBC adapter should generate TABLESAMPLE
---
 .../calcite/rel/rel2sql/RelToSqlConverter.java | 25 ++
 .../apache/calcite/rel/rel2sql/SqlImplementor.java |  3 +-
 .../calcite/rel/rel2sql/RelToSqlConverterTest.java | 40 ++
 3 files changed, 67 insertions(+), 1 deletion(-)

diff --git 
a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java 
b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java
index 5853ddd414..2462b89d55 100644
--- a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java
+++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java
@@ -19,6 +19,7 @@ package org.apache.calcite.rel.rel2sql;
 import org.apache.calcite.adapter.jdbc.JdbcTable;
 import org.apache.calcite.linq4j.Ord;
 import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.calcite.plan.RelOptSamplingParameters;
 import org.apache.calcite.plan.RelOptTable;
 import org.apache.calcite.rel.RelCollation;
 import org.apache.calcite.rel.RelCollations;
@@ -36,6 +37,7 @@ import org.apache.calcite.rel.core.JoinRelType;
 import org.apache.calcite.rel.core.Match;
 import org.apache.calcite.rel.core.Minus;
 import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.core.Sample;
 import org.apache.calcite.rel.core.Sort;
 import org.apache.calcite.rel.core.TableFunctionScan;
 import org.apache.calcite.rel.core.TableModify;
@@ -72,6 +74,7 @@ import org.apache.calcite.sql.SqlLiteral;
 import org.apache.calcite.sql.SqlMatchRecognize;
 import org.apache.calcite.sql.SqlNode;
 import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.SqlSampleSpec;
 import org.apache.calcite.sql.SqlSelect;
 import org.apache.calcite.sql.SqlTableRef;
 import org.apache.calcite.sql.SqlUpdate;
@@ -875,6 +878,28 @@ public class RelToSqlConverter extends SqlImplementor
 return result(query, clauses, e, null);
   }
 
+  /** Visits a Sample; called by {@link #dispatch} via reflection. */
+  public Result visit(Sample e) {
+Result x = visitInput(e, 0);
+RelOptSamplingParameters parameters = e.getSamplingParameters();
+boolean isRepeatable = parameters.isRepeatable();
+boolean isBernoulli = parameters.isBernoulli();
+
+SqlSampleSpec tableSampleSpec =
+isRepeatable
+? SqlSampleSpec.createTableSample(
+isBernoulli, parameters.sampleRate, parameters.getRepeatableSeed())
+: SqlSampleSpec.createTableSample(isBernoulli, 
parameters.sampleRate);
+
+SqlLiteral tableSampleLiteral =
+SqlLiteral.createSample(tableSampleSpec, POS);
+
+SqlNode tableRef =
+SqlStdOperatorTable.TABLESAMPLE.createCall(POS, x.node, 
tableSampleLiteral);
+
+return result(tableRef, ImmutableList.of(Clause.FROM), e, null);
+  }
+
   private @Nullable SqlIdentifier getDual() {
 final List names = dialect.getSingleRowTableName();
 if (names == null) {
diff --git 
a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java 
b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
index 6517440c5b..4c535c14e3 100644
--- a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
+++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
@@ -541,7 +541,8 @@ public abstract class SqlImplementor {
 || node instanceof SqlCall
 && (((SqlCall) node).getOperator() instanceof SqlSetOperator
 || ((SqlCall) node).getOperator() == SqlStdOperatorTable.AS
-|| ((SqlCall) node).getOperator() == 
SqlStdOperatorTable.VALUES)
+|| ((SqlCall) node).getOperator() == SqlStdOperatorTable.VALUES
+|| ((SqlCall) node).getOperator() == 
SqlStdOperatorTable.TABLESAMPLE)
 : node;
 if (requiresAlias(node)) {
   node = as(node, "t");
diff --git 
a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java 
b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
index 6670a44349..dded73c882 100644
--- 
a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
+++ 
b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
@@ -360,6 +360,46 @@ class RelToSqlConverterTest {
 sql(query).ok(expected);
   }
 
+  /** Test case for
+   * https://issues.apache.org/jira/browse/CALCITE-5906;>[CALCITE-5906]
+   * JDBC adapter should generate TABLESAMPLE. */
+  @Test void testTableSampleBernoulli() 

[GitHub] [calcite] julianhyde commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


julianhyde commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295274217


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   I wouldn't link to jira from the source code. Comments in the source code 
should be self-contained.
   
   (I know we add jira links in bugs. But that's because we *removed* a bug, 
and we don't want to leave a trail of mistakes in the source code.)
   
   This is a decision affects the specification of the function, not just its 
implementation. So I think the right place for the comment is in 
`big-query.iq`. You could have another comment in the body of `regexpContains` 
if you think maintainers might be confused why we're using Java regex.
   



-- 
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



[GitHub] [calcite] Anthrino opened a new pull request, #3369: [CALCITE-5910] Add REGEXP_EXTRACT and REGEXP_SUBSTR functions (enabled in BigQuery library)

2023-08-15 Thread via GitHub


Anthrino opened a new pull request, #3369:
URL: https://github.com/apache/calcite/pull/3369

   (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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3338:
URL: https://github.com/apache/calcite/pull/3338#issuecomment-1679793467

   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=3338)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3338=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=3338=false=CODE_SMELL)
 
[![D](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/D-16px.png
 
'D')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
 [6 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
   
   
[![100.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/100-16px.png
 
'100.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
 [100.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
  
   
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png
 
'2.1%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_duplicated_lines_density=list)
 [2.1% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3338=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3338:
URL: https://github.com/apache/calcite/pull/3338#issuecomment-1679719742

   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=3338)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3338=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=3338=false=CODE_SMELL)
 
[![D](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/D-16px.png
 
'D')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
 [6 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
   
   
[![100.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/100-16px.png
 
'100.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
 [100.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
  
   
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png
 
'2.1%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_duplicated_lines_density=list)
 [2.1% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3338=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3338:
URL: https://github.com/apache/calcite/pull/3338#issuecomment-1679687642

   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=3338)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3338=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=3338=false=CODE_SMELL)
 
[![D](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/D-16px.png
 
'D')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
 [6 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
   
   
[![100.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/100-16px.png
 
'100.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
 [100.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
  
   
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png
 
'2.1%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_duplicated_lines_density=list)
 [2.1% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3338=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3338:
URL: https://github.com/apache/calcite/pull/3338#issuecomment-1679685151

   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=3338)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3338=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=3338=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=3338=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3338=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=3338=false=CODE_SMELL)
 
[![D](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/D-16px.png
 
'D')](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
 [6 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3338=false=CODE_SMELL)
   
   
[![100.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/100-16px.png
 
'100.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
 [100.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_coverage=list)
  
   
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png
 
'2.1%')](https://sonarcloud.io/component_measures?id=apache_calcite=3338=new_duplicated_lines_density=list)
 [2.1% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3338=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



[GitHub] [calcite] Anthrino commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


Anthrino commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295165098


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   Thanks for the pointer Tanner, added a note with issue link to the method 
description.



-- 
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



[GitHub] [calcite] tanclary commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


tanclary commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295127698


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   you can use "

[GitHub] [calcite] tanclary commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


tanclary commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295127698


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   you can use "" to link to a specific case if you text-search you 
should find some good examples



##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   you can use  to link to a specific case if you text-search you 
should find some good examples



-- 
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



[GitHub] [calcite] tanclary commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


tanclary commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295097215


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -345,6 +346,17 @@ public static String sha512(ByteString string)  {
 return DigestUtils.sha512Hex(string.getBytes());
   }
 
+  /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+   * Throws a runtime exception for invalid regular expressions.*/
+  public static boolean regexpContains(String value, String regex) {
+try {
+  Pattern regexp = Pattern.compile(regex);

Review Comment:
   If you're going to stick with Java library, I think it would help to add a 
comment here or elsewhere linking to the case where that decision was made for 
future users/devs



-- 
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



[GitHub] [calcite] wnob commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)

2023-08-15 Thread via GitHub


wnob commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295062657


##
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##
@@ -475,6 +475,14 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding 
operatorBinding,
   @LibraryOperator(libraries = {MYSQL, ORACLE})
   public static final SqlFunction REGEXP_REPLACE = new 
SqlRegexpReplaceFunction();
 
+  /** The "REGEXP_CONTAINS(value, regexp)" function.
+   * Returns TRUE if value is a partial match for the regular expression, 
regexp. */
+  @LibraryOperator(libraries = {BIG_QUERY})

Review Comment:
   BigQuery [uses re2][1] for their regex engine. Google has an [implementation 
for Java][2]. We should use that here, both as a matter of syntax conformance 
(since this is a BigQuery-specific function) and for the security reasons 
outlined in the RE2J readme. This could be a follow-up, but I don't think we 
should close the bug until that's done.
   
   [1]: 
https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains
   [2]: https://github.com/google/re2j



-- 
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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3364: [CALCITE-5923] Some test cases in SqlOperatorTest violates the test fixture's design principle

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3364:
URL: https://github.com/apache/calcite/pull/3364#issuecomment-1679161525

   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)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3364=false=CODE_SMELL)
   
   
[![100.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/100-16px.png
 
'100.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3364=new_coverage=list)
 [100.0% 
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



[GitHub] [calcite] herunkang2018 commented on pull request #3364: [CALCITE-5923] Some test cases in SqlOperatorTest violates the test fixture's design principle

2023-08-15 Thread via GitHub


herunkang2018 commented on PR #3364:
URL: https://github.com/apache/calcite/pull/3364#issuecomment-1679113648

   The avatica error in CI seems related to CALCITE-5678, I will check it. The 
reason why this error appears is that it doesn't check result before, and after 
this fix, the test case fails.


-- 
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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3368: [MINOR] Fix test for exact integral literal

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3368:
URL: https://github.com/apache/calcite/pull/3368#issuecomment-1679036110

   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=3368)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3368=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=3368=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3368=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=3368=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=3368=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3368=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=3368=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=3368=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3368=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=3368=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=3368=false=CODE_SMELL)
 [1 Code 
Smell](https://sonarcloud.io/project/issues?id=apache_calcite=3368=false=CODE_SMELL)
   
   
[![83.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png
 
'83.3%')](https://sonarcloud.io/component_measures?id=apache_calcite=3368=new_coverage=list)
 [83.3% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3368=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=3368=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3368=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3368: [MINOR] Fix test for exact integral literal

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3368:
URL: https://github.com/apache/calcite/pull/3368#issuecomment-1679026683

   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=3368)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3368=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=3368=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3368=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=3368=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=3368=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3368=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=3368=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=3368=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3368=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=3368=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=3368=false=CODE_SMELL)
 [1 Code 
Smell](https://sonarcloud.io/project/issues?id=apache_calcite=3368=false=CODE_SMELL)
   
   
[![80.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png
 
'80.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3368=new_coverage=list)
 [80.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3368=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=3368=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3368=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3363: [CALCITE-5922] The SQL generated for the POSITION function(with 3 input arguments) by the SparkSqlDialect is not recognized by Spark

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3363:
URL: https://github.com/apache/calcite/pull/3363#issuecomment-1678509035

   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=3363)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3363=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=3363=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3363=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=3363=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=3363=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3363=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=3363=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=3363=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3363=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=3363=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=3363=false=CODE_SMELL)
 [1 Code 
Smell](https://sonarcloud.io/project/issues?id=apache_calcite=3363=false=CODE_SMELL)
   
   
[![89.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png
 
'89.5%')](https://sonarcloud.io/component_measures?id=apache_calcite=3363=new_coverage=list)
 [89.5% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3363=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=3363=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3363=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3367: [CALCITE-5889] Add the RelRule that converts Minus into UNION ALL..GROUP BY...WHERE

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3367:
URL: https://github.com/apache/calcite/pull/3367#issuecomment-1678499850

   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=3367)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3367=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=3367=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3367=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=3367=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=3367=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3367=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=3367=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=3367=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3367=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=3367=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=3367=false=CODE_SMELL)
 [2 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3367=false=CODE_SMELL)
   
   
[![93.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png
 
'93.7%')](https://sonarcloud.io/component_measures?id=apache_calcite=3367=new_coverage=list)
 [93.7% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3367=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=3367=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3367=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



[GitHub] [calcite] chucheng92 commented on pull request #3324: [CALCITE-5862] Incorrect semantics of ARRAY function(Spark library) when elements have Numeric and Character types

2023-08-15 Thread via GitHub


chucheng92 commented on PR #3324:
URL: https://github.com/apache/calcite/pull/3324#issuecomment-1678492298

   > So to clarify: you can have an array with multiple types, but only if they 
are NUMERIC/CHARACTER? What if you have another combination like [1, Date 
'2008-12-25', 'a']?
   
   @tanclary thanks for reviewing. I understand your point. however, array 
function use `SameOperandTypeChecker`, it will cause exception firstly and can 
not enter arrayReturnTypeInference when use `[1, Date '2008-12-25', 
'a']`.(varchar is a special case, it will pass SameOperandTypeChecker in 
SqlTypeUtil.isComparable). So, can returnTypeInference rely on 
OperandTypeChecker?  if yes, then here we do not need other types check. and if 
no, we need other types check here. from your professional perspective, 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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3367: [CALCITE-5889] Add the RelRule that converts Minus into UNION ALL..GROUP BY...WHERE

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3367:
URL: https://github.com/apache/calcite/pull/3367#issuecomment-1678491490

   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=3367)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3367=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=3367=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3367=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=3367=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=3367=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3367=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=3367=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=3367=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3367=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=3367=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=3367=false=CODE_SMELL)
 [2 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3367=false=CODE_SMELL)
   
   
[![93.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png
 
'93.7%')](https://sonarcloud.io/component_measures?id=apache_calcite=3367=new_coverage=list)
 [93.7% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3367=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=3367=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3367=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



[GitHub] [calcite] sonarcloud[bot] commented on pull request #3320: [CALCITE-5830] Add ARRAY_INSERT function(enabled in Spark library)

2023-08-15 Thread via GitHub


sonarcloud[bot] commented on PR #3320:
URL: https://github.com/apache/calcite/pull/3320#issuecomment-1678469254

   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=3320)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_calcite=3320=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=3320=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_calcite=3320=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=3320=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=3320=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_calcite=3320=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=3320=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=3320=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite=3320=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=3320=false=CODE_SMELL)
 
[![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png
 
'B')](https://sonarcloud.io/project/issues?id=apache_calcite=3320=false=CODE_SMELL)
 [16 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3320=false=CODE_SMELL)
   
   
[![78.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png
 
'78.6%')](https://sonarcloud.io/component_measures?id=apache_calcite=3320=new_coverage=list)
 [78.6% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3320=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=3320=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_calcite=3320=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