SteNicholas commented on code in PR #1447:
URL: https://github.com/apache/paimon-rust/pull/1447#discussion_r4662522328


##########
crates/paimon/src/table/format_table_defaults.rs:
##########
@@ -406,31 +272,16 @@ fn cast_default(
                 *sorted,
             )?))
         }
-        DataType::Multiset(_) => Err(cast_error(
-            "Java does not support casting a string default to MULTISET",
-        )),
-        DataType::Vector(_) => Err(cast_error(
-            "Java does not support casting a string default to VECTOR",
-        )),
-        DataType::Variant(_) => Err(cast_error(
-            "Java does not support casting a string default to VARIANT",
-        )),
-        DataType::Blob(_) => Err(arrow_schema::ArrowError::CastError(
-            "Java does not support casting a string default to BLOB".into(),
-        )),
-        _ => arrow_cast::cast(&StringArray::from(vec![text]), 
arrow_field.data_type()),
+        _ => {
+            let string = DataType::VarChar(VarCharType::string_type());
+            let input: ArrayRef = Arc::new(StringArray::from(vec![text]));
+            CastExecutor::new(string.clone(), string, data_type.clone())

Review Comment:
   Thanks for reproducing this. Fixed in `03f5412e`. Format Table writers 
preserve the legacy interpretation of stored defaults. `CREATE` and column 
value-type changes validate defaults with Java-compatible casts before 
publication. 
[Commit](https://github.com/SteNicholas/paimon-rust/commit/03f5412e803bb70077b424884a87d4670d786b3a)
   
   The regression reopens a legacy Parquet Format Table, writes a `NULL` with 
the stored default `'2026-01-02T00:00:00+08:00'`, and asserts that it reads 
back as `2026-01-01T16:00:00Z`. It also covers a same-type `ALTER` and a change 
to `NOT NULL`. [Regression 
test](https://github.com/SteNicholas/paimon-rust/blob/03f5412e803bb70077b424884a87d4670d786b3a/crates/paimon/src/catalog/filesystem.rs#L2379)
   



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