Skip to content

Conversation

@janewangfb
Copy link
Contributor

@janewangfb janewangfb commented Apr 27, 2017

What changes were proposed in this pull request?

Add UDF array_unique which return a new array with all the duplicated elements in the original array removed.

How was this patch tested?

Added various unittests in collectionExpressionsSuite.scala and also in spark-shell, created tables with columns of array type and inserted values with duplicated array elements, ran queries with UDF and verified the results.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@HyukjinKwon
Copy link
Member

Hi @janewangfb, it looks we need a JIRA, better PR title and PR description. Please check out http://spark.apache.org/contributing.html.

@srowen
Copy link
Member

srowen commented Apr 27, 2017

Why does this need to be added? If it isn't a standard function somewhere it probably doesn't need to be in Spark

@janewangfb
Copy link
Contributor Author

@srowen We have array_contains UDF. I think it is nice to have one that removes all the duplicated elements.

@janewangfb janewangfb changed the title Add array_unique UDF [SPARK-20494] Implement UDF array_unique in Spark with codegen Apr 27, 2017
@srowen
Copy link
Member

srowen commented Apr 27, 2017

@janewangfb that's because array_contains is a Hive function

@srowen
Copy link
Member

srowen commented May 6, 2017

We should close this

@srowen srowen mentioned this pull request May 17, 2017
@asfgit asfgit closed this in 5d2750a May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants