Closed andrewemeryanz closed 4 years ago
float32 is not needed for cloud spanner. Spanner supports only float64. https://cloud.google.com/spanner/docs/data-types
A description of the current support of numeric, string and byte types:
d <: decimal # primitive: DECIMAL
dx <: decimal(4) # primitive: DECIMAL, constraint: { length: { max: 4 } }
dxy <: decimal(4.8) # primitive: DECIMAL, constraint: { length: { max: 4 }, precision: 4, scale: 8 }
dxxy <: decimal(4..8) # primitive: DECIMAL, constraint: { length: { min: 4, max: 8 } }
i <: int # primitive: INT
ix <: int(4) # primitive: INT, constraint: { length: { max: 4 } }
ixy <: int(4.8) # primitive: INT, constraint: { length: { max: 4 } }
ixxy <: int(4..8) # primitive: INT, constraint: { length: { min: 4, max: 8 } }
i32 <: int32 # primitive: INT, constraint: { range: { min: { i: -2147483648 }, max: { i: 2147483647 } } }
i32x <: int32(4) # primitive: INT, constraint: { length: { max: 4 } }
i32xy <: int32(4.8) # primitive: INT, constraint: { length: { max: 4 } }
i32xxy <: int32(4..8) # primitive: INT, constraint: { length: { min: 4, max: 8 } }
i64 <: int64 # primitive: INT, constraint: { range: { min: { i: -9223372036854775808 }, max: { i: 9223372036854775807 } } }
i64x <: int64(4) # primitive: INT, constraint: { length: { max: 4 } }
i64xy <: int64(4.8) # primitive: INT, constraint: { length: { max: 4 } }
i64xxy <: int64(4..8) # primitive: INT, constraint: { length: { min: 4, max: 8 } }
f <: float # primitive: FLOAT
fx <: float(4) # parse error
fxy <: float(4.8) # parse error
fxxy <: float(4..8) # parse error
s <: string # primitive: STRING
sx <: string(4) # primitive: STRING, constraint: { length: { max: 4 } }
sxy <: string(4.8) # primitive: STRING, constraint: { length: { max: 4 } }
sxxy <: string(4..8) # primitive: STRING, constraint: { length: { max: 8 } }
b <: bytes # primitive: BYTES
bx <: bytes(4) # parse error
bxy <: bytes(4.8) # parse error
bxxy <: bytes(4..8) # parse error
The following changes should be made:
int32 bitWidth
value within the Constraint
type.bitWidth
of int32
and int64
types to be 32
and 64
respectively.float32
and float64
types setting the bitWidth
to be 32
and 64
respectively.This should result in the following values:
i32 <: int32 # primitive: INT, constraint: { bitWidth: 32, range: { min: { i: -2147483648 }, max: { i: 2147483647 } } }
i32x <: int32(4) # primitive: INT, constraint: { bitWidth: 32, length: { max: 4 } }
i32xy <: int32(4.8) # primitive: INT, constraint: { bitWidth: 32, length: { max: 4 } }
i32xxy <: int32(4..8) # primitive: INT, constraint: { bitWidth: 32, length: { min: 4, max: 8 } }
i64 <: int64 # primitive: INT, constraint: { bitWidth: 64, range: { min: { i: -9223372036854775808 }, max: { i: 9223372036854775807 } } }
i64x <: int64(4) # primitive: INT, constraint: { bitWidth: 64, length: { max: 4 } }
i64xy <: int64(4.8) # primitive: INT, constraint: { bitWidth: 64, length: { max: 4 } }
i64xxy <: int64(4..8) # primitive: INT, constraint: { bitWidth: 64, length: { min: 4, max: 8 } }
f32 <: float32 # primitive: FLOAT, constraint: { bitWidth: 32 }
f64 <: float64 # primitive: FLOAT, constraint: { bitWidth: 64 }
Description
Sysl currently includes support for
int
,int32
,int64
andfloat
primitive types.Support for
float32
andfloat64
types should be added.Steps to Reproduce
The current behaviour is to regard
float32
andfloat64
as custom types:Expected behavior
Actual behavior
Your Environment