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

Support writing IntervalMonthDayNanoArray to parquet via Arrow Writer #5868

Closed

Conversation

xinlifoobar
Copy link
Contributor

Which issue does this PR close?

Closes #5849 and Related #5847

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the parquet Changes to the parquet crate label Jun 11, 2024
@xinlifoobar
Copy link
Contributor Author

This PR is super weird due to:

  1. From a spec perspective, it defines the interval data type as 12 bytes which could not accommodate the IntervalMonthDayNanoArray(16 bytes).
  2. From the arrow-rs implementations, the interval type is not defined as a logic type.

pub enum LogicalType {
String,
Map,
List,
Enum,
Decimal {
scale: i32,
precision: i32,
},
Date,
Time {
is_adjusted_to_u_t_c: bool,
unit: TimeUnit,
},
Timestamp {
is_adjusted_to_u_t_c: bool,
unit: TimeUnit,
},
Integer {
bit_width: i8,
is_signed: bool,
},
Unknown,
Json,
Bson,
Uuid,
Float16,
}

It would be more natural if we set both logic type and converted type at

pub struct PrimitiveTypeBuilder<'a> {
name: &'a str,
repetition: Repetition,
physical_type: PhysicalType,
converted_type: ConvertedType,
logical_type: Option<LogicalType>,
length: i32,
precision: i32,
scale: i32,
id: Option<i32>,
}

Now it is (None, ConvertedType:Interval).

@tustvold
Copy link
Contributor

#5849 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support writing IntervalMonthDayNanoArray to parquet via Arrow Writer
2 participants