[KYUUBI #6373] Avoid NPE in get operation log api

# 🔍 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 🔖

- [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 ⚰️

#### Behavior With This Pull Request 🎉

#### 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 <643348094@qq.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
This commit is contained in:
wforget 2024-05-09 08:44:34 -07:00 committed by Wang, Fei
parent 3439ea03f2
commit 5b6ab1af88

View File

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