Casting arrays to VECTOR: Overflow now returns an error (Pending)¶
Attention
This behavior change is in the 2026_07 bundle.
For the current status of the bundle, refer to Bundle history.
When the 2026_07 behavior change bundle is enabled in your account, the behavior of casting an array
to a VECTOR (using the ::VECTOR or CAST( ... AS VECTOR( ... )) syntax) improves for array input
values that overflow the target type. For more information about the VECTOR data type and casting,
see VECTOR.
- Before the change:
- When casting an array to an
INTvector, values outside the INT32 range were silently truncated without an error. - When casting an array to a
FLOATvector, double-precision values that exceeded the float32 range were silently wrapped to ±Inf without an error.
- When casting an array to an
- After the change:
- INT overflow is now an error: Integer values that don’t fit in INT32 now return an explicit error instead of being silently truncated:
- FLOAT overflow is now an error: Double-precision values that exceed the float32 range now return an explicit error instead of being silently wrapped to ±Inf:
This can be a breaking change if you rely on either of the following behaviors:
- Large integers (outside the INT32 range of approximately ±2.1 billion) being silently truncated
when you cast to
VECTOR(INT, N). - Out-of-range double-precision values silently becoming ±Inf when you cast to
VECTOR(FLOAT, N).
If you’re affected, review the array values that you cast to VECTOR to make sure that all elements
are within the target type’s representable range before the bundle is enabled.
Ref: 2361