[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17259735#comment-17259735 ] Geraud Le Falher commented on SPARK-23908: -- ok it seems it will be the case in pyspark 3.1.0 https://github.com/apache/spark/blob/3cdc4ef5b41ce1254610436a8721ea517124d62e/python/pyspark/sql/functions.py#L4195 > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Takuya Ueshin >Priority: Major > Fix For: 2.4.0 > > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17259734#comment-17259734 ] Geraud Le Falher commented on SPARK-23908: -- Since 3.0.0 it is [exposed in the scala API|[https://spark.apache.org/docs/latest/api/scala/org/apache/spark/sql/functions$.html#transform(column:org.apache.spark.sql.Column,f:(org.apache.spark.sql.Column,org.apache.spark.sql.Column)=%3Eorg.apache.spark.sql.Column):org.apache.spark.sql.Column],] therefore would it also be possible to expose in python (and other languages?) > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Takuya Ueshin >Priority: Major > Fix For: 2.4.0 > > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16581364#comment-16581364 ] Marco Gaido commented on SPARK-23908: - [~huaxingao] they are not exposed through the Scala API, so they don't either on the other APIs. Thanks. > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Takuya Ueshin >Priority: Major > Fix For: 2.4.0 > > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16581354#comment-16581354 ] Huaxin Gao commented on SPARK-23908: [~ueshin] I am just wondering if the newly added functions (exists/transform/filter/aggregate) in higherOrderFunctions need to be put in functions.py and functions.R. If yes, I will open a Jira to work on. Thanks! > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Takuya Ueshin >Priority: Major > Fix For: 2.4.0 > > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16577080#comment-16577080 ] Apache Spark commented on SPARK-23908: -- User 'ueshin' has created a pull request for this issue: https://github.com/apache/spark/pull/22075 > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Takuya Ueshin >Priority: Major > Fix For: 2.4.0 > > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16566293#comment-16566293 ] Apache Spark commented on SPARK-23908: -- User 'ueshin' has created a pull request for this issue: https://github.com/apache/spark/pull/21954 > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Herman van Hovell >Priority: Major > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16549628#comment-16549628 ] Frederick Reiss commented on SPARK-23908: - Thanks Herman, looking forward to seeing this feature! > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Herman van Hovell >Priority: Major > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16548427#comment-16548427 ] Herman van Hovell commented on SPARK-23908: --- Yeah I am, sorry for the hold up. I'll try to have something out ASAP. > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Herman van Hovell >Priority: Major > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23908) High-order function: transform(array, function) → array
[ https://issues.apache.org/jira/browse/SPARK-23908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16548421#comment-16548421 ] Frederick Reiss commented on SPARK-23908: - This Jira is marked as "in progress" with the target set to a previous release of Spark. Are you working on this, [~hvanhovell]? > High-order function: transform(array, function) → array > --- > > Key: SPARK-23908 > URL: https://issues.apache.org/jira/browse/SPARK-23908 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 2.3.0 >Reporter: Xiao Li >Assignee: Herman van Hovell >Priority: Major > > Ref: https://prestodb.io/docs/current/functions/array.html > Returns an array that is the result of applying function to each element of > array: > {noformat} > SELECT transform(ARRAY [], x -> x + 1); -- [] > SELECT transform(ARRAY [5, 6], x -> x + 1); -- [6, 7] > SELECT transform(ARRAY [5, NULL, 6], x -> COALESCE(x, 0) + 1); -- [6, 1, 7] > SELECT transform(ARRAY ['x', 'abc', 'z'], x -> x || '0'); -- ['x0', 'abc0', > 'z0'] > SELECT transform(ARRAY [ARRAY [1, NULL, 2], ARRAY[3, NULL]], a -> filter(a, x > -> x IS NOT NULL)); -- [[1, 2], [3]] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org