You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2026/05/04 15:10:15 UTC
(kyuubi) branch master updated: [KYUUBI #7428] Support fetchOrientation parameter in OperationRestApi.getOperationLog
This is an automated email from the ASF dual-hosted git repository.
pan3793 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new c961d1c2e8 [KYUUBI #7428] Support fetchOrientation parameter in OperationRestApi.getOperationLog
c961d1c2e8 is described below
commit c961d1c2e89b64074bac606d114695081e2acde8
Author: yuqi <yu...@bestpay.com.cn>
AuthorDate: Mon May 4 23:10:01 2026 +0800
[KYUUBI #7428] Support fetchOrientation parameter in OperationRestApi.getOperationLog
### Why are the changes needed?
The current getOperationLog method in OperationRestApi does not support the fetchOrientation parameter, which limits the client's ability to control the fetch direction (e.g., FETCH_NEXT, FETCH_FIRST) when retrieving operation logs. This change adds an overloaded method that accepts
fetchOrientation, while keeping the original method signature for backward compatibility.
### How was this patch tested?
- Existing tests should pass as the original method signature is preserved via method overloading.
- Manual verification by calling the new API with and without fetchOrientation.
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #7428 from ychris78/add-fetch-orientation-to-operation-log.
Closes #7428
45a6588c4 [yuqi] reformat code
cf43fe94d [yuqi] add test
ab34e14e8 [yuqi] add `fetchOrientation` to getOperationLog
Authored-by: yuqi <yu...@bestpay.com.cn>
Signed-off-by: Cheng Pan <ch...@apache.org>
---
.../src/main/java/org/apache/kyuubi/client/OperationRestApi.java | 8 +++++++-
.../apache/kyuubi/server/rest/client/OperationRestApiSuite.scala | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/OperationRestApi.java b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/OperationRestApi.java
index ad659a5d46..9f24436fec 100644
--- a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/OperationRestApi.java
+++ b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/OperationRestApi.java
@@ -52,9 +52,15 @@ public class OperationRestApi {
}
public OperationLog getOperationLog(String operationHandleStr, int maxRows) {
+ return getOperationLog(operationHandleStr, null, maxRows);
+ }
+
+ public OperationLog getOperationLog(
+ String operationHandleStr, String fetchOrientation, Integer maxRows) {
String path = String.format("%s/%s/log", API_BASE_PATH, operationHandleStr);
Map<String, Object> params = new HashMap<>();
- params.put("maxrows", maxRows);
+ if (fetchOrientation != null) params.put("fetchorientation", fetchOrientation);
+ if (maxRows != null) params.put("maxrows", maxRows);
return this.getClient().get(path, params, OperationLog.class, client.getAuthHeader());
}
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/OperationRestApiSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/OperationRestApiSuite.scala
index e02cfd260c..c48a354fbe 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/OperationRestApiSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/OperationRestApiSuite.scala
@@ -85,6 +85,12 @@ class OperationRestApiSuite extends RestClientTestHelper {
_.contains("select \"test_value\", 1, 0.32d, true")))
assert(logRowSet.getRowCount === 10)
+ val logRowSetWithOrientation =
+ operationRestApi.getOperationLog(statementHandleStr, "FETCH_FIRST", 10)
+ assert(logRowSetWithOrientation.getLogRowSet.asScala.exists(
+ _.contains("select \"test_value\", 1, 0.32d, true")))
+ assert(logRowSetWithOrientation.getRowCount === 10)
+
val resultRowSet = operationRestApi.getNextRowSet(statementHandleStr)
assert("test_value".equals(resultRowSet.getRows.asScala.head.getFields.asScala.head.getValue))
assert(resultRowSet.getRowCount == 1)