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

Fix map nullable flag in ParquetTypeConverter #1592

Merged
merged 3 commits into from
Apr 21, 2022
Merged
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
33 changes: 28 additions & 5 deletions parquet/src/arrow/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ impl ParquetTypeConverter<'_> {
Box::new(Field::new(
key_item.name(),
DataType::Struct(vec![key, value]),
false,
self.schema.is_optional(),
Copy link
Member Author

Choose a reason for hiding this comment

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

Due to previous inconsistency I described in the ticket, I changed this to follow visit_map.

)),
false, // There is no information to tell if keys are sorted
))),
Expand Down Expand Up @@ -1500,7 +1500,7 @@ mod tests {
Field::new("str", DataType::Utf8, false),
Field::new("num", DataType::Int32, false),
]),
false,
true,
)),
false,
),
Expand All @@ -1525,7 +1525,7 @@ mod tests {
Field::new("key", DataType::Utf8, false),
Field::new("value", DataType::Int32, true),
]),
false,
true,
)),
false,
),
Expand Down Expand Up @@ -2096,7 +2096,7 @@ mod tests {
true,
),
]),
false,
true,
)),
false, // fails to roundtrip keys_sorted
),
Expand All @@ -2119,12 +2119,35 @@ mod tests {
true,
),
]),
false,
true,
)),
false, // fails to roundtrip keys_sorted
),
true,
),
Field::new(
"c41",
DataType::Map(
Box::new(Field::new(
"my_entries",
DataType::Struct(vec![
Field::new("my_key", DataType::Utf8, false),
Field::new(
"my_value",
DataType::List(Box::new(Field::new(
"item",
DataType::Utf8,
true,
))),
true,
),
]),
false,
)),
false, // fails to roundtrip keys_sorted
),
false,
),
],
metadata,
);
Expand Down