[jira] [Updated] (CALCITE-6231) ORDINALITY is omitted during the RelToSql stage

2024-01-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-6231:

Labels: pull-request-available  (was: )

> ORDINALITY is omitted during the RelToSql stage
> ---
>
> Key: CALCITE-6231
> URL: https://issues.apache.org/jira/browse/CALCITE-6231
> Project: Calcite
>  Issue Type: Bug
>Reporter:  EveyWu
>Assignee:  EveyWu
>Priority: Major
>  Labels: pull-request-available
>
> The syntax UNNEST() WITH ORDINALITY is missing the ORDINALITY keyword.
> For example sql:
> {code:java}
> select did + 1 from 
> unnest(select collect("department_id") as deptid from "department") 
> with ordinality as t(did, pos){code}
>  
> current planned sql:
> {code:java}
> SELECT DEPTID + 1 FROM UNNEST (
> SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
> AS "t0" ("DEPTID", "ORDINALITY") {code}
>  
> fixed planned sql:
> {code:java}
> SELECT "DEPTID" + 1 FROM UNNEST (
> SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
> WITH ORDINALITY AS "t0" ("DEPTID", "ORDINALITY") {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (CALCITE-6231) ORDINALITY is omitted during the RelToSql stage

2024-01-26 Thread EveyWu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

 EveyWu reassigned CALCITE-6231:


Assignee:  EveyWu

> ORDINALITY is omitted during the RelToSql stage
> ---
>
> Key: CALCITE-6231
> URL: https://issues.apache.org/jira/browse/CALCITE-6231
> Project: Calcite
>  Issue Type: Bug
>Reporter:  EveyWu
>Assignee:  EveyWu
>Priority: Major
>
> The syntax UNNEST() WITH ORDINALITY is missing the ORDINALITY keyword.
> For example sql:
> {code:java}
> select did + 1 from 
> unnest(select collect("department_id") as deptid from "department") 
> with ordinality as t(did, pos){code}
>  
> current planned sql:
> {code:java}
> SELECT DEPTID + 1 FROM UNNEST (
> SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
> AS "t0" ("DEPTID", "ORDINALITY") {code}
>  
> fixed planned sql:
> {code:java}
> SELECT "DEPTID" + 1 FROM UNNEST (
> SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
> WITH ORDINALITY AS "t0" ("DEPTID", "ORDINALITY") {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-6231) ORDINALITY is omitted during the RelToSql stage

2024-01-26 Thread EveyWu (Jira)
 EveyWu created CALCITE-6231:


 Summary: ORDINALITY is omitted during the RelToSql stage
 Key: CALCITE-6231
 URL: https://issues.apache.org/jira/browse/CALCITE-6231
 Project: Calcite
  Issue Type: Bug
Reporter:  EveyWu


The syntax UNNEST() WITH ORDINALITY is missing the ORDINALITY keyword.

For example sql:
{code:java}
select did + 1 from 
unnest(select collect("department_id") as deptid from "department") 
with ordinality as t(did, pos){code}
 
current planned sql:
{code:java}
SELECT DEPTID + 1 FROM UNNEST (
SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
AS "t0" ("DEPTID", "ORDINALITY") {code}
 
fixed planned sql:
{code:java}
SELECT "DEPTID" + 1 FROM UNNEST (
SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
WITH ORDINALITY AS "t0" ("DEPTID", "ORDINALITY") {code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (CALCITE-6063) If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted

2024-01-26 Thread Ran Tao (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811465#comment-17811465
 ] 

Ran Tao edited comment on CALCITE-6063 at 1/27/24 3:47 AM:
---

Fixed via 
[dc4ce8|https://github.com/apache/calcite/commit/dc4ce8b31c4927f6f43d6b6f81533ac232e1f72c]


was (Author: lemonjing):
Fixed via 
[dc4ce8b31c4927f6f43d6b6f81533ac232e1f72c|https://github.com/apache/calcite/commit/dc4ce8b31c4927f6f43d6b6f81533ac232e1f72c]

> If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted
> ---
>
> Key: CALCITE-6063
> URL: https://issues.apache.org/jira/browse/CALCITE-6063
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.35.0
>Reporter: Ran Tao
>Assignee: Ran Tao
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> calcite support array query constructor.
> but If we run sub-query with orderby:
> {code:java}
> select array(select x from unnest(array[1,2,3]) as t(x) order by x desc); 
> select array(select x from unnest(array[1,2,3]) as t(x) order by x asc); 
> {code}
> they both return
> {code:java}
> +---+
> |  EXPR$0   |
> +---+
> | [1, 2, 3] |
> +---+
>  {code}
> however, we expect return *[3, 2, 1]* when use {*}order by x desc{*}.
> It seems that the *order by* not works properly in array sub-query.
> This issue is introduced by the issue 
> https://issues.apache.org/jira/browse/CALCITE-2978
> However the ARRAY is not applicable in this scenario. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6063) If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted

2024-01-26 Thread Ran Tao (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811465#comment-17811465
 ] 

Ran Tao commented on CALCITE-6063:
--

Fixed via 
[dc4ce8b31c4927f6f43d6b6f81533ac232e1f72c|https://github.com/apache/calcite/commit/dc4ce8b31c4927f6f43d6b6f81533ac232e1f72c]

> If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted
> ---
>
> Key: CALCITE-6063
> URL: https://issues.apache.org/jira/browse/CALCITE-6063
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.35.0
>Reporter: Ran Tao
>Assignee: Ran Tao
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> calcite support array query constructor.
> but If we run sub-query with orderby:
> {code:java}
> select array(select x from unnest(array[1,2,3]) as t(x) order by x desc); 
> select array(select x from unnest(array[1,2,3]) as t(x) order by x asc); 
> {code}
> they both return
> {code:java}
> +---+
> |  EXPR$0   |
> +---+
> | [1, 2, 3] |
> +---+
>  {code}
> however, we expect return *[3, 2, 1]* when use {*}order by x desc{*}.
> It seems that the *order by* not works properly in array sub-query.
> This issue is introduced by the issue 
> https://issues.apache.org/jira/browse/CALCITE-2978
> However the ARRAY is not applicable in this scenario. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CALCITE-6063) If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted

2024-01-26 Thread Ran Tao (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6063?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ran Tao resolved CALCITE-6063.
--
Resolution: Fixed

> If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted
> ---
>
> Key: CALCITE-6063
> URL: https://issues.apache.org/jira/browse/CALCITE-6063
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.35.0
>Reporter: Ran Tao
>Assignee: Ran Tao
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> calcite support array query constructor.
> but If we run sub-query with orderby:
> {code:java}
> select array(select x from unnest(array[1,2,3]) as t(x) order by x desc); 
> select array(select x from unnest(array[1,2,3]) as t(x) order by x asc); 
> {code}
> they both return
> {code:java}
> +---+
> |  EXPR$0   |
> +---+
> | [1, 2, 3] |
> +---+
>  {code}
> however, we expect return *[3, 2, 1]* when use {*}order by x desc{*}.
> It seems that the *order by* not works properly in array sub-query.
> This issue is introduced by the issue 
> https://issues.apache.org/jira/browse/CALCITE-2978
> However the ARRAY is not applicable in this scenario. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6222) Mysql does not have to_char function

2024-01-26 Thread Caican Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811454#comment-17811454
 ] 

Caican Cai commented on CALCITE-6222:
-

thank everyone

> Mysql does not have to_char function
> 
>
> Key: CALCITE-6222
> URL: https://issues.apache.org/jira/browse/CALCITE-6222
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6063) If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted

2024-01-26 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811392#comment-17811392
 ] 

Julian Hyde commented on CALCITE-6063:
--

Looks good. I asked for validator test but I see you added parser test - 
correctly, because ORDER BY is prohibited by parser logic.

> If ARRAY subquery has ORDER BY (without LIMIT), rows are not sorted
> ---
>
> Key: CALCITE-6063
> URL: https://issues.apache.org/jira/browse/CALCITE-6063
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.35.0
>Reporter: Ran Tao
>Assignee: Ran Tao
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> calcite support array query constructor.
> but If we run sub-query with orderby:
> {code:java}
> select array(select x from unnest(array[1,2,3]) as t(x) order by x desc); 
> select array(select x from unnest(array[1,2,3]) as t(x) order by x asc); 
> {code}
> they both return
> {code:java}
> +---+
> |  EXPR$0   |
> +---+
> | [1, 2, 3] |
> +---+
>  {code}
> however, we expect return *[3, 2, 1]* when use {*}order by x desc{*}.
> It seems that the *order by* not works properly in array sub-query.
> This issue is introduced by the issue 
> https://issues.apache.org/jira/browse/CALCITE-2978
> However the ARRAY is not applicable in this scenario. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CALCITE-6222) Mysql does not have to_char function

2024-01-26 Thread Julian Hyde (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde resolved CALCITE-6222.
--
Resolution: Invalid

> Mysql does not have to_char function
> 
>
> Key: CALCITE-6222
> URL: https://issues.apache.org/jira/browse/CALCITE-6222
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Reopened] (CALCITE-6222) Mysql does not have to_char function

2024-01-26 Thread Julian Hyde (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde reopened CALCITE-6222:
--

> Mysql does not have to_char function
> 
>
> Key: CALCITE-6222
> URL: https://issues.apache.org/jira/browse/CALCITE-6222
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6222) Mysql does not have to_char function

2024-01-26 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811389#comment-17811389
 ] 

Julian Hyde commented on CALCITE-6222:
--

The first step in this case should have been to contact the author of 
CALCITE-5619 and ask why they added 'm' to the list of supported dialects. I 
find [~jiajunbernoulli]'s hypothesis - that MariaDB supports {{TO_CHAR}} - to 
be compelling.

See .[Chesterton's fence|https://en.wiktionary.org/wiki/Chesterton%27s_fence]. 

Given that MariaDB has {{TO_CHAR}}, and one of the goals of the MYSQL library 
({{fun=mysql}}) is to make Calcite look like MariaDB, it seems that Calcite's 
behavior was correct before this bug was fixed.

It is much more harmful that {{TO_CHAR}} is missing for someone who expects 
MariaDB compatibility than for it to be present for someone who expects MySQL 
compatibility. Let's choose the lesser harm.

Reverted in commit 
[523bbf37|https://github.com/apache/calcite/commit/523bbf3730ac1670928ee4e0f54745cc337eefb0];
 now, the MYSQL library does support the {{TO_CHAR}} function.

> Mysql does not have to_char function
> 
>
> Key: CALCITE-6222
> URL: https://issues.apache.org/jira/browse/CALCITE-6222
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (CALCITE-6230) Jira case collections

2024-01-26 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811387#comment-17811387
 ] 

Julian Hyde edited comment on CALCITE-6230 at 1/26/24 8:12 PM:
---

Maybe the intention of this case is to group cases to make them easier to find 
by new contributors? I know we agreed to use the 'newbie' tag for that purpose 
- and we should continue to do that - but I do think this case is a good use of 
Jira, because the Jira description can contain free-format text and also 
hyperlinks.

If it makes it easier for someone to find a case to work on, it's valuable.

But let's also continue to use the 'newbie' tag where appropriate.

Also, please use the 'related' link whenever possible. That is the best tool in 
Jira, in my opinion, for making sense of the graph.


was (Author: julianhyde):
Maybe the intention of this case is to group cases to make them easier to find 
by new contributors? I know we agreed to use the 'newbie' tag for that purpose 
- and we should continue to do that - but I do think this case is a good use of 
Jira, because the Jira description can contain free-format text and also 
hyperlinks.

If it makes it easier for someone to find a case to work on, it's valuable.

But let's also continue to use the 'newbie' tag where appropriate.

> Jira case collections
> -
>
> Key: CALCITE-6230
> URL: https://issues.apache.org/jira/browse/CALCITE-6230
> Project: Calcite
>  Issue Type: Task
>Reporter: hongyu guo
>Priority: Minor
>
> Related thread: [Collection of some jira 
> cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]
> syntax:
> CALCITE-5852: MERGE INTO
> CALCITE-5301: AT TIME ZONE
> CALCITE-5386: LIKE (ANY | SOME | ALL)
> CALCITE-5216: Cannot parse parenthesized nested WITH clause
> CALCITE-5205: Supports hint option as string and numeric literal
> CALCITE-5168: Allow AS after parenthesized JOIN
> CALCITE-5084: Support ROWS syntax with TABLESAMPLE
> CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
> CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
> CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
> statement
> CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
> CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands
> data type:
> CALCITE-5346: type aliases
> CALCITE-4918: Add a VARIANT data type
> rule and optimization:
> CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
> CALCITE-4052: Enable Top-down Optimization
> dialect:
> CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
> function:
> CALCITE-5809: enable already available functions in Apache Spark Library
> CALCITE-5087: Support bitwise operators
> CALCITE-4521: Support User Defined Table-valued Function
> CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
> unique
> CALCITE-3683: Enhanced MATH Function
> CALCITE-3646: MySQL compression functions
> CALCITE-2031: Implement more OpenGIS functions
> CALCITE-2871: Implement JSON_TABLE table function



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6230) Jira case collections

2024-01-26 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811387#comment-17811387
 ] 

Julian Hyde commented on CALCITE-6230:
--

Maybe the intention of this case is to group cases to make them easier to find 
by new contributors? I know we agreed to use the 'newbie' tag for that purpose 
- and we should continue to do that - but I do think this case is a good use of 
Jira, because the Jira description can contain free-format text and also 
hyperlinks.

If it makes it easier for someone to find a case to work on, it's valuable.

But let's also continue to use the 'newbie' tag where appropriate.

> Jira case collections
> -
>
> Key: CALCITE-6230
> URL: https://issues.apache.org/jira/browse/CALCITE-6230
> Project: Calcite
>  Issue Type: Task
>Reporter: hongyu guo
>Priority: Minor
>
> Related thread: [Collection of some jira 
> cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]
> syntax:
> CALCITE-5852: MERGE INTO
> CALCITE-5301: AT TIME ZONE
> CALCITE-5386: LIKE (ANY | SOME | ALL)
> CALCITE-5216: Cannot parse parenthesized nested WITH clause
> CALCITE-5205: Supports hint option as string and numeric literal
> CALCITE-5168: Allow AS after parenthesized JOIN
> CALCITE-5084: Support ROWS syntax with TABLESAMPLE
> CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
> CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
> CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
> statement
> CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
> CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands
> data type:
> CALCITE-5346: type aliases
> CALCITE-4918: Add a VARIANT data type
> rule and optimization:
> CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
> CALCITE-4052: Enable Top-down Optimization
> dialect:
> CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
> function:
> CALCITE-5809: enable already available functions in Apache Spark Library
> CALCITE-5087: Support bitwise operators
> CALCITE-4521: Support User Defined Table-valued Function
> CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
> unique
> CALCITE-3683: Enhanced MATH Function
> CALCITE-3646: MySQL compression functions
> CALCITE-2031: Implement more OpenGIS functions
> CALCITE-2871: Implement JSON_TABLE table function



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CALCITE-5649) Produce row count statistics from ReflectiveSchema for array based tables

2024-01-26 Thread Mihai Budiu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-5649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-5649.
--
Fix Version/s: 1.37.0
   Resolution: Fixed

Fixed in 
https://github.com/apache/calcite/commit/12b3f3a6e486ef0d1cfce44664125372e35109bf
Thank you, [~adamkennedy77]

> Produce row count statistics from ReflectiveSchema for array based tables
> -
>
> Key: CALCITE-5649
> URL: https://issues.apache.org/jira/browse/CALCITE-5649
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Affects Versions: 1.34.0
>Reporter: Adam Kennedy
>Assignee: Adam Kennedy
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> When testing new Calcite implementations it is easy to use (and several 
> online examples indeed use) a trivial reflected synthetic schema such as the 
> following:
> {code:java}
> public Schema getSchema() {
> return new ReflectiveSchema(new PeopleSchema());
> }
> public static final class PeopleSchema {
> public final Person[] heroes = {
> new Person("Ironman", 12),
> new Person("Batman", 10)
> };
> public static class Person {
> public final String name;
> public final int age;
> public Person(final String name, final int age) {
> this.name = name;
> this.age = age;
> }
> }
> }
> {code}
> While this works for some basics, the lack of statistics makes it less useful 
> than it could be. While not all variations supported by ReflectiveSchema can 
> easily capture statistics, the variation which provides the table as an array 
> has trivial access to a valid RowCount value.
> For these simple cases ReflectiveSchema should provide a Statistic object 
> with a valid row count so the simple synthetic schemas will be more useful.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (CALCITE-6227) ELEMENT(NULL) causes an assertion failure

2024-01-26 Thread Mihai Budiu (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-6227.
--
Fix Version/s: 1.37.0
   Resolution: Fixed

Resolved in 
https://github.com/apache/calcite/commit/dd53e29326eb4399c5f767b22ae0ebc29a2e1c14

> ELEMENT(NULL) causes an assertion failure
> -
>
> Key: CALCITE-6227
> URL: https://issues.apache.org/jira/browse/CALCITE-6227
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.36.0
>Reporter: Mihai Budiu
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> Adding the following test to SqlValidatorTest:
> {code:java}
> @Test void testElement() {
> expr("element(null)").columnType("null");
> }
> {code}
> causes an assertion failure. The bottom of the stack trace is the following:
> {code}
>   at org.apache.calcite.sql.type.ReturnTypes$2.get(ReturnTypes.java:577)
>   at org.apache.calcite.sql.type.ReturnTypes$2.get(ReturnTypes.java:571)
>   at 
> org.apache.calcite.sql.ExplicitOperatorBinding.getOperandType(ExplicitOperatorBinding.java:78)
>   at 
> org.apache.calcite.sql.SqlOperatorBinding$1.get(SqlOperatorBinding.java:255)
>   at 
> org.apache.calcite.sql.SqlOperatorBinding$1.get(SqlOperatorBinding.java:253)
>   at 
> org.apache.calcite.sql.type.SqlTypeFactoryImpl.leastRestrictive(SqlTypeFactoryImpl.java:174)
>   at 
> org.apache.calcite.rel.type.RelDataTypeFactory.leastRestrictive(RelDataTypeFactory.java:222)
>   at 
> org.apache.calcite.sql.type.ReturnTypes.lambda$static$3(ReturnTypes.java:537)
>   at 
> org.apache.calcite.sql.type.ReturnTypes.lambda$static$6(ReturnTypes.java:586)
>   at 
> org.apache.calcite.sql.type.SqlTypeTransformCascade.inferReturnType(SqlTypeTransformCascade.java:58)
>   at 
> org.apache.calcite.sql.SqlOperator.inferReturnType(SqlOperator.java:534)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6224) Add LOG2 function (enabled in Mysql, Spark library)

2024-01-26 Thread Caican Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811287#comment-17811287
 ] 

Caican Cai commented on CALCITE-6224:
-

thank you

> Add LOG2 function (enabled in Mysql, Spark library)
> ---
>
> Key: CALCITE-6224
> URL: https://issues.apache.org/jira/browse/CALCITE-6224
> Project: Calcite
>  Issue Type: New Feature
>  Components: core
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> The log2 function is supported in many databases, such as spark, mysql, 
> postgres, etc.
> {code:java}
> > SELECT log2(2);
>  1.0 {code}
> links:
> [https://spark.apache.org/docs/3.4.0/api/sql/index.html#log2]
> https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_log2



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6226) Wrong ISOWEEK and no ISOYEAR on BigQuery FORMAT_DATE

2024-01-26 Thread Rodrigo Rueda (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811261#comment-17811261
 ] 

Rodrigo Rueda commented on CALCITE-6226:


Thanks, [~tanclary]

I ended up fixing another issue with the weekday in the same PR. Please, let me 
know if any changes are needed.

> Wrong ISOWEEK and no ISOYEAR on BigQuery FORMAT_DATE
> 
>
> Key: CALCITE-6226
> URL: https://issues.apache.org/jira/browse/CALCITE-6226
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.34.0, 1.35.0, 1.36.0
>Reporter: Rodrigo Rueda
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
>  
> Doing:
> {code:java}
> FORMAT_DATE('%G-%V', DATE '2023-01-01'){code}
>  results in:
> {code:java}
> '%G-01'{code}
> but should be:
> {code:java}
> 2022-52{code}
>  
> The week is wrong because the ISOWEEK format function is not setting the 
> minimalDaysInFirstWeek to 4 and the ISOYEAR (%g or %G) was not implemented.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CALCITE-6226) Wrong ISOWEEK and no ISOYEAR on BigQuery FORMAT_DATE

