@@ -164,6 +164,9 @@ type TableMetadata struct {
164164// where 12345 is parent id. The value is the friendly short name of the
165165// tag value, e.g. "production".
166166ResourceTags map [string ]string
167+
168+ // Specifies the configuration of a BigQuery table for Apache Iceberg (formerly BigLake Managed Table).
169+ BigLakeConfiguration * BigLakeConfiguration
167170}
168171
169172// TableConstraints defines the primary key and foreign key of a table.
@@ -380,6 +383,71 @@ func bqToMaterializedViewDefinition(q *bq.MaterializedViewDefinition) *Materiali
380383}
381384}
382385
386+ // BigLakeFileFormat represents the file format for Managed Tables for Apache Iceberg.
387+ type BigLakeFileFormat string
388+
389+ var (
390+ // UnspecifiedBigLakeFileFormat represents the default value.
391+ UnspecifiedBigLakeFileFormat BigLakeFileFormat = "FILE_FORMAT_UNSPECIFIED"
392+ // ParquetBigLakeFileFormat represents Apache Parquet Format.
393+ ParquetBigLakeFileFormat BigLakeFileFormat = "PARQUET"
394+ )
395+
396+ // BigLakeTableFormat represents the table metadata format for Managed Tables for Apache Iceberg.
397+ type BigLakeTableFormat string
398+
399+ var (
400+ // UnspecifiedBigLakeTableFormat represents the default value.
401+ UnspecifiedBigLakeTableFormat BigLakeTableFormat = "TABLE_FORMAT_UNSPECIFIED"
402+ // IcebergBigLakeTableFormat represent Apache Iceberg Format.
403+ IcebergBigLakeTableFormat BigLakeTableFormat = "ICEBERG"
404+ )
405+
406+ // BigLakeConfiguration is used to configure aspects of BigQuery tables for
407+ // Apache Iceberg (previously known as BigLake managed tables).
408+ type BigLakeConfiguration struct {
409+ // Optional. The connection specifying the credentials to be used to read and
410+ // write to external storage, such as Cloud Storage. The connection_id can
411+ // have the form `{project}.{location}.{connection_id}` or
412+ // `projects/{project}/locations/{location}/connections/{connection_id}".
413+ ConnectionID string
414+
415+ // Optional. The fully qualified location prefix of the external folder where
416+ // table data is stored. The '*' wildcard character is not allowed. The URI
417+ // should be in the format `gs://bucket/path_to_table/`
418+ StorageURI string
419+
420+ // Optional. The file format the table data is stored in.
421+ FileFormat BigLakeFileFormat
422+
423+ // Optional. The table format the metadata only snapshots are stored in.
424+ TableFormat BigLakeTableFormat
425+ }
426+
427+ func (blc * BigLakeConfiguration ) toBQ () * bq.BigLakeConfiguration {
428+ if blc == nil {
429+ return nil
430+ }
431+ return & bq.BigLakeConfiguration {
432+ ConnectionId : blc .ConnectionID ,
433+ StorageUri : blc .StorageURI ,
434+ FileFormat : string (blc .FileFormat ),
435+ TableFormat : string (blc .TableFormat ),
436+ }
437+ }
438+
439+ func bqToBigLakeConfiguration (in * bq.BigLakeConfiguration ) * BigLakeConfiguration {
440+ if in == nil {
441+ return nil
442+ }
443+ return & BigLakeConfiguration {
444+ ConnectionID : in .ConnectionId ,
445+ StorageURI : in .StorageUri ,
446+ FileFormat : BigLakeFileFormat (in .FileFormat ),
447+ TableFormat : BigLakeTableFormat (in .TableFormat ),
448+ }
449+ }
450+
383451// SnapshotDefinition provides metadata related to the origin of a snapshot.
384452type SnapshotDefinition struct {
385453
@@ -769,6 +837,7 @@ func (tm *TableMetadata) toBQ() (*bq.Table, error) {
769837t .RequirePartitionFilter = tm .RequirePartitionFilter
770838t .SnapshotDefinition = tm .SnapshotDefinition .toBQ ()
771839t .CloneDefinition = tm .CloneDefinition .toBQ ()
840+ t .BiglakeConfiguration = tm .BigLakeConfiguration .toBQ ()
772841
773842if ! validExpiration (tm .ExpirationTime ) {
774843return nil , fmt .Errorf ("invalid expiration time: %v.\n " +
@@ -917,6 +986,7 @@ func bqToTableMetadata(t *bq.Table, c *Client) (*TableMetadata, error) {
917986RequirePartitionFilter : t .RequirePartitionFilter ,
918987SnapshotDefinition : bqToSnapshotDefinition (t .SnapshotDefinition , c ),
919988CloneDefinition : bqToCloneDefinition (t .CloneDefinition , c ),
989+ BigLakeConfiguration : bqToBigLakeConfiguration (t .BiglakeConfiguration ),
920990}
921991if t .MaterializedView != nil {
922992md .MaterializedView = bqToMaterializedViewDefinition (t .MaterializedView )
@@ -1145,6 +1215,10 @@ func (tm *TableMetadataToUpdate) toBQ() (*bq.Table, error) {
11451215}
11461216forceSend ("ResourceTags" )
11471217}
1218+ if tm .BigLakeConfiguration != nil {
1219+ t .BiglakeConfiguration = tm .BigLakeConfiguration .toBQ ()
1220+ forceSend ("BigLakeConfiguration" )
1221+ }
11481222labels , forces , nulls := tm .update ()
11491223t .Labels = labels
11501224t .ForceSendFields = append (t .ForceSendFields , forces ... )
@@ -1239,6 +1313,9 @@ type TableMetadataToUpdate struct {
12391313// tag value, e.g. "production".
12401314ResourceTags map [string ]string
12411315
1316+ // Update the configuration of a BigQuery table for Apache Iceberg (formerly BigLake Managed Table).
1317+ BigLakeConfiguration * BigLakeConfiguration
1318+
12421319labelUpdater
12431320}
12441321
0 commit comments