| 374 | } |
| 375 | |
| 376 | fn decode_bytes(self, value: &[u8]) -> Result<Vec<u8>> { |
| 377 | match self { |
| 378 | Self::Base64 | Self::Base64Padded => { |
| 379 | BASE64_ENGINE.decode(value).map_err(|e| { |
| 380 | exec_datafusion_err!("Failed to decode value using {self}: {e}") |
| 381 | }) |
| 382 | } |
| 383 | Self::Hex => hex::decode(value).map_err(|e| { |
| 384 | exec_datafusion_err!("Failed to decode value using hex: {e}") |
| 385 | }), |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | // OutputOffset important to ensure Large types output Large arrays |
| 390 | fn encode_array<'a, InputBinaryArray, OutputOffset>( |