2024-01-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-6226:

Labels: pull-request-available  (was: )

> Wrong ISOWEEK and no ISOYEAR on BigQuery FORMAT_DATE
> 
>
> Key: CALCITE-6226
> URL: https://issues.apache.org/jira/browse/CALCITE-6226
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.34.0, 1.35.0, 1.36.0
>Reporter: Rodrigo Rueda
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
>  
> Doing:
> {code:java}
> FORMAT_DATE('%G-%V', DATE '2023-01-01'){code}
>  results in:
> {code:java}
> '%G-01'{code}
> but should be:
> {code:java}
> 2022-52{code}
>  
> The week is wrong because the ISOWEEK format function is not setting the 
> minimalDaysInFirstWeek to 4 and the ISOYEAR (%g or %G) was not implemented.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6222) Mysql does not have to_char function

2024-01-26 Thread Jiajun Xie (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811250#comment-17811250
 ] 

Jiajun Xie commented on CALCITE-6222:
-

Calcite has many users, and any compatibility changes should be handled with 
caution.

 

Although it's difficult, I don't want to burden users with upgrading calcite.

> Mysql does not have to_char function
> 
>
> Key: CALCITE-6222
> URL: https://issues.apache.org/jira/browse/CALCITE-6222
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6222) Mysql does not have to_char function

