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

xiong duan commented on CALCITE-6546:
-------------------------------------

Fixed in 
[1a18264be5|https://github.com/apache/calcite/commit/1a18264be53f7735c01f3fddf7c28eac7ee5384b].
 Thanks for the review [~mbudiu].

> Hive dialect does not support a sub-query in the FROM clause without alias
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-6546
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6546
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: xiong duan
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>
> In Hive, the SQL:
> {code:java}
>  select * from (select * from table1);
> {code}
> will throw an exception:
> {code:java}
> Error: Error while compiling statement: FAILED: ParseException line 1:36 
> cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in subquery source 
> (state=42000,code=40000)
> {code}
> The SQL:
> {code:java}
> select * from (select * from table1) as table2;
> {code}
> works well.
> So when we generate the Hive SQL in the Jdbc adapter, we need to create an 
> alias for the sub-query in the From clause.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to