PartiQL Parser defaults ordering_spec
and nulls_spec
in the sort_spec
AST
#832
Labels
bug
Something isn't working
ordering_spec
and nulls_spec
in the sort_spec
AST
#832
Description
Since #554, the Parser has defaulted the produced AST's
ordering_spec
andnulls_spec
in thesort_spec
.The AST allows both
ordering_spec
andnulls_spec
to be null within thesort_spec
:-- from https://github.com/partiql/partiql-lang-kotlin/blob/main/lang/resources/org/partiql/type-domains/partiql.ion#L341-L353
But the parser automatically populates these parts of the AST with the appropriate defaults if not provided, as asserted by the following test example:
partiql-lang-kotlin/lang/test/org/partiql/lang/syntax/SqlParserTest.kt
Lines 1853 to 1866 in 58e908d
So, though nullable, these fields are effectively never null.
This can cause issues for customers who wish to pre-process or validate the AST, as it is unclear whether the sort spec and nulls spec are user-supplied or defaulted.
Expected Behavior
It should be possible to move the defaulting the creation of the evaluator and preserve the query-writers intent in the AST.
Additional Context
The text was updated successfully, but these errors were encountered: