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

bug: map type has been converted into an arrow map type with a wrong field type #18451

Closed
chenzl25 opened this issue Sep 6, 2024 · 0 comments · Fixed by #18463
Closed

bug: map type has been converted into an arrow map type with a wrong field type #18451

chenzl25 opened this issue Sep 6, 2024 · 0 comments · Fixed by #18463
Assignees
Labels
type/bug Something isn't working
Milestone

Comments

@chenzl25
Copy link
Contributor

chenzl25 commented Sep 6, 2024

Describe the bug

The inner field data type of arrow map type should be a Struct<k,v> instead of List<Struct<k,v>>

fn map_type_to_arrow(&self, map_type: &MapType) -> Result<arrow_schema::DataType, ArrayError> {
let sorted = false;
let list_type = map_type.clone().into_list();
Ok(arrow_schema::DataType::Map(
Arc::new(arrow_schema::Field::new(
"entries",
self.list_type_to_arrow(&list_type)?,
true,
)),
sorted,
))
}

/// A Map is a logical nested type that is represented as
///
/// List<entries: Struct<key: K, value: V>>
///
/// The keys and values are each respectively contiguous.
/// The key and value types are not constrained, but keys should be
/// hashable and unique.
/// Whether the keys are sorted can be set in the bool after the Field.
///
/// In a field with Map type, the field has a child Struct field, which then
/// has two children: key type and the second the value type. The names of the
/// child fields may be respectively "entries", "key", and "value", but this is
/// not enforced.

Error message/log

No response

To Reproduce

No response

Expected behavior

No response

How did you deploy RisingWave?

No response

The version of RisingWave

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants