This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.8 by this push:
new 598296cd2 [KYUUBI #6373] Avoid NPE in get operation log api
598296cd2 is described below
commit 598296cd2b5678363d265b87130f65ddb3fad1a3
Author: wforget <[email protected]>
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 <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
(cherry picked from commit 5b6ab1af887daa09e0ea23ace21b2f0c1d2d887b)
Signed-off-by: Wang, Fei <[email protected]>
---
.../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 fdde5bbc5..3580cbd23 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
@@ -150,7 +150,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 =>