kasakrisz commented on code in PR #2855:
URL: https://github.com/apache/hive/pull/2855#discussion_r887942105
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/UpdateDeleteSemanticAnalyzer.java:
##########
@@ -91,23 +110,15 @@ private void analyzeDelete(ASTNode tree) throws
SemanticException {
* The sort by clause is put in there so that records come out in the right
order to enable
* merge on read.
*/
- private void reparseAndSuperAnalyze(ASTNode tree) throws SemanticException {
+ private void reparseAndSuperAnalyze(ASTNode tree, ASTNode tabNameNode, Table
mTable) throws SemanticException {
List<? extends Node> children = tree.getChildren();
- // The first child should be the table we are updating / deleting from
- ASTNode tabName = (ASTNode)children.get(0);
- assert tabName.getToken().getType() == HiveParser.TOK_TABNAME :
- "Expected tablename as first child of " + operation + " but found " +
tabName.getName();
- Table mTable = getTargetTable(tabName);
- validateTxnManager(mTable);
- validateTargetTable(mTable);
-
// save the operation type into the query state
SessionStateUtil.addResource(conf,
Context.Operation.class.getSimpleName(), operation.name());
StringBuilder rewrittenQueryStr = new StringBuilder();
rewrittenQueryStr.append("insert into table ");
- rewrittenQueryStr.append(getFullTableNameForSQL(tabName));
+ rewrittenQueryStr.append(getFullTableNameForSQL(tabNameNode));
Review Comment:
It is also used in `MergeSemanticAnalyzer`
```
String targetName = getSimpleTableName(targetNameNode);
...
appendTarget(rewrittenQueryStr, targetNameNode, targetName);
...
```
and in `AcidExportSemanticAnalyzer`
```
StringBuilder rewrittenQueryStr = generateExportQuery(
newTable.getPartCols(), tokRefOrNameExportTable, (ASTNode)
tokRefOrNameExportTable.parent, newTableName);
```
--
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]