kgyrtkirk commented on a change in pull request #2035:
URL: https://github.com/apache/hive/pull/2035#discussion_r589364183
##########
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:
I've not logged these exceptions because a lot of them may happen during
optimization - especially during swo tries uncover new possibilities.
Its already a challenging to make sense out from only looking at the swo
logs.
But some logging will still happen around
[here](https://github.com/apache/hive/blob/fb25765b831cc9269d104b5825050a7cbee0d8b6/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java#L1852)
why the optimization may not kick in.
----------------------------------------------------------------
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]