You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "kasakrisz (via GitHub)" <gi...@apache.org> on 2025/04/07 08:11:00 UTC
[PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
kasakrisz opened a new pull request, #5749:
URL: https://github.com/apache/hive/pull/5749
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
3. Ensure you have added or run the appropriate tests for your PR:
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX: Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
6. Please write your PR title to summarize what this PR proposes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### Is the change a dependency upgrade?
<!--
If yes, please attach a file with output from mvn dependency:tree to validate a complete upgrade of dependency.
If no, write 'No'.
-->
### How was this patch tested?
```
mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestNegativeLlapLocalCliDriver -Dqfile=cbo_ambiguous_colref_in_gby.q -pl itests/qtest -Pitests
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2788830343
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2785507124
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [7 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2784112918
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "kasakrisz (via GitHub)" <gi...@apache.org>.
kasakrisz commented on code in PR #5749:
URL: https://github.com/apache/hive/pull/5749#discussion_r2038903234
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -3800,19 +3800,25 @@ private RelNode genGBLogicalPlan(QB qb, RelNode srcRel) throws SemanticException
groupByOutputRowResolver.setIsExprResolver(true);
if (hasGrpByAstExprs) {
- // 4. Construct GB Keys (ExprNode)
- for (int i = 0; i < groupByNodes.size(); ++i) {
- ASTNode groupByNode = groupByNodes.get(i);
- Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
- groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
- RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
- if (groupByExpression == null) {
- throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
- UnsupportedFeature.Invalid_column_reference);
- }
+ try {
+ groupByInputRowResolver.setCheckForAmbiguity(true);
+ // 4. Construct GB Keys (ExprNode)
+ for (int i = 0; i < groupByNodes.size(); ++i) {
Review Comment:
replaced to foreach
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "kasakrisz (via GitHub)" <gi...@apache.org>.
kasakrisz merged PR #5749:
URL: https://github.com/apache/hive/pull/5749
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2786520550
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [7 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2789417641
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "kasakrisz (via GitHub)" <gi...@apache.org>.
kasakrisz commented on code in PR #5749:
URL: https://github.com/apache/hive/pull/5749#discussion_r2038905755
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -3800,19 +3800,25 @@ private RelNode genGBLogicalPlan(QB qb, RelNode srcRel) throws SemanticException
groupByOutputRowResolver.setIsExprResolver(true);
if (hasGrpByAstExprs) {
- // 4. Construct GB Keys (ExprNode)
- for (int i = 0; i < groupByNodes.size(); ++i) {
- ASTNode groupByNode = groupByNodes.get(i);
- Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
- groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
- RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
- if (groupByExpression == null) {
- throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
- UnsupportedFeature.Invalid_column_reference);
- }
+ try {
+ groupByInputRowResolver.setCheckForAmbiguity(true);
+ // 4. Construct GB Keys (ExprNode)
+ for (int i = 0; i < groupByNodes.size(); ++i) {
+ ASTNode groupByNode = groupByNodes.get(i);
+ Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
+ groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
+ RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
+ if (groupByExpression == null) {
+ throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
+ UnsupportedFeature.Invalid_column_reference);
+ }
- addToGBExpr(groupByOutputRowResolver, groupByInputRowResolver, groupByNode,
- groupByExpression, groupByExpressions, outputColumnNames);
+ addToGBExpr(groupByOutputRowResolver, groupByInputRowResolver, groupByNode,
+ groupByExpression, groupByExpressions, outputColumnNames);
+ }
+ }
+ finally {
+ groupByInputRowResolver.setCheckForAmbiguity(false);
}
Review Comment:
Your are right, an exception is causing a CBO failure anyway.
I removed the try-finally
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2782686414
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [7 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "kasakrisz (via GitHub)" <gi...@apache.org>.
kasakrisz commented on code in PR #5749:
URL: https://github.com/apache/hive/pull/5749#discussion_r2038903234
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -3800,19 +3800,25 @@ private RelNode genGBLogicalPlan(QB qb, RelNode srcRel) throws SemanticException
groupByOutputRowResolver.setIsExprResolver(true);
if (hasGrpByAstExprs) {
- // 4. Construct GB Keys (ExprNode)
- for (int i = 0; i < groupByNodes.size(); ++i) {
- ASTNode groupByNode = groupByNodes.get(i);
- Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
- groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
- RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
- if (groupByExpression == null) {
- throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
- UnsupportedFeature.Invalid_column_reference);
- }
+ try {
+ groupByInputRowResolver.setCheckForAmbiguity(true);
+ // 4. Construct GB Keys (ExprNode)
+ for (int i = 0; i < groupByNodes.size(); ++i) {
Review Comment:
replaced with foreach
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "soumyakanti3578 (via GitHub)" <gi...@apache.org>.
soumyakanti3578 commented on code in PR #5749:
URL: https://github.com/apache/hive/pull/5749#discussion_r2038418049
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -3800,19 +3800,25 @@ private RelNode genGBLogicalPlan(QB qb, RelNode srcRel) throws SemanticException
groupByOutputRowResolver.setIsExprResolver(true);
if (hasGrpByAstExprs) {
- // 4. Construct GB Keys (ExprNode)
- for (int i = 0; i < groupByNodes.size(); ++i) {
- ASTNode groupByNode = groupByNodes.get(i);
- Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
- groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
- RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
- if (groupByExpression == null) {
- throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
- UnsupportedFeature.Invalid_column_reference);
- }
+ try {
+ groupByInputRowResolver.setCheckForAmbiguity(true);
+ // 4. Construct GB Keys (ExprNode)
+ for (int i = 0; i < groupByNodes.size(); ++i) {
+ ASTNode groupByNode = groupByNodes.get(i);
+ Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
+ groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
+ RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
+ if (groupByExpression == null) {
+ throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
+ UnsupportedFeature.Invalid_column_reference);
+ }
- addToGBExpr(groupByOutputRowResolver, groupByInputRowResolver, groupByNode,
- groupByExpression, groupByExpressions, outputColumnNames);
+ addToGBExpr(groupByOutputRowResolver, groupByInputRowResolver, groupByNode,
+ groupByExpression, groupByExpressions, outputColumnNames);
+ }
+ }
+ finally {
+ groupByInputRowResolver.setCheckForAmbiguity(false);
}
Review Comment:
I was wondering if we can avoid the extra indentation caused by `try-finally` here. If we don't use `try-finally` the only concerning thing that I can think of is that `groupByInputRowResolver.setCheckForAmbiguity(false);` will not run anymore in case we throw the `CalciteSemanticException`.
But do we need to set the boolean anyway if we are throwing the Exception?
If not, then it might be better to just remove `try-finally`; then this will be a small two-line change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2791812739
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "SourabhBadhya (via GitHub)" <gi...@apache.org>.
SourabhBadhya commented on code in PR #5749:
URL: https://github.com/apache/hive/pull/5749#discussion_r2037756391
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -3800,19 +3800,25 @@ private RelNode genGBLogicalPlan(QB qb, RelNode srcRel) throws SemanticException
groupByOutputRowResolver.setIsExprResolver(true);
if (hasGrpByAstExprs) {
- // 4. Construct GB Keys (ExprNode)
- for (int i = 0; i < groupByNodes.size(); ++i) {
- ASTNode groupByNode = groupByNodes.get(i);
- Map<ASTNode, RexNode> astToRexNodeMap = genAllRexNode(
- groupByNode, groupByInputRowResolver, cluster.getRexBuilder());
- RexNode groupByExpression = astToRexNodeMap.get(groupByNode);
- if (groupByExpression == null) {
- throw new CalciteSemanticException("Invalid Column Reference: " + groupByNode.dump(),
- UnsupportedFeature.Invalid_column_reference);
- }
+ try {
+ groupByInputRowResolver.setCheckForAmbiguity(true);
+ // 4. Construct GB Keys (ExprNode)
+ for (int i = 0; i < groupByNodes.size(); ++i) {
Review Comment:
Can we use a non-indexed for loop?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2796152380
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28881: Ambiguous column reference is not detected in GROUP BY query. [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5749:
URL: https://github.com/apache/hive/pull/5749#issuecomment-2787393837
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749) **Quality Gate passed**
Issues
 [11 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5749&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5749&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5749&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org