-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14321][SQL] Reduce date format cost and string-to-date cost in date functions #13581
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
|
cc @cloud-fan |
| val formatter = ctx.freshName("formatter") | ||
| if (fString == null) { | ||
| if (formatter == null) { | ||
| ev.copy(code = s""" |
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.
this can be: ev.copy(code = "", isNull = "false", value = ctx.defaultValue(dataType))
|
LGTM except a minor comment |
|
Tip: if you put "closes #13522" in the PR description then the subsumed PR will be automatically closed once this PR is merged. |
@hvanhovell not PR title... |
|
LGTM, pending jenkins |
|
Test build #60245 has finished for PR 13581 at commit
|
|
Test build #60247 has finished for PR 13581 at commit
|
|
Merging in master/2.0. |
… date functions ## What changes were proposed in this pull request? The current implementations of `UnixTime` and `FromUnixTime` do not cache their parser/formatter as much as they could. This PR resolved this issue. This PR is a take over from #13522 and further optimizes the re-use of the parser/formatter. It also fixes the improves handling (catching the actual exception instead of `Throwable`). All credits for this work should go to rajeshbalamohan. This PR closes #13522 ## How was this patch tested? Current tests. Author: Herman van Hovell <hvanhovell@databricks.com> Author: Rajesh Balamohan <rbalamohan@apache.org> Closes #13581 from hvanhovell/SPARK-14321. (cherry picked from commit b076853) Signed-off-by: Reynold Xin <rxin@databricks.com>
… date functions ## What changes were proposed in this pull request? The current implementations of `UnixTime` and `FromUnixTime` do not cache their parser/formatter as much as they could. This PR resolved this issue. This PR is a take over from apache#13522 and further optimizes the re-use of the parser/formatter. It also fixes the improves handling (catching the actual exception instead of `Throwable`). All credits for this work should go to rajeshbalamohan. This PR closes apache#13522 ## How was this patch tested? Current tests. Author: Herman van Hovell <hvanhovell@databricks.com> Author: Rajesh Balamohan <rbalamohan@apache.org> Closes apache#13581 from hvanhovell/SPARK-14321.
What changes were proposed in this pull request?
The current implementations of
UnixTimeandFromUnixTimedo not cache their parser/formatter as much as they could. This PR resolved this issue.This PR is a take over from #13522 and further optimizes the re-use of the parser/formatter. It also fixes the improves handling (catching the actual exception instead of
Throwable). All credits for this work should go to @rajeshbalamohan.This PR closes #13522
How was this patch tested?
Current tests.