Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
andylokandy committed Oct 27, 2024
1 parent f0ec49b commit 7d1b931
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/query/expression/src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,18 +667,28 @@ impl<'a> Evaluator<'a> {
value_builder.commit_row();
}

let offsets = value_builder.offsets.into();
let key_col = key_builder.build();
let value_col = value_builder.builder.build();
let key_col = Column::String(key_builder.build());
let value_col = Column::Array(Box::new(value_builder.build().upcast()));

let kv_col = Column::Tuple(vec![
Column::String(key_col),
Column::Variant(value_col),
]);
let value_col = self
.run_cast(
span,
&DataType::Array(Box::new(DataType::Variant)),
&fields_dest_ty[1],
Value::Column(value_col),
validity,
options,
)?
.into_column()
.unwrap()
.into_array()
.unwrap();

let kv_col = Column::Tuple(vec![key_col, value_col.values]);

Ok(Value::Column(Column::Map(Box::new(ArrayColumn {
values: kv_col,
offsets,
offsets: value_col.offsets,
}))))
}
other => unreachable!("source: {}", other),
Expand Down

0 comments on commit 7d1b931

Please sign in to comment.