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

Danny Chen commented on CALCITE-4171:
-------------------------------------

bq. Did you test parameters in different orders, and with values missing for 
earlier parameters?
bq. Permuting parameters is tricky.

I tested. The sql validation would reorder the operands to be in the same order 
as what the function params specifies in. So it is actually not that tricky.

In the SQL 2017 standard for Polymorphic table functions, all the functions 
given are with param name like the "Data" style (starting with a uppercase 
character), but the standard does not say if we should follow that, i agree 
uppercase is more suitable for Calcite default lex setting. (even though i 
prefer lower case because it is more easy to typing).

bq. Did named parameters work for table functions before this?
Yes, but the value must be a scala-subquery (can not return a row), this patch 
actually fixes this and add more tests. Currently, only window table functions 
use the normal query as parameter, so i think the title is somehow suitable.


> Support named parameters for table window functions
> ---------------------------------------------------
>
>                 Key: CALCITE-4171
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4171
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.23.0, 1.24.0
>            Reporter: Danny Chen
>            Assignee: Danny Chen
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Supports window functions like named params style:
> {code:sql}
> select *
> from table(
> session(
>   data => table Shipments,
>   timecol => descriptor(rowtime),
>   key => descriptor(orderId),
>   size => INTERVAL '10' MINUTE))
> {code}



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

Reply via email to