[ 
https://issues.apache.org/jira/browse/HIVE-24841?focusedWorklogId=560025&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-560025
 ]

ASF GitHub Bot logged work on HIVE-24841:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Mar/21 16:33
            Start Date: 02/Mar/21 16:33
    Worklog Time Spent: 10m 
      Work Description: 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 560025)
    Time Spent: 20m  (was: 10m)

> Parallel edge fixer may run into NPE when RS is missing a duplicate column 
> from the output schema
> -------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-24841
>                 URL: https://issues.apache.org/jira/browse/HIVE-24841
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This may mean that the RS has an incorrect schema - but that will be 
> investigated separately



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to