-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-29554][SQL] Add version
SQL function
#26209
Conversation
Test build #112458 has finished for PR 26209 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise seems niche, but easy enough to add. How about docs or Pyspark?
Test build #112500 has finished for PR 26209 at commit
|
Not familiar with pyspark, but, does it already has its own implementation? spark/python/pyspark/version.py Line 19 in 9bf397c
|
Test build #112501 has finished for PR 26209 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same and more info have been available to users already:
scala> println(org.apache.spark.SPARK_VERSION)
3.0.0-SNAPSHOT
scala> println(org.apache.spark.SPARK_REVISION)
b4280705cb98a5e03529b638b2c1cf4213db6197
scala> println(org.apache.spark.SPARK_BRANCH)
interval-mul-div
scala> println(org.apache.spark.SPARK_BUILD_DATE)
2019-10-18T16:51:42Z
True, I guess the point is to expose it in SQL for Hive parity. |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @cloud-fan @srowen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, All.
Sorry, but let's not add a new expression because we need only SQL
support.
We can add a new function without adding the expressions.
version
SQL function
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/MiscFunctionsSuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/MiscFunctionsSuite.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @yaooqinn . I left a few additional comments.
@dongjoon-hyun Thanks a lot. Updated as you request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. (Pending Jenkins).
Thank you for updating, @yaooqinn .
Test build #112702 has finished for PR 26209 at commit
|
+1 |
usage = """_FUNC_() - Returns the Spark version. The string contains 2 fields, the first being a release version and the second being a git revision.""", | ||
since = "3.0.0") | ||
// scalastyle:on line.size.limit | ||
case class Version() extends LeafExpression with CodegenFallback { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change the class name to SparkVersion()
? Version()
is too general as a class name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
### What changes were proposed in this pull request? This is a follow-up of #26209 . This renames class `Version` to class `SparkVersion`. ### Why are the changes needed? According to the review comment, this uses more specific class name. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Pass the Jenkins with the existing tests. Closes #26647 from dongjoon-hyun/SPARK-29554. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
What changes were proposed in this pull request?
Why are the changes needed?
From hive behavior and I guess it is useful for debugging and developing etc.
Does this PR introduce any user-facing change?
add a misc func
How was this patch tested?
add ut