Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestamp parsing #102

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

timestamp parsing #102

wants to merge 7 commits into from

Conversation

yliuuuu
Copy link
Contributor

@yliuuuu yliuuuu commented Jul 13, 2023

Issue #, if available:
#86

Description of changes:

  • Timestamp Parsing conformance Tests.
  • Kotlin Reference Implementation PR: Timestamp Data Model partiql-lang-kotlin#1121
  • PartiQL SHALL support Timestamp constructor. The timestamp literal SHALL conform to SQL Standard (YYYY-MM-DD hh:mm:ss.xxx...([+-]hh:mm)?) or RFC 3339 YYYY-MM-DDThh:mm:ss.xxx...([+-]hh:mm|[Z|z])?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yliuuuu yliuuuu requested a review from alancai98 July 13, 2023 20:50
Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice set of parsing and semantic analysis tests! Left all minor comments.

I may have missed some discussion regarding this but should the RFC3339 tests be part of the core conformance tests or the extended? The core conformance tests (i.e. non-extended directory) should just contain tests based off what the PartiQL spec/rfcs and SQL spec defines. The extended tests could be a good place to put tests that aren't defined in the PartiQL/SQL specs.

},
}

// TIMESTAMP WITHOUT TIME ZONE - RFC 3339 FORMAT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the SQL spec say anything about supporting the RFC 3339 format? Or is PartiQL supporting this additional timestamp format?

We could alternatively put these tests in the partiql-tests-data-extended folder since the conformance tests should just contain tests that PartiQL + SQL specify.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SQL spec does not say anything about RFC3339(particular unknown time zone) or even ISO 8601 (T as Date Time Delimiter and Z as Zulu Time Zone). However, I personally believe that PartiQL SHALL be supporting RFC 3339 format ( not an implementation decision as we promised to be a super set of ION and ION supports it).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also move those to the extension until the RFC up and approved if you think this is the better thing to do now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, the Ion syntax (i.e. using the backticks) is a different syntax than the one included in these tests (i.e. TIMESTAMP keyword followed by a string literal w/ the T between date and time elements) despite the contents within the backticks/quotes being the same. I think it we should move these tests to the extended directory for now. If the timestamp RFC is approved with the verbiage that PartiQL SHALL support this specific syntax (i.e. TIMESTAMP keyword followed by a string literal w/ the T between date and time elements), then we can move these tests back to the core conformance tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And just so we're clear, are you equating the SHALL keyword to what RFC2119 refers to as MUST/REQUIRED/SHALL:

1. MUST   This word, or the terms "REQUIRED" or "SHALL", mean that the
   definition is an absolute requirement of the specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, the Ion syntax (i.e. using the backticks) is a different syntax than the one included in these tests (i.e. TIMESTAMP keyword followed by a string literal w/ the T between date and time elements) despite the contents within the backticks/quotes being the same. I think it we should move these tests to the extended directory for now. If the timestamp RFC is approved with the verbiage that PartiQL SHALL support this specific syntax (i.e. TIMESTAMP keyword followed by a string literal w/ the T between date and time elements), then we can move these tests back to the core conformance tests.

I agree. Will move those. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And just so we're clear, are you equating the SHALL keyword to what RFC2119 refers to as MUST/REQUIRED/SHALL:

1. MUST   This word, or the terms "REQUIRED" or "SHALL", mean that the
   definition is an absolute requirement of the specification.

Yes.

@jpschorr jpschorr requested a review from alancai98 August 9, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants