lxy-9602 commented on code in PR #416:
URL: https://github.com/apache/paimon-cpp/pull/416#discussion_r4180142306


##########
src/paimon/common/data/blob_utils.h:
##########
@@ -88,7 +89,10 @@ class PAIMON_EXPORT BlobUtils {
     static bool IsArrayBlobPlaceholder(const arrow::ListArray& array, int64_t 
row);
     /// Returns whether a MAP<..., BLOB> row is the internal fallback sentinel.
     static bool IsMapBlobPlaceholder(const arrow::MapArray& array, int64_t 
row);
-    /// Rejects MAP<..., BLOB>, which is currently supported by the C++ reader 
only.
+    /// Returns whether Paimon C++ supports `key_type` as the key type of 
MAP<..., BLOB>:
+    /// BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, DATE, DECIMAL, CHAR/VARCHAR 
and BINARY/VARBINARY.
+    static bool IsSupportedMapBlobKeyType(const arrow::DataType& key_type);
+    /// Rejects MAP<..., BLOB> fields whose key type the C++ blob writer does 
not support.
     static Status ValidateContainerBlobWriteSchema(const 
std::shared_ptr<arrow::Schema>& schema);

Review Comment:
   Could we move the MAP<BLOB> key-type validation into `SchemaValidation`, 
next to the existing BLOB schema rules, and remove 
`ValidateContainerBlobWriteSchema` plus its special calls from 
`TableSchema::Create` and `FileStoreWrite::Create`? `BlobFormatWriter::Create` 
can retain the per-field `IsSupportedMapBlobKeyType` check as a defensive 
invariant for direct use.



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