[MINOR] Follow up for SPARK-23936, fixed description of "map_concat" function#23493
Closed
asiunov wants to merge 1 commit into
Closed
[MINOR] Follow up for SPARK-23936, fixed description of "map_concat" function#23493asiunov wants to merge 1 commit into
asiunov wants to merge 1 commit into
Conversation
|
Can one of the admins verify this patch? |
HyukjinKwon
reviewed
Jan 9, 2019
| Examples: | ||
| > SELECT _FUNC_(map(1, 'a', 2, 'b'), map(2, 'c', 3, 'd')); | ||
| {1:"a",2:"c",3:"d"} | ||
| {1:"a",2:"b",2:"c",3:"d"} |
Member
There was a problem hiding this comment.
which spark version did you use? Duplicated entries were fixed and it shows:
spark-sql> SELECT map_concat(map(1, 'a', 2, 'b'), map(2, 'c', 3, 'd'));
{1:"a",2:"c",3:"d"}and
scala> spark.sql("SELECT map_concat(map(1, 'a', 2, 'b'), map(2, 'c', 3, 'd'))").show(20, false)
+--------------------------------------------+
|map_concat(map(1, a, 2, b), map(2, c, 3, d))|
+--------------------------------------------+
|[1 -> a, 2 -> c, 3 -> d] |
+--------------------------------------------+in the current master.
Author
There was a problem hiding this comment.
You are right. Looks like I've tested on v2.4.0 because my SPARK_HOME targeted to the old repo, and the logic was changed towards to exclude duplicates in #23124 .
Now I'm checking on the latest master and have the same results as yours.
Thank you!
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 free
to 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?
The description of "map_concat" function does not correspond to the actual behavior. Unit tests, an example in shell, and the PR description (https://jira.apache.org/jira/browse/SPARK-23936, #21073) say that duplicated keys will be duplicated, but the function description says the opposite.
Looks like it was implemented correctly in the original PR, but then incorrectly changed in this PR: #22437