Skip to content
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
5 changes: 4 additions & 1 deletion lang/rust/avro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,14 @@ pub use decimal::Decimal;
pub use duration::{Days, Duration, Millis, Months};
pub use error::Error;
pub use reader::{from_avro_datum, GenericSingleObjectReader, Reader, SpecificSingleObjectReader};
pub use schema::Schema;
pub use schema::{AvroSchema, Schema};
pub use ser::to_value;
pub use util::max_allocation_bytes;
pub use writer::{to_avro_datum, GenericSingleObjectWriter, SpecificSingleObjectWriter, Writer};

#[cfg(feature = "derive")]
pub use apache_avro_derive::*;

#[macro_use]
extern crate log;

Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ proc-macro2 = "1.0.37"
serde_json = "1.0.79"

[dev-dependencies]
apache-avro = { version = "0.14.0", path = "../avro", features = ["derive"] }
apache-avro = { path = "../avro", features = ["derive"] }
proptest = "1.0.0"
serde = { version = "1.0.136", features = ["derive"] }
4 changes: 2 additions & 2 deletions lang/rust/avro_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn derive_avro_schema(input: &mut DeriveInput) -> Result<TokenStream, Vec<syn::E
let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
Ok(quote! {
impl #impl_generics apache_avro::schema::derive::AvroSchemaComponent for #ident #ty_generics #where_clause {
fn get_schema_in_ctxt(named_schemas: &mut HashMap<apache_avro::schema::Name, apache_avro::schema::Schema>, enclosing_namespace: &Option<String>) -> apache_avro::schema::Schema {
fn get_schema_in_ctxt(named_schemas: &mut std::collections::HashMap<apache_avro::schema::Name, apache_avro::schema::Schema>, enclosing_namespace: &Option<String>) -> apache_avro::schema::Schema {
let name = apache_avro::schema::Name::new(#full_schema_name).expect(&format!("Unable to parse schema name {}", #full_schema_name)[..]).fully_qualified_name(enclosing_namespace);
let enclosing_namespace = &name.namespace;
if named_schemas.contains_key(&name) {
Expand Down Expand Up @@ -220,7 +220,7 @@ fn type_to_schema_expr(ty: &Type) -> Result<TokenStream, Vec<syn::Error>> {
let type_string = p.path.segments.last().unwrap().ident.to_string();

let schema = match &type_string[..] {
"bool" => quote! {Schema::Boolean},
"bool" => quote! {apache_avro::schema::Schema::Boolean},
"i8" | "i16" | "i32" | "u8" | "u16" => quote! {apache_avro::schema::Schema::Int},
"i64" => quote! {apache_avro::schema::Schema::Long},
"f32" => quote! {apache_avro::schema::Schema::Float},
Expand Down
6 changes: 3 additions & 3 deletions lang/rust/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ do
prepare_build
export RUST_LOG=apache_avro=debug
export RUST_BACKTRACE=1
cargo run --all-features --example generate_interop_data
cargo run --features snappy,zstandard,bzip,xz --example generate_interop_data
;;

interop-data-test)
prepare_build
echo "Running interop data tests"
cargo run --all-features --example test_interop_data
cargo run --features snappy,zstandard,bzip,xz --example test_interop_data
echo -e "\nRunning single object encoding interop data tests"
cargo run --all-features --example test_interop_single_object_encoding
cargo run --example test_interop_single_object_encoding
;;
*)
echo "Usage: $0 {lint|test|dist|clean|interop-data-generate|interop-data-test}" >&2
Expand Down