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

AVRO-3935: Add support for compatibility check logical types in Rust Avro #2728

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

Panaetius
Copy link
Contributor

What is the purpose of the change

This pull request adds support for schema compatibility checks on logical types in the apache-avro Rust crate, fixing AVRO-3935

This adds compatibility support for these types:

            (Schema::TimeMicros, Schema::Int),
            (Schema::TimestampMillis, Schema::Int),
            (Schema::TimestampMicros, Schema::Int),
            (Schema::TimestampNanos, Schema::Int),
            (Schema::LocalTimestampMillis, Schema::Int),
            (Schema::LocalTimestampMicros, Schema::Int),
            (Schema::LocalTimestampNanos, Schema::Int),
            (Schema::Date, Schema::Long),
            (Schema::TimeMillis, Schema::Long),

(type that gets checked, primitive type it is compatible with), of course each type also being compatible with itself

Verifying this change

This change added tests and can be verified as follows:

run cargo test in the lang/rust/avro folder, added test cases to the test_incompatible_reader_writer_pairs and test_compatible_reader_writer_pairs test cases.

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? not applicable

@github-actions github-actions bot added the Rust label Feb 9, 2024
@Panaetius Panaetius marked this pull request as ready for review February 9, 2024 17:23
@martin-g martin-g changed the title AVRO-3935: add support for logical types in rust avro AVRO-3935: Add support for compatibility check logical types in Rust Avro Feb 12, 2024
…/writer types

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@martin-g martin-g merged commit 0733dd3 into apache:main Feb 13, 2024
15 checks passed
martin-g pushed a commit that referenced this pull request Feb 13, 2024
…Avro (#2728)

* AVRO-3935: [Rust] add support for logical types in rust avro

* AVRO-3935: [Rust] Extract common logic for checking compatible reader/writer types

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

---------

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Co-authored-by: Ralf Grubenmann <ralf.grubenmann@gmail.com>
Co-authored-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
(cherry picked from commit 0733dd3)
@martin-g
Copy link
Member

Thank you for the contribution, @Panaetius !

RanbirK pushed a commit to RanbirK/avro that referenced this pull request May 13, 2024
…Avro (apache#2728)

* AVRO-3935: [Rust] add support for logical types in rust avro

* AVRO-3935: [Rust] Extract common logic for checking compatible reader/writer types

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

---------

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Co-authored-by: Ralf Grubenmann <ralf.grubenmann@gmail.com>
Co-authored-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants