partiql / partiql-lang

The PartiQL language specification
https://partiql.org/partiql-lang
Other
10 stars 1 forks source link

Define automatic type coercion #40

Open dlurton opened 4 years ago

dlurton commented 4 years ago

Because it is not part of the the specification, the PartiQL reference implementation has made some decisions regarding automatic type coercion during expression evaluation. For example, for arithmetic operations involving numeric types, the following conversions apply:

Type 1 Type 2 Result Type
FLOAT FLOAT FLOAT
FLOAT DECIMAL DECIMAL
FLOAT INT FLOAT
DECIMAL DECIMAL DECIMAL
DECIMAL INT DECIMAL
INT DECIMAL DECIMAL

We should decide if this is what is best for PartiQL and include it in the specification.