Skip to content

Push down compatible to_char#244

Merged
theory merged 1 commit into
mainfrom
to-char
May 11, 2026
Merged

Push down compatible to_char#244
theory merged 1 commit into
mainfrom
to-char

Conversation

@serprex
Copy link
Copy Markdown
Member

@serprex serprex commented May 9, 2026

Translates PG to_char(timestamp[tz], fmt) to CH formatDateTime when fmt is a constant whose every keyword has CH equivalent: YYYY/YY, MM, DD, DDD, HH24, HH12/HH, MI, SS, Q, Mon, Dy, AM/PM, plus lowercase variants

@serprex serprex requested a review from theory May 9, 2026 06:22
@serprex serprex force-pushed the to-char branch 3 times, most recently from c2176f3 to b40dc1e Compare May 9, 2026 06:47
@serprex serprex added the functions Improve function pushdown label May 9, 2026
Copy link
Copy Markdown
Collaborator

@theory theory left a comment

Choose a reason for hiding this comment

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

Very nice, thank you. Please document it; would be nice to document exactly what translates and what doesn't.

Comment thread src/deparse.c
@theory theory added the pushdown Improvements to query pushdown label May 10, 2026
@serprex
Copy link
Copy Markdown
Member Author

serprex commented May 10, 2026

updated with docs

@serprex serprex requested a review from theory May 10, 2026 16:28
Comment thread doc/pg_clickhouse.md
Translate Postgres `to_char(timestamp[tz], fmt)`` to ClickHouse
`formatDateTime()` when `fmt` is a constant in which every formatting
keyword has a ClickHouse equivalent: `YYYY/YY`, `MM`, `DD`, `DDD`,
`HH24`, `HH12/HH`, `MI`, `SS`, `Q`, `Mon`, `Dy`,  and `AM/PM` --- plus
lowercase variants.
@theory theory merged commit d1a88fe into main May 11, 2026
36 checks passed
@theory theory deleted the to-char branch May 11, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Improve function pushdown pushdown Improvements to query pushdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants