Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6874#discussion_r32724856
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -737,6 +735,21 @@ object functions {
       }
     
       /**
    +   * Creates a new struct column with given field names and columns.
    +   * The input columns should be of length 2*n and follow (name1, col1, 
name2, col2),
    +   * name* should be String Literal
    +   *
    +   * @group normal_funcs
    +   * @since 1.5.0
    +   */
    +  @scala.annotation.varargs
    +  def named_struct(cols: Column*): Column = {
    +    require(cols.length % 2 == 0,
    +      s"named_struct expects an even number of arguments.")
    +    CreateNamedStruct(cols.map(_.expr))
    +  }
    +
    +  /**
    --- End diff --
    
    We usually will have the column names version of API.  For example:
    ```
    def namedStruct(colName: String, colNames: String*): Column
    ```


---
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