-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14639][PYTHON][R] Add bround function in Python/R.
#12509
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
Conversation
|
Test build #56283 has finished for PR 12509 at commit
|
python/pyspark/sql/functions.py
Outdated
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.
is this changing the existing behavior?
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.
Thank you, @felixcheung !
I just tried to match the example between round and bround.
round does not change anything.
|
Test build #56286 has finished for PR 12509 at commit
|
|
Test build #56291 has finished for PR 12509 at commit
|
bround function in Python/R.bround function in Python/R.
|
Hi, @davies . And, if you don't mind, may I include some code of minor PR #12329 here too? That PR is so minor and needed to be merged other PR like this. If then, I will just close that PR. |
bround function in Python/R.bround function in Python/R.
R/pkg/R/functions.R
Outdated
| #' @export | ||
| #' @examples \dontrun{bround(df$c, 0)} | ||
| setMethod("bround", | ||
| signature(x = "Column", scale = "numeric"), |
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.
should scale be default to 0 to be consistent with Python?
to do that, do
signature(x = "Column"),
function(x, scale = 0),
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.
Oh, thank you for sharing know-how. I didn't know that how to do!
I will fix right now.
| #' @name bround | ||
| #' @family math_funcs | ||
| #' @export | ||
| #' @examples \dontrun{bround(df$c, 0)} |
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 you give a more detailed example of where it gets rounded down and where it gets rounded up ?
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.
Sure. Thank you for review. I'll add more example.
|
Test build #56298 has finished for PR 12509 at commit
|
|
LGTM |
|
Thank you, @davies ! |
|
I mean #12329 . I want to close that one in order to reduce committers' review & merge cost. |
|
Test build #56319 has finished for PR 12509 at commit
|
|
Merging this into master, thanks! |
What changes were proposed in this pull request?
This issue aims to expose Scala
broundfunction in Python/R API.broundfunction is implemented in SPARK-14614 by extending currentroundfunction.We used the following semantics from Hive.
After this PR,
pysparkandsparkRalso supportbroundfunction.PySpark
SparkR
How was this patch tested?
Pass the Jenkins tests (including new testcases).