deniskuzZ commented on code in PR #5267:
URL: https://github.com/apache/hive/pull/5267#discussion_r1619200754
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/MergeSemanticAnalyzer.java:
##########
@@ -350,26 +352,51 @@ private MergeStatement.InsertClause handleInsert(ASTNode
whenNotMatchedClause, S
throw new SemanticException(String.format("Column schema must have the
same length as values (%d vs %d)",
columnListNode.getChildCount(), valuesNode.getChildCount() - 1));
}
- UnparseTranslator defaultValuesTranslator = new UnparseTranslator(conf);
- defaultValuesTranslator.enable();
- List<String> targetSchema = processTableColumnNames(columnListNode,
targetTable.getFullyQualifiedName());
- collectDefaultValues(valuesNode, targetTable, targetSchema,
defaultValuesTranslator);
- defaultValuesTranslator.applyTranslations(ctx.getTokenRewriteStream());
- String valuesClause = getMatchedText(valuesNode);
- valuesClause = valuesClause.substring(1, valuesClause.length() - 1);
//strip '(' and ')'
- String extraPredicate = getWhenClausePredicate(whenNotMatchedClause);
- return new MergeStatement.InsertClause(
- getMatchedText(columnListNode), valuesClause, onClausePredicate,
extraPredicate);
- }
+ List<String> columnNames;
+ if (columnListNode != null) {
Review Comment:
can it be null, there is no check above for null -
columnListNode.getChildCount()?
--
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]