clickhouse-odbc icon indicating copy to clipboard operation
clickhouse-odbc copied to clipboard

Passing URL with parameters into url() table function

Open justulio opened this issue 5 years ago • 3 comments

When passing through ODBC driver a querry to url() table funtion the ? gets replaced by %7Bodbc_positional_1:Nullable%28Nothing%29%7D

justulio avatar Aug 25 '20 09:08 justulio

? has a special meaning in SQL queries in ODBC at least: https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/statement-parameters. Try escaping like this \?.

traceon avatar Aug 26 '20 20:08 traceon

I have tried escaping ? (and many other variants). If escaping character is used, the ? is preserved, however the character used to escape is also preserved. Meaning somedomain.com/page?parameter1=1 just becomes somedomain.com/page\?parameter1=1 And the url() function tries this and gets error.

justulio avatar Aug 27 '20 05:08 justulio

If I execute:

SELECT * FROM url('http://127.0.0.1:12345/?param1=value1', CSV, 'column1 String')

In ClickHouse log I see:

2020.08.27 13:05:01.438623 [ 8847190 ] {f75ffb28-4d5e-4aa8-835a-01436fab7e6d} <Debug> executeQuery: (from [::1]:58836) SELECT * FROM url('http://127.0.0.1:12345/?param1=value1', CSV, 'column1 String')

Could you please provide the exact query that doesn't work for you, as well as the client you are using?

traceon avatar Aug 27 '20 09:08 traceon