Today the planner only has a cast_decimal(v) function which is used in coercions but does not support parameters. This PR adds cast_decimal(v, p, s) along with using the parameters in typing judgements.
CAST(v AS DECIMAL) -- arbitrary precision/scale decimal
CAST(v AS DECIMAL(P)) -- decimal with precision = P and scale = 0
CAST(v AS DECIMAL(P,S)) -- decimal with precision = P and scale = S
-- | AST | Plan
--------------------------------|----------------------
CAST(v AS DECIMAL) -- | cast_decimal(v)
CAST(v AS DECIMAL(P)) -- | cast_decimal(v, P, 0)
CAST(v AS DECIMAL(P,S)) -- | cast_decimal(v, P, S)
Other Information
Updated Unreleased Section in CHANGELOG: [YES/NO]
No
Relevant Issues
974
Description
Today the planner only has a
cast_decimal(v)
function which is used in coercions but does not support parameters. This PR addscast_decimal(v, p, s)
along with using the parameters in typing judgements.Other Information
Updated Unreleased Section in CHANGELOG: [YES/NO] No
Any backward-incompatible changes? [YES/NO] No
Any new external dependencies? [YES/NO] No
Do your changes comply with the Contributing Guidelines and Code Style Guidelines? [YES/NO] Yes
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.