vortex_compute/cast/
decimal.rs1use vortex_dtype::DType;
5use vortex_error::VortexResult;
6use vortex_vector::Scalar;
7use vortex_vector::Vector;
8use vortex_vector::decimal::DecimalScalar;
9use vortex_vector::decimal::DecimalVector;
10use vortex_vector::match_each_dscalar;
11use vortex_vector::match_each_dvector;
12
13use crate::cast::Cast;
14
15impl Cast for DecimalVector {
16 type Output = Vector;
17
18 fn cast(&self, target_dtype: &DType) -> VortexResult<Vector> {
20 match_each_dvector!(self, |v| { Cast::cast(v, target_dtype) })
21 }
22}
23
24impl Cast for DecimalScalar {
25 type Output = Scalar;
26
27 fn cast(&self, target_dtype: &DType) -> VortexResult<Scalar> {
29 match_each_dscalar!(self, |s| { Cast::cast(s, target_dtype) })
30 }
31}