Csaba Ringhofer has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21211 )

Change subject: IMPALA-12947: Implement Calcite Planner Union and Value RelNodes
......................................................................


Patch Set 13:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/21211/13/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaValuesRel.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaValuesRel.java:

http://gerrit.cloudera.org:8080/#/c/21211/13/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaValuesRel.java@82
PS13, Line 82:     return context.filterCondition_ != null
             :       ? 
NodeCreationUtils.createSelectNode(context.filterCondition_,
             :           context.ctx_.getRootAnalyzer(), retNode,
             :           context.ctx_.getNextNodeId(), 
getCluster().getRexBuilder())
             :       : retNode;
This see, to be a common pattern - a function like  
NodeCreationUtils.wrapInSelectNodeIfNeeded(context, retNode) could be created 
to do this.


http://gerrit.cloudera.org:8080/#/c/21211/13/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaValuesRel.java@117
PS13, Line 117:       // 2) The return type of the root expression should be 
"string". While this really
IMPALA-10753 could be mentioned as it deals with similar issues. The conclusion 
there was that the union of char(N) and char(M) should be varchar(max(N,M)) if 
N!=M. The issue with string (instead of varchar) was that if the target table 
is varchar(K), then then there will be a string -> varchar(K) cast in the end, 
which is potentially lossy, while it is actually not lossy in case N and M are 
smaller than K.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd989dbb5cf0df0fcc88f72dd579ce4fd713f547
Gerrit-Change-Number: 21211
Gerrit-PatchSet: 13
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Mon, 08 Jul 2024 16:43:54 +0000
Gerrit-HasComments: Yes

Reply via email to