|
15 | 15 | // specific language governing permissions and limitations |
16 | 16 | // under the License. |
17 | 17 |
|
| 18 | +use super::{ |
| 19 | + data::{into_buffers, new_buffers}, |
| 20 | + ArrayData, ArrayDataBuilder, |
| 21 | +}; |
| 22 | +use crate::array::StringOffsetSizeTrait; |
18 | 23 | use crate::{ |
19 | 24 | buffer::MutableBuffer, |
20 | 25 | datatypes::DataType, |
21 | 26 | error::{ArrowError, Result}, |
22 | 27 | util::bit_util, |
23 | 28 | }; |
| 29 | +use half::f16; |
24 | 30 | use std::mem; |
25 | 31 |
|
26 | | -use super::{ |
27 | | - data::{into_buffers, new_buffers}, |
28 | | - ArrayData, ArrayDataBuilder, |
29 | | -}; |
30 | | -use crate::array::StringOffsetSizeTrait; |
31 | | - |
32 | 32 | mod boolean; |
33 | 33 | mod fixed_binary; |
34 | 34 | mod list; |
@@ -266,7 +266,7 @@ fn build_extend(array: &ArrayData) -> Extend { |
266 | 266 | DataType::Dictionary(_, _) => unreachable!("should use build_extend_dictionary"), |
267 | 267 | DataType::Struct(_) => structure::build_extend(array), |
268 | 268 | DataType::FixedSizeBinary(_) => fixed_binary::build_extend(array), |
269 | | - DataType::Float16 => unreachable!(), |
| 269 | + DataType::Float16 => primitive::build_extend::<f16>(array), |
270 | 270 | /* |
271 | 271 | DataType::FixedSizeList(_, _) => {} |
272 | 272 | DataType::Union(_) => {} |
@@ -315,7 +315,7 @@ fn build_extend_nulls(data_type: &DataType) -> ExtendNulls { |
315 | 315 | }, |
316 | 316 | DataType::Struct(_) => structure::extend_nulls, |
317 | 317 | DataType::FixedSizeBinary(_) => fixed_binary::extend_nulls, |
318 | | - DataType::Float16 => unreachable!(), |
| 318 | + DataType::Float16 => primitive::extend_nulls::<f16>, |
319 | 319 | /* |
320 | 320 | DataType::FixedSizeList(_, _) => {} |
321 | 321 | DataType::Union(_) => {} |
@@ -429,6 +429,7 @@ impl<'a> MutableArrayData<'a> { |
429 | 429 | | DataType::Int16 |
430 | 430 | | DataType::Int32 |
431 | 431 | | DataType::Int64 |
| 432 | + | DataType::Float16 |
432 | 433 | | DataType::Float32 |
433 | 434 | | DataType::Float64 |
434 | 435 | | DataType::Date32 |
@@ -467,7 +468,6 @@ impl<'a> MutableArrayData<'a> { |
467 | 468 | } |
468 | 469 | // the dictionary type just appends keys and clones the values. |
469 | 470 | DataType::Dictionary(_, _) => vec![], |
470 | | - DataType::Float16 => unreachable!(), |
471 | 471 | DataType::Struct(fields) => match capacities { |
472 | 472 | Capacities::Struct(capacity, Some(ref child_capacities)) => { |
473 | 473 | array_capacity = capacity; |
|
0 commit comments