Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22408 )

Change subject: IMPALA-13520: Support in clause coercing
......................................................................


Patch Set 2:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/CombineValueNodesRule.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/CombineValueNodesRule.java:

http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/CombineValueNodesRule.java@73
PS2, Line 73:         // If it's something other than a Values RelNode, the 
input will not be combined
            :         // with the Values RelNode and will be kept as/is.
            :         newRelNodes.add(realInput);
Does it matter that we remove the HepRelVertex for this non-value case? i.e. we 
use realInput vs input


http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java:

http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java@51
PS2, Line 51: treatr
Nit: "treats"


http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java@108
PS2, Line 108:     for (int i = 0; i < inList.size(); ++i) {
Do we need this loop? coerceInList() handles the whole list.


http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java@109
PS2, Line 109:       coerced = coerceInList(scope, inList, rightOperandTypes,
             :           commonType) || coerced;
Nit: This can use |=


http://gerrit.cloudera.org:8080/#/c/22408/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java@129
PS2, Line 129:    boolean coerced = fromTypes.stream().anyMatch(ft -> 
needsCasting(ft, toType));
             :
             :     if (coerced) {
             :       for (int i = 0; i < inList.size(); ++i) {
             :         SqlNode castNode = castTo(inList.get(i), toType);
             :         inList.set(i, castNode);
             :         updateInferredType(castNode, toType);
             :       }
             :     }
Nit: Could we avoid casting for items that are already the right type?

(Not sure it matters to subsequent planning or execution, but it seems a bit 
cleaner.)



--
To view, visit http://gerrit.cloudera.org:8080/22408
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I492845d623766b9182bca5eeca22eb3352ef2f3d
Gerrit-Change-Number: 22408
Gerrit-PatchSet: 2
Gerrit-Owner: Steve Carlin <scar...@cloudera.com>
Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fangyu....@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com>
Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com>
Gerrit-Comment-Date: Wed, 29 Jan 2025 00:29:19 +0000
Gerrit-HasComments: Yes

Reply via email to