2024-01-26 Thread Jiajun Xie (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811245#comment-17811245
 ] 

Jiajun Xie commented on CALCITE-6222:
-

MariaDB have it: [https://mariadb.com/kb/en/to_char/]

If someone uses it as MySQL, the function will failed.

This change needs to be declared in the Release Notes.

> Mysql does not have to_char function
> 
>
> Key: CALCITE-6222
> URL: https://issues.apache.org/jira/browse/CALCITE-6222
> Project: Calcite
>  Issue Type: Bug
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CALCITE-6230) Jira case collections

2024-01-26 Thread hongyu guo (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hongyu guo updated CALCITE-6230:

Description: 
Related thread: [Collection of some jira 
cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]

syntax:
CALCITE-5852: MERGE INTO
CALCITE-5301: AT TIME ZONE
CALCITE-5386: LIKE (ANY | SOME | ALL)
CALCITE-5216: Cannot parse parenthesized nested WITH clause
CALCITE-5205: Supports hint option as string and numeric literal
CALCITE-5168: Allow AS after parenthesized JOIN
CALCITE-5084: Support ROWS syntax with TABLESAMPLE
CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
statement
CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands

data type:
CALCITE-5346: type aliases
CALCITE-4918: Add a VARIANT data type

rule and optimization:
CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
CALCITE-4052: Enable Top-down Optimization

dialect:
CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)

