Skip to content

Commit

Permalink
workaround for array without element type
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal committed Nov 18, 2024
1 parent 045fa1f commit c4fc94a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wren-core/core/src/logical_plan/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ use std::collections::HashSet;
use std::{collections::HashMap, sync::Arc};

fn create_list_type(array_type: &str) -> Result<DataType> {
// Workaround for the array type without an element type
if array_type.len() == "array".len() {
return create_list_type("array<varchar>");
}
if let ast::DataType::Array(value) = parse_type(array_type)? {
let data_type = match value {
ArrayElemTypeDef::None => {
Expand Down Expand Up @@ -361,6 +365,7 @@ mod test {
("null", DataType::Null),
("geography", DataType::Utf8),
("range", DataType::Utf8),
("array", create_list_type("array<varchar>")?),
("array<int64>", create_list_type("array<int64>")?),
(
"struct<name string, age int>",
Expand Down

0 comments on commit c4fc94a

Please sign in to comment.