Skip to content

[CALCITE-7408] URL_ENCODE/URL_DECODE is unparsed incorrectly for ClickHouseSqlDialect#4784

Merged
xuzifu666 merged 1 commit intoapache:mainfrom
xuzifu666:ck_urlencode_support
Feb 10, 2026
Merged

[CALCITE-7408] URL_ENCODE/URL_DECODE is unparsed incorrectly for ClickHouseSqlDialect#4784
xuzifu666 merged 1 commit intoapache:mainfrom
xuzifu666:ck_urlencode_support

Conversation

@xuzifu666
Copy link
Member

@michaelmior
Copy link
Member

I'm not an expert in ClickHouse, but the documentation suggests ClickHouse calls these functions encodeURLComponent and decodeURLComponent. Since we're talking about changes to the ClickHouse dialect, it would be good to match these names.

@xuzifu666
Copy link
Member Author

I'm not an expert in ClickHouse, but the documentation suggests ClickHouse calls these functions encodeURLComponent and decodeURLComponent. Since we're talking about changes to the ClickHouse dialect, it would be good to match these names.

@michaelmior Thank you for the suggestion. Here's my understanding: this PR mainly addresses two things:

  1. It enables the ClickHouse Library to recognize the url_encode and url_decode functions;

  2. It accurately converts SQL from Calcite to the correct ClickHouse dialect, as explained in the documentation, for example, converting url_encode to encodeURLComponent.

Since this name is specific to the ClickHouse dialect, it seems unnecessary to introduce a function with the same implementation but a different name. This can be seen in RelToSqlConvertTest, where the dialect-converted name is correct. I wonder if you agree with my point of view.

@xiedeyantu
Copy link
Member

I agree with @michaelmior 's suggestion; it would be better not to enable libraries support for ClickHouse, and only perform dialect conversion. If users don't look closely, they might think ClickHouse supports URL_DECODE/URL_ENCODE. WDYT?

@michaelmior
Copy link
Member

@xuzifu666 Thanks for clarifying!

@xuzifu666 xuzifu666 changed the title [CALCITE-7408] Enable URL_ENCODE/URL_DECODE in ClickHouse Dialect [CALCITE-7408] URL_ENCODE/URL_DECODE is unparsed incorrectly for ClickHouseSqlDialect Feb 9, 2026
@xuzifu666 xuzifu666 force-pushed the ck_urlencode_support branch from d7728e5 to a236c9e Compare February 9, 2026 02:05
@xuzifu666
Copy link
Member Author

I have made the revisions according to your suggestions(Additionally, the names jira and pr have been changed.). If there are no further comments, I will merge this PR within 24 hours. @xiedeyantu @michaelmior

@xuzifu666 xuzifu666 added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Feb 9, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

@xuzifu666 xuzifu666 merged commit 8925773 into apache:main Feb 10, 2026
21 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants