Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new setting rename_response_column #228

Open
mtieuso opened this issue Aug 4, 2023 · 0 comments
Open

Support new setting rename_response_column #228

mtieuso opened this issue Aug 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mtieuso
Copy link

mtieuso commented Aug 4, 2023

In clickhouse-java, there is a setting rename_response_column for renaming the column's names https://github.com/ClickHouse/clickhouse-java/pull/923/files
But the config is not support yet in python client:

ch_conf = {
    'host': CH_HOST,
    'port': CH_PORT,
    'username': CH_USER,
    'password': CH_PASSWORD,
    'rename_response_column': 'REMOVE_PREFIX',
}

-----------------------------------------------------------------------
    105                     name = name[3:]
    106                 settings[name] = value
--> 107     return HttpClient(interface, host, port, username, password, database, settings=settings, **kwargs)
    108 raise ProgrammingError(f'Unrecognized client type {interface}')

TypeError: __init__() got an unexpected keyword argument 'rename_response_column'    105                     name = name[3:]
    106                 settings[name] = value
--> 107     return HttpClient(interface, host, port, username, password, database, settings=settings, **kwargs)
    108 raise ProgrammingError(f'Unrecognized client type {interface}')

TypeError: __init__() got an unexpected keyword argument 'rename_response_column'

How I can rename column with Alias without using X.name as name?

Example:

with 
	x as (select 1 as a, 2 as id),
	y as (select 1 as a, 3 as id)
select
	y.a,
	y.id
from 
	x
	join y using (a)

will return:

y.a|y.id|
---+----+
 1|   3|

but the expected will be:

 a| id|
---+----+
 1|   3|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant