yuchuanchen commented on code in PR #21563: URL: https://github.com/apache/flink/pull/21563#discussion_r1066838344
########## flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/DataTypeUtils.java: ########## @@ -94,6 +99,217 @@ public static DataType projectRow(DataType dataType, int[] indexPaths) { return Projection.of(indexPaths).project(dataType); } + public static List<RowType.RowField> buildRowFields(RowType allType, int[][] projectedFields) { + final List<RowType.RowField> updatedFields = new ArrayList<>(); + for (int[] projectedField : projectedFields) { + updatedFields.add( + buildRowFieldInProjectFields( + allType.getFields().get(projectedField[0]), projectedField, 0)); + } + return updatedFields; + } + + public static RowType buildRow(RowType allType, int[][] projectedFields) { + return new RowType( + allType.isNullable(), mergeRowFields(buildRowFields(allType, projectedFields))); + } + + public static RowType buildRow(RowType allType, List<RowType.RowField> updatedFields) { + return new RowType(allType.isNullable(), mergeRowFields(updatedFields)); + } + + public static RowType.RowField buildRowFieldInProjectFields( Review Comment: updated -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org