You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/03/02 11:18:30 UTC
[GitHub] [incubator-kyuubi] pan3793 opened a new pull request #1995: [KYUUBI #1988] Lazy initialize vars depends on system level confs
pan3793 opened a new pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995
<!--
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.
-->
The `new SparkConf()` and `KyuubiConf()` executes early than UT before, which makes conf overwriting does not take effect.
After the change, the `sparkConf.setIfMissing("spark.sql.catalogImplementation", defaultCat)` work as expected when we overwriting `spark.sql.catalogImplementation` in UT, and Hudi uses `in-memory` catalog to create table.
<img width="891" alt="Xnip2022-03-02_19-10-06" src="https://user-images.githubusercontent.com/26535726/156351805-bb403ee8-0b89-4db2-b91f-d7b2b9957838.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.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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#discussion_r818253942
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
##########
@@ -71,41 +71,48 @@ case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngin
object SparkSQLEngine extends Logging {
- val sparkConf: SparkConf = new SparkConf()
+ private var _sparkConf: SparkConf = _
- val kyuubiConf: KyuubiConf = KyuubiConf()
+ private var _kyuubiConf: KyuubiConf = _
+
+ def kyuubiConf: KyuubiConf = _kyuubiConf
var currentEngine: Option[SparkSQLEngine] = None
- private val user = currentUser
+ private lazy val user = currentUser
private val countDownLatch = new CountDownLatch(1)
+ SignalRegister.registerLogger(logger)
+ setupConf()
Review comment:
No, after changing system properties, we need re-init the SparkConf and KyuubiConf to let them pick up the system properties
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
pan3793 commented on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1057577428
I don't think the order is a problem, we use setIfMissing in `SparkSQLEngine#setupConf`
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1057571830
does it works ? it seems to me the problem is order of extra config and initialization config. We should setup conf first then overwrite using `withKyuubiConf`.
See the code in `WithSparkSQLEngine#startSparkEngine`
```scala
......
withKyuubiConf.foreach { case (k, v) =>
System.setProperty(k, v)
kyuubiConf.set(k, v)
}
SparkSession.clearActiveSession()
SparkSession.clearDefaultSession()
SparkSQLEngine.setupConf()
spark = SparkSQLEngine.createSpark()
SparkSQLEngine.startEngine(spark)
......
```
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] wForget commented on a change in pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#discussion_r818253224
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
##########
@@ -71,41 +71,48 @@ case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngin
object SparkSQLEngine extends Logging {
- val sparkConf: SparkConf = new SparkConf()
+ private var _sparkConf: SparkConf = _
- val kyuubiConf: KyuubiConf = KyuubiConf()
+ private var _kyuubiConf: KyuubiConf = _
+
+ def kyuubiConf: KyuubiConf = _kyuubiConf
var currentEngine: Option[SparkSQLEngine] = None
- private val user = currentUser
+ private lazy val user = currentUser
private val countDownLatch = new CountDownLatch(1)
+ SignalRegister.registerLogger(logger)
+ setupConf()
Review comment:
Should the `SparkSQLEngine.setupConf()` call in `WithSparkSQLEngine#startSparkEngine` be removed?
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 edited a comment on pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
pan3793 edited a comment on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1057577428
I don't think the order is a problem, we use `setIfMissing` in `SparkSQLEngine#setupConf`
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on pull request #1995: [KYUUBI #1988] Lazy initialize vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
pan3793 commented on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1056819551
cc @wForget @yaooqinn
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #1995: [KYUUBI #1988] Lazy initialize vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1056833847
seems the failed test is relevant
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#discussion_r818253942
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
##########
@@ -71,41 +71,48 @@ case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngin
object SparkSQLEngine extends Logging {
- val sparkConf: SparkConf = new SparkConf()
+ private var _sparkConf: SparkConf = _
- val kyuubiConf: KyuubiConf = KyuubiConf()
+ private var _kyuubiConf: KyuubiConf = _
+
+ def kyuubiConf: KyuubiConf = _kyuubiConf
var currentEngine: Option[SparkSQLEngine] = None
- private val user = currentUser
+ private lazy val user = currentUser
private val countDownLatch = new CountDownLatch(1)
+ SignalRegister.registerLogger(logger)
+ setupConf()
Review comment:
No, after changing system properties, we need to re-init the SparkConf and KyuubiConf to let them pick up the system properties
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1057587056
thank, merging to master
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you closed pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on pull request #1995: [KYUUBI #1988] Tune initialization of vars depend on system level confs
Posted by GitBox <gi...@apache.org>.
pan3793 commented on pull request #1995:
URL: https://github.com/apache/incubator-kyuubi/pull/1995#issuecomment-1057019749
@ulysses-you fixed the issue and CI passed now.
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org