Summary
evidence tables and evidence schema always fail against a BigQuery direct connector. The introspection query aliases a column to rows, which is a reserved keyword in BigQuery, so the query never parses.
Environment
- Evidence CLI v0.9.3 (
evidence upgrade confirms this is the latest)
- macOS 15.6 / arm64
- BigQuery direct connector via local
connection.yaml (not logged in to Studio)
Steps to reproduce
connection.yaml:
type: bigquery
project: my-project
keyfile: ./sa-key.json
location: EU
dataset: my_dataset
datasets:
- my_dataset
Actual
Syntax error: Unexpected keyword ROWS at [1:66]
evidence schema fails identically.
Cause
The CLI builds this query for the bigquery case:
SELECT table_id AS name, dataset_id AS schema_name, row_count AS rows
FROM `<project>`.`<dataset>`.__TABLES__ ORDER BY table_id
rows is a BigQuery reserved keyword. Character 66 is exactly where rows begins.
Confirmed by running both forms by hand:
$ evidence query "SELECT table_id AS name, dataset_id AS schema_name, row_count AS rows FROM \`p\`.\`d\`.__TABLES__"
Syntax error: Unexpected keyword ROWS at [1:81]
$ evidence query "SELECT table_id AS name, dataset_id AS schema_name, row_count AS \`rows\` FROM \`p\`.\`d\`.__TABLES__ LIMIT 3"
{"name":"ad_group","schema_name":"my_dataset","rows":0}
...
Suggested fix
Backtick the alias in the BigQuery branch:
SELECT table_id AS name, dataset_id AS schema_name, row_count AS `rows` FROM ...
The ClickHouse branch (total_rows AS rows) is fine — ClickHouse does not reserve rows.
Impact
Low severity but no workaround: the query is compiled into the CLI binary, so it cannot be overridden from config. Page rendering is unaffected — only the table-listing commands and anything downstream of them.
Possibly related
__TABLES__ only reflects tables and views with a materialized row_count; views report 0. If the intent is to list views too, INFORMATION_SCHEMA.TABLES may be a better source.
Summary
evidence tablesandevidence schemaalways fail against a BigQuery direct connector. The introspection query aliases a column torows, which is a reserved keyword in BigQuery, so the query never parses.Environment
evidence upgradeconfirms this is the latest)connection.yaml(not logged in to Studio)Steps to reproduce
connection.yaml:Actual
evidence schemafails identically.Cause
The CLI builds this query for the
bigquerycase:rowsis a BigQuery reserved keyword. Character 66 is exactly whererowsbegins.Confirmed by running both forms by hand:
Suggested fix
Backtick the alias in the BigQuery branch:
The ClickHouse branch (
total_rows AS rows) is fine — ClickHouse does not reserverows.Impact
Low severity but no workaround: the query is compiled into the CLI binary, so it cannot be overridden from config. Page rendering is unaffected — only the table-listing commands and anything downstream of them.
Possibly related
__TABLES__only reflects tables and views with a materializedrow_count; views report0. If the intent is to list views too,INFORMATION_SCHEMA.TABLESmay be a better source.