mgaido91 commented on a change in pull request #197: [LIVY-574][TESTS][THRIFT] Add tests for metadata operations URL: https://github.com/apache/incubator-livy/pull/197#discussion_r316082378
########## File path: thriftserver/session/src/main/java/org/apache/livy/thriftserver/session/ColumnBuffer.java ########## @@ -204,6 +204,12 @@ public BitSet getNulls() { return nulls != null ? BitSet.valueOf(nulls) : new BitSet(); } + /** + * Extract subset data to a new column buffer. + * @param start start row number + * @param end end row number, which is not included in the subset data + * @return + */ public ColumnBuffer extractSubset(int start, int end) { ColumnBuffer subset = new ColumnBuffer(type); subset.currentSize = end - start; Review comment: I am afraid that the `arraycopy` can go out of the boundaries (eg. a column with 110 nulls). Can you please check what was done in https://github.com/apache/hive/blob/master/serde/src/java/org/apache/hadoop/hive/serde2/thrift/ColumnBuffer.java and do something similar here? Moreover, may you please add tests for the case mentioned above? Thanks. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services