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

CQL2: Clarify that DATE and TIMESTAMP literals are in basic, but not INTERVAL #720

Closed
jerstlouis opened this issue Jun 29, 2022 · 2 comments · Fixed by #728
Closed

CQL2: Clarify that DATE and TIMESTAMP literals are in basic, but not INTERVAL #720

jerstlouis opened this issue Jun 29, 2022 · 2 comments · Fixed by #728

Comments

@jerstlouis
Copy link
Member

It is still unclear whether temporal literals (DATE(...), TIMESTAMP(...), INTERVAL(...)) are allowed in Basic CQL2 or not.
There are several mentions and examples of dates, timestamps, and intervals in 6.3 and 6.5.
However, 6.2 clearly states:

The rule temporalPredicate is added by requirements class Temporal Operators.

temporalPredicate is the only grammar rule (other than arrayElement) introducing temporalExpression which itself is the only rule introducing temporalLiteral.

See also our summary of CQL2 conformance classes (where we assumed they are not) and related PR #708.

I point to #705 where I suggest that using rules to allow/disallow what is accepted what is possble, in addition to overly complicating the grammar, is frought with such difficulties in terms of specifying what each conformance classes allow as additional rules (1), as in that arrayElement example where e.g., if the server conforms to Array Operators, but not Temporal Operators, then actually a temporalExpression is not accepted as an arrayElement. Such combinations then become impossible to specify, in addition to the issues with the impossibility to specify the requirements in terms of runtime type checks of identifier expressions (2).

@jerstlouis
Copy link
Member Author

jerstlouis commented Jun 29, 2022

Sorry, I just realized that there is a separate temporalInstantExpression that is included in scalarExpression.

This kind of highlights our difficulty with the negated "what is not allowed in Basic CQL2" vs. the positive "what is allowed".
An unaware reader like myself might easily fall in the trap of assuming all "temporal literals" are excluded from basic.

I will update our summary to reflect this.

There are still several mentions of INTERVAL in 6.3.1 and 6.3.2 which are confusing however.

@jerstlouis jerstlouis reopened this Jun 29, 2022
@jerstlouis jerstlouis changed the title CQL2: Temporal Literals in Basic or not? CQL2: Clarify that DATE and TIMESTAMP literals are in basic, but not INTERVAL Jun 29, 2022
@cportele cportele added the CQL2 label Jul 1, 2022
@cportele cportele self-assigned this Jul 4, 2022
@cportele
Copy link
Member

cportele commented Jul 4, 2022

Meeting 2022-07-04: Move the INTERVAL examples in the type casts (6.3.2) to the temporal operators req class. Clarify also the reference to interval in 6.3.1 that this requires the temporal operators req. class. Make it very clear that timestamps and dates are supported, but intervals are not.

@cportele cportele moved this from To do to To be drafted in Part 3: Filtering / Common Query Language (CQL2) Jul 4, 2022
cportele added a commit that referenced this issue Jul 4, 2022
Move the INTERVAL examples in the type casts (6.3.2) to the temporal operators req class. Clarify also the reference to interval in 6.3.1 that this requires the temporal operators req. class. Make it very clear that timestamps and dates are supported, but intervals are not.

Closes #720
Part 3: Filtering / Common Query Language (CQL2) automation moved this from To be drafted to Done Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants