asdf2014 commented on a change in pull request #7020: Write null byte when 
indexing numeric dimensions with Hadoop
URL: https://github.com/apache/incubator-druid/pull/7020#discussion_r262787803
 
 

 ##########
 File path: 
indexing-hadoop/src/main/java/org/apache/druid/indexer/InputRowSerde.java
 ##########
 @@ -190,7 +215,7 @@ public void serialize(ByteArrayDataOutput out, Object 
value)
     @Override
     public Long deserialize(ByteArrayDataInput in)
     {
-      return in.readLong();
+      return isNullByteSet(in) ? null : in.readLong();
 
 Review comment:
   Perhaps it would be better to use a functional programming style here.
   
   ```java
   return Optional.ofNullable(in)
                  .filter(InputRowSerde::isNotNullByteSet)
                  .map(ByteArrayDataInput::readLong)
                  .get();
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to