bigquery library
BigQuery datasets, tables, jobs, routines, transfers, reservations, capacity commitments, external connections, and per-resource IAM bindings.
Classes
- Access
-
Discriminated-union base for one
accessblock entry. - AccessCondition
-
access.condition— CEL binding restricting when an access entry applies. expression is the CEL source; the other three fields are metadata for debugging / UI surfaces. - AccessDataset
-
accessentry referring to a dataset (transitive read for resource types listed intargetTypes). - AccessDomain
-
accessentry granting role to all members of domain. - AccessGroupByEmail
-
accessentry granting role to groupByEmail. - AccessIamMember
-
accessentry granting role to an arbitrary IAM principal (e.g.allUsers, service identities) via iamMember. - AccessRoutine
-
accessentry referring to a BigQuery routine. Role is not required. - AccessSpecialGroup
-
accessentry granting role to specialGroup. Documented values includeprojectOwners,projectReaders,projectWriters,allAuthenticatedUsers(BigQuery treats these as case-sensitive). - AccessUserByEmail
-
accessentry granting role to userByEmail. - AccessView
-
accessentry referring to a BigQuery view. Granting view access lets queries against the view read tables in this dataset. Role is not required for view bindings. - AvroOptions
-
external_data_configuration.avro_optionssub-block. useAvroLogicalTypes is required by the provider schema. - BiglakeConfiguration
-
biglake_configurationblock (max=1). Promotes the table to a BigLake managed table — BigQuery stores metadata-only snapshots while the actual data lives at storageUri in fileFormat + tableFormat (typically Parquet + Iceberg). - BigqueryConnectionAws
-
awsblock — BigQuery Omni federation into AWS (S3 / Glue, BigLake- on-AWS). The BigQuerylocationmust beaws-us-east-1. - BigqueryConnectionAwsAccessRole
-
aws.access_roleblock — IAM role the Google-owned AWS identity assumes when reading from S3 / Glue on behalf of BigQuery. - BigqueryConnectionAzure
-
azureblock — BigQuery Omni federation into Azure Data Lake Storage. The BigQuerylocationmust beazure-eastus2. Most fields are computed and consumed by the Azure side of the federation bridge; only customerTenantId is required input. - BigqueryConnectionCloudResource
-
cloud_resourceblock — generic delegation for cross-project reads (BigLake tables over Cloud Storage in a different project, etc.). The block is empty on input; after apply,cloud_resource.service_account_idsurfaces the connection's Google-managed service account, which the consuming project must grant access to. - BigqueryConnectionCloudSpanner
-
cloud_spannerblock — federated reads against a Cloud Spanner database. The connection's BigQuery region must match the Spanner region. - BigqueryConnectionCloudSql
-
cloud_sqlblock — federated queries against a Cloud SQL Postgres or MySQL instance. - BigqueryConnectionCloudSqlCredential
-
cloud_sql.credentialblock — username / password the BigQuery federation layer presents to the Cloud SQL instance. The password is schema-flaggedsensitive: trueand is masked on synth. - BigqueryConnectionConfiguration
-
configurationblock — BigQuery Connector framework. Picks an upstream engine via connectorId (google-alloydb,google-cloudsql-mysql,google-cloudsql-postgres, and other ids supported by the framework) and wires it through asset / authentication / endpoint / network blocks. - BigqueryConnectionConfigurationAsset
-
configuration.assetblock — points the connector at a Google Cloud resource (AlloyDB cluster / instance, etc.). - BigqueryConnectionConfigurationAuthentication
-
configuration.authenticationblock — authentication configuration for the connector. Output-onlyservice_accountis consumed via the generated factory state, not a constructor input. - BigqueryConnectionConfigurationAuthenticationPassword
-
configuration.authentication.username_password.passwordblock — holds the plaintext password the connector forwards to the upstream engine.plaintextis schema-flagged sensitive and masked on synth. - BigqueryConnectionConfigurationAuthenticationUsernamePassword
-
configuration.authentication.username_passwordblock — username / password authentication for the connector framework. - BigqueryConnectionConfigurationEndpoint
-
configuration.endpointblock — host:port override for the connector's upstream endpoint (when the default endpoint derived from BigqueryConnectionConfigurationAsset is not appropriate). - BigqueryConnectionConfigurationNetwork
-
configuration.networkblock — network configuration for the connector. The schema only exposesprivate_service_connecttoday. - BigqueryConnectionConfigurationNetworkPrivateServiceConnect
-
configuration.network.private_service_connectblock — Private Service Connect network attachment for connector traffic. - BigqueryConnectionSpark
-
sparkblock — stored procedures for Apache Spark on BigQuery. The block is empty-by-default on input; provide nested metastoreServiceConfig / sparkHistoryServerConfig only when the procedures need to read Hive tables or surface history-server logs. - BigqueryConnectionSparkMetastoreServiceConfig
-
spark.metastore_service_configblock — optional binding to a Dataproc Metastore service so Spark stored procedures see Hive tables. - BigqueryConnectionSparkSparkHistoryServerConfig
-
spark.spark_history_server_configblock — optional binding to a Dataproc Cluster acting as Spark History Server for the connection. - BigqueryDataTransferConfigEmailPreferences
-
email_preferencesblock (max=1) — controls failure-email delivery to the user who owns the transfer config. The owner is the identity that created the resource (or the service account inGoogleBigqueryDataTransferConfig.serviceAccountNamewhen set). - BigqueryDataTransferConfigEncryptionConfiguration
-
encryption_configurationblock (max=1) — CMEK key used to encrypt data written by this transfer config to the destination dataset. When unset, the dataset'sdefault_encryption_configuration.kms_key_name(if any) applies; if neither is set, Google-managed encryption is used. - BigqueryDataTransferConfigScheduleOptions
-
schedule_optionsblock (max=1) — fine-grained overrides for the cron schedule defined on the parentGoogleBigqueryDataTransferConfig.scheduleslot. - BigqueryDataTransferConfigSensitiveParams
-
sensitive_paramsblock (max=1) — credential slot for theamazon_s3data source (and any future DTS connector that needs out-of-band secrets). The block is named "sensitive_params" because the keys it carries logically belong to the parentGoogleBigqueryDataTransferConfig.paramsmap; placing them here instead lets the provider flag them sensitive (so they are masked in plan output) and prevents accidental disclosure via state inspection. - BigqueryJobCopy
-
copyjob-type block. Copies one or more sourceTables into a single destinationTable. Schema requiresmin_items=1onsource_tables. Shares createDisposition / writeDisposition semantics with the other job types. - BigqueryJobDefaultDataset
-
query.default_dataset—{project_id, dataset_id}pair used as the default dataset for unqualified table references in the SQL text.datasetIdis required. - BigqueryJobDestinationTable
-
Generic
{project_id, dataset_id, table_id}reference. Used byquery.destination_table,load.destination_table,extract.source_table,copy.destination_table, and each entry incopy.source_tables.tableIdis required;projectIdanddatasetIdare optional (the provider defaults them from the surrounding project context). - BigqueryJobEncryptionConfiguration
-
query.destination_encryption_configuration/load.destination_encryption_configuration/copy.destination_encryption_configuration— CMEK key applied to the destination table.kmsKeyVersionis computed (returned by the API after the job runs); onlykmsKeyNameis settable here. - BigqueryJobExtract
-
extractjob-type block. Exports either a table (sourceTable) or an ML model (sourceModel) to one or more Cloud Storage destinations (destinationUris, required). Provide exactly one ofsourceTable/sourceModel. - BigqueryJobLoad
-
loadjob-type block. Required fields: sourceUris (GCS source pattern) and destinationTable (the schema marks the innertable_idrequired, and the block itself ismin_items=1). - BigqueryJobParquetOptions
-
load.parquet_options(max_items=1) — Parquet-specific load behavior. - BigqueryJobQuery
-
queryjob-type block. Required field: query (the SQL text). All other fields are optional. When destinationTable is set, the query result is materialized to that table according to createDisposition / writeDisposition. - BigqueryJobQueryConnectionProperty
-
One entry under
query.connection_properties—(key, value)pair (e.g.("time_zone", "America/Los_Angeles")). - BigqueryJobScriptOptions
-
query.script_options(max_items=1) — multi-statement script execution behavior. - BigqueryJobSourceModel
-
extract.source_model— fully qualified BigQuery ML model reference. All three fields are required by the schema. - BigqueryJobTimePartitioning
-
load.time_partitioning(max_items=1) — applies partitioning to the destination table on first create. Required: type (onlyDAYis documented as supported by BigQuery today). field names the column to partition on; omit for ingestion-time partitioning. - BigqueryJobUserDefinedFunctionResource
-
One entry under
query.user_defined_function_resources. Provide either resourceUri (GCS URI to a .js file) or inlineCode — not both. - BigqueryReservationAutoscale
-
autoscaleblock — enables pay-as-you-go slot scaling on top of theslotCapacityfloor. maxSlots caps the dynamic upper bound; the API reports the livecurrent_slotsvalue back through theautoscale.current_slotscomputed attribute (not surfaced here — read via the underlying state if needed). - BigqueryRoutineArgument
-
One entry of the
argumentsblock (repeatable list). dataType is a JSON-encoded BigQuery type string; omit it only when argumentKind = BigqueryRoutineArgumentKind.anyType. mode is procedure-only; leave it null for scalar / TVF functions. - BigqueryRoutineRemoteFunctionOptions
-
remote_function_optionsblock (max=1). Required when BigqueryRoutineType.scalarFunction is backed by a remote service (Cloud Functions / Cloud Run). endpoint points at the HTTPS URL of the function; connection is the fully-qualified BigQuery connection (projects/{p}/locations/{l}/connections/{c}) holding the credential. - BigqueryRoutineSparkOptions
-
spark_optionsblock (max=1). Required whenlanguageisPYTHON,JAVA, orSCALA. connection points at a BigQuery Spark connection. The remaining fields configure the Spark application — exactly one of mainClass / mainFileUri must be set for Java / Scala; PySpark uses mainFileUri ordefinitionBody. - ColumnReferences
-
Inner
column_referencesblock of a foreign key constraint — pairs one referencing column with the referenced primary-key column. - CsvOptions
-
external_data_configuration.csv_optionssub-block.quoteis required by the provider (Terraform escapes the API default"as\"; pass an empty string when the data has no quoted sections). - DatasetAccessChild
-
access.datasetsub-block — pairs a dataset reference with the targetTypes this binding applies to (currently onlyVIEWS). - DatasetReference
-
access.dataset.datasetandaccess.routineprojectId+datasetId pair. - DatasetRoutineRef
-
access.routinesub-block — fully qualified BigQuery routine reference. - DatasetView
-
access.viewsub-block — fully qualified BigQuery view reference. - DefaultEncryptionConfiguration
-
default_encryption_configurationblock — CMEK key for tables that do not specify their own encryption. - EncryptionConfiguration
-
encryption_configurationblock (max=1). Attaches a CMEK key to the table; the default BigQuery service account needs encrypt/decrypt rights on kmsKeyName.kmsKeyVersionis computed by GCP and surfaced via the wrapper'skmsKeyVersionRefgetter (not here). - ExternalCatalogDatasetOptions
-
external_catalog_dataset_optionsblock — open-source catalog metadata for datasets bridged from Iceberg / Hive Metastore-compatible sources. - ExternalDataConfiguration
-
external_data_configurationblock (max=1). Configures a federated external table — BigQuery reads data in-place from the source store (GCS / Bigtable / Drive / S3 via connection) at query time rather than ingesting it. - ExternalDatasetReference
-
external_dataset_referenceblock — points the dataset at an externally-managed source (e.g. AWS Glue) via connection. - ForeignKey
-
One entry of
table_constraints.foreign_keys. Each entry binds one referencing column to one referenced column in referencedTable; composite foreign keys are represented by multiple entries with the same referencedTable. - GoogleBigqueryCapacityCommitment
-
Factory wrapper for
google_bigquery_capacity_commitment(providerhashicorp/google ~> 7.0). - GoogleBigqueryConnection
-
Factory wrapper for
google_bigquery_connection(providerhashicorp/google ~> 7.0). - GoogleBigqueryDataset
-
Factory wrapper for
google_bigquery_dataset(providerhashicorp/google ~> 7.0). - GoogleBigqueryDatasetIamMember
-
Factory wrapper for
google_bigquery_dataset_iam_member. - GoogleBigqueryDataTransferConfig
-
Factory wrapper for
google_bigquery_data_transfer_config(providerhashicorp/google ~> 7.0). - GoogleBigqueryJob
-
Factory wrapper for
google_bigquery_job(providerhashicorp/google ~> 7.0). - GoogleBigqueryReservation
-
Factory wrapper for
google_bigquery_reservation(providerhashicorp/google ~> 7.0). - GoogleBigqueryRoutine
-
Factory wrapper for
google_bigquery_routine(providerhashicorp/google ~> 7.0). - GoogleBigqueryTable
-
Factory wrapper for
google_bigquery_table(providerhashicorp/google ~> 7.0). - GoogleBigqueryTableIamMember
-
Factory wrapper for
google_bigquery_table_iam_member. - GoogleSheetsOptions
-
external_data_configuration.google_sheets_optionssub-block. At least one of range / skipLeadingRows must be set per the provider schema; the wrapper does not enforce that. - HivePartitioningOptions
-
external_data_configuration.hive_partitioning_optionssub-block. Enables Hive-style partition keys (e.g.dt=2024-01-01/) to be surfaced as table columns. - JsonOptions
-
external_data_configuration.json_optionssub-block. - MaterializedView
-
materialized_viewblock (max=1).queryis required and frozen at create time (changing it forces replacement). The other knobs control refresh behaviour. - ParquetOptions
-
external_data_configuration.parquet_optionssub-block. - PrimaryKey
-
table_constraints.primary_keysub-block (max=1). - RangePartitioning
-
range_partitioningblock (max=1).fieldis the int64 column being partitioned on; the inner RangePartitioningRange defines the[start, end)window and bucket width. - RangePartitioningRange
-
Inner
rangeblock ofrange_partitioning. Half-open:startis inclusive,endis exclusive.intervalis the bucket width. - ReferencedTable
-
Inner
referenced_tableblock of a foreign key constraint — fully-qualified BigQuery table reference. - TableConstraints
-
table_constraintsblock (max=1). BigQuery accepts these for metadata / query-planning hints; constraints are NOT enforced at write time. - TableReplicationInfo
-
table_replication_infoblock (max=1). Marks the table as a replica of a source materialized view in another dataset (CREATE MATERIALIZED VIEW ... AS REPLICA OF ...). - TableView
-
viewblock (max=1). When set, the table is a logical view backed by query instead of physical storage.useLegacySqldefaults to false (standard SQL) at the provider; passtrueonly for legacy SQL views. - TimePartitioning
-
time_partitioningblock (max=1).typeis required; the other fields refine the partition spec.requirePartitionFilteris deprecated by BigQuery in favour of the top-levelrequirePartitionFilter, but retained here for parity with the provider schema.
Enums
- BigqueryCapacityCommitmentEdition
-
BigQuery edition for
google_bigquery_capacity_commitment.edition. Determines feature set and per-slot pricing. Documented values:STANDARD,ENTERPRISE,ENTERPRISE_PLUS. Distinct Dart type fromBigqueryReservationEditioneven though both wrap the same GCP enum — keeping resource-scoped naming avoids cross-resource coupling. - BigqueryCapacityCommitmentPlan
-
Commitment plan for
google_bigquery_capacity_commitment.plan. Pinned to the values documented by the BigQuery Reservations API (CommitmentPlan):FLEX,TRIAL,MONTHLY,ANNUAL,THREE_YEAR. Schema does not enumerate explicitly — see the field description for the authoritative link. - BigqueryCapacityCommitmentRenewalPlan
-
Renewal plan applied when the current commitment term ends.
Documented values:
NONE(no renewal — commitment lapses),FLEX,MONTHLY,ANNUAL,THREE_YEAR. (TRIALis a commitment-creation-only plan and is not a valid renewal target.) - BigqueryConnectionCloudSqlType
-
cloud_sql.type— Cloud SQL database engine. The schema includesDATABASE_TYPE_UNSPECIFIEDas a sentinel; do not pick it for new connections.SQL_SERVERis not exposed by the GA provider schema as of this curation. - BigqueryJobCreateDisposition
-
create_disposition— shared acrossquery,load, andcopyjob types. Default value:CREATE_IF_NEEDED. Possible values:["CREATE_IF_NEEDED", "CREATE_NEVER"]. - BigqueryJobExtractCompression
-
extract.compression. Schema description: "Possible values include GZIP, DEFLATE, SNAPPY, and NONE. The default value is NONE. DEFLATE and SNAPPY are only supported for Avro." The schema doesn't expose a formalenum_valuesarray — values transcribed from the description prose. - BigqueryJobExtractDestinationFormat
-
extract.destination_format. Schema description: "Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO for tables and SAVED_MODEL for models. The default value for tables is CSV. Tables with nested or repeated fields cannot be exported as CSV. The default value for models is SAVED_MODEL." Values transcribed from the description prose (no formalenum_valuesarray on this attribute). - BigqueryJobLoadSourceFormat
-
load.source_format. From the schema description: for CSV specifyCSV; for datastore backupsDATASTORE_BACKUP; for newline-delimited JSONNEWLINE_DELIMITED_JSON; for AvroAVRO; for ParquetPARQUET; for ORCORC;Betafor BigtableBIGTABLE. Default isCSV. The schema doesn't expose a formalenum_valuesarray, so this list is sourced from the attribute'sdescriptionprose. - BigqueryJobParameterMode
-
query.parameter_mode. Standard SQL only.POSITIONALuses?placeholders;NAMEDuses@paramsyntax. The provider description does not expose a formalPossible valuesarray; the BigQuery API documents these two as the supported modes. - BigqueryJobQueryPriority
-
query.priority. Default value:INTERACTIVE. Possible values:["INTERACTIVE", "BATCH"]. - BigqueryJobScriptKeyResultStatement
-
query.script_options.key_result_statement. Possible values:["LAST", "FIRST_SELECT"]. Determines which statement in the script populates the schema and query results of the script job. - BigqueryJobWriteDisposition
-
write_disposition— shared acrossquery,load, andcopyjob types. Default value:WRITE_EMPTY. Possible values:["WRITE_TRUNCATE", "WRITE_APPEND", "WRITE_EMPTY"]. - BigqueryReservationEdition
-
BigQuery reservation edition for
google_bigquery_reservation.edition. Determines feature set and billing tier. Documented values (per the field description):STANDARD,ENTERPRISE,ENTERPRISE_PLUS. The provider schema does not enumerate values explicitly; new editions ship as the BigQuery product evolves. Distinct fromBigqueryCapacityCommitmentEditionby design (the two resources reference the same GCP enum but are kept separate at the Dart type level to preserve resource-scoped naming). - BigqueryRoutineArgumentKind
-
Argument kind for
arguments.argument_kind.FIXED_TYPE(the default) requiresdataTypeto be set;ANY_TYPElets BigQuery infer the type at call site. - BigqueryRoutineArgumentMode
-
Argument direction for
arguments.mode. Procedures use this to mark each argument as input (IN), output (OUT), or bidirectional (INOUT); functions leave it null. - BigqueryRoutineDataGovernanceType
-
Data governance type for
data_governance_type. The provider only acceptsDATA_MASKINGtoday — set this to register the routine as a custom masking function consumable by BigQuery column-level policies. - BigqueryRoutineDeterminismLevel
-
Determinism level for
determinism_level. Applies to JavaScript UDFs — declaringDETERMINISTIClets BigQuery cache results across query invocations with identical inputs. - BigqueryRoutineLanguage
-
Routine source language for
language.SQLis the default for pure-SQL UDFs and TVFs;JAVASCRIPTruns inline JS bodies;PYTHON/JAVA/SCALArequire an accompanying BigqueryRoutineSparkOptions block. - BigqueryRoutineSecurityMode
-
Security mode for
security_mode.DEFINERruns the routine with the privileges of its owner;INVOKERruns with the caller's privileges. Defaults to BigQuery's auto-detect when omitted. - BigqueryRoutineType
-
Type of routine for
routine_type. BigQuery currently supports three shapes at this provider version: scalar UDFs, stored procedures, and table-valued functions. - DatasetStorageBillingModel
-
Storage billing model for
google_bigquery_dataset.storage_billing_model.LOGICAL(default per BigQuery API) bills by logical bytes;PHYSICALbills by compressed on-disk bytes (typically cheaper for high-compression data with infrequent reads). - ExternalDataCompression
-
Compression for
external_data_configuration.compression. BigQuery only accepts these two values; format-specific compression (Snappy for Parquet, Deflate for Avro, etc.) is inferred from the file. - ExternalDataSourceFormat
-
Source format for
external_data_configuration.source_format. ThegoogleSheetsvariant additionally requireshttps://www.googleapis.com/auth/drive.readonlyon the service account performing the read. - FileSetSpecType
-
File-set spec for
external_data_configuration.file_set_spec_type.fileSystemMatch(default) glob-expandssource_urisagainst the underlying object store;newLineDelimitedManifesttreats each source URI as a manifest file containing one object URI per line. - MetadataCacheMode
-
Metadata cache mode for
external_data_configuration.metadata_cache_mode.automaticlets BigQuery refresh the cache on a service-controlled cadence;manualrequires explicitBQ.REFRESH_EXTERNAL_METADATA_CACHEcalls. - ObjectMetadata
-
Object metadata for
external_data_configuration.object_metadata. Set this to create an Object Table (a listing of objects + their metadata) rather than a regular external table; when set,sourceFormatmust be omitted. - TableMetadataView
-
View for
table_metadata_view. Controls how much detail BigQuery returns when reading the table —basic(default) skips storage stats,storageStatsadds size counters,fullincludes all optional fields.unspecifiedis the no-op default. - TimePartitioningType
-
Partition unit for
time_partitioning.type. Maps to BigQuery's supported partition granularities.