SteNicholas commented on code in PR #416:
URL: https://github.com/apache/paimon-cpp/pull/416#discussion_r4214853187


##########
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:
   Done in 1300a151. The key type check now lives in 
`SchemaValidation::ValidateBlobFields`, next to the other BLOB rules, and runs 
whether or not a blob option names the field. 
`ValidateContainerBlobWriteSchema` is removed along with its calls in 
`TableSchema::Create` and `FileStoreWrite::Create`, and 
`BlobFormatWriter::Create` keeps the per-field `IsSupportedMapBlobKeyType` 
check. As a result, a table loaded with an unsupported key type, such as one 
Java created with a TIME key, now fails on its first blob file write rather 
than in `FileStoreWrite::Create`. The rejection tests moved to 
`SchemaValidationTest.TestMapBlobKeyType`.



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