You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2019/06/03 08:45:00 UTC

[jira] [Comment Edited] (CALCITE-1581) UDTF like in hive

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

Julian Hyde edited comment on CALCITE-1581 at 6/3/19 8:44 AM:
--------------------------------------------------------------

Also, there are some potential interactions with other SQL clauses.
* Is it legal to use a TF in SELECT with GROUP BY?
* Is it legal to use a TF in SELECT with HAVING?
* Is it legal to use a TF in SELECT with ORDER BY?
* Is it legal to use a TF in SELECT with a JOIN?
* What if the JOIN has UNNEST?
* Is it legal to use a TF in SELECT with other expressions in SELECT?
* Is it legal to use a TF in SELECT inside an IN sub-query?
* Is it legal to use a TF in SELECT with UNION?

For each of these that are legal, I'd like to see a test that runs a query (thereby demonstrating that sql-to-rel conversion works); for of these that are illegal, let's document that it's not allowed, and have a validator test.

Also test some combinations of the above (e.g. HAVING with and without GROUP BY); ORDER BY referencing columns by ordinal or alias.

It's not overkill to want this many tests. Remember that this is a major feature - a TF is the only thing you can put in a SELECT clause (besides DISTINCT) that alters the number of rows returned by the query.


was (Author: julianhyde):
Also, there are some potential interactions with other SQL clauses.
* Is it legal to use a TF in SELECT with GROUP BY?
* Is it legal to use a TF in SELECT with HAVING?
* Is it legal to use a TF in SELECT with ORDER BY?
* Is it legal to use a TF in SELECT with a JOIN?
* What if the JOIN has UNNEST?
* Is it legal to use a TF in SELECT with other expressions in SELECT?
* Is it legal to use a TF in SELECT inside an IN sub-query?
* Is it legal to use a TF in SELECT with UNION?

For each of these that are legal, I'd like to see a test that runs a query (thereby demonstrating that sql-to-rel conversion works); for of these that are illegal, let's document that it's not allowed, and have a validator test.

Also test some combinations of the above (e.g. HAVING with and without GROUP BY); ORDER BY referencing columns by ordinal or alias.

> 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)