I am trying to create a table in BigQuery with partitioning and clustering:
bq mk --table \
--description "My table" \
--schema $absolute_path \
--clustering_fields user_email,referenced_project_id \
--label label_app:bigquery-stats \
--time_partitioning_field creation_time \
--time_partitioning_type DAY \
--require_partition_filter true \
gcp-project.dataset.table
But I am getting the following error:
Too many positional args, still have ['gcp-project.dataset.table']
I tried re-arranging the flags but could not fix it.
I think your
bq mkcommand is ok except for the last linegcp-project.dataset.table. Based on the documentation, the project ID and dataset should be separated by a colon (:) instead of a dot/ period.Try
gcp-project:dataset.tableI found a similar post which also follows the same structure as
PROJECT_ID:DATASET.TABLE.Sample: