Sync the supported ClickHouse functions page with mapping.py#17095
Open
ivannhadz wants to merge 1 commit into
Open
Sync the supported ClickHouse functions page with mapping.py#17095ivannhadz wants to merge 1 commit into
ivannhadz wants to merge 1 commit into
Conversation
The page describes itself as the list of "enabled ClickHouse functions" and cites mapping.py as its source, but it had drifted from the engine. - Add 17 enabled-but-undocumented functions to their existing sections (greatest, least, rand, throwIf, JSONExtract, JSONExtractKeysAndValues, geohashEncode, split_part, to_char, to_date, to_timestamp, make_date, timezone, fromUnixTimestamp64Milli, toNullableString, toUUIDOrDefault, languageCodeToName) - Fix typo: make_timestampz -> make_timestamptz - Remove JSONExtractKey, which is not a registered function (the engine rejects it; JSONExtractKeys is the real one and was already listed) Verified each added function executes against a live PostHog instance, and confirmed the engine rejects the removed JSONExtractKey. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Author
|
Small docs-only change: syncs the Supported ClickHouse functions page with the functions actually enabled in mapping.py (17 missing functions added, 2 errors fixed). Each added function was verified to execute against a live PostHog instance. CI is blocked on first-run workflow approval. cc @PostHog/hogql - would appreciate a look when you have a moment. 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
The Supported ClickHouse functions page describes itself as the list of "enabled ClickHouse functions" and links to
mapping.pyas its source of truth — but it had drifted from the engine. (posthog/hogql/functions/clickhouse/strings.pyeven carries the comment "Keep in sync with the posthog.com repository: contents/docs/sql/clickhouse-functions.mdx".)This reconciles the page with the functions HogQL actually enables.
Added 17 enabled-but-undocumented functions, each in its existing section:
toNullableString,toUUIDOrDefaulttimezone,fromUnixTimestamp64Milli,make_date,to_char,to_date,to_timestampJSONExtract,JSONExtractKeysAndValuesthrowIfrandsplit_partgeohashEncodegreatest,least,languageCodeToNameFixed 2 errors:
make_timestampz→make_timestamptz(typo)JSONExtractKey— not a registered function (the engine rejects it);JSONExtractKeysis the real one and was already listed.How this was verified
posthog/hogql/functions/(the file the page already cites as its source).greatest(1, 2)→2,languageCodeToName('en')→English,split_part('a,b,c', ',', 2)→b).JSONExtractKeyis rejected by the engine as an "Unsupported function call."Scope is intentionally limited to clearly-missing, user-facing functions; internal UDFs (e.g.
aggregate_funnel*) are excluded.Agent context
Drafted with help from Claude (Claude Code). I've reviewed every change, understand each function, and verified them against the engine and a live instance as above.
Checklist
vercel.json(N/A — no page moved)