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


##########
paimon-python/pypaimon/schema/schema_manager.py:
##########
@@ -364,6 +428,7 @@ def create_table(self, schema: Schema) -> TableSchema:
                 comment=schema.comment,
             )
 
+            _validate_blob_fields(schema.fields, schema.options, 
schema.primary_keys)

Review Comment:
   [P2] This closes the direct `create_table(Schema(...))` path, but schema 
changes still bypass the same Blob validation. `commit_changes()` builds a new 
`TableSchema` and calls `commit()` without running `_validate_blob_fields()` or 
`_validate_blob_external_storage_fields()`, whereas Java 
`SchemaManager.commit()` runs `SchemaValidation.validateTableSchema(newSchema)` 
for every schema commit. This means users can still `alter_table` with 
`SetOption('blob-view-field', 'non_blob_col')`, remove `row-tracking.enabled` / 
`data-evolution.enabled` from a table with BLOB columns, or add a BLOB column 
via directive without the required options, and the invalid schema is 
committed. Please centralize this validation before writing schema changes as 
well, ideally in the Python `commit()` path to match Java.



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