You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/12/21 07:58:04 UTC
[GitHub] [incubator-kyuubi] cfmcgrady opened a new pull request, #4019: [WIP]Binding python/sql spark session
cfmcgrady opened a new pull request, #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019
<!--
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/CONTRIBUTING.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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] cfmcgrady closed pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
cfmcgrady closed pull request #4019: Binding python/sql spark session
URL: https://github.com/apache/kyuubi/pull/4019
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] cfmcgrady commented on pull request #4019: [WIP]Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
cfmcgrady commented on PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#issuecomment-1360972793
cc @bowenliang123 @turboFei
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#discussion_r1054189974
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala:
##########
@@ -177,3 +181,18 @@ class SparkSQLSessionManager private (name: String, spark: SparkSession)
override protected def isServer: Boolean = false
}
+
+object SparkSQLSessionManager {
+ private val sessionManager = new AtomicReference[SparkSQLSessionManager]
+
+ private def setSessionManager(manager: SparkSQLSessionManager): Unit = {
+ sessionManager.set(manager)
+ }
+
+ def getSparkSession(uuid: String): SparkSession = {
+ sessionManager.get()
Review Comment:
how about get from object `SparkSQLEngine`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] cfmcgrady commented on pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
cfmcgrady commented on PR #4019:
URL: https://github.com/apache/kyuubi/pull/4019#issuecomment-1364817455
thanks all. merging to master(v1.7.0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#discussion_r1054236856
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala:
##########
@@ -177,3 +181,18 @@ class SparkSQLSessionManager private (name: String, spark: SparkSession)
override protected def isServer: Boolean = false
}
+
+object SparkSQLSessionManager {
+ private val sessionManager = new AtomicReference[SparkSQLSessionManager]
+
+ private def setSessionManager(manager: SparkSQLSessionManager): Unit = {
+ sessionManager.set(manager)
+ }
+
+ def getSparkSession(uuid: String): SparkSession = {
+ sessionManager.get()
Review Comment:
with that, SparkSQLSessionManager::setSessionManager is not needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] cfmcgrady commented on a diff in pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
cfmcgrady commented on code in PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#discussion_r1054202983
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala:
##########
@@ -177,3 +181,18 @@ class SparkSQLSessionManager private (name: String, spark: SparkSession)
override protected def isServer: Boolean = false
}
+
+object SparkSQLSessionManager {
+ private val sessionManager = new AtomicReference[SparkSQLSessionManager]
+
+ private def setSessionManager(manager: SparkSQLSessionManager): Unit = {
+ sessionManager.set(manager)
+ }
+
+ def getSparkSession(uuid: String): SparkSession = {
+ sessionManager.get()
Review Comment:
we need a static method here, and call the method and return sql spark session on the python side. how can we get the sql spark session from `SparkSQLEngine`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] cfmcgrady commented on a diff in pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
cfmcgrady commented on code in PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#discussion_r1055169223
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala:
##########
@@ -177,3 +181,18 @@ class SparkSQLSessionManager private (name: String, spark: SparkSession)
override protected def isServer: Boolean = false
}
+
+object SparkSQLSessionManager {
+ private val sessionManager = new AtomicReference[SparkSQLSessionManager]
+
+ private def setSessionManager(manager: SparkSQLSessionManager): Unit = {
+ sessionManager.set(manager)
+ }
+
+ def getSparkSession(uuid: String): SparkSession = {
+ sessionManager.get()
Review Comment:
addressed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#issuecomment-1361602562
# [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#4019](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c9ece27) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/6cd8a362d0d0a9f000126bc0babea4dbf62939ea?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6cd8a36) will **decrease** coverage by `0.04%`.
> The diff coverage is `68.57%`.
> :exclamation: Current head c9ece27 differs from pull request most recent head 2136dfd. Consider uploading reports for the commit 2136dfd to get more accurate results
```diff
@@ Coverage Diff @@
## master #4019 +/- ##
============================================
- Coverage 53.04% 52.99% -0.05%
Complexity 13 13
============================================
Files 541 541
Lines 29483 29502 +19
Branches 3939 3940 +1
============================================
- Hits 15639 15636 -3
- Misses 12418 12437 +19
- Partials 1426 1429 +3
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...n/java/org/apache/hive/beeline/KyuubiCommands.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtYmVlbGluZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaGl2ZS9iZWVsaW5lL0t5dXViaUNvbW1hbmRzLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [.../org/apache/kyuubi/session/KyuubiSessionImpl.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL0t5dXViaVNlc3Npb25JbXBsLnNjYWxh) | `76.38% <14.28%> (-3.33%)` | :arrow_down: |
| [...he/kyuubi/ha/client/etcd/EtcdDiscoveryClient.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9ldGNkL0V0Y2REaXNjb3ZlcnlDbGllbnQuc2NhbGE=) | `69.02% <85.71%> (+0.51%)` | :arrow_up: |
| [...ha/client/zookeeper/ZookeeperDiscoveryClient.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC96b29rZWVwZXIvWm9va2VlcGVyRGlzY292ZXJ5Q2xpZW50LnNjYWxh) | `72.53% <85.71%> (+0.43%)` | :arrow_up: |
| [.../kyuubi/engine/spark/operation/ExecutePython.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vRXhlY3V0ZVB5dGhvbi5zY2FsYQ==) | `83.59% <100.00%> (+0.08%)` | :arrow_up: |
| [.../engine/spark/session/SparkSQLSessionManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9zZXNzaW9uL1NwYXJrU1FMU2Vzc2lvbk1hbmFnZXIuc2NhbGE=) | `81.60% <100.00%> (+1.86%)` | :arrow_up: |
| [.../scala/org/apache/kyuubi/session/SessionType.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL1Nlc3Npb25UeXBlLnNjYWxh) | `100.00% <100.00%> (ø)` | |
| [...e/kyuubi/jdbc/hive/ClosedOrCancelledException.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtamRiYy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3l1dWJpL2pkYmMvaGl2ZS9DbG9zZWRPckNhbmNlbGxlZEV4Y2VwdGlvbi5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rg/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWN0bC9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jdGwvY21kL2xvZy9Mb2dCYXRjaENvbW1hbmQuc2NhbGE=) | `60.00% <0.00%> (-7.70%)` | :arrow_down: |
| [.../kyuubi/server/mysql/constant/MySQLErrorCode.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvbXlzcWwvY29uc3RhbnQvTXlTUUxFcnJvckNvZGUuc2NhbGE=) | `13.84% <0.00%> (-6.16%)` | :arrow_down: |
| ... and [4 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/4019/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#discussion_r1054189974
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala:
##########
@@ -177,3 +181,18 @@ class SparkSQLSessionManager private (name: String, spark: SparkSession)
override protected def isServer: Boolean = false
}
+
+object SparkSQLSessionManager {
+ private val sessionManager = new AtomicReference[SparkSQLSessionManager]
+
+ private def setSessionManager(manager: SparkSQLSessionManager): Unit = {
+ sessionManager.set(manager)
+ }
+
+ def getSparkSession(uuid: String): SparkSession = {
+ sessionManager.get()
Review Comment:
how about getting from object `SparkSQLEngine`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #4019: Binding python/sql spark session
Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #4019:
URL: https://github.com/apache/incubator-kyuubi/pull/4019#discussion_r1054235975
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala:
##########
@@ -177,3 +181,18 @@ class SparkSQLSessionManager private (name: String, spark: SparkSession)
override protected def isServer: Boolean = false
}
+
+object SparkSQLSessionManager {
+ private val sessionManager = new AtomicReference[SparkSQLSessionManager]
+
+ private def setSessionManager(manager: SparkSQLSessionManager): Unit = {
+ sessionManager.set(manager)
+ }
+
+ def getSparkSession(uuid: String): SparkSession = {
+ sessionManager.get()
Review Comment:
```
SparkSQLEngine.currentEngine.map(_.backendService.sessionManager)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org