Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5802#discussion_r29482265
  
    --- Diff: python/pyspark/sql/functions.py ---
    @@ -135,6 +158,24 @@ def sparkPartitionId():
         return Column(sc._jvm.functions.sparkPartitionId())
     
     
    +def struct(*cols):
    +    """Creates a new struct column.
    +
    +    :param cols: list of column names (string) or list of :class:`Column` 
expressions
    +        that are named or aliased.
    +
    +    >>> df.select(struct('age', 'name').alias("struct")).collect()
    +    [Row(struct=[u'2', u'Alice']), Row(struct=[u'5', u'Bob'])]
    +    >>> df.select(struct([df.age, df.name]).alias("struct")).collect()
    +    [Row(struct=[u'2', u'Alice']), Row(struct=[u'5', u'Bob'])]
    --- End diff --
    
    I think there is a bug with struct type conversion in Python (see age 
becomes a string). Will file a separate jira to fix this one.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to