Skip to content

Commit ff1f064

Browse files
authoredMay 24, 2023
feat: add table sampling to ReadAPI v1 (#596)
* feat: add table sampling to ReadAPI v1 feat: add storage error codes for KMS PiperOrigin-RevId: 534092654 Source-Link: googleapis/googleapis@adcd87e Source-Link: googleapis/googleapis-gen@53f03dc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTNmMDNkY2QyYWUwZDg2ODMyZDg3YTUzMGFhNTM4YjlkYWViZjJiMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 98e976a commit ff1f064

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed
 

‎google/cloud/bigquery_storage_v1/types/storage.py

+20
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,21 @@ class StorageErrorCode(proto.Enum):
790790
Offset already exists.
791791
OFFSET_OUT_OF_RANGE (9):
792792
Offset out of range.
793+
CMEK_NOT_PROVIDED (10):
794+
Customer-managed encryption key (CMEK) not
795+
provided for CMEK-enabled data.
796+
INVALID_CMEK_PROVIDED (11):
797+
Customer-managed encryption key (CMEK) was
798+
incorrectly provided.
799+
CMEK_ENCRYPTION_ERROR (12):
800+
There is an encryption error while using
801+
customer-managed encryption key.
802+
KMS_SERVICE_ERROR (13):
803+
Key Management Service (KMS) service returned
804+
an error.
805+
KMS_PERMISSION_DENIED (14):
806+
Permission denied while using
807+
customer-managed encryption key.
793808
"""
794809
STORAGE_ERROR_CODE_UNSPECIFIED = 0
795810
TABLE_NOT_FOUND = 1
@@ -801,6 +816,11 @@ class StorageErrorCode(proto.Enum):
801816
SCHEMA_MISMATCH_EXTRA_FIELDS = 7
802817
OFFSET_ALREADY_EXISTS = 8
803818
OFFSET_OUT_OF_RANGE = 9
819+
CMEK_NOT_PROVIDED = 10
820+
INVALID_CMEK_PROVIDED = 11
821+
CMEK_ENCRYPTION_ERROR = 12
822+
KMS_SERVICE_ERROR = 13
823+
KMS_PERMISSION_DENIED = 14
804824

805825
code: StorageErrorCode = proto.Field(
806826
proto.ENUM,

‎google/cloud/bigquery_storage_v1/types/stream.py

+15
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,16 @@ class TableReadOptions(proto.Message):
230230
output format
231231
232232
This field is a member of `oneof`_ ``output_format_serialization_options``.
233+
sample_percentage (float):
234+
Optional. Specifies a table sampling percentage.
235+
Specifically, the query planner will use TABLESAMPLE SYSTEM
236+
(sample_percentage PERCENT). This samples at the file-level.
237+
It will randomly choose for each file whether to include
238+
that file in the sample returned. Note, that if the table
239+
only has one file, then TABLESAMPLE SYSTEM will select that
240+
file and return all returnable rows contained within.
241+
242+
This field is a member of `oneof`_ ``_sample_percentage``.
233243
"""
234244

235245
selected_fields: MutableSequence[str] = proto.RepeatedField(
@@ -252,6 +262,11 @@ class TableReadOptions(proto.Message):
252262
oneof="output_format_serialization_options",
253263
message=avro.AvroSerializationOptions,
254264
)
265+
sample_percentage: float = proto.Field(
266+
proto.DOUBLE,
267+
number=5,
268+
optional=True,
269+
)
255270

256271
name: str = proto.Field(
257272
proto.STRING,

‎samples/generated_samples/snippet_metadata_google.cloud.bigquery.storage.v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-bigquery-storage",
11-
"version": "2.19.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

‎samples/generated_samples/snippet_metadata_google.cloud.bigquery.storage.v1beta2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-bigquery-storage",
11-
"version": "2.19.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)
Please sign in to comment.