Is there a way to query the total number of columns in a BigQuery table? I went through the BigQuery documentation but did not find anything relevant.
Thanks in advance!
Using SQL query & built-in INFORMATION_SCHEMA tables:
SELECT count(distinct column_name)
FROM `project_id`.name_of_dataset.INFORMATION_SCHEMA.COLUMNS
WHERE table_name = "name_of_table"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With