Commit Graph

1480 Commits

Author SHA1 Message Date
Cheng Pan
e4f5ba7010
[KYUUBI #1673] [BUILD] Improve log4j configurations
### _Why are the changes needed?_

- Flink engine print log to console on UT, and use `$FLINK_CONF_DIR/log4j.properties` in production.
- Add missing log4j conf `kyuubi-trino-engine` module.
- Fix log4j configuration issue of THRIFT

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1673 from pan3793/log.

Closes #1673

8abe9d08 [Cheng Pan] Remove flink-sql-engine conf
b1726288 [Cheng Pan] Improve log4j configurations

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2022-01-04 19:43:14 +08:00
Simon
dc26f2128c
[KYUUBI #1568] [FOLLOWUP] Add getSessionEvent in session
### _Why are the changes needed?_
KyuubiSessionEvent.apply will get incorrect info.
The first one is  from `Session.getSessionEvent`, the second one is `KyuubiSessionEvent.apply`

![image](https://user-images.githubusercontent.com/18065113/147657104-16247260-4b50-4485-843c-f5dbb0116c99.png)

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1644 from simon824/1229.

Closes #1568

bc5e4b49 [Simon] Merge branch 'apache:master' into 1229
bb316e6a [simon] Add getSessionEvent in session

Lead-authored-by: Simon <3656562@qq.com>
Co-authored-by: simon <zhangshiming@cvte.com>
Signed-off-by: Kent Yao <yao@apache.org>
2022-01-04 19:40:57 +08:00
minyk
0f8ebb6006
[KYUUBI #1675][FEATURE] Redact secret information from SparkSQLEngine log
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Secret informations on log is dangerous on the production environment. Secret info should be redacted in some way.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate
capture from Spark Driver's STDERR
![Screen Shot 2022-01-04 at 11 56 43 AM](https://user-images.githubusercontent.com/1802676/148022789-f005748e-4efe-47da-8d2d-87ecdd233910.png)

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1677 from minyk/kyuubi-1675.

Closes #1675

6a390575 [minyk] redact statement in the log

Authored-by: minyk <minykreva@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2022-01-04 19:30:42 +08:00
Wang Zhen
47533100f6
[KYUUBI #1674] Uncache cached tables when session closed
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
As mentioned in SPARK-29911 , there may also be memory leaks in kyuubi.  #1674

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [X] Add screenshots for manual tests if appropriate
![微信截图_20220104145456](https://user-images.githubusercontent.com/17894939/148021323-9f3e4268-ff54-4ad3-bb7e-2044d73ae154.png)
close session:
![微信截图_20220104145530](https://user-images.githubusercontent.com/17894939/148021331-2a816934-2c07-47dd-b939-01117f93bb5b.png)

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1676 from wForget/KYUUBI-1674.

Closes #1674

e2bec4ec [Wang Zhen] [KYUUBI-1674] Uncache cached tables when session closed

Authored-by: Wang Zhen <wangzhen07@qiyi.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2022-01-04 15:48:05 +08:00
simon
4655cd8515
[KYUUBI #1654][Bug] Flaky OperationsResourceSuite
### _Why are the changes needed?_
closes #1654

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1655 from simon824/flaky.

Closes #1654

92548e46 [simon] style
3a748969 [simon] state
3c507da3 [simon] state
4436bb89 [simon] rm
e12d483c [simon] flakyut

Authored-by: simon <zhangshiming@cvte.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-31 19:28:57 +08:00
yanghua
4e3c718108
[KYUUBI #1665][FOLLOWUP] Rename FlinkEngineProcessBuilder to FlinkProcessBuilder to align with SparkProcessBuilder
…

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1667 from yanghua/KYUUBI-1665-FOLLOWUP.

Closes #1665

aa6f6120 [yanghua] retrigger ci
013005c3 [yanghua] [KYUUBI #1665][FOLLOWUP] Rename FlinkEngineProcessBuilder to FlinkProcessBuilder to align with SparkProcessBuilder

Authored-by: yanghua <yanghua1127@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-31 19:27:58 +08:00
zwangsheng
872551d3aa
[KYUUBI #1594] SparkProcessBuild submit add --conf spark.driver.host=
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
detail #1594
When Kyuubi On Kubernetes submit spark engine by client mode, executor pod can not connect to driver by kyuubi pod name, which is default set.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1596 from zwangsheng/kyuubi/1594.

Closes #1594

d4b41005 [zwangsheng] add comment
f7bcffb6 [zwangsheng] fix test name
581eb508 [zwangsheng] fix test name
b19a2c21 [zwangsheng] simple & add testsuit
83979935 [zwangsheng] fix
1a9ae9b1 [zwangsheng] fix doc
d857eac7 [zwangsheng] Merge branch 'kyuubi/1594' of https://github.com/zwangsheng/incubator-kyuubi into kyuubi/1594
b723f4ed [zwangsheng] retest
8210de56 [zwangsheng] make import normal
92ec9cf4 [zwangsheng] 1594

Authored-by: zwangsheng <2213335496@qq.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-31 19:25:18 +08:00
yanghua
3eaa1d86c8 [KYUUBI #1665] Rename FlinkEngineProcessBuilder to FlinkProcessBuilder to align with SparkProcessBuilder
…r to align with SparkProcessBuilder

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1666 from yanghua/KYUUBI-1665.

Closes #1665

569becd3 [yanghua] [KYUUBI #1665] Rename FlinkEngineProcessBuilder to FlinkProcessBuilder to align with SparkProcessBuilder

Authored-by: yanghua <yanghua1127@gmail.com>
Signed-off-by: yanghua <yanghua1127@gmail.com>
2021-12-31 17:12:53 +08:00
shenbing
05b22989ef
[KYUUBI #1656] Fix dist failed with --spark-provided
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate
![image](https://user-images.githubusercontent.com/16119667/147799077-3ccff7ba-d1bc-494e-b7ae-d92c900b2fff.png)
![image](https://user-images.githubusercontent.com/16119667/147799399-cc0fc685-0fc7-4ea2-b72b-1bed97cd9dbf.png)

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1664 from shenbinglife/master.

Closes #1656

576f387c [shenbing] [KYUUBI #1656] Add flink profile active to maven opts
de9c14d0 [shenbing] [KYUUBI #1656] Fix dist failed with --spark-provided

Authored-by: shenbing <shenbinglife@163.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-31 14:51:26 +08:00
Kent Yao
d1de9ca529
[KYUUBI #1658] Revamp swagger ui dependencies
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

This PR mainly removes the swagger-scala-module which is currently fine to remove. It also introduces transitive deps with
`-jakarta` which could introduce jar conflicts like ,

```scala
Caused by: java.lang.NoClassDefFoundError: jakarta/xml/bind/annotation/XmlElement
	at io.swagger.v3.core.jackson.SwaggerAnnotationIntrospector.hasRequiredMarker(SwaggerAnnotationIntrospector.java:29)
	at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.hasRequiredMarker(AnnotationIntrospectorPair.java:319)
	at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.hasRequiredMarker(AnnotationIntrospectorPair.java:319)
	at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.hasRequiredMarker(AnnotationIntrospectorPair.java:319)
	at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getMetadata(POJOPropertyBuilder.java:229)
```
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1658 from yaooqinn/dep.

Closes #1658

d5ab0765 [Kent Yao] Merge branch 'master' into dep
d1ddd5fd [Kent Yao] Revamp swagger ui dependencies
ecfcc92a [Kent Yao] Revamp swagger ui dependencies
59196b94 [Kent Yao] Revamp swagger ui dependencies
d7ca6a5f [Kent Yao] Revamp swagger ui dependencies
215b1b53 [Kent Yao] Revamp swagger ui dependencies

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-31 09:22:24 +08:00
Kent Yao
6a9550938e
[KYUUBI #1662] Turn up maven options in mvn script
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1662 from yaooqinn/mvn.

Closes #1662

4d310988 [Kent Yao] Turn up maven options in mvn script
db153080 [Kent Yao] Turn up maven options in mvn script

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-30 20:29:28 +08:00
xifeng yang
8e9e8c3c7e
[KYUUBI #1597] fix row value in Query Execution should be queryExecution
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

row value in Query Execution should be queryExecution

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate
![image](https://user-images.githubusercontent.com/12961802/147735708-bfb49799-1aa8-4eb2-8ef8-eda81fbfa869.png)

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1657 from xifeng/kyuubi-1597.

Closes #1597

cf9f9aca [xifeng yang] [KYUUBI #1597] fix row value in Query Execution should be queryExecution

Authored-by: xifeng yang <xifeng.yang@hotmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-30 19:28:08 +08:00
wForget
92163dda42
[KYUUBI #1649] Determine the yarn command in stop-application.sh.
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

When HADOOP_HOME is not set, the stop-application.sh script cannot kill the yarn task even if the yarn command exists. #1649

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [X] Add screenshots for manual tests if appropriate
![image](https://user-images.githubusercontent.com/17894939/147664786-564b20b7-ce90-47ec-bffb-2ada93774345.png)

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1650 from wForget/KYUUBI-1649.

Closes #1649

aa8c08d8 [wForget] change error msg
4ec523be [wForget] [KYUUBI-1649] Determine the yarn command in stop-application.sh.

Authored-by: wForget <643348094@qq.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-30 11:01:54 +08:00
minyk
7d68aa07ff
[KYUUBI #1634][FEATURE] Redact secret information from SparkSQLEngine UI
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
SparkSQLEngine's Kyuubi UI tab shows SQL statements. In some cases, these informations are secret information like S3 access/secret key. Spark SQL UI tab already redact with `spark.redaction.string.regex` configuration. Kyuubi also should redact secret informations with this property.

### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [X] Add screenshots for manual tests if appropriate
with below property and query:
spark-defaults.conf:
```
spark.redaction.string.regex (?i)url|access.*|secret.*|password
```
query:
```
SET fs.s3a.access.key=testkey
```

![Screen Shot 2021-12-28 at 9 00 07 PM](https://user-images.githubusercontent.com/1802676/147564262-bf06869f-2c2f-4e76-8380-34a92b2a390c.png)

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1640 from minyk/redact-ui.

Closes #1634

4051522a [minyk] set job description with setJobGroup()
3a8e0e91 [minyk] use redactedStatement
c84778e3 [minyk] move to SparkOperation
97a4fb4a [minyk] fix code formatting
79fe52d3 [minyk] redact UI with `spark.redaction.string.regex`

Authored-by: minyk <minykreva@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-29 13:37:03 +08:00
Kent Yao
c4fd287c8b
[KYUUBI #1639] Make ApiRequestContext provide KyuubiRestFrontendService directly
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

Make full use of KyuubiRestFrontendService without hacking, e.g. for the swagger UI base.

We can do further improvement based on this PR.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1639 from yaooqinn/ApiRequestContext.

Closes #1639

3c0c7061 [Kent Yao] Make ApiRequestContext provides KyuubiRestFrontendService directly
10506c2c [Kent Yao] Make ApiRequestContext provides KyuubiRestFrontendService directly
1482bd78 [Kent Yao] Make ApiRequestContext provides KyuubiRestFrontendService directly
01a0b023 [Kent Yao] Make ApiRequestContext provides KyuubiRestFrontendService directly
d3119fa4 [Kent Yao] Make ApiRequestContext provides KyuubiRestFrontendService directly
0f45258c [Kent Yao] Make ApiRequestContext provides KyuubiRestFrontendService directly

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-29 13:10:22 +08:00
Cheng Pan
cb8721fef1
[KYUUBI #1629] Flink backend implementation
### _Why are the changes needed?_

This PR covers #1619.

Overall, this PR contains the following changs,

1. change `build/dist` script to support flink sql engine
2. enhance `externals/flink-sql-engine/pom.xml` to support create a shaded jar
3. simplify `externals/kyuubi-flink-sql-engine/bin/flink-sql-engine.sh`
4. introduce `FlinkSQLEngine`(flink sql engine entrypoint) and `FlinkProcessBuilder`(kyuubi server launcher)
5. add ut in kyuubi server side

After this PR, we can run the basic query e.g. `select now()` from beeline and get result, and Kyuubi Server can auto launch flink engine if there is no proper one. The Flink engine also supports other engine share levels defined in Kyuubi.

The implementation based on Flink 1.14 codebase.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1629 from pan3793/flink-backend.

Closes #1629

b7e5f0e3 [Cheng Pan] revert tgz name change
a4496c37 [Cheng Pan] Fix reflection
3b4e86a1 [Cheng Pan] deps
68efa42c [Cheng Pan] log
8a9e37f3 [Cheng Pan] nit
10fb2bc3 [Cheng Pan] CI
c1560fdb [Cheng Pan] nit
303e2f1e [Cheng Pan] Restore log conf
d84720b1 [Cheng Pan] SessionContext
b258d81a [Cheng Pan] cleanup
16edd528 [Cheng Pan] Cleanup
9ae54557 [Cheng Pan] Fix CI
25b6b57d [Cheng Pan] hadoop-client-api
c12b5ca4 [Cheng Pan] Server UT pass
502d3f08 [Cheng Pan] pass
dac4323b [yanghua] Laungh local flink engine container successfully

Lead-authored-by: Cheng Pan <chengpan@apache.org>
Co-authored-by: yanghua <yanghua1127@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-28 17:20:26 +08:00
Kent Yao
e1587eeaf4
[KYUUBI #1631] Migrating existing rest fe tests to real cases
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

In this PR, we target the existing UTs from a noop server to a real shared Kyuubi server.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1631 from yaooqinn/resttest.

Closes #1631

2726ab44 [Kent Yao] address comments
c0da8090 [Kent Yao] ci
5d12f70f [Kent Yao] address comments
80e14044 [Kent Yao] Migrating existing rest fe test to real cases
a31ab506 [Kent Yao] Migrating existing rest fe test to real cases
0c1feb45 [Kent Yao] Migrating existing rest fe test to real cases
fbd9769e [Kent Yao] Migrating existing rest fe test to real cases
75cca5ff [Kent Yao] Migrating existing rest fe test to real cases
119712e8 [Kent Yao] Migrating existing rest fe test to real cases
8196e4df [Kent Yao] Migrating existing rest fe test to real cases

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-28 17:17:27 +08:00
rayliu
2af105a417 [KYUUBI #1556] Upgrade swagger-ui version from 4.1.0 to 4.1.3
### _Why are the changes needed?_
Close https://github.com/apache/incubator-kyuubi/issues/1612

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1630 from ldzhjn/1612.

Closes #1556

71fe05bc [rayliu] Upgrade swagger-ui version from 4.1.0 to 4.1.3

Authored-by: rayliu <rayliu@cisco.com>
Signed-off-by: yanghua <yanghua1127@gmail.com>
2021-12-25 20:50:56 +08:00
Fu Chen
21f10d752d
[KYUUBI #1614] Fix hardcoded version in OpenAPIDefinition
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

close #1614

curl http://0.0.0.0:10099/openapi.json
```json
{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "Apache Kyuubi REST API Documentation",
    "description" : "Apache Kyuubi REST API Documentation",
    "contact" : {
      "name" : "Apache Kyuubi Community",
      "url" : "https://kyuubi.apache.org/issue_tracking.html",
      "email" : "devkyuubi.apache.org"
    },
    "license" : {
      "name" : "Apache 2.0",
      "url" : "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version" : "1.5.0-SNAPSHOT"
  },
  "tags" : [ {
    "name" : "Session"
  }, {
    "name" : "Operation"
  } ],
  "paths" : {
    "/api/v1/operations/{operationHandle}" : {
      "put" : {
        "tags" : [ "Operation" ],
        "operationId" : "applyOpAction",
        "parameters" : [ {
          "name" : "operationHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "*/*" : {
              "schema" : {
                "$ref" : "#/components/schemas/OpActionRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "apply an action for an operation",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/operations/{operationHandle}/event" : {
      "get" : {
        "tags" : [ "Operation" ],
        "operationId" : "getOperationEvent",
        "parameters" : [ {
          "name" : "operationHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Get an operation event",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/operations/{operationHandle}/resultsetmetadata" : {
      "get" : {
        "tags" : [ "Operation" ],
        "operationId" : "getResultSetMetadata",
        "parameters" : [ {
          "name" : "operationHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "get result set metadata",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/ping" : {
      "get" : {
        "operationId" : "ping",
        "responses" : {
          "default" : {
            "description" : "default response",
            "content" : {
              "text/plain" : {
                "schema" : {
                  "type" : "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/{operationHandle}" : {
      "delete" : {
        "tags" : [ "Session" ],
        "operationId" : "closeOperation",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "operationHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Close an operation",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}" : {
      "get" : {
        "tags" : [ "Session" ],
        "operationId" : "sessionInfo",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "get a session event via session handle identifier",
            "content" : {
              "application/json" : { }
            }
          }
        }
      },
      "delete" : {
        "tags" : [ "Session" ],
        "operationId" : "closeSession",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Close a session",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/execPool/statistic" : {
      "get" : {
        "tags" : [ "Session" ],
        "operationId" : "execPoolStatistic",
        "responses" : {
          "200" : {
            "description" : "Get statistic info of background executors",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/statement" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "executeStatement",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "*/*" : {
              "schema" : {
                "$ref" : "#/components/schemas/StatementRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Create an operation with EXECUTE_STATEMENT type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/catalogs" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getCatalogs",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_CATALOGS type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/columns" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getColumns",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "*/*" : {
              "schema" : {
                "$ref" : "#/components/schemas/GetColumnsRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_COLUMNS type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/functions" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getFunctions",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "*/*" : {
              "schema" : {
                "$ref" : "#/components/schemas/GetFunctionsRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_FUNCTIONS type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/info/{infoType}" : {
      "get" : {
        "tags" : [ "Session" ],
        "operationId" : "getInfo",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "infoType",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "integer",
            "format" : "int32"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "get a information detail via session handle identifier and a specific information type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/schemas" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getSchemas",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "*/*" : {
              "schema" : {
                "$ref" : "#/components/schemas/GetSchemasRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_SCHEMAS type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/tableTypes" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getTableTypes",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_TABLE_TYPES type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/tables" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getTables",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "*/*" : {
              "schema" : {
                "$ref" : "#/components/schemas/GetTablesRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_TABLES type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{sessionHandle}/operations/typeInfo" : {
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "getTypeInfo",
        "parameters" : [ {
          "name" : "sessionHandle",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Create an operation with GET_TYPE_INFO type",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions" : {
      "get" : {
        "tags" : [ "Session" ],
        "operationId" : "sessionInfoList",
        "responses" : {
          "200" : {
            "description" : "get all the session list hosted in SessionManager",
            "content" : {
              "application/json" : { }
            }
          }
        }
      },
      "post" : {
        "tags" : [ "Session" ],
        "operationId" : "openSession",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SessionOpenRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Open(create) a session",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/sessions/count" : {
      "get" : {
        "tags" : [ "Session" ],
        "operationId" : "sessionCount",
        "responses" : {
          "200" : {
            "description" : "Get the current open session count",
            "content" : {
              "application/json" : { }
            }
          }
        }
      }
    },
    "/api/v1/swagger-ui" : {
      "get" : {
        "operationId" : "swaggerUi",
        "responses" : {
          "default" : {
            "description" : "default response",
            "content" : {
              "text/html" : { }
            }
          }
        }
      }
    },
    "/api/v1/exception" : {
      "get" : {
        "operationId" : "test",
        "responses" : {
          "default" : {
            "description" : "default response",
            "content" : {
              "text/plain" : { }
            }
          }
        }
      }
    },
    "/application.wadl/{path}" : {
      "get" : {
        "operationId" : "getExternalGrammar",
        "parameters" : [ {
          "name" : "path",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "default" : {
            "description" : "default response",
            "content" : {
              "application/xml" : { }
            }
          }
        }
      }
    },
    "/application.wadl" : {
      "get" : {
        "operationId" : "getWadl",
        "responses" : {
          "default" : {
            "description" : "default response",
            "content" : {
              "application/vnd.sun.wadl+xml" : { },
              "application/xml" : { }
            }
          }
        }
      }
    }
  },
  "components" : {
    "schemas" : {
      "OpActionRequest" : {
        "required" : [ "action" ],
        "type" : "object",
        "properties" : {
          "action" : {
            "type" : "string"
          }
        }
      },
      "KyuubiOperationEvent" : {
        "required" : [ "eventTime", "shouldRunAsync", "statementId" ],
        "type" : "object",
        "properties" : {
          "statementId" : {
            "type" : "string"
          },
          "remoteId" : {
            "type" : "string"
          },
          "statement" : {
            "type" : "string"
          },
          "shouldRunAsync" : {
            "type" : "boolean"
          },
          "state" : {
            "type" : "string"
          },
          "eventTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "createTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "startTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "completeTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "exception" : {
            "type" : "object",
            "properties" : {
              "cause" : {
                "required" : [ "stackTrace", "suppressed" ],
                "type" : "object",
                "properties" : {
                  "stackTrace" : {
                    "type" : "array",
                    "items" : {
                      "required" : [ "lineNumber" ],
                      "type" : "object",
                      "properties" : {
                        "methodName" : {
                          "type" : "string"
                        },
                        "fileName" : {
                          "type" : "string"
                        },
                        "lineNumber" : {
                          "type" : "integer",
                          "format" : "int32"
                        },
                        "className" : {
                          "type" : "string"
                        },
                        "nativeMethod" : {
                          "type" : "boolean"
                        }
                      }
                    }
                  },
                  "message" : {
                    "type" : "string"
                  },
                  "localizedMessage" : {
                    "type" : "string"
                  },
                  "suppressed" : {
                    "type" : "array",
                    "items" : {
                      "type" : "object",
                      "properties" : {
                        "stackTrace" : {
                          "type" : "array",
                          "items" : {
                            "required" : [ "lineNumber" ],
                            "type" : "object",
                            "properties" : {
                              "methodName" : {
                                "type" : "string"
                              },
                              "fileName" : {
                                "type" : "string"
                              },
                              "lineNumber" : {
                                "type" : "integer",
                                "format" : "int32"
                              },
                              "className" : {
                                "type" : "string"
                              },
                              "nativeMethod" : {
                                "type" : "boolean"
                              }
                            }
                          }
                        },
                        "message" : {
                          "type" : "string"
                        },
                        "localizedMessage" : {
                          "type" : "string"
                        }
                      }
                    }
                  }
                }
              },
              "stackTrace" : {
                "type" : "array",
                "items" : {
                  "required" : [ "lineNumber" ],
                  "type" : "object",
                  "properties" : {
                    "methodName" : {
                      "type" : "string"
                    },
                    "fileName" : {
                      "type" : "string"
                    },
                    "lineNumber" : {
                      "type" : "integer",
                      "format" : "int32"
                    },
                    "className" : {
                      "type" : "string"
                    },
                    "nativeMethod" : {
                      "type" : "boolean"
                    }
                  }
                }
              },
              "message" : {
                "type" : "string"
              },
              "localizedMessage" : {
                "type" : "string"
              },
              "suppressed" : {
                "type" : "array",
                "items" : {
                  "type" : "object",
                  "properties" : {
                    "stackTrace" : {
                      "type" : "array",
                      "items" : {
                        "required" : [ "lineNumber" ],
                        "type" : "object",
                        "properties" : {
                          "methodName" : {
                            "type" : "string"
                          },
                          "fileName" : {
                            "type" : "string"
                          },
                          "lineNumber" : {
                            "type" : "integer",
                            "format" : "int32"
                          },
                          "className" : {
                            "type" : "string"
                          },
                          "nativeMethod" : {
                            "type" : "boolean"
                          }
                        }
                      }
                    },
                    "message" : {
                      "type" : "string"
                    },
                    "localizedMessage" : {
                      "type" : "string"
                    }
                  }
                }
              }
            }
          },
          "sessionId" : {
            "type" : "string"
          },
          "sessionUser" : {
            "type" : "string"
          },
          "eventType" : {
            "type" : "string"
          }
        }
      },
      "ColumnDesc" : {
        "required" : [ "columnIndex", "columnName" ],
        "type" : "object",
        "properties" : {
          "columnName" : {
            "type" : "string"
          },
          "dataType" : {
            "type" : "string"
          },
          "columnIndex" : {
            "type" : "integer",
            "format" : "int32"
          },
          "precision" : {
            "type" : "integer",
            "format" : "int32"
          },
          "scale" : {
            "type" : "integer",
            "format" : "int32"
          },
          "comment" : {
            "type" : "string"
          }
        }
      },
      "ResultSetMetaData" : {
        "required" : [ "columns" ],
        "type" : "object",
        "properties" : {
          "columns" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/ColumnDesc"
            }
          }
        }
      },
      "SeqColumnDesc" : {
        "type" : "array",
        "items" : {
          "$ref" : "#/components/schemas/ColumnDesc"
        }
      },
      "HandleIdentifier" : {
        "required" : [ "publicId" ],
        "type" : "object",
        "properties" : {
          "publicId" : {
            "type" : "string",
            "format" : "uuid"
          },
          "secretId" : {
            "type" : "string",
            "format" : "uuid"
          }
        }
      },
      "OperationHandle" : {
        "required" : [ "hasResultSet", "identifier", "protocol", "typ" ],
        "type" : "object",
        "properties" : {
          "identifier" : {
            "$ref" : "#/components/schemas/HandleIdentifier"
          },
          "typ" : {
            "$ref" : "#/components/schemas/Value"
          },
          "protocol" : {
            "type" : "string",
            "enum" : [ "HIVE_CLI_SERVICE_PROTOCOL_V1", "HIVE_CLI_SERVICE_PROTOCOL_V2", "HIVE_CLI_SERVICE_PROTOCOL_V3", "HIVE_CLI_SERVICE_PROTOCOL_V4", "HIVE_CLI_SERVICE_PROTOCOL_V5", "HIVE_CLI_SERVICE_PROTOCOL_V6", "HIVE_CLI_SERVICE_PROTOCOL_V7", "HIVE_CLI_SERVICE_PROTOCOL_V8", "HIVE_CLI_SERVICE_PROTOCOL_V9", "HIVE_CLI_SERVICE_PROTOCOL_V10" ]
          },
          "hasResultSet" : {
            "type" : "boolean",
            "writeOnly" : true
          }
        }
      },
      "Value" : {
        "type" : "object"
      },
      "ExecPoolStatistic" : {
        "required" : [ "execPoolSize" ],
        "type" : "object",
        "properties" : {
          "execPoolSize" : {
            "type" : "integer",
            "format" : "int32"
          },
          "execPoolActiveCount" : {
            "type" : "integer",
            "format" : "int32"
          }
        }
      },
      "StatementRequest" : {
        "required" : [ "queryTimeout", "runAsync", "statement" ],
        "type" : "object",
        "properties" : {
          "statement" : {
            "type" : "string"
          },
          "runAsync" : {
            "type" : "boolean"
          },
          "queryTimeout" : {
            "type" : "integer",
            "format" : "int64"
          }
        }
      },
      "GetColumnsRequest" : {
        "required" : [ "catalogName" ],
        "type" : "object",
        "properties" : {
          "catalogName" : {
            "type" : "string"
          },
          "schemaName" : {
            "type" : "string"
          },
          "tableName" : {
            "type" : "string"
          },
          "columnName" : {
            "type" : "string"
          }
        }
      },
      "GetFunctionsRequest" : {
        "required" : [ "catalogName" ],
        "type" : "object",
        "properties" : {
          "catalogName" : {
            "type" : "string"
          },
          "schemaName" : {
            "type" : "string"
          },
          "functionName" : {
            "type" : "string"
          }
        }
      },
      "InfoDetail" : {
        "required" : [ "infoType" ],
        "type" : "object",
        "properties" : {
          "infoType" : {
            "type" : "string"
          },
          "infoValue" : {
            "type" : "string"
          }
        }
      },
      "GetSchemasRequest" : {
        "required" : [ "catalogName" ],
        "type" : "object",
        "properties" : {
          "catalogName" : {
            "type" : "string"
          },
          "schemaName" : {
            "type" : "string"
          }
        }
      },
      "GetTablesRequest" : {
        "required" : [ "catalogName", "tableTypes" ],
        "type" : "object",
        "properties" : {
          "catalogName" : {
            "type" : "string"
          },
          "schemaName" : {
            "type" : "string"
          },
          "tableName" : {
            "type" : "string"
          },
          "tableTypes" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        }
      },
      "SessionHandle" : {
        "required" : [ "identifier", "protocol" ],
        "type" : "object",
        "properties" : {
          "identifier" : {
            "$ref" : "#/components/schemas/HandleIdentifier"
          },
          "protocol" : {
            "type" : "string",
            "enum" : [ "HIVE_CLI_SERVICE_PROTOCOL_V1", "HIVE_CLI_SERVICE_PROTOCOL_V2", "HIVE_CLI_SERVICE_PROTOCOL_V3", "HIVE_CLI_SERVICE_PROTOCOL_V4", "HIVE_CLI_SERVICE_PROTOCOL_V5", "HIVE_CLI_SERVICE_PROTOCOL_V6", "HIVE_CLI_SERVICE_PROTOCOL_V7", "HIVE_CLI_SERVICE_PROTOCOL_V8", "HIVE_CLI_SERVICE_PROTOCOL_V9", "HIVE_CLI_SERVICE_PROTOCOL_V10" ]
          }
        }
      },
      "MapStringString" : {
        "type" : "object",
        "additionalProperties" : {
          "type" : "string"
        }
      },
      "SessionOpenRequest" : {
        "required" : [ "configs", "protocolVersion", "user" ],
        "type" : "object",
        "properties" : {
          "protocolVersion" : {
            "type" : "integer",
            "format" : "int32"
          },
          "user" : {
            "type" : "string"
          },
          "password" : {
            "type" : "string"
          },
          "ipAddr" : {
            "type" : "string"
          },
          "configs" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "string"
            }
          }
        }
      },
      "SessionOpenCount" : {
        "required" : [ "openSessionCount" ],
        "type" : "object",
        "properties" : {
          "openSessionCount" : {
            "type" : "integer",
            "format" : "int32"
          }
        }
      },
      "KyuubiSessionEvent" : {
        "required" : [ "clientVersion", "conf", "sessionName", "startTime" ],
        "type" : "object",
        "properties" : {
          "sessionName" : {
            "type" : "string"
          },
          "user" : {
            "type" : "string"
          },
          "clientIP" : {
            "type" : "string"
          },
          "serverIP" : {
            "type" : "string"
          },
          "conf" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "string"
            }
          },
          "startTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "sessionId" : {
            "type" : "string"
          },
          "remoteSessionId" : {
            "type" : "string"
          },
          "clientVersion" : {
            "type" : "integer",
            "format" : "int32"
          },
          "openedTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "endTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "totalOperations" : {
            "type" : "integer",
            "format" : "int32"
          },
          "eventType" : {
            "type" : "string"
          }
        }
      },
      "SeqSessionOverview" : {
        "type" : "array",
        "items" : {
          "$ref" : "#/components/schemas/SessionOverview"
        }
      },
      "SessionList" : {
        "required" : [ "sessionList" ],
        "type" : "object",
        "properties" : {
          "sessionList" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/SessionOverview"
            }
          }
        }
      },
      "SessionOverview" : {
        "required" : [ "createTime", "user" ],
        "type" : "object",
        "properties" : {
          "user" : {
            "type" : "string"
          },
          "ipAddr" : {
            "type" : "string"
          },
          "createTime" : {
            "type" : "integer",
            "format" : "int64"
          },
          "sessionHandle" : {
            "$ref" : "#/components/schemas/SessionHandle"
          }
        }
      }
    }
  }
}
```

curl http://0.0.0.0:10099/openapi.yaml

```yaml
openapi: 3.0.1
info:
  title: Apache Kyuubi REST API Documentation
  description: Apache Kyuubi REST API Documentation
  contact:
    name: Apache Kyuubi Community
    url: https://kyuubi.apache.org/issue_tracking.html
    email: devkyuubi.apache.org
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.5.0-SNAPSHOT
tags:
- name: Session
- name: Operation
paths:
  /api/v1/operations/{operationHandle}:
    put:
      tags:
      - Operation
      operationId: applyOpAction
      parameters:
      - name: operationHandle
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/OpActionRequest'
      responses:
        "200":
          description: apply an action for an operation
          content:
            application/json: {}
  /api/v1/operations/{operationHandle}/event:
    get:
      tags:
      - Operation
      operationId: getOperationEvent
      parameters:
      - name: operationHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Get an operation event
          content:
            application/json: {}
  /api/v1/operations/{operationHandle}/resultsetmetadata:
    get:
      tags:
      - Operation
      operationId: getResultSetMetadata
      parameters:
      - name: operationHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: get result set metadata
          content:
            application/json: {}
  /api/v1/ping:
    get:
      operationId: ping
      responses:
        default:
          description: default response
          content:
            text/plain:
              schema:
                type: string
  /api/v1/sessions/{sessionHandle}/operations/{operationHandle}:
    delete:
      tags:
      - Session
      operationId: closeOperation
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      - name: operationHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Close an operation
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}:
    get:
      tags:
      - Session
      operationId: sessionInfo
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: get a session event via session handle identifier
          content:
            application/json: {}
    delete:
      tags:
      - Session
      operationId: closeSession
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Close a session
          content:
            application/json: {}
  /api/v1/sessions/execPool/statistic:
    get:
      tags:
      - Session
      operationId: execPoolStatistic
      responses:
        "200":
          description: Get statistic info of background executors
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/statement:
    post:
      tags:
      - Session
      operationId: executeStatement
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/StatementRequest'
      responses:
        "200":
          description: Create an operation with EXECUTE_STATEMENT type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/catalogs:
    post:
      tags:
      - Session
      operationId: getCatalogs
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Create an operation with GET_CATALOGS type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/columns:
    post:
      tags:
      - Session
      operationId: getColumns
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/GetColumnsRequest'
      responses:
        "200":
          description: Create an operation with GET_COLUMNS type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/functions:
    post:
      tags:
      - Session
      operationId: getFunctions
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/GetFunctionsRequest'
      responses:
        "200":
          description: Create an operation with GET_FUNCTIONS type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/info/{infoType}:
    get:
      tags:
      - Session
      operationId: getInfo
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      - name: infoType
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: get a information detail via session handle identifier and
            a specific information type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/schemas:
    post:
      tags:
      - Session
      operationId: getSchemas
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/GetSchemasRequest'
      responses:
        "200":
          description: Create an operation with GET_SCHEMAS type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/tableTypes:
    post:
      tags:
      - Session
      operationId: getTableTypes
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Create an operation with GET_TABLE_TYPES type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/tables:
    post:
      tags:
      - Session
      operationId: getTables
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/GetTablesRequest'
      responses:
        "200":
          description: Create an operation with GET_TABLES type
          content:
            application/json: {}
  /api/v1/sessions/{sessionHandle}/operations/typeInfo:
    post:
      tags:
      - Session
      operationId: getTypeInfo
      parameters:
      - name: sessionHandle
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Create an operation with GET_TYPE_INFO type
          content:
            application/json: {}
  /api/v1/sessions:
    get:
      tags:
      - Session
      operationId: sessionInfoList
      responses:
        "200":
          description: get all the session list hosted in SessionManager
          content:
            application/json: {}
    post:
      tags:
      - Session
      operationId: openSession
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionOpenRequest'
      responses:
        "200":
          description: Open(create) a session
          content:
            application/json: {}
  /api/v1/sessions/count:
    get:
      tags:
      - Session
      operationId: sessionCount
      responses:
        "200":
          description: Get the current open session count
          content:
            application/json: {}
  /api/v1/swagger-ui:
    get:
      operationId: swaggerUi
      responses:
        default:
          description: default response
          content:
            text/html: {}
  /api/v1/exception:
    get:
      operationId: test
      responses:
        default:
          description: default response
          content:
            text/plain: {}
  /application.wadl/{path}:
    get:
      operationId: getExternalGrammar
      parameters:
      - name: path
        in: path
        required: true
        schema:
          type: string
      responses:
        default:
          description: default response
          content:
            application/xml: {}
  /application.wadl:
    get:
      operationId: getWadl
      responses:
        default:
          description: default response
          content:
            application/vnd.sun.wadl+xml: {}
            application/xml: {}
components:
  schemas:
    OpActionRequest:
      required:
      - action
      type: object
      properties:
        action:
          type: string
    KyuubiOperationEvent:
      required:
      - eventTime
      - shouldRunAsync
      - statementId
      type: object
      properties:
        statementId:
          type: string
        remoteId:
          type: string
        statement:
          type: string
        shouldRunAsync:
          type: boolean
        state:
          type: string
        eventTime:
          type: integer
          format: int64
        createTime:
          type: integer
          format: int64
        startTime:
          type: integer
          format: int64
        completeTime:
          type: integer
          format: int64
        exception:
          type: object
          properties:
            cause:
              required:
              - stackTrace
              - suppressed
              type: object
              properties:
                stackTrace:
                  type: array
                  items:
                    required:
                    - lineNumber
                    type: object
                    properties:
                      methodName:
                        type: string
                      fileName:
                        type: string
                      lineNumber:
                        type: integer
                        format: int32
                      className:
                        type: string
                      nativeMethod:
                        type: boolean
                message:
                  type: string
                localizedMessage:
                  type: string
                suppressed:
                  type: array
                  items:
                    type: object
                    properties:
                      stackTrace:
                        type: array
                        items:
                          required:
                          - lineNumber
                          type: object
                          properties:
                            methodName:
                              type: string
                            fileName:
                              type: string
                            lineNumber:
                              type: integer
                              format: int32
                            className:
                              type: string
                            nativeMethod:
                              type: boolean
                      message:
                        type: string
                      localizedMessage:
                        type: string
            stackTrace:
              type: array
              items:
                required:
                - lineNumber
                type: object
                properties:
                  methodName:
                    type: string
                  fileName:
                    type: string
                  lineNumber:
                    type: integer
                    format: int32
                  className:
                    type: string
                  nativeMethod:
                    type: boolean
            message:
              type: string
            localizedMessage:
              type: string
            suppressed:
              type: array
              items:
                type: object
                properties:
                  stackTrace:
                    type: array
                    items:
                      required:
                      - lineNumber
                      type: object
                      properties:
                        methodName:
                          type: string
                        fileName:
                          type: string
                        lineNumber:
                          type: integer
                          format: int32
                        className:
                          type: string
                        nativeMethod:
                          type: boolean
                  message:
                    type: string
                  localizedMessage:
                    type: string
        sessionId:
          type: string
        sessionUser:
          type: string
        eventType:
          type: string
    ColumnDesc:
      required:
      - columnIndex
      - columnName
      type: object
      properties:
        columnName:
          type: string
        dataType:
          type: string
        columnIndex:
          type: integer
          format: int32
        precision:
          type: integer
          format: int32
        scale:
          type: integer
          format: int32
        comment:
          type: string
    ResultSetMetaData:
      required:
      - columns
      type: object
      properties:
        columns:
          type: array
          items:
            $ref: '#/components/schemas/ColumnDesc'
    SeqColumnDesc:
      type: array
      items:
        $ref: '#/components/schemas/ColumnDesc'
    HandleIdentifier:
      required:
      - publicId
      type: object
      properties:
        publicId:
          type: string
          format: uuid
        secretId:
          type: string
          format: uuid
    OperationHandle:
      required:
      - hasResultSet
      - identifier
      - protocol
      - typ
      type: object
      properties:
        identifier:
          $ref: '#/components/schemas/HandleIdentifier'
        typ:
          $ref: '#/components/schemas/Value'
        protocol:
          type: string
          enum:
          - HIVE_CLI_SERVICE_PROTOCOL_V1
          - HIVE_CLI_SERVICE_PROTOCOL_V2
          - HIVE_CLI_SERVICE_PROTOCOL_V3
          - HIVE_CLI_SERVICE_PROTOCOL_V4
          - HIVE_CLI_SERVICE_PROTOCOL_V5
          - HIVE_CLI_SERVICE_PROTOCOL_V6
          - HIVE_CLI_SERVICE_PROTOCOL_V7
          - HIVE_CLI_SERVICE_PROTOCOL_V8
          - HIVE_CLI_SERVICE_PROTOCOL_V9
          - HIVE_CLI_SERVICE_PROTOCOL_V10
        hasResultSet:
          type: boolean
          writeOnly: true
    Value:
      type: object
    ExecPoolStatistic:
      required:
      - execPoolSize
      type: object
      properties:
        execPoolSize:
          type: integer
          format: int32
        execPoolActiveCount:
          type: integer
          format: int32
    StatementRequest:
      required:
      - queryTimeout
      - runAsync
      - statement
      type: object
      properties:
        statement:
          type: string
        runAsync:
          type: boolean
        queryTimeout:
          type: integer
          format: int64
    GetColumnsRequest:
      required:
      - catalogName
      type: object
      properties:
        catalogName:
          type: string
        schemaName:
          type: string
        tableName:
          type: string
        columnName:
          type: string
    GetFunctionsRequest:
      required:
      - catalogName
      type: object
      properties:
        catalogName:
          type: string
        schemaName:
          type: string
        functionName:
          type: string
    InfoDetail:
      required:
      - infoType
      type: object
      properties:
        infoType:
          type: string
        infoValue:
          type: string
    GetSchemasRequest:
      required:
      - catalogName
      type: object
      properties:
        catalogName:
          type: string
        schemaName:
          type: string
    GetTablesRequest:
      required:
      - catalogName
      - tableTypes
      type: object
      properties:
        catalogName:
          type: string
        schemaName:
          type: string
        tableName:
          type: string
        tableTypes:
          type: array
          items:
            type: string
    SessionHandle:
      required:
      - identifier
      - protocol
      type: object
      properties:
        identifier:
          $ref: '#/components/schemas/HandleIdentifier'
        protocol:
          type: string
          enum:
          - HIVE_CLI_SERVICE_PROTOCOL_V1
          - HIVE_CLI_SERVICE_PROTOCOL_V2
          - HIVE_CLI_SERVICE_PROTOCOL_V3
          - HIVE_CLI_SERVICE_PROTOCOL_V4
          - HIVE_CLI_SERVICE_PROTOCOL_V5
          - HIVE_CLI_SERVICE_PROTOCOL_V6
          - HIVE_CLI_SERVICE_PROTOCOL_V7
          - HIVE_CLI_SERVICE_PROTOCOL_V8
          - HIVE_CLI_SERVICE_PROTOCOL_V9
          - HIVE_CLI_SERVICE_PROTOCOL_V10
    MapStringString:
      type: object
      additionalProperties:
        type: string
    SessionOpenRequest:
      required:
      - configs
      - protocolVersion
      - user
      type: object
      properties:
        protocolVersion:
          type: integer
          format: int32
        user:
          type: string
        password:
          type: string
        ipAddr:
          type: string
        configs:
          type: object
          additionalProperties:
            type: string
    SessionOpenCount:
      required:
      - openSessionCount
      type: object
      properties:
        openSessionCount:
          type: integer
          format: int32
    KyuubiSessionEvent:
      required:
      - clientVersion
      - conf
      - sessionName
      - startTime
      type: object
      properties:
        sessionName:
          type: string
        user:
          type: string
        clientIP:
          type: string
        serverIP:
          type: string
        conf:
          type: object
          additionalProperties:
            type: string
        startTime:
          type: integer
          format: int64
        sessionId:
          type: string
        remoteSessionId:
          type: string
        clientVersion:
          type: integer
          format: int32
        openedTime:
          type: integer
          format: int64
        endTime:
          type: integer
          format: int64
        totalOperations:
          type: integer
          format: int32
        eventType:
          type: string
    SeqSessionOverview:
      type: array
      items:
        $ref: '#/components/schemas/SessionOverview'
    SessionList:
      required:
      - sessionList
      type: object
      properties:
        sessionList:
          type: array
          items:
            $ref: '#/components/schemas/SessionOverview'
    SessionOverview:
      required:
      - createTime
      - user
      type: object
      properties:
        user:
          type: string
        ipAddr:
          type: string
        createTime:
          type: integer
          format: int64
        sessionHandle:
          $ref: '#/components/schemas/SessionHandle'
```

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1628 from cfmcgrady/kyuubi-1614.

Closes #1614

9310f5a0 [Fu Chen] address comment
ef3cb812 [Fu Chen] fix hardcoded version in OpenAPIDefinition

Authored-by: Fu Chen <cfmcgrady@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-24 19:29:14 +08:00
Kent Yao
99e278ce76
[KYUUBI #1623] KyuubiSessionEvent shall always have Id
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

session id is a val

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1623 from yaooqinn/val.

Closes #1623

23fc3b2b [Kent Yao] test
6cd86610 [Kent Yao] npe
6fb75d47 [Kent Yao] KyuubiSessionEvent shall always have Id

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-24 19:27:48 +08:00
ulysses-you
69efac59ef
[KYUUBI #1618] Correct hadoop version in RELEASE file
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
correct verion of

- Spark Hadoop
- Kyuubi Hadoop

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1618 from ulysses-you/correct-version.

Closes #1618

64c8a5a8 [ulysses-you] grep -v
86d48df9 [ulysses-you] fix
eb39f636 [ulysses-you] fix

Authored-by: ulysses-you <ulyssesyou18@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-24 19:27:13 +08:00
hongdongdong
4c6a07f847
[KYUUBI #1581] Add SchemaHelper for trino engine
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Add SchemaHelper for trino engine

### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1617 from hddong/add-schemaHelper.

Closes #1581

f6a03fad [hongdongdong] fix
3c7d9079 [hongdongdong] fix
a8e9463d [hongdongdong] add throw unrecognized type
a03220bb [hongdongdong] [KYUUBI #1581] Add SchemaHelper for trino engine

Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-24 19:26:09 +08:00
simon
c42f31e211
[KYUUBI #1620] Implement api: /${version}/operations/${operation_identifier}/log
### _Why are the changes needed?_
closes #1620
 Implement api: /${version}/operations/${operation_identifier}/log

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1621 from simon824/1223.

Closes #1620

5f211473 [simon] rm
f6d0ce7c [simon] fix
346df798 [simon] operationLog
c60d3447 [simon] init

Authored-by: simon <zhangshiming@cvte.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-24 17:02:05 +08:00
Wang Zhen
fbccba90f4
[KYUUBI #1613] Record the engine's applicationId in KyuubiSessionEvent
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Record the engine's applicationId in KyuubiSessionEvent. #1613

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [X] Add screenshots for manual tests if appropriate
![image](https://user-images.githubusercontent.com/17894939/147318970-d939b3c0-c3c6-4f45-9e5b-c2de6402b5de.png)

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1622 from wForget/KYUUBI-1613.

Closes #1613

24e001f6 [Wang Zhen] comment
29453fc3 [Wang Zhen] [KYUUBI-1613] Record the engine's applicationId in KyuubiSessionEvent

Authored-by: Wang Zhen <wangzhen07@qiyi.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-24 14:01:01 +08:00
Fu Chen
54a1b88245
[KYUUBI #1611] Fix swagger-ui redirect wrong to other service address
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

close #1611

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1615 from cfmcgrady/kyuubi-1611.

Closes #1611

f44bf3b1 [Fu Chen] fix swagger-ui

Authored-by: Fu Chen <cfmcgrady@gmail.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-23 16:58:43 +08:00
Kent Yao
1b48b1874f
[KYUUBI #1601] Align SparkStatementEvent to KyuubiOperationEvent
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

Align SparkStatementEvent to KyuubiOperationEvent

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1601 from yaooqinn/soe.

Closes #1601

090dee8f [Kent Yao] Merge branch 'master' of github.com:apache/incubator-kyuubi into soe
a61ce3b7 [Kent Yao] Align SparkStatementEvent to KyuubiOperationEven
efbbdf79 [Kent Yao] Align SparkStatementEvent to KyuubiOperationEven

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-23 16:10:43 +08:00
Cheng Pan
152e394016
[KYUUBI #1592] [TEST][ICEBERG][DELTA] Introduce row level operation test for data lake format
### _Why are the changes needed?_

Introduce row level operation test for data lake format and remove redundant tests

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1592 from pan3793/test.

Closes #1592

892feb8a [Cheng Pan] Simplify test
72fd0939 [Cheng Pan] Fix import
9d208392 [Cheng Pan] Add row level operation tests for Iceberg and Delta
7730b4df [Cheng Pan] Also test JDBC connection MetaData in Kyuubi server
7a41dfdf [Cheng Pan] [TEST] Remove redundant type info test in DeltaMetadataTests

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-23 11:38:34 +08:00
hongdongdong
fcc6471fec
[KYUUBI #1582] Use ClientTypeSignature to further analysis of trino column type
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Use ClientTypeSignature to further analysis of trino column type

### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1598 from hddong/use-ClientTypeSignature.

Closes #1582

36ef139e [hongdongdong] Add check
22060208 [hongdongdong] remove guard
337f11ee [hongdongdong] [KYUUBI #1582] Use ClientTypeSignature to further analysis of trino column type

Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-23 11:36:46 +08:00
zhenjiaguo
3ffb12de24
[KYUUBI #1607] [DOC] Add operation and backend service metrics in metrics doc
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Add operation and backend service metrics doc.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request
![FireShot Capture 002 - 2  Monitoring Kyuubi - Server Metrics — Kyuubi 1 5 0-SNAPSHOT documen_ - localhost](https://user-images.githubusercontent.com/29809822/147097486-c2fc3867-de9a-4545-b927-85af3aeaa50a.png)

Closes #1607 from zhenjiaguo/add_be_metric_doc.

Closes #1607

e10bf146 [zhenjiaguo] Comment
0062f3d8 [zhenjiaguo] Metric format adjustment
af84534c [zhenjiaguo] Add metrics version compatibility description
c6f9eb26 [zhenjiaguo] Add operation and backend service method metric info doc

Authored-by: zhenjiaguo <zhenjia_guo@163.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-23 11:31:57 +08:00
yanghua
3673399329
[KYUUBI #1579] Implement basic ability of executing statement in Flink engine
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1603 from yanghua/KYUUBI-1579.

Closes #1579

48db76b3 [Cheng Pan] cleanup
36707516 [Cheng Pan] Address comments
25ca5ae2 [yanghua] reduce code
6f18a4a0 [yanghua] [KYUUBI #1579] Implement basic ability of executing statement

Lead-authored-by: yanghua <yanghua1127@gmail.com>
Co-authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-22 22:55:43 +08:00
simon
c972139b51
[KYUUBI #1575] Implement api: /${version}/operations/${operation_identifier}/resultsetmetadata
### _Why are the changes needed?_
#1575
Implement api: /${version}/operations/${operation_identifier}/resultsetmetadata

- /${version}/operations/${operation_identifier}/resultsetmetadata
  - mapping: ICLIService#getResultSetMetadata
  - desc: get the table schema of the result set via the given operation identifier
  - method: GET
  - params: none
  - returns: an instance of TableSchema

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1576 from simon824/api1.

Closes #1575

ecc976d1 [simon] reorder
0ef2accf [simon] add
ea635da4 [simon] fix
310ad983 [simon] resultsetmetadata
595294fa [simon] init

Authored-by: simon <zhangshiming@cvte.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-22 18:17:08 +08:00
zwangsheng
d595eb97a1
[KYUUBI #1593] use user set host or ip instead of read hostname from user set
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
User can select IP or hostname for binding.
Detail #1593

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1602 from zwangsheng/kyuubi/1593-01.

Closes #1593

8897ec46 [zwangsheng] fix test
67452451 [zwangsheng] use use set
76af3072 [zwangsheng] fix test
f75d2db0 [zwangsheng] 1593

Authored-by: zwangsheng <2213335496@qq.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-22 14:39:56 +08:00
Fu Chen
2b8304d154
[KYUUBI #1591] Watchdog support for Spark-3.2
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
<!-- 2. move spark-3.1 `MarkAggregateOrderRule` to spark-common and rename to `MarkAggregateOrderBase` -->

1. move spark-3.1 `ForcedMaxOutputRowsRule` to spark-common and rename to `ForcedMaxOutputRowsBase`
2. handle `WithCTE` logical plan in spark-3.2
3. move spark-3.1 `MaxPartitionStrategy` to spark-common
4. add netsted cte unit test for `ForcedMaxOutputRowsRule`

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1591 from cfmcgrady/watchdog-spark32.

Closes #1591

5399a3f0 [Fu Chen] fix style
0ce83ba5 [Fu Chen] remove MarkAggregateOrderRule
364fc26e [Fu Chen] add license header
44726dee [Fu Chen] fix style
4847dbf3 [Fu Chen] watchdog support for spark-3.2

Authored-by: Fu Chen <cfmcgrady@gmail.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-21 12:17:30 +08:00
Cheng Pan
d529402168
[KYUUBI #1587] [SUB-TASK][KPIP-2] Bump Flink 1.14.2
### _Why are the changes needed?_

Bump the latest version of 1.14.x to suppress log4-shell issue

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1587 from pan3793/flink-version.

Closes #1587

9d7ca949 [Cheng Pan] Bump Flink 1.14.2

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-20 18:19:30 +08:00
Wang Zhen
df1d9f3bb2
[KYUUBI #1577] Add DropIgnoreNonexistent Rule.
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

Like the `hive.exec.drop.ignorenonexistent` configuration in hive, do not report an error if DROP DATABASE/TABLE/VIEW/Function/Partition specifies a non-existent database/table/view/function/partition. For details: #1577.

### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1583 from wForget/KYUUBI-1577.

Closes #1577

63382660 [Wang Zhen] delete useless comment
adadf424 [Wang Zhen] add DropIgnoreNonexistent rule using injectPostHocResolutionRule
860b15d3 [Wang Zhen] add DropIgnoreNonexistent rule for spark 3.2
aad43cdb [Wang Zhen] adjust code
ca1b9f11 [Wang Zhen] make some adjustments and update rules.md
804bf40e [Wang Zhen] [KYUUBI-1577] Add DropIgnoreNonexistent Rule.

Authored-by: Wang Zhen <wangzhen07@qiyi.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
2021-12-20 11:46:25 +08:00
zhenjiaguo
f3dc1fdecd
[KYUUBI #1586] Add time metric on each KyuubiBackendService method
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Add time metric on each` KyuubiBackendService` method can help us inspect Kyuubi Server running status inside. It can Indirect reflecting our RPC call time when using Kyuubi.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate

![Screenshot from 2021-12-19 12-26-39](https://user-images.githubusercontent.com/29809822/146663963-7e483f45-198c-4fd7-b039-211dcf26dde5.png)

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1588 from zhenjiaguo/add_be_method_metric.

Closes #1586

a001eb96 [zhenjiaguo] Add time metric on each KyuubiBackendService method

Authored-by: zhenjiaguo <zhenjia_guo@163.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-20 09:59:57 +08:00
yanghua
01364e589f
[KYUUBI #1578] Introduce flink-sql-client dependency to reduce some duplicated code
…uplicated code

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1584 from yanghua/KYUUBI-1578.

Closes #1578

90c2f89e [yanghua] [KYUUBI #1578] Introduce flink-sql-client dependency to reduce some duplicated code

Authored-by: yanghua <yanghua1127@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-17 16:30:33 +08:00
Kent Yao
b2e679d5c7
[KYUUBI #1499] Introduce DataFrameHolder for cli result fetching
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Replace ArrayList with DataFrameHolder

### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1507 from yaooqinn/1499.

Closes #1499

7fd2b0ef [Kent Yao] fix it
6278009b [Kent Yao] root
de3c601d [Kent Yao] fi
358d7a68 [Kent Yao] refine
8373b9b3 [Kent Yao] refine
ab95f7dc [Kent Yao] refine
86d90b80 [Kent Yao] loader
a07117c4 [Kent Yao] nit
90a7dd4f [Kent Yao] [KYUUBI #1499] Introduce DataFrameHolder for cli result fetching
8d97b51d [Kent Yao] [KYUUBI #1499] Introduce DataFrameHolder for cli result fetching

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-17 10:45:05 +08:00
zhouyifan279
6e10eec4ca
[KYUUBI #1550] Provide a specific user guide about connecting to kerberized kyuubi
### _Why are the changes needed?_
Many kyuubi users are not familiar with kerberos authentication mechanism and encountered troubles connecting to kerberized Kyuubi.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate
Configurations are verified in #1432

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1552 from zhouyifan279/1550.

Closes #1550

58e324a8 [zhouyifan279] [KYUUBI #1550] Add kerberos authentication flow
3b030a91 [zhouyifan279] [KYUUBI #1550] Add kerberos authentication flow
4449b689 [zhouyifan279] [KYUUBI #1550] Improve doc style
3aa8e20c [zhouyifan279] [KYUUBI #1550] Add Windows configuration steps
7e67cdc5 [zhouyifan279] [KYUUBI #1550] Capitalize title and emphasize the relation between KinitAuxiliaryService and Kerberos authentication
424e56b3 [zhouyifan279] [KYUUBI #1550] Rename client/kerberos.md to client/kerberized_kyuubi.md
d8977cea [zhouyifan279] [KYUUBI #1550] Provide a specific user guide about connecting to kerberized kyuubi

Authored-by: zhouyifan279 <zhouyifan279@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-16 17:21:31 +08:00
yanghua
4b58b0ab9b
[KYUUBI #1555][FLINK] Bump flink version to 1.14.0
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1573 from yanghua/KYUUBI-1555.

Closes #1555

4f5ce746 [yanghua] [KYUUBI #1555] [SUB-TASK][KPIP-2] Bump flink version to 1.14.1

Authored-by: yanghua <yanghua1127@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-16 16:59:38 +08:00
Wang Zhen
be3a964f37
[KYUUBI #1554] Add kyuubi.engine.pool.name configuration
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

Add kyuubi.engine.pool.name configuration. #1554

### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [X] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1572 from wForget/KYUUBI-1554.

Closes #1554

40850f5a [Wang Zhen] [KYUUBI-1554] Add kyuubi.engine.pool.name configuration

Authored-by: Wang Zhen <wangzhen07@qiyi.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-16 16:33:51 +08:00
Cheng Pan
022f52bc7e
[KYUUBI #1460] Bump Hudi 0.10.0
### _Why are the changes needed?_

https://hudi.apache.org/releases/release-0.10.0

Switch test from Hudi 0.9.0 & Spark 3.0 to Hudi 1.10.0 & Spark 3.1. Drop test of Spark 3.0 because

1. Hudi 1.10.0 claims to support Spark 3.0 but requires to build by self with specific maven profile, the published jar only support Spark 3.1
2. Hudi has lots of transitive deps and there are different in different versions, it's hard to maintain multi hudi versions.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1460 from pan3793/hudi.

Closes #1460

bac633a7 [Cheng Pan] Update comments
0ab8784d [Cheng Pan] Pin hadoop-common
c811e679 [Cheng Pan] Exclude scala-library
63cad3b9 [Cheng Pan] Exclude hudi-aws
a13708f9 [Cheng Pan] Disable Hudi test on Spark 3.0
4b179bae [Cheng Pan] Enable Hudi test in Spark 3.1
79dca54c [Cheng Pan] Bump Hudi 0.10.0
71982890 [Cheng Pan] Add default Pk col

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-16 10:13:42 +08:00
Cheng Pan
77a278707f
[KYUUBI #1559] Bump Jersey 2.34
### _Why are the changes needed?_

#1561 and align Spark 3.2.0

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1559 from pan3793/jersey.

Closes #1559

a86d4d9f [Cheng Pan] Bump Jersey 2.34

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-16 10:12:46 +08:00
simon
bcd8c06e7f
[KYUUBI #1568] Replace sessionDetail with sessionEvent
### _Why are the changes needed?_
Replace sessionDetail with sessionEvent, because sessionEvent has more message about session.
#1568

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1569 from simon824/api.

Closes #1568

00a0ddfe [simon] Replace sessionDetail with sessionEvent
efc84a2e [simon] init

Authored-by: simon <zhangshiming@cvte.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-16 10:10:56 +08:00
hongdongdong
11e208a688
[KYUUBI #1565] Move time functions to RowSetUtils and move schema to spark package
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
1. move time functions from Rowset to RowSetUtils
2. move schema to spark package

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1566 from hddong/move-time-functions.

Closes #1565

75de2e8d [hongdongdong] private
8b16217b [hongdongdong] [KYUUBI #1565] Move time functions to RowSetUtils and move schema to spark package

Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-15 21:31:06 +08:00
zhouyifan279
6c235e5925
[KYUUBI #1567] [Bug] Expose HADOOP_CONF_DIR to Kyuubi beeline to fix "GSS initiate failed" error
### _Why are the changes needed?_
Failed to connect to kerberized Kyuubi with Kyuubi beeline.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate

Before:
![image](https://user-images.githubusercontent.com/88070094/146178642-d02748f9-ba7c-4fd0-8375-d3dc1adcfdc1.png)

After:
![image](https://user-images.githubusercontent.com/88070094/146179154-c6f5b133-b533-4649-bd4f-c0c757f1e10c.png)

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1570 from zhouyifan279/1567.

Closes #1567

1ee66b08 [zhouyifan279] [KYUUBI #1567] [Bug] Kyuubi beeline can not connect to kerberized Kyuubi

Authored-by: zhouyifan279 <zhouyifan279@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-15 21:27:12 +08:00
Cheng Pan
2f45e34dc3
[KYUUBI #1571] [BUILD] Correct build command in build/dist
### _Why are the changes needed?_

`mvn install` is required because of `kyuubi-hive-jdbc-shaded`

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1571 from pan3793/dist.

Closes #1571

c905411c [Cheng Pan] Correct build command in build/dist

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-15 21:23:10 +08:00
Cheng Pan
f841da4b4e
[KYUUBI #1558] Bump Jackson 2.12.5
### _Why are the changes needed?_

Because Spark 3.2, Trino 363, Jersey 2.34 (we use Jersey 2.30 now, will update to 2.34 soon) use Jackson 2.12.x

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1558 from pan3793/jackson.

Closes #1558

7bdd65b0 [Cheng Pan] Bump Jackson 2.12.5

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-15 21:21:01 +08:00
Brian Yue
01da9b432e
[KYUUBI #1556] Shorten kyuubi.session.engine.check.interval to one minute
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Close #1556.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1562 from byyue/dev-1556.

Closes #1556

8ceb244a [Brian Yue] Update the doc
fdb73c4d [Brian Yue] Shorten kyuubi.session.engine.check.interval to one minute

Authored-by: Brian Yue <code.byyue@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
2021-12-15 17:32:22 +08:00
Cheng Pan
6fa1327f4e
[KYUUBI #1560] Align all Jackson libs version
### _Why are the changes needed?_

Fix missing version of `jackson-module-jaxb-annotations` in `dependencyManagement`

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1560 from pan3793/jackson-1.

Closes #1560

49529d47 [Cheng Pan] Update deps
b3610007 [Cheng Pan] fix
67044840 [Cheng Pan] Algin all Jackson libs version

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-12-15 12:02:10 +08:00