DonnyZone commented on code in PR #3203:
URL: https://github.com/apache/calcite/pull/3203#discussion_r1194897093
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -1164,10 +1164,9 @@ public Expression handle(Expression x) {
static Expression getDefaultValue(Type type) {
Primitive p = Primitive.of(type);
- if (p != null) {
- return Expressions.constant(p.defaultValue, type);
- }
- return Expressions.constant(null, type);
+ return p != null
+ ? Expressions.constant(p.defaultValue, type)
+ : Expressions.constant(null);
Review Comment:
@rubenada @zstan Yes, just concern, but I can't come up with a UT to
trigger this code path right now. This function is also called by some complex
WinAggs. I'm personally incline to perform such common optimizations at the
Linq4J side when generating the **code string**, rather than dropping type
information of expressions, i.e., `(Integer) null` to `(Object) null`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]