Skip to content

Commit 655d318

Browse files
bug[decimal]: to arrow use precision not scale to decide arrow type (#3577)
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 873849f commit 655d318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vortex-dtype/src/arrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use std::sync::Arc;
1414

1515
use arrow_schema::{
16-
DECIMAL128_MAX_SCALE, DataType, Field, FieldRef, Fields, Schema, SchemaBuilder, SchemaRef,
16+
DECIMAL128_MAX_PRECISION, DataType, Field, FieldRef, Fields, Schema, SchemaBuilder, SchemaRef,
1717
};
1818
use vortex_error::{VortexExpect, VortexResult, vortex_bail, vortex_err};
1919

@@ -177,7 +177,7 @@ impl DType {
177177
PType::F64 => DataType::Float64,
178178
},
179179
DType::Decimal(dt, _) => {
180-
if dt.scale() > DECIMAL128_MAX_SCALE {
180+
if dt.precision() > DECIMAL128_MAX_PRECISION {
181181
DataType::Decimal256(dt.precision(), dt.scale())
182182
} else {
183183
DataType::Decimal128(dt.precision(), dt.scale())

0 commit comments

Comments
 (0)