Commit 02e06c5
Add arrow-avro support for Duration type and minor fixes for UUID decoding (#7889)
# Which issue does this PR close?
- Part of #4886
- Related to #6965
# Rationale for this change
The `arrow-avro` crate currently lacks support for the Avro `duration`
type, which is a standard and commonly used type in Avro schemas. This
omission prevents users from reading Avro files containing duration
types, limiting the crate's utility.
This change introduces support for decoding Avro duration types by
mapping them to the Arrow `Interval` type. This is a logical and
efficient representation. Implementing this feature brings the
`arrow-avro` crate closer to full Avro specification compliance and
makes it more robust for real-world use cases.
# What changes are included in this PR?
This PR contains:
* arrow-avro decoder support for Duration types.
* Minor fixes UUID decoding. UUID types now map to `utf8` type to better
align with the [Avro
specification](https://avro.apache.org/docs/1.11.1/specification/#uuid)
* New integration test using a temporary `duration_uuid.avro` file crate
using this python script:
https://gist.github.com/jecsand838/cbdaaf581af78f357778bf87d2f3cf15
# Are these changes tested?
Yes, this PR includes for integration and unit tests covering these
modifications.
# Are there any user-facing changes?
N/A
# Follow-Up PRs
1. PR to update `test_duration_uuid` once
apache/arrow-testing#108 is merged in.
---------
Co-authored-by: Matthijs Brobbel <[email protected]>1 parent 52fd59c commit 02e06c5
File tree
5 files changed
+222
-27
lines changed- arrow-avro
- src
- reader
- test/data
5 files changed
+222
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
| |||
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
64 | | - | |
65 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
66 | 79 | | |
67 | 80 | | |
68 | 81 | | |
| |||
200 | 213 | | |
201 | 214 | | |
202 | 215 | | |
203 | | - | |
| 216 | + | |
204 | 217 | | |
205 | 218 | | |
206 | 219 | | |
| |||
479 | 492 | | |
480 | 493 | | |
481 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
482 | 507 | | |
483 | 508 | | |
484 | 509 | | |
| |||
543 | 568 | | |
544 | 569 | | |
545 | 570 | | |
546 | | - | |
547 | 571 | | |
548 | 572 | | |
549 | 573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
799 | 860 | | |
0 commit comments