wangyum commented on a change in pull request #26014: [SPARK-29349][SQL] 
Support FETCH_PRIOR in Thriftserver fetch request
URL: https://github.com/apache/spark/pull/26014#discussion_r333071815
 
 

 ##########
 File path: 
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala
 ##########
 @@ -684,6 +685,94 @@ class HiveThriftBinaryServerSuite extends 
HiveThriftJdbcTest {
       
assert(e.getMessage.contains("org.apache.spark.sql.catalyst.parser.ParseException"))
     }
   }
+
+  test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") {
+    def checkResult(rows: RowSet, start: Long, end: Long): Unit = {
+      assert(rows.getStartOffset() == start)
+      assert(rows.numRows() == end - start)
+      // scalastyle:off
+      rows.iterator.asScala.zip((start until end).iterator).foreach { a =>
+        val rowValue = a._1(0).asInstanceOf[Long]
+        assert(rowValue == a._2)
+      }
 
 Review comment:
   Could we change this  assert to?
   ```scala
   rows.iterator.asScala.zip((start until end).iterator).foreach { case (row, 
v2) =>
     assert(row(0).asInstanceOf[Long] === v2)
   }
   ```

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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to