DonnyZone commented on code in PR #3203:
URL: https://github.com/apache/calcite/pull/3203#discussion_r1194923331
##########
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:
On the other hand, this PR changes two static functions which can be called
by users. But the functions are not only limited to the scope of this ticket.
For example, the original `Expressions.makeTernary` is intended to infer the
untyped null, but this PR breaks this behavior.
--
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]