partiql / partiql-tests

Test data for checking conformance to the PartiQL specification.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Normalize `date` and `time` value annotations

alancai98 opened this issue · comments

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

e.g.:

{ 'data_value': $time::{'hour':12, 'minute':12, 'second':12.1,'timezone_hour':null.int,'timezone_minute':null.int} },

While some other TIME values use an annotated string:

e.g.

logs: [{sensor:1, co:0.4, timestamp: $time::"04:05:06"}, // ex in spec used an undocumented timestamp
{sensor:1, co:0.2, timestamp: $time::"04:05:07"}, // syntax. changed to use time annotation
{sensor:1, co:0.5, timestamp: $time::"04:05:10"}, // in the test suite
{sensor:2, co:0.3}

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:

  • Also sort out the modeling of other time/timestamp types that use timezone

date is also modeled using a timestamp in some tests

{ 'data_value': $date::2021-08-22 },

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.

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