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

Config rename_response_column to clickhouse connection #176

Open
mtieuso opened this issue Aug 3, 2023 · 2 comments
Open

Config rename_response_column to clickhouse connection #176

mtieuso opened this issue Aug 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mtieuso
Copy link

mtieuso commented Aug 3, 2023

I am trying this query

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)

And the result is

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

Is there any way/config to remove automatically the alias y. in the final response (without using y.a as a)?

In DBeaver, I can config rename_response_column=REMOVE_PREFIX in database connection.
but when I tried config in clickhouse's profile:

    ch:
      type: clickhouse
      name: ch
      schema: ch
      host: "{{ env_var('DBT_ENV_CH_HOST') }}"
      port: "{{ env_var('DBT_ENV_CH_PORT', '8123') | int }}"
      user: "{{ env_var('DBT_ENV_SECRET_CH_USER') }}"
      password: "{{ env_var('DBT_ENV_SECRET_CH_PASSWORD') }}"
      secure: False
      custom_settings:
        rename_response_column: REMOVE_PREFIX

There is an error:

10:35:36  Encountered an error:
Database Error
  Setting rename_response_column is unknown or readonly

How can I config this setting properly?

@mtieuso mtieuso added the enhancement New feature or request label Aug 3, 2023
@mtieuso
Copy link
Author

mtieuso commented Aug 4, 2023

seem the new setting is not handled by clickhouse-connect, I just create ticket for enhancement in ClickHouse/clickhouse-connect#228

@genzgd
Copy link
Contributor

genzgd commented Aug 4, 2023

Just a heads up, this is also not supported by the clickhouse-driver project (which dbt-clickhouse uses for native connections) or any other ClickHouse client that I'm aware of other than the Java/JDBC driver.

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

2 participants