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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]