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

Output duration values as ISO-8601, not Cassandra "standard" notation #1617

Open
tatu-at-datastax opened this issue Oct 29, 2024 · 1 comment · May be fixed by #1619
Open

Output duration values as ISO-8601, not Cassandra "standard" notation #1617

tatu-at-datastax opened this issue Oct 29, 2024 · 1 comment · May be fixed by #1619
Assignees

Comments

@tatu-at-datastax
Copy link
Contributor

Currently API Tables handling of CQL duration type:

  1. Accepts ISO-8601 duration formats (PnYnMnDTnHnMnS, like "PT1H30M", see https://en.wikipedia.org/wiki/ISO_8601) -- as well as Cassandra's "Standard" format (like "1h30m")
  2. Produces Cassandra style values.

But specification defines that output should be done using ISO-8601 format.

@tatu-at-datastax tatu-at-datastax self-assigned this Oct 29, 2024
@tatu-at-datastax
Copy link
Contributor Author

Hmmmh. This is more complicated than I thought: turns out JDK 8 has TWO separate types, neither of which covers full range of CQL duration:

  1. java.time.Duration: time-based amount of time (like "34.5 seconds") -- serialized like PT8H6M12.345S
  2. java.time.Period: date-based amount of time (like "2 years, 3 months and 4 days") -- serialized like P6Y3M1D

So essentially JDK types are not good representations to cover duration type.

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 a pull request may close this issue.

1 participant