Hyukjin Kwon created SPARK-60949:
------------------------------------

             Summary: Access struct fields as attributes of a Column in Spark 
Connect Rust as PySpark does
                 Key: SPARK-60949
                 URL: https://issues.apache.org/jira/browse/SPARK-60949
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: Hyukjin Kwon


In PySpark Connect, an attribute that a Column does not have is the field of 
that name ({{Column.__getattr__}} returns {{self[item]}}): {{F.col("a").b}} is 
{{Column<'a['b']'>}}, and {{F.col("a").b.c}} is {{Column<'a['b']['c']'>}}, so 
that {{df.person.name}} selects a field of a struct column. A name that starts 
with {{__}} raises {{PySparkAttributeError}} {{ATTRIBUTE_NOT_SUPPORTED}}, and 
{{_jc}} raises {{JVM_ATTRIBUTE_NOT_SUPPORTED}}.

The Rust-backed Python client raises {{AttributeError}} for every such 
attribute, so {{df.select(F.col("s").field)}} fails. Resolve the attributes 
that a Column does not have as PySpark does.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to