[
https://issues.apache.org/jira/browse/HIVE-935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787746#action_12787746
]
Paul Yang commented on HIVE-935:
--------------------------------
Offline meeting - we will support both forms but with slight modifications to
the syntax to allow the user to define the column aliases.
For UDTF's in the select expression: (To reiterate, we are supporting this
because it'd be easier for new users to learn. Plus, it's similar to the
transform syntax)
{code}
SELECT udtf(inputCol1, inputCol2) AS (colAlias1, colAlias2, ...) FROM
sourceTable
i.e.
SELECT explode(adid_list) as (adid) FROM src;
{code}
The column alias list is required, and must be in parenthesis to aid parsing.
Otherwise, it would be difficult to differentiate between column aliases in the
AS and other select expressions.
For UDTF's in lateral view
{code}
SELECT <expression list> FROM sourceTable LATERAL VIEW udtf(inputCol1,
inputCol2, ...) tableAlias AS (colAlias1, colAlias2..) ...
i.e.
SELECT myTable.* FROM src LATERAL VIEW explode(adid_list) myTable AS (adid);
{code}
For the lateral view, the both table and column aliases will be required
parameters.
In either form, an error will be generated if the number of aliases supplied in
the AS is not the same as the number of columns (fields) output by the UDTF.
> support LATERAL VIEW
> --------------------
>
> Key: HIVE-935
> URL: https://issues.apache.org/jira/browse/HIVE-935
> Project: Hadoop Hive
> Issue Type: New Feature
> Components: Query Processor
> Reporter: Namit Jain
> Assignee: Paul Yang
> Attachments: HIVE-935.1.patch, HIVE-935.2.patch, HIVE-935.3.patch,
> HIVE-935.4.patch, HIVE-935.5.patch
>
>
> For table functions, the following syntax should be supported
> select ... from T LATERAL VIEW explode(adid_list) as adid,...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.