You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/03/15 19:21:41 UTC

[GitHub] [incubator-livy] vanzin commented on a change in pull request #155: [LIVY-565] Ensure column buffer for string and binary returns all data.

vanzin commented on a change in pull request #155: [LIVY-565] Ensure column buffer for string and binary returns all data.
URL: https://github.com/apache/incubator-livy/pull/155#discussion_r266117225
 
 

 ##########
 File path: thriftserver/session/src/main/java/org/apache/livy/thriftserver/session/ColumnBuffer.java
 ##########
 @@ -203,21 +205,10 @@ public Object getValues() {
       return (doubles.length != currentSize) ? Arrays.copyOfRange(doubles, 0, currentSize)
         : doubles;
     case BINARY:
-      // org.apache.hadoop.hive.serde2.thrift.ColumnBuffer expects a List<ByteBuffer>, so convert
-      // when reading the value. The Hive/Thrift stack also dislikes nulls, and returning a
-      // list with a different number of elements than expected.
-      return Arrays.stream(buffers)
-        .limit(currentSize)
-        .map(b -> (b != null) ? ByteBuffer.wrap(b) : EMPTY_BUFFER)
-        .collect(Collectors.toList());
+      return toList(Arrays.stream(buffers).map(b -> (b != null) ? ByteBuffer.wrap(b) : null),
 
 Review comment:
   The map is not because of nulls, it's because the internal buffer is an array of `byte[]` and the Hive code expects `ByteBuffer`s, not byte arrays.

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