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

Julian Hyde commented on CALCITE-1581:
--------------------------------------

I looked into the causes of this choice conflict. With this extension, the 
parser allows {code}select myFunc (x, y) from t{code}

That's a call to a function with arguments x and y, right? No, that's a call to 
a nilary function, assigning names to the result columns. Identical effect to 
this:

{code}select myFunc() as (x, y) from t{code}

Can we change this PR so that {{AS}} is mandatory if followed by "(col, ...)"? 
Is it mandatory in Hive.

By the way, I agree with [~zabetak] on removing minor comments like "fix 
format" when you squash. It's not a complete log of everything you did. It is 
whatever will be most helpful to the person reading the commit in a week or a 
year.

> UDTF like in hive
> -----------------
>
>                 Key: CALCITE-1581
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1581
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Xiaoyong Deng
>            Assignee: pengzhiwei
>            Priority: Major
>              Labels: pull-request-available, udtf
>             Fix For: 1.21.0
>
>          Time Spent: 8h 10m
>  Remaining Estimate: 0h
>
> Support one row in and multi-column/multi-row out(one-to-many mapping), just 
> like udtf in hive.
> The query would like this:
> {code}
> select
>   func(c0, c1) as (f0, f1, f2)
> from table_name;
> {code}
> c0 and c1 are 'table_name' columns. f0, f1 and f2 are new generated columns.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to