[jira] [Commented] (SPARK-7133) Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python
[ https://issues.apache.org/jira/browse/SPARK-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14538385#comment-14538385 ] Reynold Xin commented on SPARK-7133: That should be a separate ticket if we want to do it. Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python -- Key: SPARK-7133 URL: https://issues.apache.org/jira/browse/SPARK-7133 Project: Spark Issue Type: Sub-task Components: SQL Reporter: Reynold Xin Assignee: Wenchen Fan Priority: Blocker Fix For: 1.4.0 Typing {code} df.col[1] {code} and {code} df.col['field'] {code} is so much eaiser than {code} df.col.getField('field') df.col.getItem(1) {code} This would require us to define (in Column) an apply function in Scala, and a __getitem__ function in Python. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-7133) Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python
[ https://issues.apache.org/jira/browse/SPARK-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14538832#comment-14538832 ] Nicholas Chammas commented on SPARK-7133: - [SPARK-7544} Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python -- Key: SPARK-7133 URL: https://issues.apache.org/jira/browse/SPARK-7133 Project: Spark Issue Type: Sub-task Components: SQL Reporter: Reynold Xin Assignee: Wenchen Fan Priority: Blocker Fix For: 1.4.0 Typing {code} df.col[1] {code} and {code} df.col['field'] {code} is so much eaiser than {code} df.col.getField('field') df.col.getItem(1) {code} This would require us to define (in Column) an apply function in Scala, and a __getitem__ function in Python. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-7133) Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python
[ https://issues.apache.org/jira/browse/SPARK-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14538272#comment-14538272 ] Nicholas Chammas commented on SPARK-7133: - [~rxin] - Should we also implement {{\_\_getitem\_\_}} access in PySpark for {{Row}}? Or does this patch also cover that? As of Spark 1.3.1, you can do {{row.field}} but not {{row\['field'\]}}. Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python -- Key: SPARK-7133 URL: https://issues.apache.org/jira/browse/SPARK-7133 Project: Spark Issue Type: Sub-task Components: SQL Reporter: Reynold Xin Assignee: Wenchen Fan Priority: Blocker Fix For: 1.4.0 Typing {code} df.col[1] {code} and {code} df.col['field'] {code} is so much eaiser than {code} df.col.getField('field') df.col.getItem(1) {code} This would require us to define (in Column) an apply function in Scala, and a __getitem__ function in Python. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-7133) Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python
[ https://issues.apache.org/jira/browse/SPARK-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14516815#comment-14516815 ] Apache Spark commented on SPARK-7133: - User 'cloud-fan' has created a pull request for this issue: https://github.com/apache/spark/pull/5744 Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python -- Key: SPARK-7133 URL: https://issues.apache.org/jira/browse/SPARK-7133 Project: Spark Issue Type: Sub-task Components: SQL Reporter: Reynold Xin Labels: starter Typing {code} df.col[1] {code} and {code} df.col['field'] {code} is so much eaiser than {code} df.col.getField('field') df.col.getItem(1) {code} This would require us to define (in Column) an apply function in Scala, and a __getitem__ function in Python. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-7133) Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python
[ https://issues.apache.org/jira/browse/SPARK-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14512943#comment-14512943 ] Reynold Xin commented on SPARK-7133: cc [~cloud_fan] I'm looking at some code you wrote. Looks like both GetItem and ArrayGetField can be used to get a field out of an array. Any reason why we don't just have ArrayGetField, MapGetField, StructGetField? It seems to me it'd be easier if we generalize UnresolvedGetField to support all map, struct, and array, and during analysis rewrite it to one of ArrayGetField, MapGetField, StructGetField. Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python -- Key: SPARK-7133 URL: https://issues.apache.org/jira/browse/SPARK-7133 Project: Spark Issue Type: Sub-task Components: SQL Reporter: Reynold Xin Labels: starter Typing {code} df.col[1] {code} and {code} df.col['field'] {code} is so much eaiser than {code} df.col.getField('field') df.col.getItem(1) {code} This would require us to define (in Column) an apply function in Scala, and a __getitem__ function in Python. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-7133) Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python
[ https://issues.apache.org/jira/browse/SPARK-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14512968#comment-14512968 ] Wenchen Fan commented on SPARK-7133: Hi [~rxin] , the reason why we didn't generalize UnresolvedGetField to support all map, struct, and array is because we didn't need to. With SQL, we can distinguish GetField and GetItem during parse time as they have different grammar([] and .), so we only need to consider ArrayGetField and StructGetField. Now if we want to define a unified API for all map, struct, and array in DataFrame, I think we should add MapGetField. cc [~marmbrus] , what do you think? Implement struct, array, and map field accessor using apply in Scala and __getitem__ in Python -- Key: SPARK-7133 URL: https://issues.apache.org/jira/browse/SPARK-7133 Project: Spark Issue Type: Sub-task Components: SQL Reporter: Reynold Xin Labels: starter Typing {code} df.col[1] {code} and {code} df.col['field'] {code} is so much eaiser than {code} df.col.getField('field') df.col.getItem(1) {code} This would require us to define (in Column) an apply function in Scala, and a __getitem__ function in Python. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org