Skip to content

Commit

Permalink
BigQuery: show column type on Schema Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshiokatsuneo committed Dec 19, 2024
1 parent d884da2 commit aca3cdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redash/query_runner/big_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def get_schema(self, get_stats=False):
datasets = self._get_project_datasets(project_id)

query_base = """
SELECT table_schema, table_name, field_path
SELECT table_schema, table_name, field_path, data_type
FROM `{dataset_id}`.INFORMATION_SCHEMA.COLUMN_FIELD_PATHS
WHERE table_schema NOT IN ('information_schema')
"""
Expand All @@ -325,7 +325,7 @@ def get_schema(self, get_stats=False):
table_name = "{0}.{1}".format(row["table_schema"], row["table_name"])
if table_name not in schema:
schema[table_name] = {"name": table_name, "columns": []}
schema[table_name]["columns"].append(row["field_path"])
schema[table_name]["columns"].append({"name": row["field_path"], "type": row["data_type"]})

return list(schema.values())

Expand Down

0 comments on commit aca3cdb

Please sign in to comment.