We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7b5e9b commit 06f322fCopy full SHA for 06f322f
crates/iceberg/src/avro/schema.rs
@@ -82,15 +82,7 @@ impl SchemaVisitor for SchemaToAvroSchema {
82
}
83
84
let default = if let Some(literal) = &field.initial_default {
85
- let raw_literal = RawLiteral::try_from(literal.clone(), &field.field_type)?;
86
- let json_value = serde_json::to_value(raw_literal).map_err(|e| {
87
- Error::new(
88
- ErrorKind::DataInvalid,
89
- "Failed to serialize default value to json",
90
- )
91
- .with_source(e)
92
- })?;
93
- Some(json_value)
+ Some(literal.clone().try_into_json(&field.field_type)?)
94
} else if !field.required {
95
Some(Value::Null)
96
} else {
0 commit comments