soumyakanti3578 commented on code in PR #6316:
URL: https://github.com/apache/hive/pull/6316#discussion_r2830621865
##########
ql/src/test/queries/clientpositive/distribution_key_constant_value.q:
##########
@@ -0,0 +1,7 @@
+CREATE TABLE test (col1 string, col2 string);
+
+EXPLAIN CBO
+SELECT col1 FROM test
+WHERE col2 = 'a'
+DISTRIBUTE BY col1, col2
+SORT BY col1, col2;
Review Comment:
Unfortunately this fails with:
```
EXPLAIN CBO
SELECT col1 FROM test
WHERE col2 = 'a'
DISTRIBUTE BY col1, col2
fname=distribution_key_constant_value.q
See ./ql/target/tmp/log/hive.log or ./itests/qtest/target/tmp/log/hive.log,
or check ./ql/target/surefire-reports or
./itests/qtest/target/surefire-reports/ for specific test cases logs.
org.apache.hadoop.hive.ql.parse.SemanticException: Line 6:20 Invalid table
alias or column reference 'col2': (possible column names are: col1)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner.genAllRexNode(CalcitePlanner.java:5224)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner.genAllRexNode(CalcitePlanner.java:5154)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$OrderByRelBuilder.getOrderByExpression(CalcitePlanner.java:5475)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$OrderByRelBuilder.genSortByKey(CalcitePlanner.java:5441)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$OrderByRelBuilder.addRelDistribution(CalcitePlanner.java:5507)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genSBLogicalPlan(CalcitePlanner.java:3945)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.genLogicalPlan(CalcitePlanner.java:4975)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1611)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1553)
at
org.apache.calcite.tools.Frameworks.lambda$withPlanner$0(Frameworks.java:140)
at
org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:936)
at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:191)
at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:135)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1331)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:588)
at
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:13222)
at
org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:481)
at
org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:358)
at
org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:187)
at
org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:358)
at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:224)
```
I think this is a bug and should be resolved in another ticket.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]