[
https://issues.apache.org/jira/browse/HIVE-18725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524183#comment-16524183
]
Vineet Garg commented on HIVE-18725:
------------------------------------
[~ikryvenko] You patch doesn't resolve the underlying issue. e.g. with your
patch following query still throws misleading error
{code:sql}
hive> explain select * from srcpart where srcpart.key IN ( select p_type from
part p where p.p_type = srcpart.non_exisiting_column) and srcpart.key in
(select 4 from part p1);
FAILED: SemanticException Line 0:-1 Unsupported SubQuery Expression 'key': Only
1 SubQuery expression is supported.
{code}
Ideal fix would probably entail subquery code to catch any semantic exception
and wrap it in calcitesubquerysemanticexception and rethrow it.
> Improve error handling for subqueries if there is wrong column reference
> ------------------------------------------------------------------------
>
> Key: HIVE-18725
> URL: https://issues.apache.org/jira/browse/HIVE-18725
> Project: Hive
> Issue Type: Improvement
> Components: Query Planning
> Reporter: Vineet Garg
> Assignee: Igor Kryvenko
> Priority: Major
> Attachments: HIVE-18725.01.patch, HIVE-18725.02.patch,
> HIVE-18725.03.patch, HIVE-18725.04.patch, HIVE-18725.05.patch,
> HIVE-18725.06.patch, HIVE-18725.07.patch, HIVE-18725.08.patch
>
>
> If there is a column reference within subquery which doesn't exist Hive
> throws misleading error message.
> e.g.
> {code:sql}
> select * from table1 where table1.col1 IN (select col2 from table2 where
> table2.col1=table1.non_existing_column) and table1.col1 IN (select 4);
> {code}
> The above query, assuming table1 doesn't have non_existing_column, will throw
> following misleading error:
> {noformat}
> FAILED: SemanticException Line 0:-1 Unsupported SubQuery Expression 'col1':
> Only 1 SubQuery expression is supported.
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)