JingsongLi commented on code in PR #10655:
URL: https://github.com/apache/paimon/pull/10655#discussion_r4313377456


##########
paimon-python/pypaimon/schema/schema_manager.py:
##########
@@ -437,35 +437,125 @@ def _validate_blob_fields(
             )
         )
 
+    if video_fields and primary_keys:
+        raise ValueError(
+            f"'{CoreOptions.VIDEO_FRAME_FIELD.key()}' only supports 
append-only tables."
+        )
+
     if blob_field_names:
-        required_options = {
-            CoreOptions.ROW_TRACKING_ENABLED.key(): 'true',
-            CoreOptions.DATA_EVOLUTION_ENABLED.key(): 'true'
-        }
+        if blob_field_names.intersection(partition_keys):
+            raise ValueError(
+                "The BLOB, ARRAY<BLOB> or MAP<X, BLOB> type column can not be "
+                "part of partition keys."
+            )
 
-        missing_options = []
-        for key, expected_value in required_options.items():
-            if key not in options or options[key] != expected_value:
-                missing_options.append(f"{key}='{expected_value}'")
+        if not primary_keys:
+            required_options = {
+                CoreOptions.ROW_TRACKING_ENABLED.key(): 'true',
+                CoreOptions.DATA_EVOLUTION_ENABLED.key(): 'true'
+            }
+
+            missing_options = []
+            for key, expected_value in required_options.items():
+                if key not in options or options[key] != expected_value:
+                    missing_options.append(f"{key}='{expected_value}'")
+
+            if missing_options:
+                raise ValueError(
+                    f"Schema contains BLOB, ARRAY<BLOB> or MAP<X, BLOB> type 
but is "
+                    f"missing required options: "
+                    f"{', '.join(missing_options)}. "
+                    f"Please add these options to the schema."
+                )
+        else:
+            _validate_primary_key_blob_fields(

Review Comment:
   [P2] Validate the remaining partial-update BLOB restrictions before 
persisting the schema
   
   The new PK validation path accepts schemas that Java cannot even load. For 
example, with `id INT` as PK, `ts INT`, `payload BLOB`, `bucket=1`, 
`merge-engine=partial-update`, `fields.ts.sequence-group=payload`, and 
`fields.payload.aggregate-function=last_non_null_value`, Python `create_table` 
succeeds, but loading the same directory with Java 
`FileStoreTableFactory.create` throws the managed-BLOB retract-aggregation 
error from `validatePrimaryKeyBlobConfiguration`. Likewise, 
`fields.payload.sequence-group=ts` is accepted even with 
`blob-descriptor-field=payload`, but Java rejects the BLOB ordering field in 
`validateSequenceGroupOrderingFields`. I reproduced both failures against the 
persisted Python schemas. Please mirror those remaining Java guards (including 
the valid ignore-retract/ignore-delete exceptions) before committing the 
schema, and add rejection tests so Python-created tables remain loadable by 
Java/Flink/Spark.



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