Commit 96b33cf
committed
Omit zero-millis fractional in resolved date-math timestamps
The previous {@code "yyyy-MM-dd HH:mm:ss.SSSSSSSSS"} format always
emitted a 9-digit fractional component, which Calcite's TIMESTAMP
literal parser rejected with IllegalArgumentException on
{@code yyyy-MM-dd HH:mm:ss.000000000}-shape inputs. Round at
millisecond precision and emit the {@code .SSS} suffix only when
non-zero so whole-second values (epoch-millis ending in {@code 000},
{@code "now"} resolved on an exact-second boundary) match the
canonical PPL form the analyzer accepts.
Fixes {@code testSearchWithNumericTimeRange} which previously failed
with {@code IllegalArgumentException: "2025-08-01 03:47:41."} after
the visitor resolved {@code latest=1754020061} (whole-second
millis-since-epoch) to a {@code .000}-suffixed literal.
Signed-off-by: Kai Huang <ahkcs@amazon.com>1 parent 52ffeb8 commit 96b33cf
1 file changed
Lines changed: 9 additions & 1 deletion
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
518 | 526 | | |
519 | | - | |
| 527 | + | |
520 | 528 | | |
521 | 529 | | |
522 | 530 | | |
| |||
0 commit comments