yiheng commented on a change in pull request #197: [LIVY-574][THRIFT 
SERVER][TEST] Add tests for metadata operations
URL: https://github.com/apache/incubator-livy/pull/197#discussion_r313453604
 
 

 ##########
 File path: 
thriftserver/server/src/main/scala/org/apache/livy/thriftserver/operation/MetadataOperation.scala
 ##########
 @@ -42,8 +46,14 @@ abstract class MetadataOperation(sessionHandle: 
SessionHandle, opType: Operation
     assertState(Seq(OperationState.FINISHED))
     validateFetchOrientation(orientation)
     if (orientation.equals(FetchOrientation.FETCH_FIRST)) {
-      rowSet.setRowOffset(0)
+      offset = 0
+    }
+
+    if (offset >= rowSet.numRows) {
 
 Review comment:
   Here are the two solutions I have thought:
   1. Return an empty ResultSet when needed
   2. Implement an `extractSubset()` method for ThriftResultSet, which is 
similar to what Spark thrift server do. In another patch, you have a concern of 
it's not efficient.
   
   Please let me know your thought. 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

Reply via email to