Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump apache-avro to 0.16.0 #13523

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 93 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified scripts/source/test_data/avro_bin.1
Binary file not shown.
2 changes: 1 addition & 1 deletion src/connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ normal = ["workspace-hack"]

[dependencies]
anyhow = "1"
apache-avro = { git = "https://github.com/risingwavelabs/avro", rev = "3c257c1f65e63a80ac44f1cffaf083cdaeab431a", features = [
apache-avro = { git = "https://github.com/risingwavelabs/avro", rev = "b251943586e7fe7dd52319fc84f8be47921434aa", features = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"snappy",
"zstandard",
"bzip",
Expand Down
17 changes: 11 additions & 6 deletions src/connector/src/parser/avro/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ mod test {
use std::ops::Sub;
use std::path::PathBuf;

use apache_avro::schema::RecordSchema;
use apache_avro::types::{Record, Value};
use apache_avro::{Codec, Days, Duration, Millis, Months, Reader, Schema, Writer};
use itertools::Itertools;
Expand Down Expand Up @@ -471,12 +472,17 @@ mod test {

match build_field(inner_schema) {
None => {
let index_of_union =
union_schema.find_schema(&Value::Null).unwrap().0 as u32;
let index_of_union = union_schema
.find_schema_with_known_schemata::<&Schema>(&Value::Null, None, &None)
.unwrap()
.0 as u32;
Some(Value::Union(index_of_union, Box::new(Value::Null)))
}
Some(value) => {
let index_of_union = union_schema.find_schema(&value).unwrap().0 as u32;
let index_of_union = union_schema
.find_schema_with_known_schemata::<&Schema>(&value, None, &None)
.unwrap()
.0 as u32;
Some(Value::Union(index_of_union, Box::new(value)))
}
}
Expand All @@ -487,9 +493,9 @@ mod test {

fn build_avro_data(schema: &Schema) -> Record<'_> {
let mut record = Record::new(schema).unwrap();
if let Schema::Record {
if let Schema::Record(RecordSchema {
name: _, fields, ..
} = schema.clone()
}) = schema.clone()
{
for field in &fields {
let value = build_field(&field.schema)
Expand All @@ -513,7 +519,6 @@ mod test {
#[tokio::test]
async fn test_new_avro_parser() {
let avro_parser_rs = new_avro_parser_from_local("simple-schema.avsc").await;
assert!(avro_parser_rs.is_ok());
let avro_parser = avro_parser_rs.unwrap();
println!("avro_parser = {:?}", avro_parser);
}
Expand Down
Loading
Loading