mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
BigQuery: show column type on Schema Browser (#7257)
This commit is contained in:
@@ -304,7 +304,7 @@ class BigQuery(BaseQueryRunner):
|
||||
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')
|
||||
"""
|
||||
@@ -325,7 +325,7 @@ class BigQuery(BaseQueryRunner):
|
||||
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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user