[ 
https://issues.apache.org/jira/browse/CALCITE-7408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yu Xu updated CALCITE-7408:
---------------------------
    Summary: URL_ENCODE/URL_DECODE is unparsed incorrectly for 
ClickHouseSqlDialect  (was: Enable URL_ENCODE/URL_DECODE in ClickHouse Dialect)

> URL_ENCODE/URL_DECODE is unparsed incorrectly for ClickHouseSqlDialect
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-7408
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7408
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.41.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.42.0
>
>
> test:
> {code:java}
> @Test void testUrlencodeAndUrldecodeForClickHouse() {
>   final String query = "SELECT URL_ENCODE(\"product_name\") from \"product\"";
>   final String expected = "SELECT URL_ENCODE(\"product_name\" from 
> \"product\")";
>   sql(query).withClickHouse().ok(expected);
>   final String query1 = "SELECT URL_DECODE(\"product_name\") from 
> \"product\"";
>   final String expected1 = "SELECT URL_DECODE(\"product_name\" from 
> \"product\")";
>   sql(query1).withClickHouse().ok(expected1);
> } {code}
> error:
> {code:java}
> Caused by: org.apache.calcite.sql.validate.SqlValidatorException: No match 
> found for function signature URL_ENCODE(<CHARACTER>)       at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)     at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
>       at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>       at 
> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
>   at 
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)    
> at 
> org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511)  
> at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:605)   ... 
> 84 more {code}
>  
> The URL_ENCODE/URL_DECODE functions are not currently supported in Calcite 
> ClickHouse Dialect.
> we can also refer to:
> [https://clickhouse.com/docs/sql-reference/functions/url-functions#encodeURLComponent|https://clickhouse.com/docs/sql-reference/functions/url-functions#decodeURLComponent]
> https://clickhouse.com/docs/sql-reference/functions/url-functions#decodeURLComponent



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to