You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/05/23 01:41:07 UTC

[GitHub] [incubator-kyuubi] SteNicholas commented on a diff in pull request #2678: [KYUUBI #2285] trino's result fetching method is changed to a streaming iterator mode to avoid hold data at server side

SteNicholas commented on code in PR #2678:
URL: https://github.com/apache/incubator-kyuubi/pull/2678#discussion_r878965619


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/operation/ExecuteStatement.scala:
##########
@@ -77,6 +81,24 @@ class ExecuteStatement(
     }
   }
 
+  override def getNextRowSet(order: FetchOrientation, rowSetSize: Int): TRowSet = {
+    validateDefaultFetchOrientation(order)
+    assertState(OperationState.FINISHED)
+    setHasResultSet(true)
+    (order, incrementalCollect) match {
+      case (FETCH_NEXT, _) => iter.fetchNext()
+      case (FETCH_PRIOR, false) => iter.fetchPrior(rowSetSize)
+      case (FETCH_FIRST, false) => iter.fetchAbsolute(0)
+      case _ =>
+        val mode = if (incrementalCollect) "incremental collect" else "full collect"
+        throw KyuubiSQLException(s"Fetch orientation[$order] is not supported in $mode mode")

Review Comment:
   `FeatureNotSupportedException`?



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

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org