XiaoHongbo-Hope commented on code in PR #8021:
URL: https://github.com/apache/paimon/pull/8021#discussion_r3346516956
##########
paimon-python/pypaimon/schema/schema.py:
##########
@@ -133,3 +102,56 @@ def from_pyarrow_schema(pa_schema: pa.Schema,
partition_keys: Optional[List[str]
)
return Schema(fields, partition_keys, primary_keys, options, comment)
+
+ @staticmethod
+ def _validate_blob_fields(fields, options, primary_keys):
+ """Validate blob field configurations in the schema."""
+
+ if options is None:
+ options = {}
+
+ blob_field_names = {
+ field.name for field in fields if 'blob' in str(field.type).lower()
+ }
+
+ if len(fields) <= len(blob_field_names):
+ raise ValueError(
+ "Table with BLOB type column must have other normal columns."
+ )
+
+ core_options = CoreOptions.from_dict(options)
+
+ descriptor_fields = core_options.blob_descriptor_fields()
+ view_fields = core_options.blob_view_fields()
+ unknown_inline_fields =
descriptor_fields.union(view_fields).difference(blob_field_names)
Review Comment:
`blob-field` is not validated against BLOB fields.
--
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]