@@ -150,15 +150,15 @@ function arrowtype(b, ::Type{Bool})
150150end
151151
152152struct Decimal{P,S,T}
153- value:: T # only Int128 or Int256
153+ value:: T # only Int32, Int64, Int128 or Int256
154154end
155155
156156Base. zero (:: Type{Decimal{P,S,T}} ) where {P,S,T} = Decimal {P,S,T} (T (0 ))
157157== (a:: Decimal{P,S,T} , b:: Decimal{P,S,T} ) where {P,S,T} = == (a. value, b. value)
158158Base. isequal (a:: Decimal{P,S,T} , b:: Decimal{P,S,T} ) where {P,S,T} = isequal (a. value, b. value)
159159
160160function juliaeltype (f:: Meta.Field , x:: Meta.Decimal , convert)
161- return Decimal{x. precision,x. scale,x. bitWidth == 256 ? Int256 : Int128}
161+ return Decimal{x. precision, x. scale, x. bitWidth == 256 ? Int256 : x . bitWidth == 128 ? Int128 : x . bitWidth == 64 ? Int64 : Int32 }
162162end
163163
164164ArrowTypes. ArrowKind (:: Type{<:Decimal} ) = PrimitiveKind ()
@@ -167,7 +167,7 @@ function arrowtype(b, ::Type{Decimal{P,S,T}}) where {P,S,T}
167167 Meta. decimalStart (b)
168168 Meta. decimalAddPrecision (b, Int32 (P))
169169 Meta. decimalAddScale (b, Int32 (S))
170- Meta. decimalAddBitWidth (b, Int32 (T == Int256 ? 256 : 128 ))
170+ Meta. decimalAddBitWidth (b, Int32 (T == Int256 ? 256 : T == Int128 ? 128 : T == Int64 ? 64 : 32 ))
171171 return Meta. Decimal, Meta. decimalEnd (b), nothing
172172end
173173
0 commit comments