You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/26 03:21:10 UTC

[GitHub] beliefer commented on a change in pull request #23891: [SPARK-26987][SQL] Add a new method to RowFactory: Row with schema

beliefer commented on a change in pull request #23891: [SPARK-26987][SQL] Add a new method to RowFactory: Row with schema
URL: https://github.com/apache/spark/pull/23891#discussion_r260111607
 
 

 ##########
 File path: sql/catalyst/src/main/java/org/apache/spark/sql/RowFactory.java
 ##########
 @@ -37,4 +39,17 @@
   public static Row create(Object ... values) {
     return new GenericRow(values);
   }
+
+  /**
+   * Create a {@link Row} from the given arguments. Provided schema is incorporated into
+   * created {@link Row} object, and allows getAs(fieldName) to access the value of column.
+   *
+   * Note that every Rows will contain the duplicated schema, hence in high volume it is still
+   * recommended to use `create` with accessing column by position.
+   *
+   * @since 3.0.0
+   */
+  public static Row createWithSchema(StructType schema, Object ... values) {
 
 Review comment:
   This change looks useful!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org