Uh oh!
There was an error while loading. Please reload this page.
[SPARK-31503][SQL] fix the SQL string of the TRIM functions - #28281
Closed
cloud-fan wants to merge 1 commit into
Closed
[SPARK-31503][SQL] fix the SQL string of the TRIM functions#28281cloud-fan wants to merge 1 commit into
cloud-fan wants to merge 1 commit into
Conversation
cloud-fan
commented
Apr 21, 2020
ContributorAuthor
dongjoon-hyun
commented
Apr 21, 2020
Member
Thank you for pinging me, @cloud-fan . |
| SELECT trim(BOTH 'xyz' FROM 'yxTomxx'), trim('xyz' FROM 'yxTomxx') | ||
| -- !query schema | ||
| struct<trim(yxTomxx, xyz):string,trim(yxTomxx, xyz):string> | ||
| struct<TRIM(BOTH xyz FROM yxTomxx):string,TRIM(BOTH xyz FROM yxTomxx):string> |
SparkQA
commented
Apr 21, 2020
Test build #121568 has finished for PR 28281 at commit
|
maropu
commented
Apr 21, 2020
Member
retest this please |
ContributorAuthor
@dongjoon-hyun I think this bug exists the first day we add |
SparkQA
commented
Apr 21, 2020
Test build #121575 has finished for PR 28281 at commit
|
SparkQA
commented
Apr 21, 2020
Test build #121578 has finished for PR 28281 at commit
|
dongjoon-hyun
approved these changes
Apr 21, 2020
dongjoon-hyun
left a comment
Member
There was a problem hiding this comment.
+1, LGTM. Thank you, @cloud-fan and @maropu .
Merged to master/3.0.
dongjoon-hyun pushed a commit
that referenced
this pull request
Apr 21, 2020
### What changes were proposed in this pull request? override the `sql` method of `StringTrim`, `StringTrimLeft` and `StringTrimRight`, to use the standard SQL syntax. ### Why are the changes needed? The current implementation is wrong. It gives you a SQL string that returns different result. ### Does this PR introduce any user-facing change? No ### How was this patch tested? new tests Closes#28281 from cloud-fan/sql. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit b209b5f) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun
commented
Apr 21, 2020
Member
Could you make a backporting PR to branch-2.4? |
dongjoon-hyun
commented
Apr 21, 2020
Member
cc @holdenk since she is the release manager for 2.4.6. |
cloud-fan added a commit
to cloud-fan/spark
that referenced
this pull request
Apr 22, 2020
override the `sql` method of `StringTrim`, `StringTrimLeft` and `StringTrimRight`, to use the standard SQL syntax. The current implementation is wrong. It gives you a SQL string that returns different result. No new tests Closesapache#28281 from cloud-fan/sql. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit b209b5f) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
cloud-fan
commented
Apr 22, 2020
ContributorAuthor
The backport PR: #28299 |
dongjoon-hyun pushed a commit
that referenced
this pull request
Apr 22, 2020
backport #28281 to 2.4 This backport has one difference: there is no `EXTRACT(... FROM ...)` SQL syntax in 2.4, so this PR just uses the common function call syntax. Closes#28299 from cloud-fan/pick. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
override the
sqlmethod ofStringTrim,StringTrimLeftandStringTrimRight, to use the standard SQL syntax.Why are the changes needed?
The current implementation is wrong. It gives you a SQL string that returns different result.
Does this PR introduce any user-facing change?
No
How was this patch tested?
new tests