function:
CALCITE-5809: enable already available functions in Apache Spark Library
CALCITE-5087: Support bitwise operators
CALCITE-4521: Support User Defined Table-valued Function
CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
unique
CALCITE-3683: Enhanced MATH Function
CALCITE-3646: MySQL compression functions
CALCITE-2031: Implement more OpenGIS functions
CALCITE-2871: Implement JSON_TABLE table function

  was:
Relate thread: [Collection of some jira 
cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]

syntax:
CALCITE-5852: MERGE INTO
CALCITE-5301: AT TIME ZONE
CALCITE-5386: LIKE (ANY | SOME | ALL)
CALCITE-5216: Cannot parse parenthesized nested WITH clause
CALCITE-5205: Supports hint option as string and numeric literal
CALCITE-5168: Allow AS after parenthesized JOIN
CALCITE-5084: Support ROWS syntax with TABLESAMPLE
CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
statement
CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands

data type:
CALCITE-5346: type aliases
CALCITE-4918: Add a VARIANT data type

rule and optimization:
CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
CALCITE-4052: Enable Top-down Optimization

dialect:
CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)

function:
CALCITE-5809: enable already available functions in Apache Spark Library
CALCITE-5087: Support bitwise operators
CALCITE-4521: Support User Defined Table-valued Function
CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
unique
CALCITE-3683: Enhanced MATH Function
CALCITE-3646: MySQL compression functions
CALCITE-2031: Implement more OpenGIS functions
CALCITE-2871: Implement JSON_TABLE table function


