[
https://issues.apache.org/jira/browse/CALCITE-4337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422898#comment-17422898
]
Julian Hyde commented on CALCITE-4337:
--------------------------------------
I support this feature. But I would like to add it as a general feature of our
table functions. Therefore we should split into two issues (and commits): this
issue adding general support, and a new issue with changes for window functions
such as {{SESSION}}.
The PR for this issue should not touch window functions at all. In particular,
{{enum InputSemantics}} should not be in {{class SqlWindowTableFunction}} but
somewhere that applies to all table functions.
A few questions on the {{PARTITION BY}} clause:
* If a table function has two table parameters, is it possible for one of them
to have row semantics and another to have set semantics? If so, the semantics
is a property of the parameter, not the function.
* If a table function has a table parameter, it it possible for one call to
that function to use {{PARTITION BY}} and another call to not use {{PARTITION
BY}}? In other words, is the "set semantics" a property of the call or the
function?
* If a table function (parameter) has row semantics, is it an error to provide
an argument with {{PARTITION BY}}? And vice versa?
The PR would need to contain tests - probably validator tests - that answer
these questions.
Are polymorphic table functions different from table functions? I thought the
standard was just extending the capabilities of table functions to include
polymorphism. If so, the documentation shouldn't talk about PTFs; it should
just talk about table functions.
> Support PARTITION BY clause in table function call
> --------------------------------------------------
>
> Key: CALCITE-4337
> URL: https://issues.apache.org/jira/browse/CALCITE-4337
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Affects Versions: 1.26.0
> Reporter: Danny Chen
> Assignee: Danny Chen
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2021-09-30-11-04-33-474.png,
> image-2021-09-30-11-05-12-400.png, image-2021-09-30-11-05-42-033.png
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> An example from the SQL standard 2016 Polymorphic Table Functions:
> {code:sql}
> SELECT W.wstart, W.wend, OI.customer, SUM(OI.price)
> FROM TABLE(SESSION(
> data => TABLE(order_item) AS OI PARTITION BY customer,
> timecol => DESCRIPTOR(order_time),
> timeout => INTERVAL '10' MINUTE)) W
> GROUP BY 1, 2, 3
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)