[
https://issues.apache.org/jira/browse/CALCITE-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17177614#comment-17177614
]
Danny Chen commented on CALCITE-4171:
-------------------------------------
[~julianhyde] ~
{quote}I saw you added some mechanism to prevent functions from using default
values for parameters. Is this necessary?{quote}
It is not, i did it to simplify the code generation for the table functions,
because i must unify the logic when the function was invoked with named params
and with non-named params. We patched up the named params calls with
{{DEFAULT}} but not with non-named call. Somehow these table functions are all
SqlFunctions and they have their signature validation so it can decide whether
some params are optional statically. The case is not same with UDF because
there is not a real back-end function there so there is no annotations.
I can remove the {{SqlOperator#paramFallBackAsDefault}} method and rework the
code generation part, but i still think the patch {{DEFAULT}} behaviors is not
necessary at least for builtin functions. (e.g. you patched it up with defaults
and then replace it with another value in code generation, the behavior is
different when the call is from a non-named call).
[~amaliujia] We parse the name as an identifier, so the names matching should
use the name matcher, e.g. in a case-insensitive SQL context, we should allow
user to match with lower case names.
> 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: 3h 50m
> 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)