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

JING ZHANG commented on CALCITE-4337:
-------------------------------------

[~vilo]
 # Maybe there are only minor differences in the way of our expression.:) I 
just don't agree with the description "The ROW semantics is a special case of 
partitioning where each row is its own partition (as in `PARTITION BY 
primaryKey`)."  I think "Partition by" means the function has requirement on 
data distribution of input data.
 ## For input table with set semantics, the function always has requirement on 
data distribution of input data. If defined partitioned columns, input data 
should be partitioned by these fields; if not defined partitioned columns, 
input data should be broadcast.
 ## For input table with row semantics, the function does not have requirement 
on data distribution of input data. So input data could be  shuffled in any 
way, for example:  random, round-roubin,  any, broadcast and so on, they are 
all satisfied.
 # I think your demand is reasonable. However the following demand is 
reasonable, too: input table1 partition by f1, input table2 partition by f2,f3. 
The input tables are different with each other and their partition keys also 
has no relation with each other. We could form cross products of left 
partitions with right partitions (similar with cross join). SQL standard also 
refers this in "8.14 Cross products of partitions". 

> 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, 
> image-2021-10-13-20-19-55-855.png, image-2021-10-13-20-22-42-675.png, 
> image-2021-10-13-20-23-26-890.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)

Reply via email to