[GitHub] [hive] jcamachor commented on a change in pull request #1357: HIVE-23963: UnsupportedOperationException in queries 74 and 84 while applying HiveCardinalityPreservingJoinRule

2020-08-06 Thread GitBox


jcamachor commented on a change in pull request #1357:
URL: https://github.com/apache/hive/pull/1357#discussion_r466575229



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelDistribution.java
##
@@ -81,8 +84,16 @@ public RelDistribution apply(TargetMapping mapping) {
   return this;
 }
 List newKeys = new ArrayList<>(keys.size());
+
+// Instead of using a HashMap for lookup 
newKeys.add(mapping.getTargetOpt(key)); should be called but not all the
+// mapping supports that. See HIVE-23963. Replace this when this is fixed 
in calcite.

Review comment:
   @kasakrisz , please create the Calcite JIRA so it is easier to track. 
Thanks





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



-
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org



[GitHub] [hive] jcamachor commented on a change in pull request #1357: HIVE-23963: UnsupportedOperationException in queries 74 and 84 while applying HiveCardinalityPreservingJoinRule

2020-08-04 Thread GitBox


jcamachor commented on a change in pull request #1357:
URL: https://github.com/apache/hive/pull/1357#discussion_r465194632



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelDistribution.java
##
@@ -82,7 +83,14 @@ public RelDistribution apply(TargetMapping mapping) {
 }
 List newKeys = new ArrayList<>(keys.size());
 for (Integer key : keys) {
-  newKeys.add(mapping.getTargetOpt(key));
+  // Instead of this inner for loop 
newKeys.add(mapping.getTargetOpt(key)); should be called but not all the

Review comment:
   nit. Can we add the mapping to a map and do the lookup, instead of 
having a nested loop?





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



-
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org