Clarify truncating or rounding of fractions past milliseconds (Time, DateTime, ToTime, ToDateTime)
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- testing-qa
調査の方向性
Start with tests/cql/CqlTypesTest.xml and the TimeMillisParsing case, then check how this test suite represents DateTime literals and ToTime/ToDateTime conversions. The issue asks maintainers to decide truncation, rounding, and overflow behavior before adding cases for the listed boundary inputs; done means the expected behavior is clarified and covered by tests.
索引モデルが issue の本文から書いたものです。
説明
Question
When a Time or DateTime value carries more fraction digits than milliseconds, is it reduced by truncating or by rounding? And does the same rule hold for ToTime(String) and ToDateTime(String)? The specification says such a value is quantized but not how, and the suite has no case where the two readings differ. Engines can then disagree on results that change the second, the day or the year.
This continues #166, which proposes millisecond from @2017-12-21T02:00:00.1234 → 123 and notes that truncating and rounding both give 123 there.
What the specification says
CQL 1.5.3:
- Language Semantics, Table 5‑G, Millisecond: "999 milliseconds is the maximum required precision. Note that many operations require the ability to compute the “next” or “prior” instant, and these semantics depend on the step-size of 1 millisecond, so systems that support more than millisecond precision will need to quantize to the millisecond to achieve these semantics."
- Appendix B, Types, DateTime: "CQL supports date and time values in the range @0001-01-01T00:00:00.0 to @9999-12-31T23:59:59.999 with a 1 millisecond step size." Time has the same sentence for "@T00:00:00.0 to @T23:59:59.999".
- Appendix B,
ToTimeandToDateTime: the string is expected in the formhh:mm:ss.fffandYYYY-MM-DDThh:mm:ss.fff(Z|((+|-)hh:mm)).
"Quantize" does not say whether the extra digits are dropped or rounded.
What the tests say
tests/cql/CqlTypesTest.xml, test TimeMillisParsing, is the only case with more than three fraction digits:
<expression>@T23:59:59.10000</expression>
<output>@T23:59:59.100</output>
.10000 gives .100 under either reading.
Cases that are undecided
| Expression | Truncate | Round |
|---|---|---|
@T10:30:00.1239 |
@T10:30:00.123 |
@T10:30:00.124 |
@T23:59:59.9996 |
@T23:59:59.999 |
@T00:00:00.000, or an error, since there is no 24:00:00 |
@2020-12-31T23:59:59.9996Z |
@2020-12-31T23:59:59.999Z |
@2021-01-01T00:00:00.000Z |
@9999-12-31T23:59:59.9996Z |
@9999-12-31T23:59:59.999Z |
outside the required range |
And for the string conversions, where "not formatted correctly" gives null:
| Expression | Reduced like a literal | Rejected |
|---|---|---|
ToTime('10:30:00.1239') |
@T10:30:00.123 or .124 |
null |
ToDateTime('2020-12-31T23:59:59.9996Z') |
as the literal above | null |
Two sub-questions:
- Literals: truncate or round? If round, what is the result when rounding leaves the day (Time) or the required range (DateTime)?
ToTime(String),ToDateTime(String)andconvert: is a string with more than three fraction digits reduced like a literal, or is the resultnull?
The answer also settles, by analogy, values that reach CQL from a data model, such as a FHIR time or dateTime whose text has more than three fraction digits.
Request
A clarification of the intended behaviour, and test cases like the rows above once it is decided. I am happy to contribute the cases.
Generated by Claude Code
- 主要言語
- 言語のデータがありません
- スター
- 8
- フォーク
- 9
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cqframework/cql-tests のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cqframework/cql-tests#182 ·
メンテナーはふだん 5 日以内に返信
-
CqlComparisonOperatorsTest: NotEquivalentNullNull marks `null !~ null` invalid, where the specification gives it as false対応中かも @leftonmars が 13 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
cqframework/cql-tests#172 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cqframework/cql-tests#170 ·
メンテナーはふだん 5 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
cqframework/cql-tests#158 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
cqframework/cql-tests#157 ·
メンテナーはふだん 5 日以内に返信
cqframework/cql-tests の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"対応中かも @cestercian が今日担当しました。 オープンcomp/cli P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#162259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: ui priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
tetsuji16/microProject#1721 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
sagemathinc/sagebrush-agent#230 ·
メンテナーはふだん 1 日以内に返信
-
[fullsend] E2E: extensions — spec asserts extensions 1.2.0 UI but nightly deploys the RHDH-bundled extensions plugin対応中かも @fullsend-ai-coder が今日担当しました。 オープンe2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
redhat-developer/rhdh-plugin-export-overlays#4969 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信