-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22844][R] Adds date_trunc in R API #20031
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
c54abe9 to
1c3e956
Compare
|
cc @felixcheung, could you take a look when you have some time? |
|
Test build #85175 has finished for PR 20031 at commit
|
|
Test build #85177 has finished for PR 20031 at commit
|
dongjoon-hyun
left a comment
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
R/pkg/R/functions.R
Outdated
| #' to use to specify the truncation method. For example, "year", "yyyy", "yy" for | ||
| #' truncate by year, or "month", "mon", "mm" for truncate by month. | ||
| #' Column \code{x} to DateType or TimestampType. | ||
| #' |
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.
I'm pretty sure these whitespace will be stripped by roxygen2.
use item if you think that makes sense, otherwise it might be better to keep as a single paragraph
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.
Yup, I am fine with fixing. Will check and fix late tomorrow.
| #' "mm" for truncate by month. | ||
| #' \item \code{date_trunc}: it is similar with \code{trunc}'s but additionally | ||
| #' supports "day", "dd", "second", "minute", "hour", "week" and "quarter". | ||
| #' } |
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.
I am fine with a single paragraph too. Please let me know if you have a preference @felixcheung.
|
Test build #85308 has finished for PR 20031 at commit
|
|
Thanks for review and approval, @dongjoon-hyun and @felixcheung. |
|
Merged to master. |

What changes were proposed in this pull request?
This PR adds
date_truncin R API as below:How was this patch tested?
Unit tests added in
R/pkg/tests/fulltests/test_sparkSQL.R.