You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2024/05/09 15:44:45 UTC
(kyuubi) branch branch-1.9 updated: [KYUUBI #6373] Avoid NPE in get operation log api
This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.9 by this push:
new 6c8d4631b [KYUUBI #6373] Avoid NPE in get operation log api
6c8d4631b is described below
commit 6c8d4631b697ecaddfac3000b3daea30ff22e1d7
Author: wforget <64...@qq.com>
AuthorDate: Thu May 9 08:44:34 2024 -0700
[KYUUBI #6373] Avoid NPE in get operation log api
# :mag: Description
## Issue References ๐
This pull request fixes #6373
## Describe Your Solution ๐ง
`ThriftUtils#EMPTY_ROW_SET` is not suitable for OperationLog , so I add a new `LOG_EMPTY_ROW_SET`
## Types of changes :bookmark:
- [X] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
#### Related Unit Tests
---
# Checklist ๐
- [X] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6378 from wForget/KYUUBI-6373.
Closes #6373
f25aa593f [wforget] revert
ef87b3f4c [wforget] revert and fix npe
7219d35de [wforget] add test
06135fe0e [wforget] fix test
c0bd29078 [wforget] [KYUUBI #6373] Add empty RowSet for OpertationLog
Authored-by: wforget <64...@qq.com>
Signed-off-by: Wang, Fei <fw...@ebay.com>
(cherry picked from commit 5b6ab1af887daa09e0ea23ace21b2f0c1d2d887b)
Signed-off-by: Wang, Fei <fw...@ebay.com>
---
.../scala/org/apache/kyuubi/server/api/v1/OperationsResource.scala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/OperationsResource.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/OperationsResource.scala
index e7a15ab92..224b34cf7 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/OperationsResource.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/OperationsResource.scala
@@ -149,7 +149,11 @@ private[v1] class OperationsResource extends ApiRequestContext with Logging {
FetchOrientation.withName(fetchOrientation),
maxRows)
val rowSet = fetchResultsResp.getResults
- val logRowSet = rowSet.getColumns.get(0).getStringVal.getValues.asScala
+ val logRowSet = if (rowSet.getColumns != null) {
+ rowSet.getColumns.get(0).getStringVal.getValues.asScala
+ } else {
+ Seq.empty
+ }
new OperationLog(logRowSet.asJava, logRowSet.size)
} catch {
case e: BadRequestException =>