partiql / partiql-tests

Test data for checking conformance to the PartiQL specification.
Apache License 2.0
7 stars 1 forks source link

Normalize `date` and `time` value annotations #82

Open alancai98 opened 1 year ago

alancai98 commented 1 year ago

I noticed that some TIME values in the test data use an annotated struct:

e.g.: https://github.com/partiql/partiql-tests/blob/e24d8ef837303e675bc7c29b8a41f3cc81d6b96e/partiql-tests-data/eval/query/order-by.ion#L43

While some other TIME values use an annotated string:

e.g. https://github.com/partiql/partiql-tests/blob/e24d8ef837303e675bc7c29b8a41f3cc81d6b96e/partiql-tests-data/eval/spec-tests.ion#L755-L758

The partiql-tests spec proposal defines using the annotated string form: https://github.com/partiql/partiql-tests/blob/e24d8ef837303e675bc7c29b8a41f3cc81d6b96e/docs/partiql-tests-schema-proposal.md#modeling-partiql-types-in-ion.

These should likely be normalized to the same thing.

TODO:

alancai98 commented 1 year ago

date is also modeled using a timestamp in some tests

https://github.com/partiql/partiql-tests/blob/e24d8ef837303e675bc7c29b8a41f3cc81d6b96e/partiql-tests-data/eval/query/order-by.ion#L48

The spec proposal uses an annotated string: https://github.com/partiql/partiql-tests/blob/e24d8ef837303e675bc7c29b8a41f3cc81d6b96e/docs/partiql-tests-schema-proposal.md#modeling-partiql-types-in-ion.

alancai98 commented 1 year ago

Also need to normalize how PartiQL timestamps are to be represented in Ion (could be the same as Ion?)