Github user dhruve commented on a diff in the pull request: https://github.com/apache/spark/pull/13061#discussion_r63411773 --- Diff: core/src/main/scala/org/apache/spark/package.scala --- @@ -41,7 +41,50 @@ package org.apache * level interfaces. These are subject to changes or removal in minor releases. */ +import java.util.Properties + +import org.apache.spark.internal.Logging + package object spark { - // For package docs only - val SPARK_VERSION = "2.0.0-SNAPSHOT" + + object SparkBuildInfo extends Logging { + val unknownProp = "<unknown>" + val props = new Properties() + val resourceStream = Thread.currentThread().getContextClassLoader. + getResourceAsStream("spark-version-info.properties") + val (spark_version: String, spark_branch: String, spark_revision: String, + spark_build_user: String, spark_repo_url: String, spark_build_date: String) = + try { + props.load(resourceStream) + ( + props.getProperty("version", unknownProp), + props.getProperty("branch", unknownProp), + props.getProperty("revision", unknownProp), + props.getProperty("user", unknownProp), + props.getProperty("url", unknownProp), + props.getProperty("date", unknownProp) + ) + } catch { + case e: Exception => + logError("Unable to read spark build properties.", e); + throw new SparkException("Error load properties from spark-version-info.properties", e) --- End diff -- Will correct this one. Agreed - Log seems redundant, we can remove it.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org