You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "clintropolis (via GitHub)" <gi...@apache.org> on 2023/05/02 01:42:40 UTC

[GitHub] [druid] clintropolis commented on a diff in pull request #14139: fix issues with filtering nulls on values coerced to numeric types

clintropolis commented on code in PR #14139:
URL: https://github.com/apache/druid/pull/14139#discussion_r1182013044


##########
processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:
##########
@@ -459,11 +461,12 @@ public Object getObject()
         if (0 <= dimIndex && dimIndex < dims.length) {
           final StructuredData data = (StructuredData) dims[dimIndex];
           if (data != null) {
-            return ExprEval.bestEffortOf(data.getValue()).valueOrDefault();
+            final Object o = ExprEval.bestEffortOf(data.getValue()).valueOrDefault();
+            return o == null ? defaultValue : o;

Review Comment:
   I did this to make things behave consistently for realtime selectors of 'auto' typed columns as when those columns are persisted, rather than to pre-empitively eliminate null values from the indexer like the regular numeric indexers do in default value mode. So its not at all for callers, and just for consistency in default value mode when we are dealing with a single type numeric.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org