davidradl commented on code in PR #28074:
URL: https://github.com/apache/flink/pull/28074#discussion_r3196292071
##########
flink-table/flink-table-type-utils/src/main/java/org/apache/flink/table/runtime/typeutils/RowDataSerializer.java:
##########
@@ -364,5 +366,32 @@ public TypeSerializerSchemaCompatibility<RowData>
resolveSchemaCompatibility(
return intermediateResult.getFinalResult();
}
+
+ /**
+ * Returns true when new field types are structurally equal to old
ones ignoring top-level
+ * nullability, and no field narrows from nullable to non-nullable.
+ */
+ private static boolean typesAreCompatibleAfterNullabilityWidening(
+ LogicalType[] newTypes, LogicalType[] oldTypes) {
+ if (newTypes == oldTypes) {
+ return true;
+ }
+ if (newTypes == null || oldTypes == null || newTypes.length !=
oldTypes.length) {
+ return false;
+ }
+ for (int i = 0; i < newTypes.length; i++) {
+ LogicalType newType = newTypes[i];
+ LogicalType oldType = oldTypes[i];
+ // structurally equal except (possibly) for top-level
nullability
Review Comment:
can you expand on what you mean by `(possibly)`.
--
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]