You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/04/18 02:38:02 UTC

[GitHub] [iceberg] openinx commented on a diff in pull request #3991: Flink: Support nested projection

openinx commented on code in PR #3991:
URL: https://github.com/apache/iceberg/pull/3991#discussion_r851846034


##########
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/data/RowDataProjection.java:
##########
@@ -60,11 +76,37 @@ public static RowDataProjection create(Schema schema, Schema projectedSchema) {
    * @return a wrapper to project rows
    */
   public static RowDataProjection create(RowType rowType, Types.StructType schema, Types.StructType projectedSchema) {
-    return new RowDataProjection(rowType, schema, projectedSchema);
+    return RowDataProjection.create(rowType, schema, projectedSchema, null);
+  }
+
+  /**
+   * Creates a projecting wrapper for {@link RowData} rows.
+   * <p>
+   * This projection will not project the nested children types of repeated types like lists and maps.
+   *
+   * @param rowType flink row type of rows wrapped by this projection
+   * @param schema schema of rows wrapped by this projection
+   * @param projectedSchema result schema of the projected rows
+   * @param projectedFields mapping of nested fields
+   * @return a wrapper to project rows
+   */
+  public static RowDataProjection create(RowType rowType,
+                                         Types.StructType schema,
+                                         Types.StructType projectedSchema,
+                                         int[][] projectedFields) {

Review Comment:
   In this `create` method,  we are passing both `projectedSchema` and `projectedFields`  ?  That's making confusion for me personally.  one of the two is required enough to decide how to project the raw row into the projected `RowData`, so why we require the upper layer users to provide both of them ? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org