> Jira case collections
> -
>
> Key: CALCITE-6230
> URL: https://issues.apache.org/jira/browse/CALCITE-6230
> Project: Calcite
>  Issue Type: Task
>Reporter: hongyu guo
>Priority: Minor
>
> Related thread: [Collection of some jira 
> cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]
> syntax:
> CALCITE-5852: MERGE INTO
> CALCITE-5301: AT TIME ZONE
> CALCITE-5386: LIKE (ANY | SOME | ALL)
> CALCITE-5216: Cannot parse parenthesized nested WITH clause
> CALCITE-5205: Supports hint option as string and numeric literal
> CALCITE-5168: Allow AS after parenthesized JOIN
> CALCITE-5084: Support ROWS syntax with TABLESAMPLE
> CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
> CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
> CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
> statement
> CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
> CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands
> data type:
> CALCITE-5346: type aliases
> CALCITE-4918: Add a VARIANT data type
> rule and optimization:
> CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
> CALCITE-4052: Enable Top-down Optimization
> dialect:
> CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
> function:
> CALCITE-5809: enable already available functions in Apache Spark Library
> CALCITE-5087: Support bitwise operators
> CALCITE-4521: Support User Defined Table-valued Function
> CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
>

[jira] [Updated] (CALCITE-6230) Jira case collections

