spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takuya Ueshin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-23932) High-order function: zip_with(array<T>, array<U>, function<T, U, R>) → array<R>
Date Fri, 03 Aug 2018 10:25:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-23932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568059#comment-16568059
] 

Takuya Ueshin commented on SPARK-23932:
---------------------------------------

Hi [~crafty-coder],
 Are you still working on this?
 Recently I added a base framework for higher-order functions. You can use it to implement
this.
 If you don't have enough time, I can take this over, so please let me know.
 Thanks!

> High-order function: zip_with(array<T>, array<U>, function<T, U, R>)
→ array<R>
> -------------------------------------------------------------------------------
>
>                 Key: SPARK-23932
>                 URL: https://issues.apache.org/jira/browse/SPARK-23932
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 2.3.0
>            Reporter: Xiao Li
>            Priority: Major
>
> Ref: https://prestodb.io/docs/current/functions/array.html
> Merges the two given arrays, element-wise, into a single array using function. Both arrays
must be the same length.
> {noformat}
> SELECT zip_with(ARRAY[1, 3, 5], ARRAY['a', 'b', 'c'], (x, y) -> (y, x)); -- [ROW('a',
1), ROW('b', 3), ROW('c', 5)]
> SELECT zip_with(ARRAY[1, 2], ARRAY[3, 4], (x, y) -> x + y); -- [4, 6]
> SELECT zip_with(ARRAY['a', 'b', 'c'], ARRAY['d', 'e', 'f'], (x, y) -> concat(x, y));
-- ['ad', 'be', 'cf']
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message