[
https://issues.apache.org/jira/browse/SPARK-8230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14629079#comment-14629079
]
Pedro Rodriguez commented on SPARK-8230:
----------------------------------------
Moving to here instead of mailing list.
I would be interested in implementing it. I am not certain of all the steps,
thus far:
1. The code that actually does the work would go somewhere here:
https://github.com/apache/spark/tree/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions
2. Which would be added here:
https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
3. Then would have to be brought to the Java/Python APIs.
I am not certain where in sql.catalyst.expressions this would go. On the parent
JIRA it looks like this is labeled as a complex function (because of type
signature accepting anything?), so in a new file complex.scala? I am also
unsure what general form it would take.
I have been looking through how the other functions are defined. As far as
taking the column as input, explode
(https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala)
looks like it would provide a good starting point for getting the Array/Map,
then look at any of the other functions which returns an integer to see how it
should return a value. Lastly, I noticed there are two other complex functions:
sort_array and array_contains, would these be related in some way (much as the
mathematical operations all share similar code)?
Thanks
> complex function: size
> ----------------------
>
> Key: SPARK-8230
> URL: https://issues.apache.org/jira/browse/SPARK-8230
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Reporter: Reynold Xin
> Assignee: Cheng Hao
>
> size(Map<K.V>): int
> size(Array<T>): int
> return the number of elements in the map or array.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]