2024-01-26 Thread hongyu guo (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hongyu guo updated CALCITE-6230:

Description: 
Relate thread: [Collection of some jira 
cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]

syntax:
CALCITE-5852: MERGE INTO
CALCITE-5301: AT TIME ZONE
CALCITE-5386: LIKE (ANY | SOME | ALL)
CALCITE-5216: Cannot parse parenthesized nested WITH clause
CALCITE-5205: Supports hint option as string and numeric literal
CALCITE-5168: Allow AS after parenthesized JOIN
CALCITE-5084: Support ROWS syntax with TABLESAMPLE
CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
statement
CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands

data type:
CALCITE-5346: type aliases
CALCITE-4918: Add a VARIANT data type

rule and optimization:
CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
CALCITE-4052: Enable Top-down Optimization

dialect:
CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)

function:
CALCITE-5809: enable already available functions in Apache Spark Library
CALCITE-5087: Support bitwise operators
CALCITE-4521: Support User Defined Table-valued Function
CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
unique
CALCITE-3683: Enhanced MATH Function
CALCITE-3646: MySQL compression functions
CALCITE-2031: Implement more OpenGIS functions
CALCITE-2871: Implement JSON_TABLE table function

  was:
syntax:
CALCITE-5852: MERGE INTO
CALCITE-5301: AT TIME ZONE
CALCITE-5386: LIKE (ANY | SOME | ALL)
CALCITE-5216: Cannot parse parenthesized nested WITH clause
CALCITE-5205: Supports hint option as string and numeric literal
CALCITE-5168: Allow AS after parenthesized JOIN
CALCITE-5084: Support ROWS syntax with TABLESAMPLE
CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
statement
CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands

data type:
CALCITE-5346: type aliases
CALCITE-4918: Add a VARIANT data type

