konstantinb commented on code in PR #6423:
URL: https://github.com/apache/hive/pull/6423#discussion_r3227827776
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -1568,7 +1569,7 @@ Table materializeCTE(String cteName, CTEClause cte)
throws HiveException {
createTable.addChild(temporary);
createTable.addChild(cte.cteNode);
- SemanticAnalyzer analyzer = new SemanticAnalyzer(queryState);
+ SemanticAnalyzer analyzer = (SemanticAnalyzer)
DDLSemanticAnalyzerFactory.getAnalyzer(createTable, queryState);
Review Comment:
> is this a safe cast?
Yes — for TOK_CREATETABLE, the factory returns CreateTableAnalyzer, which
extends CalcitePlanner → SemanticAnalyzer. The token type is set as a literal
constant 3 lines above, making this the most deterministic instance of the
pattern. The same cast is used in AbstractCreateViewAnalyzer,
AlterTableExecuteAnalyzer, and ExplainSQRewriteSemanticAnalyzer (where the
token type is less locally obvious).
--
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]