Open findepi opened 3 years ago
I updated the description with the checklist. @prestosql/maintainers please update if any more checks we should add come to your mind.
We still need to add checks for decimal
.
So far @ksobolew added a check flagging "negative zero", but we also need precision/scale checks.
cc @ksobolew @lukasz-stec
io.prestosql.sql.query.QueryAssertions#expression(java.lang.String)
+matches
can pass eveb when value is not correct for given type: eg not properly truncated (char with trailing spaces), or not properly rounded (timestamp with not max precision).See https://github.com/prestosql/presto/issues/5736#issuecomment-718846167 for example.
Implementation plan:
Add checks within (explicitly or implicitly)
io.prestosql.spi.type.Type#getObjectValue
implementations:decimal
scale, precision checkschar
length check, padding spaces stripped check https://github.com/prestosql/presto/pull/5743varchar
length check https://github.com/prestosql/presto/pull/5743time
andtime with time zone
precision checkstimestamp
andtimestamp with time zone
precision checks https://github.com/prestosql/presto/pull/5742 (https://github.com/prestosql/presto/pull/5742/commits/ba17097e495544fdb633c327a8c548f5858f54d4)