rule and optimization:
CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
CALCITE-4052: Enable Top-down Optimization

dialect:
CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)

function:
CALCITE-5809: enable already available functions in Apache Spark Library
CALCITE-5087: Support bitwise operators
CALCITE-4521: Support User Defined Table-valued Function
CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
unique
CALCITE-3683: Enhanced MATH Function
CALCITE-3646: MySQL compression functions
CALCITE-2031: Implement more OpenGIS functions
CALCITE-2871: Implement JSON_TABLE table function


> Jira case collections
> -
>
> Key: CALCITE-6230
> URL: https://issues.apache.org/jira/browse/CALCITE-6230
> Project: Calcite
>  Issue Type: Task
>Reporter: hongyu guo
>Priority: Minor
>
> Relate thread: [Collection of some jira 
> cases|https://lists.apache.org/thread/tmtql0yt3nyn6obdw677pm6lyxljpg0w]
> syntax:
> CALCITE-5852: MERGE INTO
> CALCITE-5301: AT TIME ZONE
> CALCITE-5386: LIKE (ANY | SOME | ALL)
> CALCITE-5216: Cannot parse parenthesized nested WITH clause
> CALCITE-5205: Supports hint option as string and numeric literal
> CALCITE-5168: Allow AS after parenthesized JOIN
> CALCITE-5084: Support ROWS syntax with TABLESAMPLE
> CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
> CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
> CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
> statement
> CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
> CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands
> data type:
> CALCITE-5346: type aliases
> CALCITE-4918: Add a VARIANT data type
> rule and optimization:
> CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
> CALCITE-4052: Enable Top-down Optimization
> dialect:
> CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
> function:
> CALCITE-5809: enable already available functions in Apache Spark Library
> CALCITE-5087: Support bitwise operators
> CALCITE-4521: Support User Defined Table-valued Function
> CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
> unique
> CALCITE-3683: Enhanced MATH Function
> CALCITE-3646: MySQL compression functions
> CALCITE-2031: Implement

[jira] [Comment Edited] (CALCITE-6230) Jira case collections

2024-01-26 Thread Alessandro Solimando (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811192#comment-17811192
 ] 

Alessandro Solimando edited comment on CALCITE-6230 at 1/26/24 9:57 AM:


[~hongyuguo], what's the purpose of this ticket?

If multiple tickets can be grouped into a single coherent topic (probably more 
fine-grained than the labels you used), you can make an umbrella ticket and 
have them as sub-tickets.

In general any Jira ticket ideally ends up in our release notes describing an 
improvement or bug-fix, but I don't see how this ticket can fit into this model.

EDIT: maybe you can propose to add some extra labels if you want to categorize 
those tickets (like: "dialect") and see what the community thinks of the 
proposal.


was (Author: asolimando):
[~hongyuguo], what's the purpose of this ticket?

If multiple tickets can be grouped into a single coherent topic (probably more 
fine-grained than the labels you used), you can make an umbrella ticket and 
have them as sub-tickets.

In general any Jira ticket ideally ends up in our release notes describing an 
improvement or bug-fix, but I don't see how this ticket can fit into this model.

> Jira case collections
> -
>
> Key: CALCITE-6230
> URL: https://issues.apache.org/jira/browse/CALCITE-6230
> Project: Calcite
>  Issue Type: Task
>Reporter: hongyu guo
>Priority: Minor
>
> syntax:
> CALCITE-5852: MERGE INTO
> CALCITE-5301: AT TIME ZONE
> CALCITE-5386: LIKE (ANY | SOME | ALL)
> CALCITE-5216: Cannot parse parenthesized nested WITH clause
> CALCITE-5205: Supports hint option as string and numeric literal
> CALCITE-5168: Allow AS after parenthesized JOIN
> CALCITE-5084: Support ROWS syntax with TABLESAMPLE
> CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
> CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
> CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
> statement
> CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
> CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands
> data type:
> CALCITE-5346: type aliases
> CALCITE-4918: Add a VARIANT data type
> rule and optimization:
> CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
> CALCITE-4052: Enable Top-down Optimization
> dialect:
> CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
> function:
> CALCITE-5809: enable already available functions in Apache Spark Library
> CALCITE-5087: Support bitwise operators
> CALCITE-4521: Support User Defined Table-valued Function
> CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
> unique
> CALCITE-3683: Enhanced MATH Function
> CALCITE-3646: MySQL compression functions
> CALCITE-2031: Implement more OpenGIS functions
> CALCITE-2871: Implement JSON_TABLE table function



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-6230) Jira case collections

2024-01-26 Thread Alessandro Solimando (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811192#comment-17811192
 ] 

Alessandro Solimando commented on CALCITE-6230:
---

[~hongyuguo], what's the purpose of this ticket?

