[GitHub] [incubator-livy] yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending
yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending URL: https://github.com/apache/incubator-livy/pull/165#discussion_r351958564 ## File path: server/src/main/scala/org/apache/livy/server/interactive/InteractiveSession.scala ## @@ -285,17 +285,17 @@ object InteractiveSession extends Logging { } } -def mergeHiveSiteAndHiveDeps(sparkMajorVersion: Int): Unit = { - val sparkFiles = conf.get("spark.files").map(_.split(",")).getOrElse(Array.empty[String]) - hiveSiteFile(sparkFiles, livyConf) match { +def mergeHiveSiteAndHiveDeps(sparkMajorVersion: Int, files: Array[String], + mergeJarsConf: String, mergeFilesConf: String): Unit = { Review comment: indent? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-livy] yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending
yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending URL: https://github.com/apache/incubator-livy/pull/165#discussion_r351091430 ## File path: server/src/main/scala/org/apache/livy/server/interactive/InteractiveSession.scala ## @@ -332,7 +348,11 @@ object InteractiveSession extends Logging { LivySparkUtils.formatSparkVersion(livyConf.get(LivyConf.LIVY_SPARK_VERSION)) val scalaVersion = livyConf.get(LivyConf.LIVY_SPARK_SCALA_VERSION) -mergeConfList(livyJars(livyConf, scalaVersion), LivyConf.SPARK_JARS) +if (conf.get(LivyConf.SPARK_JARS) != None || conf.get(LivyConf.SPARK_JARS) == None){ Review comment: For the spark file conf ```scala val (files, mergeFileConf) = if (!sparkFiles.isEmpty || yarnFiles.isEmpty) { (sparkFiles, LivyConf.SPARK_FILES) } else { (yarnFiles, LivyConf.SPARK_YARN_DIST_FILES) } ... mergeConfList(List(file.getAbsolutePath), mergeFileConf) ``` 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-livy] yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending
yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending URL: https://github.com/apache/incubator-livy/pull/165#discussion_r351088916 ## File path: server/src/main/scala/org/apache/livy/server/interactive/InteractiveSession.scala ## @@ -286,16 +286,33 @@ object InteractiveSession extends Logging { } def mergeHiveSiteAndHiveDeps(sparkMajorVersion: Int): Unit = { - val sparkFiles = conf.get("spark.files").map(_.split(",")).getOrElse(Array.empty[String]) - hiveSiteFile(sparkFiles, livyConf) match { + val yarnFiles = conf.get(LivyConf.SPARK_YARN_DIST_FILES) + .map(_.split(",")).getOrElse(Array.empty[String]) + val sparkFiles = conf.get(LivyConf.SPARK_FILES) + .map(_.split(",")).getOrElse(Array.empty[String]) + var files = Array.empty[String] + if (!sparkFiles.isEmpty || yarnFiles.isEmpty) files = sparkFiles else files = yarnFiles + hiveSiteFile(files, livyConf) match { case (_, true) => debug("Enable HiveContext because hive-site.xml is found in user request.") - mergeConfList(datanucleusJars(livyConf, sparkMajorVersion), LivyConf.SPARK_JARS) + if (conf.get(LivyConf.SPARK_JARS) != None || conf.get(LivyConf.SPARK_YARN_JARS) == None) { Review comment: @Limmen Sorry for missing the message. > The behavior is that if both spark.jars and spark.yarn.jars are set, spark ignores the yarn-property. If it's spark behavior, it's fine to deal with it like this. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-livy] yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending
yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending URL: https://github.com/apache/incubator-livy/pull/165#discussion_r348934926 ## File path: server/src/main/scala/org/apache/livy/server/interactive/InteractiveSession.scala ## @@ -286,16 +286,33 @@ object InteractiveSession extends Logging { } def mergeHiveSiteAndHiveDeps(sparkMajorVersion: Int): Unit = { - val sparkFiles = conf.get("spark.files").map(_.split(",")).getOrElse(Array.empty[String]) - hiveSiteFile(sparkFiles, livyConf) match { + val yarnFiles = conf.get(LivyConf.SPARK_YARN_DIST_FILES) + .map(_.split(",")).getOrElse(Array.empty[String]) + val sparkFiles = conf.get(LivyConf.SPARK_FILES) + .map(_.split(",")).getOrElse(Array.empty[String]) + var files = Array.empty[String] + if (!sparkFiles.isEmpty || yarnFiles.isEmpty) files = sparkFiles else files = yarnFiles + hiveSiteFile(files, livyConf) match { case (_, true) => debug("Enable HiveContext because hive-site.xml is found in user request.") - mergeConfList(datanucleusJars(livyConf, sparkMajorVersion), LivyConf.SPARK_JARS) + if (conf.get(LivyConf.SPARK_JARS) != None || conf.get(LivyConf.SPARK_YARN_JARS) == None) { Review comment: I feel like it's not so straight forward here. In the JIRA description: >Now what seems to happen is that if all of spark.files, spark.jars, spark.yarn.dist.files, and spark.yarn.jars are non-null when the job is submitted (spark.files spark.jars filled in by livy and spark.yarn.dist.files spark.yarn.jars filled in by the user-request from our platform),spark.yarn.dist.files gets set to spark.files and spark.yarn.jars gets set to spark.jars Should we change the `set` behavior to `merge` where the job is submitted? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-livy] yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending
yiheng commented on a change in pull request #165: [LIVY-581] Fix edge-case where livy overrides user-provided spark properties instead of appending URL: https://github.com/apache/incubator-livy/pull/165#discussion_r348914530 ## File path: server/src/main/scala/org/apache/livy/server/interactive/InteractiveSession.scala ## @@ -286,16 +286,33 @@ object InteractiveSession extends Logging { } def mergeHiveSiteAndHiveDeps(sparkMajorVersion: Int): Unit = { - val sparkFiles = conf.get("spark.files").map(_.split(",")).getOrElse(Array.empty[String]) - hiveSiteFile(sparkFiles, livyConf) match { + val yarnFiles = conf.get(LivyConf.SPARK_YARN_DIST_FILES) + .map(_.split(",")).getOrElse(Array.empty[String]) + val sparkFiles = conf.get(LivyConf.SPARK_FILES) + .map(_.split(",")).getOrElse(Array.empty[String]) + var files = Array.empty[String] + if (!sparkFiles.isEmpty || yarnFiles.isEmpty) files = sparkFiles else files = yarnFiles Review comment: This code can be refactored like this ```scala val files = if (!sparkFiles.isEmpty || yarnFiles.isEmpty) sparkFiles else yarnFiles ``` 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services