[calcite-avatica] branch tjbanghart/5549 updated (cd3db52f7 -> ddd6fce5f)

2023-10-11 Thread tjbanghart
This is an automated email from the ASF dual-hosted git repository.

tjbanghart pushed a change to branch tjbanghart/5549
in repository https://gitbox.apache.org/repos/asf/calcite-avatica.git


from cd3db52f7 [CALCITE-6034] Add isAutoIncrement and isGenerated args to 
MetaColumn constructor
 add ddd6fce5f Address comments

No new revisions were added by this update.

Summary of changes:
 core/src/main/java/org/apache/calcite/avatica/MetaImpl.java | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)



Re: [PR] [CALCITE-6021] Add CURRENT_DATETIME function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java:
##
@@ -995,7 +995,7 @@ private List toRexList(RelInput relInput, List 
operands) {
 operatorTable.lookupOperatorOverloads(
 new SqlIdentifier(name, new SqlParserPos(0, 0)),
 null,
-sqlSyntax,
+sqlSyntax.family,

Review Comment:
   I removed this change in a later commit



-- 
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-6021] Add CURRENT_DATETIME function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##
@@ -1605,25 +1605,23 @@ void testLikeAndSimilarFails() {
 + "Was expecting 2 arguments");
   }
 
-  @Test void testCurrentDatetime() throws SqlParseException, 
ValidationException {
+  @Test void testCurrentDatetime() {
 final String currentDateTimeExpr = "select ^current_datetime^";
 SqlValidatorFixture shouldFail = sql(currentDateTimeExpr)
 .withConformance(SqlConformanceEnum.BIG_QUERY);
 final String expectedError = "query [select CURRENT_DATETIME]; exception "
 + "[Column 'CURRENT_DATETIME' not found in any table]; class "
 + "[class org.apache.calcite.sql.validate.SqlValidatorException]; pos 
[line 1 col 8 thru line 1 col 8]";
-shouldFail.fails("Column 'CURRENT_DATETIME' not found in any table");
+//shouldFail.fails("Column 'CURRENT_DATETIME' not found in any table");

Review Comment:
   remove the comment or the line



-- 
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-6021] Add CURRENT_DATETIME function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java:
##
@@ -995,7 +995,7 @@ private List toRexList(RelInput relInput, List 
operands) {
 operatorTable.lookupOperatorOverloads(
 new SqlIdentifier(name, new SqlParserPos(0, 0)),
 null,
-sqlSyntax,
+sqlSyntax.family,

Review Comment:
   I agree with @tjbanghart that this change is mysterious. You should explain 
it in a commit comment.
   
   Something like the fact that CURRENT_DATETIME has FUNCTION_ID syntax (to 
allow being called without parentheses) but is registered in the op table as a 
FUNCTION. I don't recall, but it's worth digging up the rationale.



-- 
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-6021] Add CURRENT_DATETIME function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/util/BuiltInMethod.java:
##
@@ -682,6 +682,9 @@ public enum BuiltInMethod {
   CURRENT_TIMESTAMP(SqlFunctions.class, "currentTimestamp", DataContext.class),
   CURRENT_TIME(SqlFunctions.class, "currentTime", DataContext.class),
   CURRENT_DATE(SqlFunctions.class, "currentDate", DataContext.class),
+  CURRENT_DATETIME(SqlFunctions.class, "currentDatetime", DataContext.class),
+  CURRENT_DATETIME2(SqlFunctions.class, "currentDatetime", DataContext.class,
+String.class),

Review Comment:
   indent 4, not 2



-- 
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-6021] Add CURRENT_DATETIME function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
babel/src/test/resources/sql/big-query.iq:
##
@@ -148,23 +148,25 @@ SELECT current_date() AS the_date, t.current_date FROM t;
 #
 # Returns DATETIME
 
-!if (false) {
-SELECT CURRENT_DATETIME() as now;
-++
-| now|
-++
-| 2016-05-19T10:38:47.046465 |
-++
+SELECT CURRENT_DATETIME() > DATETIME '2008-12-25 15:30:00' as now;
++--+
+| now  |
++--+
+| true |
++--+
+(1 row)
+
 !ok
 
-SELECT CURRENT_DATETIME as now;
-++
-| now|
-++
-| 2016-05-19T10:38:47.046465 |
-++
+SELECT CURRENT_DATETIME > DATETIME '2008-12-25 15:30:00' as now;
++--+

Review Comment:
   Would it be useful if Quidem had a way to mask out results? E.g.
   ```
   !mask 6 "[0-9]" "x"
   SELECT CURRENT_DATETIME as now;
   ++
   | now|
   ++
   | 2016-05-19T10:38:47.046465 |
   ++
   ```
   would succeed because '2016-05-19T10:38:47.046465' and 
'2023-11-11T16:38:47.012345' would both be converted to 
'-xx-xxTxx:xx:xx.xx'. The 6 means 'the next 6 lines'.
   
   I logged https://github.com/julianhyde/quidem/issues/79. Please add comments 
there.



-- 
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-avatica-go] branch main updated: Bump golang.org/x/net from 0.11.0 to 0.17.0

2023-10-11 Thread francischuang
This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git


The following commit(s) were added to refs/heads/main by this push:
 new 1cf62a6  Bump golang.org/x/net from 0.11.0 to 0.17.0
1cf62a6 is described below

commit 1cf62a60a4d6d76df9bc8db3cc867510b2274adf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Oct 11 22:47:41 2023 +

Bump golang.org/x/net from 0.11.0 to 0.17.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.11.0 to 
0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.11.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] 
---
 go.mod |  4 ++--
 go.sum | 32 ++--
 2 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/go.mod b/go.mod
index 8b09432..3e3cd9c 100644
--- a/go.mod
+++ b/go.mod
@@ -15,6 +15,6 @@ require (
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
-   golang.org/x/crypto v0.10.0 // indirect
-   golang.org/x/net v0.11.0 // indirect
+   golang.org/x/crypto v0.14.0 // indirect
+   golang.org/x/net v0.17.0 // indirect
 )
diff --git a/go.sum b/go.sum
index 4f024c2..1ab7c3e 100644
--- a/go.sum
+++ b/go.sum
@@ -12,8 +12,6 @@ github.com/gorilla/sessions v1.2.1/go.mod 
h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/z
 github.com/hashicorp/go-uuid v1.0.2/go.mod 
h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
 github.com/hashicorp/go-uuid v1.0.3 
h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
 github.com/hashicorp/go-uuid v1.0.3/go.mod 
h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
-github.com/icholy/digest v0.1.15 
h1:3vCTbaXcUjF84YlICrP/4FvfVX2TKDKgMheLwNZA+GM=
-github.com/icholy/digest v0.1.15/go.mod 
h1:uLAeDdWKIWNFMH0wqbwchbTQOmJWhzSnL7zmqSPqEEc=
 github.com/icholy/digest v0.1.22 
h1:dRIwCjtAcXch57ei+F0HSb5hmprL873+q7PoVojdMzM=
 github.com/icholy/digest v0.1.22/go.mod 
h1:uLAeDdWKIWNFMH0wqbwchbTQOmJWhzSnL7zmqSPqEEc=
 github.com/jcmturner/aescts/v2 v2.0.0 
h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
@@ -24,8 +22,6 @@ github.com/jcmturner/gofork v1.7.6 
h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVET
 github.com/jcmturner/gofork v1.7.6/go.mod 
h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo=
 github.com/jcmturner/goidentity/v6 v6.0.1 
h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=
 github.com/jcmturner/goidentity/v6 v6.0.1/go.mod 
h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg=
-github.com/jcmturner/gokrb5/v8 v8.4.3 
h1:iTonLeSJOn7MVUtyMT+arAn5AKAPrkilzhGw8wE/Tq8=
-github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod 
h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0=
 github.com/jcmturner/gokrb5/v8 v8.4.4 
h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8=
 github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod 
h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs=
 github.com/jcmturner/rpc/v2 v2.0.3 
h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
@@ -40,58 +36,58 @@ github.com/stretchr/objx v0.4.0/go.mod 
h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
 github.com/stretchr/objx v0.5.0/go.mod 
h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
 github.com/stretchr/testify v1.4.0/go.mod 
h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 github.com/stretchr/testify v1.7.1/go.mod 
h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0 
h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
 github.com/stretchr/testify v1.8.0/go.mod 
h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/stretchr/testify v1.8.1 
h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
 github.com/stretchr/testify v1.8.1/go.mod 
h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
 github.com/yuin/goldmark v1.4.13/go.mod 
h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod 
h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod 
h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa 
h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c=
-golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod 
h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.6.0/go.mod 
h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
-golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
-golang.org/x/crypto v0.10.0/go.mod 
h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
+golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
+golang.org/x/crypto v0.14.0/go.mod 
h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod 
h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=

[calcite-avatica-go] branch dependabot/go_modules/golang.org/x/net-0.17.0 deleted (was 5ba412d)

2023-10-11 Thread francischuang
This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a change to branch 
dependabot/go_modules/golang.org/x/net-0.17.0
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git


 was 5ba412d  Bump golang.org/x/net from 0.11.0 to 0.17.0

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



Re: [PR] Bump golang.org/x/net from 0.11.0 to 0.17.0 [calcite-avatica-go]

2023-10-11 Thread via GitHub


F21 merged PR #70:
URL: https://github.com/apache/calcite-avatica-go/pull/70


-- 
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-avatica-go] branch dependabot/go_modules/golang.org/x/net-0.17.0 created (now 5ba412d)

