apache / apache/kyuubi

[TASK][EASY] Support setting the username to launch Kyuubi engines in USER & CONNECTION share level

Open
#5,369 8 comments 0 reactions 1 assignee Claimed by @mrtisttt View on GitHub
hacktoberfest
Dominant language
Scala
Stars
2.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

### Search before creating

- [X] I have searched in the [task list](https://github.com/orgs/apache/projects/296) and found no similar tasks.

### Mentor

- [ ] I have sufficient knowledge and experience of this task, and I volunteer to be the mentor of this task to guide contributors to complete the task.

### Skill requirements

- Basic knowledge on Scala Programing Language

### Background and Goals

Hive supports SQL operation authorization against the session user, and then runs SQL as Hive Server user.

Currently, Kyuubi supports this feature at the SERVER share level.

We want to also support this feature in other share levels, which provide fine isolation.

### Implementation steps

Currently, `EngineRef#appUser` serves two purposes:
- The username used to run the `SparkSQLEngine`
- Part of the key used to look up the `SparkSQLEngine` to connect to.

To implement this feature, we need to replace `EngineRef#appUser` with two new fields, `EngineRef#appUser` and `EngineRef#engineSpaceUser`.

- The new `EngineRef#appUser` is the username used to run the `SparkSQLEngine`.
- The `EngineRef#engineSpaceUser` is used to look up the `SparkSQLEngine`.

`EngineRef#engineSpaceUser` is set in the same way as the old `EngineRef#appUser`.

The new `EngineRef#appUser` is set according to a new config, `kyuubi.engine.user`:
- When `kyuubi.engine.user` is not set, set `EngineRef#appUser` to `EngineRef#engineSpaceUser`
- When `kyuubi.engine.user` is set, set `EngineRef#appUser` to that value.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.