Skip to content

Commit 523c84f

Browse files
authored
fix(gcp-resources): Add project_id and id as PKs of gcp_bigquery_tables (#6533)
#### Summary Same as #6532 for tables <!--
1 parent 47c87b4 commit 523c84f

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

plugins/source/gcp/docs/tables/gcp_bigquery_tables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#Table
44

5-
The primary key for this table is **_cq_id**.
5+
The composite primary key for this table is (**project_id**, **id**).
66

77
## Relations
88

@@ -14,9 +14,10 @@ This table depends on [gcp_bigquery_datasets](gcp_bigquery_datasets.md).
1414
| ------------- | ------------- |
1515
|_cq_source_name|String|
1616
|_cq_sync_time|Timestamp|
17-
|_cq_id (PK)|UUID|
17+
|_cq_id|UUID|
1818
|_cq_parent_id|UUID|
19-
|project_id|String|
19+
|project_id (PK)|String|
20+
|id (PK)|String|
2021
|clone_definition|JSON|
2122
|clustering|JSON|
2223
|creation_time|Int|
@@ -27,7 +28,6 @@ This table depends on [gcp_bigquery_datasets](gcp_bigquery_datasets.md).
2728
|expiration_time|Int|
2829
|external_data_configuration|JSON|
2930
|friendly_name|String|
30-
|id|String|
3131
|kind|String|
3232
|labels|JSON|
3333
|last_modified_time|Int|

plugins/source/gcp/resources/services/bigquery/tables.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ func Tables() *schema.Table {
2020
Name: "project_id",
2121
Type: schema.TypeString,
2222
Resolver: client.ResolveProject,
23+
CreationOptions: schema.ColumnCreationOptions{
24+
PrimaryKey: true,
25+
},
26+
},
27+
{
28+
Name: "id",
29+
Type: schema.TypeString,
30+
Resolver: schema.PathResolver("Id"),
31+
CreationOptions: schema.ColumnCreationOptions{
32+
PrimaryKey: true,
33+
},
2334
},
2435
},
2536
}

0 commit comments

Comments
 (0)