You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/11/16 01:02:49 UTC

[GitHub] [incubator-druid] jon-wei commented on a change in pull request #8871: sampler returns nulls in CSV

jon-wei commented on a change in pull request #8871: sampler returns nulls in CSV
URL: https://github.com/apache/incubator-druid/pull/8871#discussion_r347065426
 
 

 ##########
 File path: indexing-service/src/main/java/org/apache/druid/indexing/overlord/sampler/FirehoseSampler.java
 ##########
 @@ -256,9 +256,7 @@ public SamplerResponse sample(FirehoseFactory firehoseFactory, DataSchema dataSc
         Map<String, Object> parsed = new HashMap<>();
 
         columnNames.forEach(k -> {
-          if (row.getRaw(k) != null) {
-            parsed.put(k, row.getRaw(k));
-          }
+          parsed.put(k, row.getRaw(k) == null ? "" : row.getRaw(k));
 
 Review comment:
   I think this should just return nulls as is, any null->empty string conversion should have happened already at this point, so any nulls you see here should really be 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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