gianm commented on a change in pull request #11170:
URL: https://github.com/apache/druid/pull/11170#discussion_r621587032
##########
File path:
processing/src/main/java/org/apache/druid/segment/virtual/SingleLongInputCachingExpressionColumnValueSelector.java
##########
@@ -99,7 +99,8 @@ public ExprEval getObject()
{
// things can still call this even when underlying selector is null (e.g.
ExpressionColumnValueSelector#isNull)
if (selector.isNull()) {
- return ExprEval.ofLong(null);
+ bindings.set(null);
+ return expression.eval(bindings);
Review comment:
Hmm, we should cache the result of `expression.eval(bindings)` for null
too. (The purpose of this selector is to cache expression evaluations, and
there might be a lot of nulls in a column, so it might be very useful to do
that!)
I'd suggest adding a `lastInputIsNull` boolean and adjusting the logic of
getObject accordingly: set it to true when we encounter a null, set it to false
when we encounter nonnull.
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]