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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to