You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/03/02 16:33:26 UTC
[GitHub] [hive] kasakrisz commented on a change in pull request #2035: HIVE-24841: Parallel edge fixer may run into NPE when RS is missing a duplicate column from the output schema
kasakrisz commented on a change in pull request #2035:
URL: https://github.com/apache/hive/pull/2035#discussion_r585719471
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/ParallelEdgeFixer.java
##########
@@ -256,9 +257,20 @@ private static String extractColumnName(ExprNodeDesc expr) throws SemanticExcept
public static Optional<Set<String>> colMappingInverseKeys(ReduceSinkOperator rs) {
Map<String, String> ret = new HashMap<String, String>();
Map<String, ExprNodeDesc> exprMap = rs.getColumnExprMap();
+ Set<String> neededColumns = new HashSet<String>();
try {
for (Entry<String, ExprNodeDesc> e : exprMap.entrySet()) {
- ret.put(extractColumnName(e.getValue()), e.getKey());
+ String columnName = extractColumnName(e.getValue());
+ if (rs.getSchema().getColumnInfo(e.getKey()) == null) {
+ // ignore incorrectly mapped columns (if there's any) - but require its input to be present
+ neededColumns.add(columnName);
+ } else {
+ ret.put(columnName, e.getKey());
+ }
+ }
+ neededColumns.removeAll(ret.keySet());
+ if (!neededColumns.isEmpty()) {
+ throw new SemanticException("There is no way to compute: " + neededColumns);
Review comment:
It would be useful to log the exception in the catch clause at least debug level.
----------------------------------------------------------------
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.
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