Search code examples
google-bigquery

How do I programatically create a BigQuery table from a Google Sheet from a command line?


I can create a BigQuery table based on Google Sheet by selecting the dataset hamburger menu.

How can I do this from the command line, either with one of the gdrive/bq commands or another program?


Solution

  • You can try creating the external tables by using the bq cli command to create a bigquery table based on the google sheet as per the documentation.

    To create an external table,

    use the bq mk command with the --external\_table\_definition flag . This flag contains either a path to a table definition file or an inline table definition.