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

pengzhiwei edited comment on CALCITE-1581 at 6/4/19 1:32 PM:
-------------------------------------------------------------

Hi [~julianhyde],Thanks for you constructive suggestion. I have fixed most 
problem you mentioned and also added some test case. But there are some left.
 * _The "handle..." method works in a mysterious way. Perhaps it writes into an 
IdentityHashMap, perhaps not._

The  "selectTableFunctions" is used to associate the SqlSelect with the Table 
Function contains in the select list. In the "handleTableFunctionInSelect" 
method,I will always put it to the _IdentityHashMap_ except that there exist a 
validate exception .So I cannot understand "_perhaps it writes to ....perhaps 
not_" means.

 

   _The validator test ought to check that table functions are rejected even if 
they don't use       the  'as (...)' syntax_

The sql without  _'as (..'_  like _"select table_func(0) from emp"_ can pass 
the validator and generate the logical plan.It is not a new issue introduced by 
this PR,So I will fix it in another issue.

Please have a review again when you have time,Thanks!

 

 

.


was (Author: pzw2018):
Hi [~julianhyde],Thanks for you constructive suggestion. I have fixed most 
problem you mentioned and also added some test case. But there are some left.
 * _The "handle..." method works in a mysterious way. Perhaps it writes into an 
IdentityHashMap, perhaps not._

The  "selectTableFunctions" is used to associate the SqlSelect with the Table 
Function contains in the select list. In the "handleTableFunctionInSelect" 
method,I will always put it to the _IdentityHashMap_ except that there exist a 
validate exception .

 

   _The validator test ought to check that table functions are rejected even if 
they don't use       the  'as (...)' syntax_

The sql without  _'as (..'_  like _"select table_func(0) from emp"_ can pass 
the validator and generate the logical plan.It is not a new issue introduced by 
this PR,So I will fix it in another issue.

Please have a review again when you have time,Thanks!

 

 

.

> 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.20.0
>
>          Time Spent: 3h 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
(v7.6.3#76005)

Reply via email to