JingsongLi commented on code in PR #1447:
URL: https://github.com/apache/paimon-rust/pull/1447#discussion_r4662231951
##########
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:
**[P1] Keep existing Format Tables writable after changing default parsing**
I loaded a previously supported Format Table schema with `TIMESTAMP(3) WITH
LOCAL TIME ZONE` and `defaultValue: "'2026-01-02T00:00:00+08:00'"`. On
`ea90bef2`, the writer applied the default to a NULL input, committed the
Parquet file, and read back `2026-01-01T16:00:00Z`. On `99345c13`, the same
persisted schema fails at `new_write()` because the new temporal parser rejects
the explicit offset. `FormatTableDefaults::new` eagerly parses every default,
so supplying a non-null value does not restore writes.
Please preserve the legacy parser behavior for already-stored defaults,
while validating new or changed defaults before publishing them. A regression
test should reopen a schema written by a previous Rust version and verify that
its default still produces the same stored instant.
--
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]