[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-14 Thread Viliam Durina (Jira)


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

Viliam Durina commented on CALCITE-3970:


I didn't plan to do a PR.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-13 Thread Rui Wang (Jira)


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

Rui Wang commented on CALCITE-3970:
---

While we are continuing discussing, an actionable task is to support `TABLE()` 
syntax, cause it's used in standard already.

Hi Viliam, do you have a plan to open a PR (if so I can help do code review). 
If not I am willing to make a change.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-13 Thread Rui Wang (Jira)


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

Rui Wang commented on CALCITE-3970:
---

>Julian: So, how about allowing TABLE as an alternative to CURSOR, and 
>deprecating CURSOR with an eye to eventually removing it?

I also didn't find the reference of CURSOR, and then what's the SQL semantics 
of it becomes not clear to me. So deprecate it from the syntax makes sense to 
me.

I tried to dig into CURSOR implementation and I find it makes sense. E.g. 
Within a scope there is a list of CURSORS, and then in other places we can use 
RexNode to refer to CURSORS. CURSORS, for example, can be converted to Rel's 
input. This fits table function implementation: table function has table 
parameters, which becomes CURSORS and later becomes TableFunctionScan's inputs. 
And in runtime, based on a RexNode, table function impl will know which input 
in TableFunctionScan to use.

So keep CURSOR idea in implementation seems useful.


> Danny: what kind of rex node should we translate the `col` column of table 
> my_table
I think the suggestion here [1] is a working approach. See my description of 
CURSOR implementation above. 

However to adopt the implementation of [1], there will be some non-trivial 
changes required.


[1]: 
https://issues.apache.org/jira/browse/CALCITE-3955?focusedCommentId=17097014=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17097014

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-13 Thread Danny Chen (Jira)


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

Danny Chen commented on CALCITE-3970:
-

[~julianhyde] Another question is for query

{code:sql}
SELECT * FROM TABLE(TUMBLE(TABLE(my_table), DESCRIPTOR(col1)))
{code}
what kind of rex node should we translate the `col` column of table my_table, 
the current implementation translates it to a RexAccess, such as "$cor0.0", but 
apparently it is wrong, there is no correlation in the plan.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-06 Thread Julian Hyde (Jira)


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

Julian Hyde commented on CALCITE-3970:
--

I don't recall where {{CURSOR}} came from, or whether it is even in the 
standard, but it seems that this use of {{TABLE}} is very similar to Calcite's 
current use of {{CURSOR}}. So, how about allowing {{TABLE}} as an alternative 
to {{CURSOR}}, and deprecating {{CURSOR}} with an eye to eventually removing it?

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-06 Thread Viliam Durina (Jira)


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

Viliam Durina commented on CALCITE-3970:


See the section "8.6":
{code:java}
 ::=
TABLE   
  | TABLE 
  | 
{code}
 also specifies that a subquery also uses TABLE keyword, not 
CURSOR (see section 8.6.2):
{code:java}
FROMTABLE (Ptf ( TABLE ( SELECT * FROM Emp ) ) ) AS P
{code}
 

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-05 Thread Danny Chen (Jira)


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

Danny Chen commented on CALCITE-3970:
-

[~amaliujia], previously we have supported a sub-query as the first argument of 
the TUMBLE function, after we solve the CALCITE-3955, if we translate the 
query/table argument of the table function, we should apply a explicit CURSOR 
keyword for the query, that is CURSOR(query) <=> Table t.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-05 Thread Julian Hyde (Jira)


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

Julian Hyde commented on CALCITE-3970:
--

If it’s in the standard we should do it. But can you please quote the relevant 
section.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-05 Thread Viliam Durina (Jira)


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

Viliam Durina commented on CALCITE-3970:


The standard has this syntax for passing tables as arguments to functions:
{code:sql}
SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...))
{code}
This syntax is rejected by calcite, that's an issue I think. Maybe there's a 
switch to enable it, I didn't find it. You can support non-standard syntax, but 
the standard syntax should be supported too. The specification only mentions 
this syntax.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-04 Thread Julian Hyde (Jira)


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

Julian Hyde commented on CALCITE-3970:
--

No, the two existing syntax are
{code:sql}
select * from TABLE(table_function(arg1, arg2));
select * from (TABLE t)
{code}

There are examples of each in {{SqlParserTest}}.

Maybe 'TABLE arg' as an argument to a function is a third syntax. If so, it 
would be variant of 'CURSOR (query)' as an argument to a function.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-04 Thread Rui Wang (Jira)


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

Rui Wang commented on CALCITE-3970:
---

So to conclude, there are two syntax of "TABLE"

{code:sql}
select * from table_funcion(TABLE(name));
select * from (table t)
{code}

if so a valid bug will just be enforce parentheses around table name: 
"table_funcion(TABLE(name))"







> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-04 Thread Julian Hyde (Jira)


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

Julian Hyde commented on CALCITE-3970:
--

[~vilo] I believe there are two different uses of {{TABLE}} in standard SQL. 
One is for functions, another is for identifiers. For example, in PostgreSQL, 
the following is valid:
{code}
select * from (table emp) as e;
{code}

So I think this bug is invalid.

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3970) Table-valued function TUMBLE uses non-standard syntax

2020-05-04 Thread Rui Wang (Jira)


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

Rui Wang commented on CALCITE-3970:
---

I did encounter the same confusion before: "TABLE(t)" does not work but "TABLE 
t" works.

[~julianhyde] any objection to use "TABLE(t)" syntax?

> Table-valued function TUMBLE uses non-standard syntax
> -
>
> Key: CALCITE-3970
> URL: https://issues.apache.org/jira/browse/CALCITE-3970
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.22.0
>Reporter: Viliam Durina
>Priority: Major
>
> The currently supported syntax is this:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
> {code}
> But the SQL standard specifies that {{my_table}} must be in parentheses, such 
> as here:
> {code:java}
> SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
> {code}
> The second syntax is currently rejected with:
> {code:none}
> Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "(" at line 1, column 33.
> Was expecting one of:
>  ...
>  ...
>  ...
>  ...
>  ...
> {code}
> I'm not sure if the currently supported syntax is optional, but I think it's 
> not.
> I followed this document: 
> [http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip]
> The {{TABLE}} clause acts in both ways: (1) to convert a table value to a 
> table object (when used in the {{FROM}} clause to convert the function 
> result) and (2) to convert a table object to a table value (when used to 
> convert arguments to a function).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)