(value: &ScalarValue, encoding: Encoding)
| 246 | } |
| 247 | |
| 248 | fn decode_scalar(value: &ScalarValue, encoding: Encoding) -> Result<ColumnarValue> { |
| 249 | match value { |
| 250 | ScalarValue::Binary(maybe_bytes) |
| 251 | | ScalarValue::BinaryView(maybe_bytes) |
| 252 | | ScalarValue::FixedSizeBinary(_, maybe_bytes) => { |
| 253 | Ok(ColumnarValue::Scalar(ScalarValue::Binary( |
| 254 | maybe_bytes |
| 255 | .as_ref() |
| 256 | .map(|x| encoding.decode_bytes(x)) |
| 257 | .transpose()?, |
| 258 | ))) |
| 259 | } |
| 260 | ScalarValue::LargeBinary(maybe_bytes) => { |
| 261 | Ok(ColumnarValue::Scalar(ScalarValue::LargeBinary( |
| 262 | maybe_bytes |
| 263 | .as_ref() |
| 264 | .map(|x| encoding.decode_bytes(x)) |
| 265 | .transpose()?, |
| 266 | ))) |
| 267 | } |
| 268 | v => internal_err!("Unexpected value for decode: {v}"), |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /// Estimate how many bytes are actually represented by the array; in case the |
| 273 | /// the array slices it's internal buffer, this returns the byte size of that slice |
no test coverage detected
searching dependent graphs…