You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Igor Kryvenko <kr...@gmail.com> on 2018/03/29 21:17:59 UTC
Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/
-----------------------------------------------------------
Review request for hive, Ashutosh Chauhan and Vineet Garg.
Bugs: HIVE-18725
https://issues.apache.org/jira/browse/HIVE-18725
Repository: hive-git
Description
-------
If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
Diffs
-----
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
Diff: https://reviews.apache.org/r/66370/diff/1/
Testing
-------
Thanks,
Igor Kryvenko
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Vineet Garg <vg...@hortonworks.com>.
> On April 5, 2018, 8:34 p.m., Igor Kryvenko wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
> > Line 1314 (original), 1309 (patched)
> > <https://reviews.apache.org/r/66370/diff/2/?file=1990863#file1990863line1316>
> >
> > If it is CalciteSemanticException we convert it to SemanticException for saving original cause(CalciteSubquerySemanticException or CalciteViewSemanticException).
> > If it is Semantic exceptin we just wrapped original message into CalciteSemanticException. If
> > we will do
> > throw new CalciteSemanticException(first) we will have redundant exception message such as
> > SemanticException : CalciteSemanticException : CalciteSubquerySemanticException.
Why create a new exception object if it is SemanticException. Previously if first is instance of SemanticException it was rethrown i.e. throw (SemanticException) first. But now we create a new CalciteSemanticException object. I think we should keep this case like it was i.e. just throw SemanticException as it is.
- Vineet
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/#review200565
-----------------------------------------------------------
On April 1, 2018, 8:36 p.m., Igor Kryvenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66370/
> -----------------------------------------------------------
>
> (Updated April 1, 2018, 8:36 p.m.)
>
>
> Review request for hive, Ashutosh Chauhan and Vineet Garg.
>
>
> Bugs: HIVE-18725
> https://issues.apache.org/jira/browse/HIVE-18725
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
> ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
> ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/66370/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Igor Kryvenko
>
>
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/#review200565
-----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
Line 1314 (original), 1309 (patched)
<https://reviews.apache.org/r/66370/#comment281309>
If it is CalciteSemanticException we convert it to SemanticException for saving original cause(CalciteSubquerySemanticException or CalciteViewSemanticException).
If it is Semantic exceptin we just wrapped original message into CalciteSemanticException. If
we will do
throw new CalciteSemanticException(first) we will have redundant exception message such as
SemanticException : CalciteSemanticException : CalciteSubquerySemanticException.
- Igor Kryvenko
On Апрель 1, 2018, 8:36 п.п., Igor Kryvenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66370/
> -----------------------------------------------------------
>
> (Updated Апрель 1, 2018, 8:36 п.п.)
>
>
> Review request for hive, Ashutosh Chauhan and Vineet Garg.
>
>
> Bugs: HIVE-18725
> https://issues.apache.org/jira/browse/HIVE-18725
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
> ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
> ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/66370/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Igor Kryvenko
>
>
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
> On Апрель 3, 2018, 9:58 п.п., Vineet Garg wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
> > Line 1314 (original), 1309 (patched)
> > <https://reviews.apache.org/r/66370/diff/2/?file=1990863#file1990863line1316>
> >
> > I didn't understand this. If it is CalciteSemanticException we convert it to CalciteSemancticException but if it is SemanticException we convert it to CalciteSemanticException? Why do we do that?
If it is CalciteSemanticException we convert it to SemanticException for saving original cause(CalciteSubquerySemanticException or CalciteViewSemanticException).
If it is Semantic exceptin we just wrapped original message into CalciteSemanticException. If
we will do
throw new CalciteSemanticException(first) we will have redundant exception message such as
SemanticException : CalciteSemanticException : CalciteSubquerySemanticException.
- Igor
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/#review200401
-----------------------------------------------------------
On Апрель 1, 2018, 8:36 п.п., Igor Kryvenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66370/
> -----------------------------------------------------------
>
> (Updated Апрель 1, 2018, 8:36 п.п.)
>
>
> Review request for hive, Ashutosh Chauhan and Vineet Garg.
>
>
> Bugs: HIVE-18725
> https://issues.apache.org/jira/browse/HIVE-18725
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
> ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
> ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/66370/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Igor Kryvenko
>
>
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Vineet Garg <vg...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/#review200401
-----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
Line 1314 (original), 1309 (patched)
<https://reviews.apache.org/r/66370/#comment281135>
I didn't understand this. If it is CalciteSemanticException we convert it to CalciteSemancticException but if it is SemanticException we convert it to CalciteSemanticException? Why do we do that?
- Vineet Garg
On April 1, 2018, 8:36 p.m., Igor Kryvenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66370/
> -----------------------------------------------------------
>
> (Updated April 1, 2018, 8:36 p.m.)
>
>
> Review request for hive, Ashutosh Chauhan and Vineet Garg.
>
>
> Bugs: HIVE-18725
> https://issues.apache.org/jira/browse/HIVE-18725
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
> ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
> ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/66370/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Igor Kryvenko
>
>
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Vineet Garg <vg...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/#review208385
-----------------------------------------------------------
Ship it!
Ship It!
- Vineet Garg
On Sept. 5, 2018, 8 p.m., Igor Kryvenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66370/
> -----------------------------------------------------------
>
> (Updated Sept. 5, 2018, 8 p.m.)
>
>
> Review request for hive, Ashutosh Chauhan and Vineet Garg.
>
>
> Bugs: HIVE-18725
> https://issues.apache.org/jira/browse/HIVE-18725
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java df40a2878d
> ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
> ql/src/test/results/clientnegative/subquery_corr_from.q.out 3af1a8a710
> ql/src/test/results/clientnegative/subquery_corr_grandparent.q.out 6f06fc71b0
> ql/src/test/results/clientnegative/subquery_corr_select.q.out d95b9397cf
> ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
> ql/src/test/results/clientnegative/subquery_scalar_multi_columns.q.out ee1e44e1d2
>
>
> Diff: https://reviews.apache.org/r/66370/diff/6/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Igor Kryvenko
>
>
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/
-----------------------------------------------------------
(Updated Сен. 5, 2018, 8 п.п.)
Review request for hive, Ashutosh Chauhan and Vineet Garg.
Bugs: HIVE-18725
https://issues.apache.org/jira/browse/HIVE-18725
Repository: hive-git
Description
-------
If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
Diffs (updated)
-----
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java df40a2878d
ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
ql/src/test/results/clientnegative/subquery_corr_from.q.out 3af1a8a710
ql/src/test/results/clientnegative/subquery_corr_grandparent.q.out 6f06fc71b0
ql/src/test/results/clientnegative/subquery_corr_select.q.out d95b9397cf
ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
ql/src/test/results/clientnegative/subquery_scalar_multi_columns.q.out ee1e44e1d2
Diff: https://reviews.apache.org/r/66370/diff/6/
Changes: https://reviews.apache.org/r/66370/diff/5-6/
Testing
-------
Thanks,
Igor Kryvenko
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Vineet Garg <vg...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/#review208367
-----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
Lines 528 (patched)
<https://reviews.apache.org/r/66370/#comment292253>
Why should missing stats cause AST to reanalyze? This doesn't look correct.
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
Lines 539 (patched)
<https://reviews.apache.org/r/66370/#comment292254>
Same as above. This doesn't look correct.
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
Lines 544 (patched)
<https://reviews.apache.org/r/66370/#comment292255>
So basically if CBO fails due to some reason beside unsupported feature we will end up throwing semantic exception. This will cause the code to not try non-cbo in case of cbo failure. I don't think we want to do that.
- Vineet Garg
On July 1, 2018, 8:55 a.m., Igor Kryvenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66370/
> -----------------------------------------------------------
>
> (Updated July 1, 2018, 8:55 a.m.)
>
>
> Review request for hive, Ashutosh Chauhan and Vineet Garg.
>
>
> Bugs: HIVE-18725
> https://issues.apache.org/jira/browse/HIVE-18725
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c789
> ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a03
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java e091f38bc6
> ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
> ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/66370/diff/5/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Igor Kryvenko
>
>
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/
-----------------------------------------------------------
(Updated Июль 1, 2018, 8:55 д.п.)
Review request for hive, Ashutosh Chauhan and Vineet Garg.
Changes
-------
Rewrite the part of handling exception in CalcitePlanner.
1. If we got RuntimeException we just rethrow it.
2. If we got CalciteSemanticException with unsupported feature, we move to non-cbo analyzing.
3. If we got CalciteSemanticException w/o unsupported feature, we just rethrow it, wrapping it to new SemanticException(e.getMessage()), if we just wrap it, we will have redundant exception message with path of CalciteSemanticException.
Also, I've tested the original cause in the Hive CLI, and it throws expected error, that column reference not found.
Bugs: HIVE-18725
https://issues.apache.org/jira/browse/HIVE-18725
Repository: hive-git
Description
-------
If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
Diffs (updated)
-----
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c789
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a03
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java e091f38bc6
ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
Diff: https://reviews.apache.org/r/66370/diff/5/
Changes: https://reviews.apache.org/r/66370/diff/4-5/
Testing
-------
Thanks,
Igor Kryvenko
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/
-----------------------------------------------------------
(Updated Июнь 26, 2018, 4:43 п.п.)
Review request for hive, Ashutosh Chauhan and Vineet Garg.
Bugs: HIVE-18725
https://issues.apache.org/jira/browse/HIVE-18725
Repository: hive-git
Description
-------
If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
Diffs (updated)
-----
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c789
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a03
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java e091f38bc6
ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
Diff: https://reviews.apache.org/r/66370/diff/4/
Changes: https://reviews.apache.org/r/66370/diff/3-4/
Testing
-------
Thanks,
Igor Kryvenko
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/
-----------------------------------------------------------
(Updated Апрель 5, 2018, 8:59 п.п.)
Review request for hive, Ashutosh Chauhan and Vineet Garg.
Changes
-------
Deleted redundant converting from SemanticException to CalciteSemanticException
Bugs: HIVE-18725
https://issues.apache.org/jira/browse/HIVE-18725
Repository: hive-git
Description
-------
If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
Diffs (updated)
-----
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
Diff: https://reviews.apache.org/r/66370/diff/3/
Changes: https://reviews.apache.org/r/66370/diff/2-3/
Testing
-------
Thanks,
Igor Kryvenko
Re: Review Request 66370: HIVE-18725: Improve error handling for
subqueries if there is wrong column reference
Posted by Igor Kryvenko <kr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66370/
-----------------------------------------------------------
(Updated Апрель 1, 2018, 8:36 п.п.)
Review request for hive, Ashutosh Chauhan and Vineet Garg.
Bugs: HIVE-18725
https://issues.apache.org/jira/browse/HIVE-18725
Repository: hive-git
Description
-------
If there is a column reference within subquery which doesn't exist Hive throws misleading error message.
Diffs (updated)
-----
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteSubquerySemanticException.java 4321a5c7894cec0713ef6e89092ec923f8273b4c
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CalciteViewSemanticException.java c2a4e94a032b46134932d4bec5f70b197788654b
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 41de17fd4679009ef6a4fb5a6d976cbc794ce791
ql/src/test/queries/clientnegative/subquery_non_exisiting_column.q PRE-CREATION
ql/src/test/results/clientnegative/subquery_non_exisiting_column.q.out PRE-CREATION
Diff: https://reviews.apache.org/r/66370/diff/2/
Changes: https://reviews.apache.org/r/66370/diff/1-2/
Testing
-------
Thanks,
Igor Kryvenko