If multiple tickets can be grouped into a single coherent topic (probably more 
fine-grained than the labels you used), you can make an umbrella ticket and 
have them as sub-tickets.

In general any Jira ticket ideally ends up in our release notes describing an 
improvement or bug-fix, but I don't see how this ticket can fit into this model.

> Jira case collections
> -
>
> Key: CALCITE-6230
> URL: https://issues.apache.org/jira/browse/CALCITE-6230
> Project: Calcite
>  Issue Type: Task
>Reporter: hongyu guo
>Priority: Minor
>
> syntax:
> CALCITE-5852: MERGE INTO
> CALCITE-5301: AT TIME ZONE
> CALCITE-5386: LIKE (ANY | SOME | ALL)
> CALCITE-5216: Cannot parse parenthesized nested WITH clause
> CALCITE-5205: Supports hint option as string and numeric literal
> CALCITE-5168: Allow AS after parenthesized JOIN
> CALCITE-5084: Support ROWS syntax with TABLESAMPLE
> CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
> CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
> CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
> statement
> CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
> CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands
> data type:
> CALCITE-5346: type aliases
> CALCITE-4918: Add a VARIANT data type
> rule and optimization:
> CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
> CALCITE-4052: Enable Top-down Optimization
> dialect:
> CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
> function:
> CALCITE-5809: enable already available functions in Apache Spark Library
> CALCITE-5087: Support bitwise operators
> CALCITE-4521: Support User Defined Table-valued Function
> CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
> unique
> CALCITE-3683: Enhanced MATH Function
> CALCITE-3646: MySQL compression functions
> CALCITE-2031: Implement more OpenGIS functions
> CALCITE-2871: Implement JSON_TABLE table function



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-6230) Jira case collections

2024-01-26 Thread hongyu guo (Jira)
hongyu guo created CALCITE-6230:
---

 Summary: Jira case collections
 Key: CALCITE-6230
 URL: https://issues.apache.org/jira/browse/CALCITE-6230
 Project: Calcite
  Issue Type: Task
Reporter: hongyu guo


syntax:
CALCITE-5852: MERGE INTO
CALCITE-5301: AT TIME ZONE
CALCITE-5386: LIKE (ANY | SOME | ALL)
CALCITE-5216: Cannot parse parenthesized nested WITH clause
CALCITE-5205: Supports hint option as string and numeric literal
CALCITE-5168: Allow AS after parenthesized JOIN
CALCITE-5084: Support ROWS syntax with TABLESAMPLE
CALCITE-5066: Support variables with “@" and “@@" prefixes (like MySQL)
CALCITE-4705: Support hints like /*+ skewjoin(a(c0, c1)) */
CALCITE-4455: Babel parser support Spark INSERT OVERWRITE TABLE/DIRECTORY 
statement
CALCITE-3970: Table-valued function TUMBLE uses non-standard syntax
CALCITE-5681: Support authorization via GRANT and REVOKE DDL commands

data type:
CALCITE-5346: type aliases
CALCITE-4918: Add a VARIANT data type

rule and optimization:
CALCITE-4843: optimize ALL,SOME sub-query list when op is the <, <=,> or >=
CALCITE-4052: Enable Top-down Optimization

dialect:
CALCITE-4782: Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)

function:
CALCITE-5809: enable already available functions in Apache Spark Library
CALCITE-5087: Support bitwise operators
CALCITE-4521: Support User Defined Table-valued Function
CALCITE-4484: Add UNIQUE_VALUE(x) aggregate function, that throws if x is not 
unique
CALCITE-3683: Enhanced MATH Function
CALCITE-3646: MySQL compression functions
CALCITE-2031: Implement more OpenGIS functions
CALCITE-2871: Implement JSON_TABLE table function



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CALCITE-6224) Add LOG2 function (enabled in Mysql, Spark library)

2024-01-26 Thread Caican Cai (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Caican Cai updated CALCITE-6224:

Summary: Add LOG2 function (enabled in Mysql, Spark library)  (was: Add 
LOG2 function on SqlStdOperatorTable)

> Add LOG2 function (enabled in Mysql, Spark library)
> ---
>
> Key: CALCITE-6224
> URL: https://issues.apache.org/jira/browse/CALCITE-6224
> Project: Calcite
>  Issue Type: New Feature
>  Components: core
>Affects Versions: 1.36.0
>Reporter: Caican Cai
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> The log2 function is supported in many databases, such as spark, mysql, 
> postgres, etc.
> {code:java}
> > SELECT log2(2);
>  1.0 {code}
> links:
> [https://spark.apache.org/docs/3.4.0/api/sql/index.html#log2]
> https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_log2



--
This message was sent by Atlassian Jira
(v8.20.10#820010)