Skip to content

Commit

Permalink
try removing Field::new_with_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jan 24, 2025
1 parent 6400197 commit 0ee0b4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
7 changes: 1 addition & 6 deletions native/core/src/execution/operators/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,7 @@ fn scan_schema(input_batch: &InputBatch, data_types: &[DataType]) -> SchemaRef {
.map(|(idx, c)| {
let datatype = ScanExec::unpack_dictionary_type(c.data_type());
// We don't use the field name. Put a placeholder.
if matches!(datatype, DataType::Dictionary(_, _)) {
#[allow(deprecated)]
Field::new_dict(format!("col_{}", idx), datatype, true, idx as i64, false)
} else {
Field::new(format!("col_{}", idx), datatype, true)
}
Field::new(format!("col_{}", idx), datatype, true)
})
.collect::<Vec<Field>>()
}
Expand Down
16 changes: 1 addition & 15 deletions native/core/src/execution/shuffle/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3439,21 +3439,7 @@ fn make_batch(arrays: Vec<ArrayRef>, row_count: usize) -> Result<RecordBatch, Ar
let fields = arrays
.iter()
.enumerate()
.map(|(i, array)| match array.data_type() {
DataType::Dictionary(_, _) => {
#[allow(deprecated)]
let field = Field::new_dict(
format!("c{}", i),
array.data_type().clone(),
true,
dict_id,
false,
);
dict_id += 1;
field
}
_ => Field::new(format!("c{}", i), array.data_type().clone(), true),
})
.map(|(i, array)| Field::new(format!("c{}", i), array.data_type().clone(), true))
.collect::<Vec<_>>();
let schema = Arc::new(Schema::new(fields));
let options = RecordBatchOptions::new().with_row_count(Option::from(row_count));
Expand Down

0 comments on commit 0ee0b4c

Please sign in to comment.