0dunay0 commented on code in PR #11101:
URL: https://github.com/apache/paimon/pull/11101#discussion_r4542357141


##########
paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/ComputedColumnUtils.java:
##########
@@ -58,6 +68,11 @@ public static List<ComputedColumn> buildComputedColumns(
                                         DataField::type,
                                         (v1, v2) -> v2));
 
+        for (CdcMetadataConverter converter : metadataConverters) {
+            typeMapping.put(
+                    toLowerCaseIfNeed(converter.columnName(), caseSensitive), 
converter.dataType());

Review Comment:
   A source field named like a metadata column now feeds the metadata value 
into computed columns. a source field with the same name as a metadata column, 
with the default empty prefixcan cause the Base64 decode of a binary source 
field to crash and a PKeyed job that starts on base to get rejected.



##########
paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/format/AbstractJsonRecordParser.java:
##########
@@ -104,8 +104,8 @@ protected Map<String, String> extractRowData(JsonNode 
record, CdcSchema.Builder
                                             }
                                             return 
Objects.toString(entry.getValue());
                                         }));
-        evalComputedColumns(rowData, schemaBuilder);
         evalMetadataColumns(rowData, schemaBuilder);
+        evalComputedColumns(rowData, schemaBuilder);

Review Comment:
   Schema evolution now adds metadata columns before computed columns. an 
existing table gains `[id, __kafka_timestamp, s]`, whereas base and a newly 
created table give `[id, s, __kafka_timestamp]`. This affects jobs that don't 
reference metadata in a computed column at all.



-- 
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]

Reply via email to