healchow commented on code in PR #8238:
URL: https://github.com/apache/inlong/pull/8238#discussion_r1229035370
##########
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/FlinkSink.java:
##########
@@ -778,18 +781,32 @@ private DataStream<RowData> distributeDataStream(
}
+ static DataType filterOutMetaField(TableSchema requestedSchema) {
+ DataTypes.Field[] fields =
+ requestedSchema.getTableColumns().stream()
+ .filter(column ->
!META_INCREMENTAL.equals(column.getName()))
+ .map(column -> FIELD(column.getName(),
column.getType()))
+ .toArray(DataTypes.Field[]::new);
+ return ROW(fields).notNull();
+ }
+
static RowType toFlinkRowType(Schema schema, TableSchema requestedSchema) {
if (requestedSchema != null) {
// Convert the flink schema to iceberg schema firstly, then
reassign ids to match the existing iceberg
// schema.
- Schema writeSchema =
TypeUtil.reassignIds(FlinkSchemaUtil.convert(requestedSchema), schema);
+ List<org.apache.iceberg.types.Types.NestedField> filteredFields =
FlinkSchemaUtil.convert(requestedSchema)
Review Comment:
Why not import this class?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]