2023-10-11 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/go_modules/golang.org/x/net-0.17.0
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git


  at 5ba412d  Bump golang.org/x/net from 0.11.0 to 0.17.0

No new revisions were added by this update.



[PR] Bump golang.org/x/net from 0.11.0 to 0.17.0 [calcite-avatica-go]

2023-10-11 Thread via GitHub


dependabot[bot] opened a new pull request, #70:
URL: https://github.com/apache/calcite-avatica-go/pull/70

   Bumps [golang.org/x/net](https://github.com/golang/net) from 0.11.0 to 
0.17.0.
   
   Commits
   
   https://github.com/golang/net/commit/b225e7ca6dde1ef5a5ae5ce922861bda011cfabd;>b225e7c
 http2: limit maximum handler goroutines to MaxConcurrentStreams
   https://github.com/golang/net/commit/88194ad8ab44a02ea952c169883c3f57db6cf9f4;>88194ad
 go.mod: update golang.org/x dependencies
   https://github.com/golang/net/commit/2b60a61f1e4cf3a5ecded0bd7e77ea168289e6de;>2b60a61
 quic: fix several bugs in flow control accounting
   https://github.com/golang/net/commit/73d82efb96cacc0c378bc150b56675fc191894b9;>73d82ef
 quic: handle DATA_BLOCKED frames
   https://github.com/golang/net/commit/5d5a036a503f8accd748f7453c0162115187be13;>5d5a036
 quic: handle streams moving from the data queue to the meta queue
   https://github.com/golang/net/commit/350aad2603e57013fafb1a9e2089a382fe67dc80;>350aad2
 quic: correctly extend peer's flow control window after MAX_DATA
   https://github.com/golang/net/commit/21814e71db756f39b69fb1a3e06350fa555a79b1;>21814e7
 quic: validate connection id transport parameters
   https://github.com/golang/net/commit/a600b3518eed7a9a4e24380b4b249cb986d9b64d;>a600b35
 quic: avoid redundant MAX_DATA updates
   https://github.com/golang/net/commit/ea633599b58dc6a50d33c7f5438edfaa8bc313df;>ea63359
 http2: check stream body is present on read timeout
   https://github.com/golang/net/commit/ddd8598e5694aa5e966e44573a53e895f6fa5eb2;>ddd8598
 quic: version negotiation
   Additional commits viewable in https://github.com/golang/net/compare/v0.11.0...v0.17.0;>compare 
view
   
   
   
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net=go_modules=0.11.0=0.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot show  ignore conditions` will show all of 
the ignore conditions of the specified dependency
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Dependabot creating any more for this dependency (unless you reopen the PR or 
upgrade to it yourself)
   You can disable automated security fix PRs for this repo from the [Security 
Alerts page](https://github.com/apache/calcite-avatica-go/network/alerts).
   
   


-- 
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-6034] Adds isAutoIncrement and isGenerated arguments to MetaColumn constructor [calcite-avatica]

2023-10-11 Thread via GitHub


tjbanghart commented on code in PR #229:
URL: https://github.com/apache/calcite-avatica/pull/229#discussion_r1355830634


##
core/src/main/java/org/apache/calcite/avatica/MetaImpl.java:
##
@@ -383,11 +405,29 @@ public MetaColumn(
   this.charOctetLength = charOctetLength;
   this.ordinalPosition = ordinalPosition;
   this.isNullable = isNullable;
+  this.isAutoincrement = isAutoincrement;
+  this.isGeneratedcolumn = isGeneratedcolumn;
 }
 
 public String getName() {
   return columnName;
 }
+
+/** Returns a copy of this MetaColumn, overriding the value of {@code 
isAutoincrement}. */
+@SuppressWarnings("unused") // called from Calcite
+public MetaColumn withIsAutoIncrement(String isAutoincrement) {

Review Comment:
   lol, I thought about this for too long. I'll change it for consistency.



-- 
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-6034] Adds isAutoIncrement and isGenerated arguments to MetaColumn constructor [calcite-avatica]

2023-10-11 Thread via GitHub


tjbanghart commented on code in PR #229:
URL: https://github.com/apache/calcite-avatica/pull/229#discussion_r1355829878


##
core/src/main/java/org/apache/calcite/avatica/MetaImpl.java:
##
@@ -370,6 +371,27 @@ public MetaColumn(
 Integer charOctetLength,
 int ordinalPosition,
 String isNullable) {
+  this(tableCat, tableSchem, tableName, columnName, dataType, typeName, 
columnSize,
+  decimalDigits, numPrecRadix, nullable, charOctetLength, 
ordinalPosition, isNullable, "",
+  "");
+}
+
+public MetaColumn(
+String tableCat,
+String tableSchem,
+String tableName,
+String columnName,
+int dataType,
+String typeName,
+Integer columnSize,
+Integer decimalDigits,
+Integer numPrecRadix,
+int nullable,
+Integer charOctetLength,
+int ordinalPosition,
+String isNullable,
+String isAutoincrement,

Review Comment:
   Yeah I guess that's the convention! I see the same in Calcite so probably 
won't change it 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-6034] Adds isAutoIncrement and isGenerated arguments to MetaColumn constructor [calcite-avatica]

2023-10-11 Thread via GitHub


tanclary commented on code in PR #229:
URL: https://github.com/apache/calcite-avatica/pull/229#discussion_r1355810616


##
core/src/main/java/org/apache/calcite/avatica/MetaImpl.java:
##
@@ -383,11 +405,29 @@ public MetaColumn(
   this.charOctetLength = charOctetLength;
   this.ordinalPosition = ordinalPosition;
   this.isNullable = isNullable;
+  this.isAutoincrement = isAutoincrement;
+  this.isGeneratedcolumn = isGeneratedcolumn;
 }
 
 public String getName() {
   return columnName;
 }
+
+/** Returns a copy of this MetaColumn, overriding the value of {@code 
isAutoincrement}. */
+@SuppressWarnings("unused") // called from Calcite
+public MetaColumn withIsAutoIncrement(String isAutoincrement) {

Review Comment:
   I would make it consistent either do AutoIncremeent or Autoincrement 
everywhere



-- 
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-6034] Adds isAutoIncrement and isGenerated arguments to MetaColumn constructor [calcite-avatica]

2023-10-11 Thread via GitHub


tanclary commented on code in PR #229:
URL: https://github.com/apache/calcite-avatica/pull/229#discussion_r1355810095


##
core/src/main/java/org/apache/calcite/avatica/MetaImpl.java:
##
@@ -370,6 +371,27 @@ public MetaColumn(
 Integer charOctetLength,
 int ordinalPosition,
 String isNullable) {
+  this(tableCat, tableSchem, tableName, columnName, dataType, typeName, 
columnSize,
+  decimalDigits, numPrecRadix, nullable, charOctetLength, 
ordinalPosition, isNullable, "",
+  "");
+}
+
+public MetaColumn(
+String tableCat,
+String tableSchem,
+String tableName,
+String columnName,
+int dataType,
+String typeName,
+Integer columnSize,
+Integer decimalDigits,
+Integer numPrecRadix,
+int nullable,
+Integer charOctetLength,
+int ordinalPosition,
+String isNullable,
+String isAutoincrement,

Review Comment:
   
https://stackoverflow.com/questions/44170873/camel-casing-hyphenated-english-words-e-g-re-render#:~:text=1%20Answer=In%20camel%2Dcase%2C%20individual%20trailing,a%20single%20word%20would%20normally.
 this SO user makes a compelling case, sounds good to me



-- 
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-6034] Adds isAutoIncrement and isGenerated arguments to MetaColumn constructor [calcite-avatica]

2023-10-11 Thread via GitHub


tanclary commented on code in PR #229:
URL: https://github.com/apache/calcite-avatica/pull/229#discussion_r1355809442


##
core/src/main/java/org/apache/calcite/avatica/MetaImpl.java:
##
@@ -370,6 +371,27 @@ public MetaColumn(
 Integer charOctetLength,
 int ordinalPosition,
 String isNullable) {
+  this(tableCat, tableSchem, tableName, columnName, dataType, typeName, 
columnSize,
+  decimalDigits, numPrecRadix, nullable, charOctetLength, 
ordinalPosition, isNullable, "",
+  "");
+}
+
+public MetaColumn(
+String tableCat,
+String tableSchem,
+String tableName,
+String columnName,
+int dataType,
+String typeName,
+Integer columnSize,
+Integer decimalDigits,
+Integer numPrecRadix,
+int nullable,
+Integer charOctetLength,
+int ordinalPosition,
+String isNullable,
+String isAutoincrement,

Review Comment:
   is auto-increment one word?  Do you camelCase hyphenated words? Interesting..



-- 
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-6034] Adds isAutoIncrement and isGenerated arguments to MetaColumn constructor [calcite-avatica]

2023-10-11 Thread via GitHub


tanclary commented on code in PR #229:
URL: https://github.com/apache/calcite-avatica/pull/229#discussion_r1355808523


##
core/src/main/java/org/apache/calcite/avatica/MetaImpl.java:
##
@@ -352,10 +352,11 @@ public static class MetaColumn implements Named {
 public final String scopeTable = null;
 public final Short sourceDataType = null;
 @ColumnNoNulls
-public final String isAutoincrement = "";
+public final String isAutoincrement;
 @ColumnNoNulls
-public final String isGeneratedcolumn = "";
+public final String isGeneratedcolumn;
 
+@Deprecated // to be removed before 2.0

Review Comment:
   I assume this is the constructor that was failing when building Calcite?



-- 
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-avatica] branch tjbanghart/5549 updated (0c9d0b1b4 -> cd3db52f7)

2023-10-11 Thread tjbanghart
This is an automated email from the ASF dual-hosted git repository.

tjbanghart pushed a change to branch tjbanghart/5549
in repository https://gitbox.apache.org/repos/asf/calcite-avatica.git


 discard 0c9d0b1b4 [CALCITE-6034] Adds isAutoIncrement and isGenerated args to 
MetaColumn constructor
 add cd3db52f7 [CALCITE-6034] Add isAutoIncrement and isGenerated args to 
MetaColumn constructor

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (0c9d0b1b4)
\
 N -- N -- N   refs/heads/tjbanghart/5549 (cd3db52f7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 .../java/org/apache/calcite/avatica/MetaImpl.java  | 36 ++
 1 file changed, 36 insertions(+)



Re: [PR] [CALCITE-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java:
##
@@ -256,6 +256,16 @@ public interface SqlConformance {
*/
   boolean isMinusAllowed();
 
+  /**
+   * Whether dialect uses default syntax of {@code $} for indexing capturing 
groups in
+   * regular expressions or alternate syntax of {@code \\} for {@code 
REGEXP_REPLACE}.

Review Comment:
   s/regular expressions/the replacement string of regular expression functions/
   
   also add an example. Something like "For example BigQuery 
REGEXP_REPLACE(...)  is equivalent to Postgres REGEXP_REPLACE(...)"



-- 
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-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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

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

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -546,8 +548,8 @@ public int regexpInstr(String value, String regex, int 
position,
   final String methodName = "REGEXP_INSTR";
   final Pattern pattern = validateRegexPattern(regex, methodName);
 
-  if (checkPosOccurrenceParamValues(position, occurrence, 
occurrencePosition, value,
-  methodName) || regex.isEmpty()) {
+  if (regex.isEmpty() || !validatePosOccurrenceParamValues(position, 
occurrence,
+  occurrencePosition, value, methodName)) {

Review Comment:
   Put `||` on a new line.
   
   (Multi-line expressions shouldn't cross 'branches' of the expression tree in 
the middle of a line.)



-- 
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-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -603,6 +605,38 @@ public String regexpReplace(String s, String regex, String 
replacement,
   return Unsafe.regexpReplace(s, pattern, replacement, pos, occurrence);
 }
 
+/** SQL {@code REGEXP_REPLACE} function with 3 arguments with
+ * {@code \\} based indexing for capturing groups.
+ */
+public String regexpReplaceNonDollarIndexed(String s, String regex,
+String replacement) {
+  // Preprocessing to convert double-backslash based indexing for capturing
+  // groups into $ based indices recognized by java regex.
+
+  // Explicitly escaping any $ symbols coming from input
+  // to ignore them from being considered as capturing group index.
+  String indexedReplacement = replacement.replace("", "\\")
+  .replace("$", "\\$");
+
+  // Check each occurrence of escaped chars, convert \ integers into
+  // $ indices, keep \\ and \$, throw an error for any other invalid 
escapes.
+  int lastOccIdx = 0;
+  while (lastOccIdx != -1) {

Review Comment:
   Thanks for the feedback Tanner, restructured the index lookup statement 
outside the loop to remove one if condition. 



-- 
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-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##
@@ -4810,12 +4810,34 @@ private static void checkIf(SqlOperatorFixture f) {
   "VARCHAR NOT NULL");
   f.checkString("regexp_replace('abc\t\ndef\t\nghi', '\\w+', '+')", 
"+\t\n+\t\n+",
   "VARCHAR NOT NULL");
+
   f.checkQuery("select regexp_replace('a b c', 'b', 'X')");
   f.checkQuery("select regexp_replace('a b c', 'b', 'X', 1)");
   f.checkQuery("select regexp_replace('a b c', 'b', 'X', 1, 3)");
   f.checkQuery("select regexp_replace('a b c', 'b', 'X', 1, 3, 'i')");
 };
-f0.forEachLibrary(list(SqlLibrary.MYSQL, SqlLibrary.ORACLE), consumer);
+f0.forEachLibrary(list(SqlLibrary.MYSQL, SqlLibrary.ORACLE, 
SqlLibrary.BIG_QUERY), consumer);
+

Review Comment:
   Sounds good!



-- 
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-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java:
##
@@ -240,6 +240,15 @@ public enum SqlConformanceEnum implements SqlConformance {
 }
   }
 
+  @Override public boolean isRegexReplaceCaptureGroupDollarIndexed() {

Review Comment:
   Hi @julianhyde, we came up with this approach to identify calls from Big 
Query by adding an `isRegexReplaceCaptureGroupDollarIndexed()` method in 
`SqlConformanceEnum`. 
   Like Tanner mentioned, it is a function specific use case so would it be 
better to create a new BQ specific operator (`REGEXP_REPLACE_BIG_QUERY`) in 
`StandardConvertletTable` instead and point that to the added custom 
preprocessing method in `SqlFunctions`



-- 
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-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java:
##
@@ -240,6 +240,15 @@ public enum SqlConformanceEnum implements SqlConformance {
 }
   }
 
+  @Override public boolean isRegexReplaceCaptureGroupDollarIndexed() {

Review Comment:
   Hi @julianhyde, we came up with this approach to identify calls from Big 
Query by adding an `isRegexReplaceCaptureGroupDollarIndexed()` method in the 
`SqlConformanceEnum`. 
   Like Tanner mentioned, it is a function specific use case so would it be 
better to create a new BQ specific operator (`REGEXP_REPLACE_BIG_QUERY`) in 
`StandardConvertletTable` instead and point that to the added custom 
preprocessing method in `SqlFunctions`



-- 
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-5979] Add REGEXP_REPLACE function (enabled in BigQuery library) [calcite]

2023-10-11 Thread via GitHub


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


##
core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java:
##
@@ -240,6 +240,15 @@ public enum SqlConformanceEnum implements SqlConformance {
 }
   }
 
+  @Override public boolean isRegexReplaceCaptureGroupDollarIndexed() {

Review Comment:
   Hi @julianhyde, we came up with this approach to identify calls from Big 
Query by adding an `isDollarIndexed()` method in the `SqlConformanceEnum`. 
   Like Tanner mentioned, it is a function specific use case so would it be 
better to create a new BQ specific operator (`REGEXP_REPLACE_BIG_QUERY`) in 
`StandardConvertletTable` instead and point that to the added custom 
preprocessing method in `SqlFunctions`



-- 
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-5993] Add CODE_POINTS_TO_STRING, TO_CODE_POINTS function (en… [calcite]

2023-10-11 Thread via GitHub


tanclary merged PR #3417:
URL: https://github.com/apache/calcite/pull/3417


-- 
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-5993] Add CODE_POINTS_TO_STRING, TO_CODE_POINTS function (enabled in BigQuery library)

2023-10-11 Thread tanner
This is an automated email from the ASF dual-hosted git repository.

tanner 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 77b3689e90 [CALCITE-5993] Add CODE_POINTS_TO_STRING, TO_CODE_POINTS 
function (enabled in BigQuery library)
77b3689e90 is described below

commit 77b3689e907e188d25d76e5d82e5f19a3323dba8
Author: macroguo 
AuthorDate: Mon Sep 11 00:35:15 2023 +0800

[CALCITE-5993] Add CODE_POINTS_TO_STRING, TO_CODE_POINTS function (enabled 
in BigQuery library)
---
 babel/src/test/resources/sql/big-query.iq  | 154 +
 .../calcite/adapter/enumerable/RexImpTable.java|   6 +
 .../apache/calcite/runtime/CalciteResource.java|   4 +-
 .../org/apache/calcite/runtime/SqlFunctions.java   |  63 -
 .../calcite/sql/fun/SqlLibraryOperators.java   |  24 +++-
 .../apache/calcite/sql/type/SqlTypeTransforms.java |  10 +-
 .../org/apache/calcite/util/BuiltInMethod.java |   2 +
 .../calcite/runtime/CalciteResource.properties |   2 +-
 site/_docs/reference.md|   2 +
 .../org/apache/calcite/test/SqlOperatorTest.java   |  74 +-
 10 files changed, 327 insertions(+), 14 deletions(-)

diff --git a/babel/src/test/resources/sql/big-query.iq 
b/babel/src/test/resources/sql/big-query.iq
index 9dce6abdd0..36c8144a30 100755
--- a/babel/src/test/resources/sql/big-query.iq
+++ b/babel/src/test/resources/sql/big-query.iq
@@ -2184,6 +2184,160 @@ SELECT CODE_POINTS_TO_BYTES(array[2147483648, 1]);
 Input arguments of CODE_POINTS_TO_BYTES out of range: 2147483648
 !error
 
+#
+# CODE_POINTS_TO_STRING(array)
+#
+# Takes an array of Unicode code points as ARRAY
+# and returns a STRING.
+#
+SELECT CODE_POINTS_TO_STRING(array[65, 66, 67, 68]) as result;
+++
+| result |
+++
+| ABCD   |
+++
+(1 row)
+
+!ok
+
+SELECT CODE_POINTS_TO_STRING(array[255, 254, 1024, 7]) as result;
+++
+| result |
+++
+| ÿþЀᅰ  |
+++
+(1 row)
+
+!ok
+
+SELECT CODE_POINTS_TO_STRING(array[1+2, 3]) as result;
+++
+| result |
+++
+|  |
+++
+(1 row)
+
+!ok
+
+SELECT CODE_POINTS_TO_STRING(null) as result;
+++
+| result |
+++
+||
+++
+(1 row)
+
+!ok
+
+SELECT CODE_POINTS_TO_STRING(array[65, null]) as result;
+++
+| result |
+++
+||
+++
+(1 row)
+
+!ok
+
+SELECT CODE_POINTS_TO_STRING('abc') as result;
+Cannot apply 'CODE_POINTS_TO_STRING' to arguments of type 
'CODE_POINTS_TO_STRING()'. Supported form(s): 
CODE_POINTS_TO_STRING()
+!error
+
+SELECT CODE_POINTS_TO_STRING(array[-1]) as result;
+Input arguments of CODE_POINTS_TO_STRING out of range: -1
+!error
+
+SELECT CODE_POINTS_TO_STRING(array[2147483648, 1]);
+Input arguments of CODE_POINTS_TO_STRING out of range: 2147483648
+!error
+
+#
+# TO_CODE_POINTS(value)
+#
+# Takes a STRING or BYTES value and returns an array of INT64 values
+# that represent code points or extended ASCII character values.
+# 1. If value is a STRING, each element in the returned array
+# represents a code point. Each code point falls within the range of
+# [0, 0xD7FF] and [0xE000, 0x10].
+# 2. If value is BYTES, each element in the array is an extended
+# ASCII character value in the range of [0, 255].
+#
+SELECT TO_CODE_POINTS('ABCD') as result;
++--+
+| result   |
++--+
+| [65, 66, 67, 68] |
++--+
+(1 row)
+
+!ok
+
+SELECT TO_CODE_POINTS(x'11223344') as result;
++--+
+| result   |
++--+
+| [17, 34, 51, 68] |
++--+
+(1 row)
+
+!ok
+
+SELECT TO_CODE_POINTS(CODE_POINTS_TO_STRING(array[255, 254, 1024, 7, 65])) 
as result;
++-+
+| result  |
++-+
+| [255, 254, 1024, 7, 65] |
++-+
+(1 row)
+
+!ok
+
+SELECT TO_CODE_POINTS(CODE_POINTS_TO_BYTES(array[64, 65, 66, 67])) as result;
++--+
+| result   |
++--+
+| [64, 65, 66, 67] |
++--+
+(1 row)
+
+!ok
+
+SELECT TO_CODE_POINTS(null) as result;
+++
+| result |
+++
+||
+++
+(1 row)
+
+!ok
+
+SELECT TO_CODE_POINTS('') as result;
+++
+| result |
+++
+||
+++
+(1 row)
+
+!ok
+
+SELECT TO_CODE_POINTS(x'') as result;
+++
+| result |
+++
+||
+++
+(1 row)
+
+!ok
+
+SELECT to_code_points(array[1, 2, 3]) as result;
+Error while executing SQL "SELECT to_code_points(array[1, 2, 3]) as result": 
From line 1, column 8 to line 1, column 37: Cannot apply 'TO_CODE_POINTS' to 
arguments of type 'TO_CODE_POINTS()'. Supported form(s): 
'TO_CODE_POINTS()'

Re: [PR] [CALCITE-6038] Remove redundant TopN when its input's row count is provably at most one row [calcite]

2023-10-11 Thread via GitHub


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

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



[PR] [CALCITE-6038] Remove redundant TopN when its input's row count is provably at most one row [calcite]

2023-10-11 Thread via GitHub


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

   (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-6022] Support "CREATE TABLE LIKE" DDL [calcite]

2023-10-11 Thread via GitHub


macroguo-ghy commented on PR #3442:
URL: https://github.com/apache/calcite/pull/3442#issuecomment-1757457607

   Hi @JiajunBernoulli, can you review this PR again? I believe we can merge it 
before 1.36.0 release.


-- 
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-5993] Add CODE_POINTS_TO_STRING, TO_CODE_POINTS function (en… [calcite]

2023-10-11 Thread via GitHub


macroguo-ghy commented on PR #3417:
URL: https://github.com/apache/calcite/pull/3417#issuecomment-1757440252

   Hi @tanclary, could you please review this PR again when you have time? I 
believe we can merge it before the 1.36.0 release.


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

2023-10-11 Thread via GitHub


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

   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)
 [18 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_calcite=3459=false=CODE_SMELL)
   
   
[![97.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png
 
'97.6%')](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_coverage=list)
 [97.6% 
Coverage](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_coverage=list)
  
   
[![10.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png
 
'10.0%')](https://sonarcloud.io/component_measures?id=apache_calcite=3459=new_duplicated_lines_density=list)
 [10.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