Skip to content

Commit

Permalink
fix: use upstream avro (#276)
Browse files Browse the repository at this point in the history
Co-authored-by: ZENOTME <st810918843@gmail.com>
  • Loading branch information
ZENOTME and ZENOTME committed Jun 19, 2024
1 parent be8b2c2 commit f04c4f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resolver = "2"
anyhow = "1"
async-trait = "0.1"
# branch is icelake-dev
apache-avro = { git = "https://github.com/icelake-io/avro.git", branch = "icelake-dev", recv = "4b828e9283e7248fd3ca42f5b590c2160b201785",features = ["derive"] }
apache-avro = { git = "https://github.com/apache/avro.git", recv = "fdab5db0816e28e3e10c87910c8b6f98c33072dc",features = ["derive"] }
arrow-array = { version = ">=50" }
arrow-schema = { version = ">=50" }
arrow-select = { version = ">=50" }
Expand Down
10 changes: 4 additions & 6 deletions icelake/src/types/to_avro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ impl<'a, 'b> TryFrom<AnyWithFieldId<'a, 'b>> for AvroSchema {
doc: None,
size: Primitive::decimal_required_bytes(*precision as u32)? as usize,
attributes: BTreeMap::default(),
default: None,
})),
}),
Primitive::Date => AvroSchema::Date,
Expand Down Expand Up @@ -161,7 +162,7 @@ impl<'a, 'b> TryFrom<AnyWithFieldId<'a, 'b>> for AvroSchema {

AvroSchema::Map(AvroMapSchema {
types: Box::new(value_avro_schema),
custom_attributes: BTreeMap::from([
attributes: BTreeMap::from([
(
KEY_ID.to_string(),
JsonValue::String(map.key_id.to_string()),
Expand Down Expand Up @@ -207,7 +208,7 @@ impl<'a, 'b> TryFrom<AnyWithFieldId<'a, 'b>> for AvroSchema {
format!("k{}_v{}", map.key_id, map.value_id).as_str(),
vec![key_field, value_field],
))),
custom_attributes: BTreeMap::from([(
attributes: BTreeMap::from([(
LOGICAL_TYPE.to_string(),
JsonValue::String("map".to_string()),
)]),
Expand All @@ -224,10 +225,7 @@ impl<'a, 'b> TryFrom<AnyWithFieldId<'a, 'b>> for AvroSchema {
}
AvroSchema::Array(AvroArraySchema {
items: Box::new(avro_schema),
custom_attributes: BTreeMap::from([(
ELEMENT_ID.to_string(),
list.element_id.into(),
)]),
attributes: BTreeMap::from([(ELEMENT_ID.to_string(), list.element_id.into())]),
})
}
Any::Struct(s) => {
Expand Down

0 comments on commit f04c4f0

Please sign in to comment.