(&'a self, idx: usize, packer: &'a mut RowPacker)
| 907 | |
| 908 | impl DatumColumnDecoder { |
| 909 | fn get<'a>(&'a self, idx: usize, packer: &'a mut RowPacker) { |
| 910 | let datum = match self { |
| 911 | DatumColumnDecoder::Bool(array) => array |
| 912 | .is_valid(idx) |
| 913 | .then(|| array.value(idx)) |
| 914 | .map(|x| if x { Datum::True } else { Datum::False }), |
| 915 | DatumColumnDecoder::U8(array) => array |
| 916 | .is_valid(idx) |
| 917 | .then(|| array.value(idx)) |
| 918 | .map(Datum::UInt8), |
| 919 | DatumColumnDecoder::U16(array) => array |
| 920 | .is_valid(idx) |
| 921 | .then(|| array.value(idx)) |
| 922 | .map(Datum::UInt16), |
| 923 | DatumColumnDecoder::U32(array) => array |
| 924 | .is_valid(idx) |
| 925 | .then(|| array.value(idx)) |
| 926 | .map(Datum::UInt32), |
| 927 | DatumColumnDecoder::U64(array) => array |
| 928 | .is_valid(idx) |
| 929 | .then(|| array.value(idx)) |
| 930 | .map(Datum::UInt64), |
| 931 | DatumColumnDecoder::I16(array) => array |
| 932 | .is_valid(idx) |
| 933 | .then(|| array.value(idx)) |
| 934 | .map(Datum::Int16), |
| 935 | DatumColumnDecoder::I32(array) => array |
| 936 | .is_valid(idx) |
| 937 | .then(|| array.value(idx)) |
| 938 | .map(Datum::Int32), |
| 939 | DatumColumnDecoder::I64(array) => array |
| 940 | .is_valid(idx) |
| 941 | .then(|| array.value(idx)) |
| 942 | .map(Datum::Int64), |
| 943 | DatumColumnDecoder::F32(array) => array |
| 944 | .is_valid(idx) |
| 945 | .then(|| array.value(idx)) |
| 946 | .map(|x| Datum::Float32(ordered_float::OrderedFloat(x))), |
| 947 | DatumColumnDecoder::F64(array) => array |
| 948 | .is_valid(idx) |
| 949 | .then(|| array.value(idx)) |
| 950 | .map(|x| Datum::Float64(ordered_float::OrderedFloat(x))), |
| 951 | DatumColumnDecoder::Numeric(array) => array.is_valid(idx).then(|| { |
| 952 | let val = array.value(idx); |
| 953 | let val = PackedNumeric::from_bytes(val) |
| 954 | .expect("failed to roundtrip Numeric") |
| 955 | .into_value(); |
| 956 | Datum::Numeric(OrderedDecimal(val)) |
| 957 | }), |
| 958 | DatumColumnDecoder::String(array) => array |
| 959 | .is_valid(idx) |
| 960 | .then(|| array.value(idx)) |
| 961 | .map(Datum::String), |
| 962 | DatumColumnDecoder::Bytes(array) => array |
| 963 | .is_valid(idx) |
| 964 | .then(|| array.value(idx)) |
| 965 | .map(Datum::Bytes), |
| 966 | DatumColumnDecoder::Date(array) => { |
no test coverage detected