You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "pvary (via GitHub)" <gi...@apache.org> on 2025/05/19 11:50:46 UTC
Re: [PR] Flink: Migrate Flink TableSchema for IcebergSource [iceberg]
pvary commented on code in PR #13072:
URL: https://github.com/apache/iceberg/pull/13072#discussion_r2095533397
##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/FlinkSchemaUtil.java:
##########
@@ -201,6 +233,21 @@ public static TableSchema toSchema(RowType rowType) {
return builder.build();
}
+ /**
+ * Convert a {@link RowType} to a {@link ResolvedSchema}.
+ *
+ * @param rowType a RowType
+ * @return Flink ResolvedSchema
+ */
+ public static ResolvedSchema toResolvedSchema(RowType rowType) {
+ List<Column> columns = Lists.newArrayListWithExpectedSize(rowType.getFieldCount());
+ for (RowType.RowField field : rowType.getFields()) {
+ columns.add(
+ Column.physical(field.getName(), TypeConversions.fromLogicalToDataType(field.getType())));
+ }
+ return ResolvedSchema.of(columns);
Review Comment:
nit: newline: https://iceberg.apache.org/contribute/#block-spacing
--
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