clintropolis commented on code in PR #16708:
URL: https://github.com/apache/druid/pull/16708#discussion_r1673610239
##########
processing/src/main/java/org/apache/druid/query/rowsandcols/concrete/ColumnHolderRACColumn.java:
##########
@@ -91,7 +91,7 @@ public int numRows()
public boolean isNull(int rowNum)
{
offset.set(rowNum);
- return valueSelector.isNull();
+ return valueSelector.getObject() == null;
Review Comment:
i think we need to revisit this contract, since it doesn't really feel
compatible to coexist with implicit casting on the `getLong`/`getFloat` etc
methods. If you have a string column but want to read numbers from it but not
all of them can be parsed into numbers, you can't reliably use any of the
primitive getters, because `isNull` would say false, but `getLong` would not be
parseable into a number and return 0. See `ObjectColumnAccessorBase`.
This means you can't actually use these methods if you want to try to get
numbers from an object column, so they should probably instead throw exceptions
instead of silently giving you zeros that should have been handled as nulls.
We can fix this by just forbidding this sort of implicit casting, I'm not
sure it does us any favors in terms of making code clear to follow, while
having explicit casting wrapper gizmos would make it obvious when something is
turning a string into a number.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]