Skip to content

[CALCITE-7692] FLOOR/CEIL of INTERVAL produces wrong results - #5155

Merged
mihaibudiu merged 1 commit into
apache:mainfrom
mihaibudiu:issue7692
Aug 6, 2026
Merged

[CALCITE-7692] FLOOR/CEIL of INTERVAL produces wrong results#5155
mihaibudiu merged 1 commit into
apache:mainfrom
mihaibudiu:issue7692

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-7692

Changes Proposed

FLOOR/CEIL were only implemented correctly for INTERVAL LITERALS. This PR generalizes them to arbitrary intervals, using the convertlet table. The implementation bails out for non-deterministic functions - that should probably be handled in a different place for all such rewrites.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu

mihaibudiu commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

BTW: there are some (disabled) tests which use a two-argument FLOOR(timestamp TO qualifier); this two-argument FLOOR function is not supported by the validator, so I left them unsupported.

@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@xuzifu666 xuzifu666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@mihaibudiu
mihaibudiu merged commit b3527ee into apache:main Aug 6, 2026
20 checks passed
@mihaibudiu
mihaibudiu deleted the issue7692 branch August 6, 2026 03:37
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