Skip to content

Commit

Permalink
fix(clickhouse): fix information_schema (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhucheung authored Jan 2, 2024
1 parent 6aa4800 commit 33ea58f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbgpt/datasource/rdbms/conn_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_indexes(self, table_name: str) -> List[Dict]:
"""
session = self.client

_query_sql = f"""
_query_sql = f"""
SELECT name AS table, primary_key, from system.tables where database ='{self.client.database}' and table = '{table_name}'
"""
with session.query_row_block_stream(_query_sql) as stream:
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_fields(self, table_name):
"""Get column fields about specified table."""
session = self.client

_query_sql = f"""
_query_sql = f"""
SELECT name, type, default_expression, is_in_primary_key, comment from system.columns where table='{table_name}'
""".format(
table_name
Expand Down Expand Up @@ -275,7 +275,7 @@ def table_simple_info(self):

_sql = f"""
SELECT concat(TABLE_NAME, '(', arrayStringConcat(groupArray(column_name), '-'), ')') AS schema_info
FROM information_schema.COLUMNS
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = '{self.get_current_db_name()}'
GROUP BY TABLE_NAME
"""
Expand Down

0 comments on commit 33ea58f

Please sign in to comment.