UNPKG

264 kBTypeScriptView Raw
1// Copyright 2024 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/**
16 * BigQuery API
17 */
18declare namespace bigquery {
19 /**
20 * Aggregate metrics for classification/classifier models. For multi-class models, the metrics are either macro-averaged or micro-averaged. When macro-averaged, the metrics are calculated for each label and then an unweighted average is taken of those values. When micro-averaged, the metric is calculated globally by counting the total number of correctly predicted rows.
21 */
22 type IAggregateClassificationMetrics = {
23 /**
24 * Accuracy is the fraction of predictions given the correct label. For multiclass this is a micro-averaged metric.
25 */
26 accuracy?: number;
27 /**
28 * The F1 score is an average of recall and precision. For multiclass this is a macro-averaged metric.
29 */
30 f1Score?: number;
31 /**
32 * Logarithmic Loss. For multiclass this is a macro-averaged metric.
33 */
34 logLoss?: number;
35 /**
36 * Precision is the fraction of actual positive predictions that had positive actual labels. For multiclass this is a macro-averaged metric treating each class as a binary classifier.
37 */
38 precision?: number;
39 /**
40 * Recall is the fraction of actual positive labels that were given a positive prediction. For multiclass this is a macro-averaged metric.
41 */
42 recall?: number;
43 /**
44 * Area Under a ROC Curve. For multiclass this is a macro-averaged metric.
45 */
46 rocAuc?: number;
47 /**
48 * Threshold at which the metrics are computed. For binary classification models this is the positive class threshold. For multi-class classfication models this is the confidence threshold.
49 */
50 threshold?: number;
51 };
52
53 /**
54 * Represents privacy policy associated with "aggregation threshold" method.
55 */
56 type IAggregationThresholdPolicy = {
57 /**
58 * Optional. The privacy unit column(s) associated with this policy. For now, only one column per data source object (table, view) is allowed as a privacy unit column. Representing as a repeated field in metadata for extensibility to multiple columns in future. Duplicates and Repeated struct fields are not allowed. For nested fields, use dot notation ("outer.inner")
59 */
60 privacyUnitColumns?: Array<string>;
61 /**
62 * Optional. The threshold for the "aggregation threshold" policy.
63 */
64 threshold?: string;
65 };
66
67 /**
68 * Input/output argument of a function or a stored procedure.
69 */
70 type IArgument = {
71 /**
72 * Optional. Defaults to FIXED_TYPE.
73 */
74 argumentKind?: 'ARGUMENT_KIND_UNSPECIFIED' | 'FIXED_TYPE' | 'ANY_TYPE';
75 /**
76 * Required unless argument_kind = ANY_TYPE.
77 */
78 dataType?: IStandardSqlDataType;
79 /**
80 * Optional. Whether the argument is an aggregate function parameter. Must be Unset for routine types other than AGGREGATE_FUNCTION. For AGGREGATE_FUNCTION, if set to false, it is equivalent to adding "NOT AGGREGATE" clause in DDL; Otherwise, it is equivalent to omitting "NOT AGGREGATE" clause in DDL.
81 */
82 isAggregate?: boolean;
83 /**
84 * Optional. Specifies whether the argument is input or output. Can be set for procedures only.
85 */
86 mode?: 'MODE_UNSPECIFIED' | 'IN' | 'OUT' | 'INOUT';
87 /**
88 * Optional. The name of this argument. Can be absent for function return argument.
89 */
90 name?: string;
91 };
92
93 /**
94 * Arima coefficients.
95 */
96 type IArimaCoefficients = {
97 /**
98 * Auto-regressive coefficients, an array of double.
99 */
100 autoRegressiveCoefficients?: Array<number>;
101 /**
102 * Intercept coefficient, just a double not an array.
103 */
104 interceptCoefficient?: number;
105 /**
106 * Moving-average coefficients, an array of double.
107 */
108 movingAverageCoefficients?: Array<number>;
109 };
110
111 /**
112 * ARIMA model fitting metrics.
113 */
114 type IArimaFittingMetrics = {
115 /**
116 * AIC.
117 */
118 aic?: number;
119 /**
120 * Log-likelihood.
121 */
122 logLikelihood?: number;
123 /**
124 * Variance.
125 */
126 variance?: number;
127 };
128
129 /**
130 * Model evaluation metrics for ARIMA forecasting models.
131 */
132 type IArimaForecastingMetrics = {
133 /**
134 * Arima model fitting metrics.
135 */
136 arimaFittingMetrics?: Array<IArimaFittingMetrics>;
137 /**
138 * Repeated as there can be many metric sets (one for each model) in auto-arima and the large-scale case.
139 */
140 arimaSingleModelForecastingMetrics?: Array<IArimaSingleModelForecastingMetrics>;
141 /**
142 * Whether Arima model fitted with drift or not. It is always false when d is not 1.
143 */
144 hasDrift?: Array<boolean>;
145 /**
146 * Non-seasonal order.
147 */
148 nonSeasonalOrder?: Array<IArimaOrder>;
149 /**
150 * Seasonal periods. Repeated because multiple periods are supported for one time series.
151 */
152 seasonalPeriods?: Array<
153 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
154 | 'NO_SEASONALITY'
155 | 'DAILY'
156 | 'WEEKLY'
157 | 'MONTHLY'
158 | 'QUARTERLY'
159 | 'YEARLY'
160 >;
161 /**
162 * Id to differentiate different time series for the large-scale case.
163 */
164 timeSeriesId?: Array<string>;
165 };
166
167 /**
168 * Arima model information.
169 */
170 type IArimaModelInfo = {
171 /**
172 * Arima coefficients.
173 */
174 arimaCoefficients?: IArimaCoefficients;
175 /**
176 * Arima fitting metrics.
177 */
178 arimaFittingMetrics?: IArimaFittingMetrics;
179 /**
180 * Whether Arima model fitted with drift or not. It is always false when d is not 1.
181 */
182 hasDrift?: boolean;
183 /**
184 * If true, holiday_effect is a part of time series decomposition result.
185 */
186 hasHolidayEffect?: boolean;
187 /**
188 * If true, spikes_and_dips is a part of time series decomposition result.
189 */
190 hasSpikesAndDips?: boolean;
191 /**
192 * If true, step_changes is a part of time series decomposition result.
193 */
194 hasStepChanges?: boolean;
195 /**
196 * Non-seasonal order.
197 */
198 nonSeasonalOrder?: IArimaOrder;
199 /**
200 * Seasonal periods. Repeated because multiple periods are supported for one time series.
201 */
202 seasonalPeriods?: Array<
203 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
204 | 'NO_SEASONALITY'
205 | 'DAILY'
206 | 'WEEKLY'
207 | 'MONTHLY'
208 | 'QUARTERLY'
209 | 'YEARLY'
210 >;
211 /**
212 * The time_series_id value for this time series. It will be one of the unique values from the time_series_id_column specified during ARIMA model training. Only present when time_series_id_column training option was used.
213 */
214 timeSeriesId?: string;
215 /**
216 * The tuple of time_series_ids identifying this time series. It will be one of the unique tuples of values present in the time_series_id_columns specified during ARIMA model training. Only present when time_series_id_columns training option was used and the order of values here are same as the order of time_series_id_columns.
217 */
218 timeSeriesIds?: Array<string>;
219 };
220
221 /**
222 * Arima order, can be used for both non-seasonal and seasonal parts.
223 */
224 type IArimaOrder = {
225 /**
226 * Order of the differencing part.
227 */
228 d?: string;
229 /**
230 * Order of the autoregressive part.
231 */
232 p?: string;
233 /**
234 * Order of the moving-average part.
235 */
236 q?: string;
237 };
238
239 /**
240 * (Auto-)arima fitting result. Wrap everything in ArimaResult for easier refactoring if we want to use model-specific iteration results.
241 */
242 type IArimaResult = {
243 /**
244 * This message is repeated because there are multiple arima models fitted in auto-arima. For non-auto-arima model, its size is one.
245 */
246 arimaModelInfo?: Array<IArimaModelInfo>;
247 /**
248 * Seasonal periods. Repeated because multiple periods are supported for one time series.
249 */
250 seasonalPeriods?: Array<
251 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
252 | 'NO_SEASONALITY'
253 | 'DAILY'
254 | 'WEEKLY'
255 | 'MONTHLY'
256 | 'QUARTERLY'
257 | 'YEARLY'
258 >;
259 };
260
261 /**
262 * Model evaluation metrics for a single ARIMA forecasting model.
263 */
264 type IArimaSingleModelForecastingMetrics = {
265 /**
266 * Arima fitting metrics.
267 */
268 arimaFittingMetrics?: IArimaFittingMetrics;
269 /**
270 * Is arima model fitted with drift or not. It is always false when d is not 1.
271 */
272 hasDrift?: boolean;
273 /**
274 * If true, holiday_effect is a part of time series decomposition result.
275 */
276 hasHolidayEffect?: boolean;
277 /**
278 * If true, spikes_and_dips is a part of time series decomposition result.
279 */
280 hasSpikesAndDips?: boolean;
281 /**
282 * If true, step_changes is a part of time series decomposition result.
283 */
284 hasStepChanges?: boolean;
285 /**
286 * Non-seasonal order.
287 */
288 nonSeasonalOrder?: IArimaOrder;
289 /**
290 * Seasonal periods. Repeated because multiple periods are supported for one time series.
291 */
292 seasonalPeriods?: Array<
293 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
294 | 'NO_SEASONALITY'
295 | 'DAILY'
296 | 'WEEKLY'
297 | 'MONTHLY'
298 | 'QUARTERLY'
299 | 'YEARLY'
300 >;
301 /**
302 * The time_series_id value for this time series. It will be one of the unique values from the time_series_id_column specified during ARIMA model training. Only present when time_series_id_column training option was used.
303 */
304 timeSeriesId?: string;
305 /**
306 * The tuple of time_series_ids identifying this time series. It will be one of the unique tuples of values present in the time_series_id_columns specified during ARIMA model training. Only present when time_series_id_columns training option was used and the order of values here are same as the order of time_series_id_columns.
307 */
308 timeSeriesIds?: Array<string>;
309 };
310
311 /**
312 * Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.
313 */
314 type IAuditConfig = {
315 /**
316 * The configuration for logging of each type of permission.
317 */
318 auditLogConfigs?: Array<IAuditLogConfig>;
319 /**
320 * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
321 */
322 service?: string;
323 };
324
325 /**
326 * Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
327 */
328 type IAuditLogConfig = {
329 /**
330 * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
331 */
332 exemptedMembers?: Array<string>;
333 /**
334 * The log type that this config enables.
335 */
336 logType?:
337 | 'LOG_TYPE_UNSPECIFIED'
338 | 'ADMIN_READ'
339 | 'DATA_WRITE'
340 | 'DATA_READ';
341 };
342
343 /**
344 * Options for external data sources.
345 */
346 type IAvroOptions = {
347 /**
348 * Optional. If sourceFormat is set to "AVRO", indicates whether to interpret logical types as the corresponding BigQuery data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER).
349 */
350 useAvroLogicalTypes?: boolean;
351 };
352
353 /**
354 * Reason why BI Engine didn't accelerate the query (or sub-query).
355 */
356 type IBiEngineReason = {
357 /**
358 * Output only. High-level BI Engine reason for partial or disabled acceleration
359 */
360 code?:
361 | 'CODE_UNSPECIFIED'
362 | 'NO_RESERVATION'
363 | 'INSUFFICIENT_RESERVATION'
364 | 'UNSUPPORTED_SQL_TEXT'
365 | 'INPUT_TOO_LARGE'
366 | 'OTHER_REASON'
367 | 'TABLE_EXCLUDED';
368 /**
369 * Output only. Free form human-readable reason for partial or disabled acceleration.
370 */
371 message?: string;
372 };
373
374 /**
375 * Statistics for a BI Engine specific query. Populated as part of JobStatistics2
376 */
377 type IBiEngineStatistics = {
378 /**
379 * Output only. Specifies which mode of BI Engine acceleration was performed (if any).
380 */
381 accelerationMode?:
382 | 'BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED'
383 | 'BI_ENGINE_DISABLED'
384 | 'PARTIAL_INPUT'
385 | 'FULL_INPUT'
386 | 'FULL_QUERY';
387 /**
388 * Output only. Specifies which mode of BI Engine acceleration was performed (if any).
389 */
390 biEngineMode?:
391 | 'ACCELERATION_MODE_UNSPECIFIED'
392 | 'DISABLED'
393 | 'PARTIAL'
394 | 'FULL';
395 /**
396 * In case of DISABLED or PARTIAL bi_engine_mode, these contain the explanatory reasons as to why BI Engine could not accelerate. In case the full query was accelerated, this field is not populated.
397 */
398 biEngineReasons?: Array<IBiEngineReason>;
399 };
400
401 /**
402 * Configuration for BigLake managed tables.
403 */
404 type IBigLakeConfiguration = {
405 /**
406 * Required. The connection specifying the credentials to be used to read and write to external storage, such as Cloud Storage. The connection_id can have the form "<project\_id>.<location\_id>.<connection\_id>" or "projects/<project\_id>/locations/<location\_id>/connections/<connection\_id>".
407 */
408 connectionId?: string;
409 /**
410 * Required. The file format the table data is stored in.
411 */
412 fileFormat?: 'FILE_FORMAT_UNSPECIFIED' | 'PARQUET';
413 /**
414 * Required. The fully qualified location prefix of the external folder where table data is stored. The '*' wildcard character is not allowed. The URI should be in the format "gs://bucket/path_to_table/"
415 */
416 storageUri?: string;
417 /**
418 * Required. The table format the metadata only snapshots are stored in.
419 */
420 tableFormat?: 'TABLE_FORMAT_UNSPECIFIED' | 'ICEBERG';
421 };
422
423 type IBigQueryModelTraining = {
424 /**
425 * Deprecated.
426 */
427 currentIteration?: number;
428 /**
429 * Deprecated.
430 */
431 expectedTotalIterations?: string;
432 };
433
434 /**
435 * Information related to a Bigtable column.
436 */
437 type IBigtableColumn = {
438 /**
439 * Optional. The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
440 */
441 encoding?: string;
442 /**
443 * Optional. If the qualifier is not a valid BigQuery field identifier i.e. does not match a-zA-Z*, a valid identifier must be provided as the column field name and is used as field name in queries.
444 */
445 fieldName?: string;
446 /**
447 * Optional. If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
448 */
449 onlyReadLatest?: boolean;
450 /**
451 * [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match a-zA-Z*, a valid identifier must be provided as field_name.
452 */
453 qualifierEncoded?: string;
454 /**
455 * Qualifier string.
456 */
457 qualifierString?: string;
458 /**
459 * Optional. The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive): * BYTES * STRING * INTEGER * FLOAT * BOOLEAN * JSON Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
460 */
461 type?: string;
462 };
463
464 /**
465 * Information related to a Bigtable column family.
466 */
467 type IBigtableColumnFamily = {
468 /**
469 * Optional. Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
470 */
471 columns?: Array<IBigtableColumn>;
472 /**
473 * Optional. The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
474 */
475 encoding?: string;
476 /**
477 * Identifier of the column family.
478 */
479 familyId?: string;
480 /**
481 * Optional. If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
482 */
483 onlyReadLatest?: boolean;
484 /**
485 * Optional. The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive): * BYTES * STRING * INTEGER * FLOAT * BOOLEAN * JSON Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
486 */
487 type?: string;
488 };
489
490 /**
491 * Options specific to Google Cloud Bigtable data sources.
492 */
493 type IBigtableOptions = {
494 /**
495 * Optional. List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
496 */
497 columnFamilies?: Array<IBigtableColumnFamily>;
498 /**
499 * Optional. If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
500 */
501 ignoreUnspecifiedColumnFamilies?: boolean;
502 /**
503 * Optional. If field is true, then each column family will be read as a single JSON column. Otherwise they are read as a repeated cell structure containing timestamp/value tuples. The default value is false.
504 */
505 outputColumnFamiliesAsJson?: boolean;
506 /**
507 * Optional. If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
508 */
509 readRowkeyAsString?: boolean;
510 };
511
512 /**
513 * Evaluation metrics for binary classification/classifier models.
514 */
515 type IBinaryClassificationMetrics = {
516 /**
517 * Aggregate classification metrics.
518 */
519 aggregateClassificationMetrics?: IAggregateClassificationMetrics;
520 /**
521 * Binary confusion matrix at multiple thresholds.
522 */
523 binaryConfusionMatrixList?: Array<IBinaryConfusionMatrix>;
524 /**
525 * Label representing the negative class.
526 */
527 negativeLabel?: string;
528 /**
529 * Label representing the positive class.
530 */
531 positiveLabel?: string;
532 };
533
534 /**
535 * Confusion matrix for binary classification models.
536 */
537 type IBinaryConfusionMatrix = {
538 /**
539 * The fraction of predictions given the correct label.
540 */
541 accuracy?: number;
542 /**
543 * The equally weighted average of recall and precision.
544 */
545 f1Score?: number;
546 /**
547 * Number of false samples predicted as false.
548 */
549 falseNegatives?: string;
550 /**
551 * Number of false samples predicted as true.
552 */
553 falsePositives?: string;
554 /**
555 * Threshold value used when computing each of the following metric.
556 */
557 positiveClassThreshold?: number;
558 /**
559 * The fraction of actual positive predictions that had positive actual labels.
560 */
561 precision?: number;
562 /**
563 * The fraction of actual positive labels that were given a positive prediction.
564 */
565 recall?: number;
566 /**
567 * Number of true samples predicted as false.
568 */
569 trueNegatives?: string;
570 /**
571 * Number of true samples predicted as true.
572 */
573 truePositives?: string;
574 };
575
576 /**
577 * Associates `members`, or principals, with a `role`.
578 */
579 type IBinding = {
580 /**
581 * The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
582 */
583 condition?: IExpr;
584 /**
585 * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
586 */
587 members?: Array<string>;
588 /**
589 * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).
590 */
591 role?: string;
592 };
593
594 type IBqmlIterationResult = {
595 /**
596 * Deprecated.
597 */
598 durationMs?: string;
599 /**
600 * Deprecated.
601 */
602 evalLoss?: number;
603 /**
604 * Deprecated.
605 */
606 index?: number;
607 /**
608 * Deprecated.
609 */
610 learnRate?: number;
611 /**
612 * Deprecated.
613 */
614 trainingLoss?: number;
615 };
616
617 type IBqmlTrainingRun = {
618 /**
619 * Deprecated.
620 */
621 iterationResults?: Array<IBqmlIterationResult>;
622 /**
623 * Deprecated.
624 */
625 startTime?: string;
626 /**
627 * Deprecated.
628 */
629 state?: string;
630 /**
631 * Deprecated.
632 */
633 trainingOptions?: {
634 earlyStop?: boolean;
635 l1Reg?: number;
636 l2Reg?: number;
637 learnRate?: number;
638 learnRateStrategy?: string;
639 lineSearchInitLearnRate?: number;
640 maxIteration?: string;
641 minRelProgress?: number;
642 warmStart?: boolean;
643 };
644 };
645
646 /**
647 * Representative value of a categorical feature.
648 */
649 type ICategoricalValue = {
650 /**
651 * Counts of all categories for the categorical feature. If there are more than ten categories, we return top ten (by count) and return one more CategoryCount with category "_OTHER_" and count as aggregate counts of remaining categories.
652 */
653 categoryCounts?: Array<ICategoryCount>;
654 };
655
656 /**
657 * Represents the count of a single category within the cluster.
658 */
659 type ICategoryCount = {
660 /**
661 * The name of category.
662 */
663 category?: string;
664 /**
665 * The count of training samples matching the category within the cluster.
666 */
667 count?: string;
668 };
669
670 /**
671 * Information about base table and clone time of a table clone.
672 */
673 type ICloneDefinition = {
674 /**
675 * Required. Reference describing the ID of the table that was cloned.
676 */
677 baseTableReference?: ITableReference;
678 /**
679 * Required. The time at which the base table was cloned. This value is reported in the JSON response using RFC3339 format.
680 */
681 cloneTime?: string;
682 };
683
684 /**
685 * Message containing the information about one cluster.
686 */
687 type ICluster = {
688 /**
689 * Centroid id.
690 */
691 centroidId?: string;
692 /**
693 * Count of training data rows that were assigned to this cluster.
694 */
695 count?: string;
696 /**
697 * Values of highly variant features for this cluster.
698 */
699 featureValues?: Array<IFeatureValue>;
700 };
701
702 /**
703 * Information about a single cluster for clustering model.
704 */
705 type IClusterInfo = {
706 /**
707 * Centroid id.
708 */
709 centroidId?: string;
710 /**
711 * Cluster radius, the average distance from centroid to each point assigned to the cluster.
712 */
713 clusterRadius?: number;
714 /**
715 * Cluster size, the total number of points assigned to the cluster.
716 */
717 clusterSize?: string;
718 };
719
720 /**
721 * Configures table clustering.
722 */
723 type IClustering = {
724 /**
725 * One or more fields on which data should be clustered. Only top-level, non-repeated, simple-type fields are supported. The ordering of the clustering fields should be prioritized from most to least important for filtering purposes. Additional information on limitations can be found here: https://cloud.google.com/bigquery/docs/creating-clustered-tables#limitations
726 */
727 fields?: Array<string>;
728 };
729
730 /**
731 * Evaluation metrics for clustering models.
732 */
733 type IClusteringMetrics = {
734 /**
735 * Information for all clusters.
736 */
737 clusters?: Array<ICluster>;
738 /**
739 * Davies-Bouldin index.
740 */
741 daviesBouldinIndex?: number;
742 /**
743 * Mean of squared distances between each sample to its cluster centroid.
744 */
745 meanSquaredDistance?: number;
746 };
747
748 /**
749 * Confusion matrix for multi-class classification models.
750 */
751 type IConfusionMatrix = {
752 /**
753 * Confidence threshold used when computing the entries of the confusion matrix.
754 */
755 confidenceThreshold?: number;
756 /**
757 * One row per actual label.
758 */
759 rows?: Array<IRow>;
760 };
761
762 /**
763 * A connection-level property to customize query behavior. Under JDBC, these correspond directly to connection properties passed to the DriverManager. Under ODBC, these correspond to properties in the connection string. Currently supported connection properties: * **dataset_project_id**: represents the default project for datasets that are used in the query. Setting the system variable `@@dataset_project_id` achieves the same behavior. For more information about system variables, see: https://cloud.google.com/bigquery/docs/reference/system-variables * **time_zone**: represents the default timezone used to run the query. * **session_id**: associates the query with a given session. * **query_label**: associates the query with a given job label. If set, all subsequent queries in a script or session will have this label. For the format in which a you can specify a query label, see labels in the JobConfiguration resource type: https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfiguration Additional properties are allowed, but ignored. Specifying multiple connection properties with the same key returns an error.
764 */
765 type IConnectionProperty = {
766 /**
767 * The key of the property to set.
768 */
769 key?: string;
770 /**
771 * The value of the property to set.
772 */
773 value?: string;
774 };
775
776 /**
777 * Information related to a CSV data source.
778 */
779 type ICsvOptions = {
780 /**
781 * Optional. Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
782 */
783 allowJaggedRows?: boolean;
784 /**
785 * Optional. Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
786 */
787 allowQuotedNewlines?: boolean;
788 /**
789 * Optional. The character encoding of the data. The supported values are UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-32BE, and UTF-32LE. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
790 */
791 encoding?: string;
792 /**
793 * Optional. The separator character for fields in a CSV file. The separator is interpreted as a single byte. For files encoded in ISO-8859-1, any single character can be used as a separator. For files encoded in UTF-8, characters represented in decimal range 1-127 (U+0001-U+007F) can be used without any modification. UTF-8 characters encoded with multiple bytes (i.e. U+0080 and above) will have only the first byte used for separating fields. The remaining bytes will be treated as a part of the field. BigQuery also supports the escape sequence "\t" (U+0009) to specify a tab separator. The default value is comma (",", U+002C).
794 */
795 fieldDelimiter?: string;
796 /**
797 * [Optional] A custom string that will represent a NULL value in CSV import data.
798 */
799 nullMarker?: string;
800 /**
801 * Optional. Indicates if the embedded ASCII control characters (the first 32 characters in the ASCII-table, from '\x00' to '\x1F') are preserved.
802 */
803 preserveAsciiControlCharacters?: boolean;
804 /**
805 * Optional. The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ("). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true. To include the specific quote character within a quoted value, precede it with an additional matching quote character. For example, if you want to escape the default character ' " ', use ' "" '.
806 */
807 quote?: string;
808 /**
809 * Optional. The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. When autodetect is on, the behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
810 */
811 skipLeadingRows?: string;
812 };
813
814 /**
815 * Options for data format adjustments.
816 */
817 type IDataFormatOptions = {
818 /**
819 * Optional. Output timestamp as usec int64. Default is false.
820 */
821 useInt64Timestamp?: boolean;
822 };
823
824 /**
825 * Statistics for data-masking.
826 */
827 type IDataMaskingStatistics = {
828 /**
829 * Whether any accessed data was protected by the data masking.
830 */
831 dataMaskingApplied?: boolean;
832 };
833
834 /**
835 * Data split result. This contains references to the training and evaluation data tables that were used to train the model.
836 */
837 type IDataSplitResult = {
838 /**
839 * Table reference of the evaluation data after split.
840 */
841 evaluationTable?: ITableReference;
842 /**
843 * Table reference of the test data after split.
844 */
845 testTable?: ITableReference;
846 /**
847 * Table reference of the training data after split.
848 */
849 trainingTable?: ITableReference;
850 };
851
852 type IDataset = {
853 /**
854 * Optional. An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER;
855 */
856 access?: Array<{
857 /**
858 * [Pick one] A grant authorizing all resources of a particular type in a particular dataset access to this dataset. Only views are supported for now. The role field is not required when this field is set. If that dataset is deleted and re-created, its access needs to be granted again via an update operation.
859 */
860 dataset?: IDatasetAccessEntry;
861 /**
862 * [Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: "example.com". Maps to IAM policy member "domain:DOMAIN".
863 */
864 domain?: string;
865 /**
866 * [Pick one] An email address of a Google Group to grant access to. Maps to IAM policy member "group:GROUP".
867 */
868 groupByEmail?: string;
869 /**
870 * [Pick one] Some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.
871 */
872 iamMember?: string;
873 /**
874 * An IAM role ID that should be granted to the user, group, or domain specified in this access entry. The following legacy mappings will be applied: OWNER <=> roles/bigquery.dataOwner WRITER <=> roles/bigquery.dataEditor READER <=> roles/bigquery.dataViewer This field will accept any of the above formats, but will return only the legacy format. For example, if you set this field to "roles/bigquery.dataOwner", it will be returned back as "OWNER".
875 */
876 role?: string;
877 /**
878 * [Pick one] A routine from a different dataset to grant access to. Queries executed against that routine will have read access to views/tables/routines in this dataset. Only UDF is supported for now. The role field is not required when this field is set. If that routine is updated by any user, access to the routine needs to be granted again via an update operation.
879 */
880 routine?: IRoutineReference;
881 /**
882 * [Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users. Maps to similarly-named IAM members.
883 */
884 specialGroup?: string;
885 /**
886 * [Pick one] An email address of a user to grant access to. For example: fred@example.com. Maps to IAM policy member "user:EMAIL" or "serviceAccount:EMAIL".
887 */
888 userByEmail?: string;
889 /**
890 * [Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to views/tables/routines in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation.
891 */
892 view?: ITableReference;
893 }>;
894 /**
895 * Output only. The time when this dataset was created, in milliseconds since the epoch.
896 */
897 creationTime?: string;
898 /**
899 * Required. A reference that identifies the dataset.
900 */
901 datasetReference?: IDatasetReference;
902 /**
903 * Optional. Defines the default collation specification of future tables created in the dataset. If a table is created in this dataset without table-level default collation, then the table inherits the dataset default collation, which is applied to the string fields that do not have explicit collation specified. A change to this field affects only tables created afterwards, and does not alter the existing tables. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.
904 */
905 defaultCollation?: string;
906 /**
907 * The default encryption key for all tables in the dataset. Once this property is set, all newly-created partitioned tables in the dataset will have encryption key set to this value, unless table creation request (or query) overrides the key.
908 */
909 defaultEncryptionConfiguration?: IEncryptionConfiguration;
910 /**
911 * This default partition expiration, expressed in milliseconds. When new time-partitioned tables are created in a dataset where this property is set, the table will inherit this value, propagated as the `TimePartitioning.expirationMs` property on the new table. If you set `TimePartitioning.expirationMs` explicitly when creating a table, the `defaultPartitionExpirationMs` of the containing dataset is ignored. When creating a partitioned table, if `defaultPartitionExpirationMs` is set, the `defaultTableExpirationMs` value is ignored and the table will not be inherit a table expiration deadline.
912 */
913 defaultPartitionExpirationMs?: string;
914 /**
915 * Optional. Defines the default rounding mode specification of new tables created within this dataset. During table creation, if this field is specified, the table within this dataset will inherit the default rounding mode of the dataset. Setting the default rounding mode on a table overrides this option. Existing tables in the dataset are unaffected. If columns are defined during that table creation, they will immediately inherit the table's default rounding mode, unless otherwise specified.
916 */
917 defaultRoundingMode?:
918 | 'ROUNDING_MODE_UNSPECIFIED'
919 | 'ROUND_HALF_AWAY_FROM_ZERO'
920 | 'ROUND_HALF_EVEN';
921 /**
922 * Optional. The default lifetime of all tables in the dataset, in milliseconds. The minimum lifetime value is 3600000 milliseconds (one hour). To clear an existing default expiration with a PATCH request, set to 0. Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property.
923 */
924 defaultTableExpirationMs?: string;
925 /**
926 * Optional. A user-friendly description of the dataset.
927 */
928 description?: string;
929 /**
930 * Output only. A hash of the resource.
931 */
932 etag?: string;
933 /**
934 * Optional. Reference to a read-only external dataset defined in data catalogs outside of BigQuery. Filled out when the dataset type is EXTERNAL.
935 */
936 externalDatasetReference?: IExternalDatasetReference;
937 /**
938 * Optional. A descriptive name for the dataset.
939 */
940 friendlyName?: string;
941 /**
942 * Output only. The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field.
943 */
944 id?: string;
945 /**
946 * Optional. TRUE if the dataset and its table names are case-insensitive, otherwise FALSE. By default, this is FALSE, which means the dataset and its table names are case-sensitive. This field does not affect routine references.
947 */
948 isCaseInsensitive?: boolean;
949 /**
950 * Output only. The resource type.
951 */
952 kind?: string;
953 /**
954 * The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See Creating and Updating Dataset Labels for more information.
955 */
956 labels?: {[key: string]: string};
957 /**
958 * Output only. The date when this dataset was last modified, in milliseconds since the epoch.
959 */
960 lastModifiedTime?: string;
961 /**
962 * Optional. The source dataset reference when the dataset is of type LINKED. For all other dataset types it is not set. This field cannot be updated once it is set. Any attempt to update this field using Update and Patch API Operations will be ignored.
963 */
964 linkedDatasetSource?: ILinkedDatasetSource;
965 /**
966 * The geographic location where the dataset should reside. See https://cloud.google.com/bigquery/docs/locations for supported locations.
967 */
968 location?: string;
969 /**
970 * Optional. Defines the time travel window in hours. The value can be from 48 to 168 hours (2 to 7 days). The default value is 168 hours if this is not set.
971 */
972 maxTimeTravelHours?: string;
973 /**
974 * Output only. Reserved for future use.
975 */
976 satisfiesPzi?: boolean;
977 /**
978 * Output only. Reserved for future use.
979 */
980 satisfiesPzs?: boolean;
981 /**
982 * Output only. A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource.
983 */
984 selfLink?: string;
985 /**
986 * Optional. Updates storage_billing_model for the dataset.
987 */
988 storageBillingModel?:
989 | 'STORAGE_BILLING_MODEL_UNSPECIFIED'
990 | 'LOGICAL'
991 | 'PHYSICAL';
992 /**
993 * Output only. Tags for the Dataset.
994 */
995 tags?: Array<{
996 /**
997 * Required. The namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is org id.
998 */
999 tagKey?: string;
1000 /**
1001 * Required. The friendly short name of the tag value, e.g. "production".
1002 */
1003 tagValue?: string;
1004 }>;
1005 /**
1006 * Output only. Same as `type` in `ListFormatDataset`. The type of the dataset, one of: * DEFAULT - only accessible by owner and authorized accounts, * PUBLIC - accessible by everyone, * LINKED - linked dataset, * EXTERNAL - dataset with definition in external metadata catalog. -- *BIGLAKE_METASTORE - dataset that references a database created in BigLakeMetastore service. --
1007 */
1008 type?: string;
1009 };
1010
1011 /**
1012 * Grants all resources of particular types in a particular dataset read access to the current dataset. Similar to how individually authorized views work, updates to any resource granted through its dataset (including creation of new resources) requires read permission to referenced resources, plus write permission to the authorizing dataset.
1013 */
1014 type IDatasetAccessEntry = {
1015 /**
1016 * The dataset this entry applies to
1017 */
1018 dataset?: IDatasetReference;
1019 /**
1020 * Which resources in the dataset this entry applies to. Currently, only views are supported, but additional target types may be added in the future.
1021 */
1022 targetTypes?: Array<'TARGET_TYPE_UNSPECIFIED' | 'VIEWS' | 'ROUTINES'>;
1023 };
1024
1025 /**
1026 * Response format for a page of results when listing datasets.
1027 */
1028 type IDatasetList = {
1029 /**
1030 * An array of the dataset resources in the project. Each resource contains basic information. For full information about a particular dataset resource, use the Datasets: get method. This property is omitted when there are no datasets in the project.
1031 */
1032 datasets?: Array<{
1033 /**
1034 * The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID.
1035 */
1036 datasetReference?: IDatasetReference;
1037 /**
1038 * An alternate name for the dataset. The friendly name is purely decorative in nature.
1039 */
1040 friendlyName?: string;
1041 /**
1042 * The fully-qualified, unique, opaque ID of the dataset.
1043 */
1044 id?: string;
1045 /**
1046 * The resource type. This property always returns the value "bigquery#dataset"
1047 */
1048 kind?: string;
1049 /**
1050 * The labels associated with this dataset. You can use these to organize and group your datasets.
1051 */
1052 labels?: {[key: string]: string};
1053 /**
1054 * The geographic location where the dataset resides.
1055 */
1056 location?: string;
1057 }>;
1058 /**
1059 * Output only. A hash value of the results page. You can use this property to determine if the page has changed since the last request.
1060 */
1061 etag?: string;
1062 /**
1063 * Output only. The resource type. This property always returns the value "bigquery#datasetList"
1064 */
1065 kind?: string;
1066 /**
1067 * A token that can be used to request the next results page. This property is omitted on the final results page.
1068 */
1069 nextPageToken?: string;
1070 /**
1071 * A list of skipped locations that were unreachable. For more information about BigQuery locations, see: https://cloud.google.com/bigquery/docs/locations. Example: "europe-west5"
1072 */
1073 unreachable?: Array<string>;
1074 };
1075
1076 type IDatasetReference = {
1077 /**
1078 * Required. A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
1079 */
1080 datasetId?: string;
1081 /**
1082 * Optional. The ID of the project containing this dataset.
1083 */
1084 projectId?: string;
1085 };
1086
1087 /**
1088 * Properties for the destination table.
1089 */
1090 type IDestinationTableProperties = {
1091 /**
1092 * Optional. The description for the destination table. This will only be used if the destination table is newly created. If the table already exists and a value different than the current description is provided, the job will fail.
1093 */
1094 description?: string;
1095 /**
1096 * Internal use only.
1097 */
1098 expirationTime?: string;
1099 /**
1100 * Optional. Friendly name for the destination table. If the table already exists, it should be same as the existing friendly name.
1101 */
1102 friendlyName?: string;
1103 /**
1104 * Optional. The labels associated with this table. You can use these to organize and group your tables. This will only be used if the destination table is newly created. If the table already exists and labels are different than the current labels are provided, the job will fail.
1105 */
1106 labels?: {[key: string]: string};
1107 };
1108
1109 /**
1110 * Model evaluation metrics for dimensionality reduction models.
1111 */
1112 type IDimensionalityReductionMetrics = {
1113 /**
1114 * Total percentage of variance explained by the selected principal components.
1115 */
1116 totalExplainedVarianceRatio?: number;
1117 };
1118
1119 /**
1120 * Detailed statistics for DML statements
1121 */
1122 type IDmlStatistics = {
1123 /**
1124 * Output only. Number of deleted Rows. populated by DML DELETE, MERGE and TRUNCATE statements.
1125 */
1126 deletedRowCount?: string;
1127 /**
1128 * Output only. Number of inserted Rows. Populated by DML INSERT and MERGE statements
1129 */
1130 insertedRowCount?: string;
1131 /**
1132 * Output only. Number of updated Rows. Populated by DML UPDATE and MERGE statements.
1133 */
1134 updatedRowCount?: string;
1135 };
1136
1137 /**
1138 * Discrete candidates of a double hyperparameter.
1139 */
1140 type IDoubleCandidates = {
1141 /**
1142 * Candidates for the double parameter in increasing order.
1143 */
1144 candidates?: Array<number>;
1145 };
1146
1147 /**
1148 * Search space for a double hyperparameter.
1149 */
1150 type IDoubleHparamSearchSpace = {
1151 /**
1152 * Candidates of the double hyperparameter.
1153 */
1154 candidates?: IDoubleCandidates;
1155 /**
1156 * Range of the double hyperparameter.
1157 */
1158 range?: IDoubleRange;
1159 };
1160
1161 /**
1162 * Range of a double hyperparameter.
1163 */
1164 type IDoubleRange = {
1165 /**
1166 * Max value of the double parameter.
1167 */
1168 max?: number;
1169 /**
1170 * Min value of the double parameter.
1171 */
1172 min?: number;
1173 };
1174
1175 type IEncryptionConfiguration = {
1176 /**
1177 * Optional. Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key.
1178 */
1179 kmsKeyName?: string;
1180 };
1181
1182 /**
1183 * A single entry in the confusion matrix.
1184 */
1185 type IEntry = {
1186 /**
1187 * Number of items being predicted as this label.
1188 */
1189 itemCount?: string;
1190 /**
1191 * The predicted label. For confidence_threshold > 0, we will also add an entry indicating the number of items under the confidence threshold.
1192 */
1193 predictedLabel?: string;
1194 };
1195
1196 /**
1197 * Error details.
1198 */
1199 type IErrorProto = {
1200 /**
1201 * Debugging information. This property is internal to Google and should not be used.
1202 */
1203 debugInfo?: string;
1204 /**
1205 * Specifies where the error occurred, if present.
1206 */
1207 location?: string;
1208 /**
1209 * A human-readable description of the error.
1210 */
1211 message?: string;
1212 /**
1213 * A short error code that summarizes the error.
1214 */
1215 reason?: string;
1216 };
1217
1218 /**
1219 * Evaluation metrics of a model. These are either computed on all training data or just the eval data based on whether eval data was used during training. These are not present for imported models.
1220 */
1221 type IEvaluationMetrics = {
1222 /**
1223 * Populated for ARIMA models.
1224 */
1225 arimaForecastingMetrics?: IArimaForecastingMetrics;
1226 /**
1227 * Populated for binary classification/classifier models.
1228 */
1229 binaryClassificationMetrics?: IBinaryClassificationMetrics;
1230 /**
1231 * Populated for clustering models.
1232 */
1233 clusteringMetrics?: IClusteringMetrics;
1234 /**
1235 * Evaluation metrics when the model is a dimensionality reduction model, which currently includes PCA.
1236 */
1237 dimensionalityReductionMetrics?: IDimensionalityReductionMetrics;
1238 /**
1239 * Populated for multi-class classification/classifier models.
1240 */
1241 multiClassClassificationMetrics?: IMultiClassClassificationMetrics;
1242 /**
1243 * Populated for implicit feedback type matrix factorization models.
1244 */
1245 rankingMetrics?: IRankingMetrics;
1246 /**
1247 * Populated for regression models and explicit feedback type matrix factorization models.
1248 */
1249 regressionMetrics?: IRegressionMetrics;
1250 };
1251
1252 /**
1253 * A single stage of query execution.
1254 */
1255 type IExplainQueryStage = {
1256 /**
1257 * Number of parallel input segments completed.
1258 */
1259 completedParallelInputs?: string;
1260 /**
1261 * Output only. Compute mode for this stage.
1262 */
1263 computeMode?: 'COMPUTE_MODE_UNSPECIFIED' | 'BIGQUERY' | 'BI_ENGINE';
1264 /**
1265 * Milliseconds the average shard spent on CPU-bound tasks.
1266 */
1267 computeMsAvg?: string;
1268 /**
1269 * Milliseconds the slowest shard spent on CPU-bound tasks.
1270 */
1271 computeMsMax?: string;
1272 /**
1273 * Relative amount of time the average shard spent on CPU-bound tasks.
1274 */
1275 computeRatioAvg?: number;
1276 /**
1277 * Relative amount of time the slowest shard spent on CPU-bound tasks.
1278 */
1279 computeRatioMax?: number;
1280 /**
1281 * Stage end time represented as milliseconds since the epoch.
1282 */
1283 endMs?: string;
1284 /**
1285 * Unique ID for the stage within the plan.
1286 */
1287 id?: string;
1288 /**
1289 * IDs for stages that are inputs to this stage.
1290 */
1291 inputStages?: Array<string>;
1292 /**
1293 * Human-readable name for the stage.
1294 */
1295 name?: string;
1296 /**
1297 * Number of parallel input segments to be processed
1298 */
1299 parallelInputs?: string;
1300 /**
1301 * Milliseconds the average shard spent reading input.
1302 */
1303 readMsAvg?: string;
1304 /**
1305 * Milliseconds the slowest shard spent reading input.
1306 */
1307 readMsMax?: string;
1308 /**
1309 * Relative amount of time the average shard spent reading input.
1310 */
1311 readRatioAvg?: number;
1312 /**
1313 * Relative amount of time the slowest shard spent reading input.
1314 */
1315 readRatioMax?: number;
1316 /**
1317 * Number of records read into the stage.
1318 */
1319 recordsRead?: string;
1320 /**
1321 * Number of records written by the stage.
1322 */
1323 recordsWritten?: string;
1324 /**
1325 * Total number of bytes written to shuffle.
1326 */
1327 shuffleOutputBytes?: string;
1328 /**
1329 * Total number of bytes written to shuffle and spilled to disk.
1330 */
1331 shuffleOutputBytesSpilled?: string;
1332 /**
1333 * Slot-milliseconds used by the stage.
1334 */
1335 slotMs?: string;
1336 /**
1337 * Stage start time represented as milliseconds since the epoch.
1338 */
1339 startMs?: string;
1340 /**
1341 * Current status for this stage.
1342 */
1343 status?: string;
1344 /**
1345 * List of operations within the stage in dependency order (approximately chronological).
1346 */
1347 steps?: Array<IExplainQueryStep>;
1348 /**
1349 * Milliseconds the average shard spent waiting to be scheduled.
1350 */
1351 waitMsAvg?: string;
1352 /**
1353 * Milliseconds the slowest shard spent waiting to be scheduled.
1354 */
1355 waitMsMax?: string;
1356 /**
1357 * Relative amount of time the average shard spent waiting to be scheduled.
1358 */
1359 waitRatioAvg?: number;
1360 /**
1361 * Relative amount of time the slowest shard spent waiting to be scheduled.
1362 */
1363 waitRatioMax?: number;
1364 /**
1365 * Milliseconds the average shard spent on writing output.
1366 */
1367 writeMsAvg?: string;
1368 /**
1369 * Milliseconds the slowest shard spent on writing output.
1370 */
1371 writeMsMax?: string;
1372 /**
1373 * Relative amount of time the average shard spent on writing output.
1374 */
1375 writeRatioAvg?: number;
1376 /**
1377 * Relative amount of time the slowest shard spent on writing output.
1378 */
1379 writeRatioMax?: number;
1380 };
1381
1382 /**
1383 * An operation within a stage.
1384 */
1385 type IExplainQueryStep = {
1386 /**
1387 * Machine-readable operation type.
1388 */
1389 kind?: string;
1390 /**
1391 * Human-readable description of the step(s).
1392 */
1393 substeps?: Array<string>;
1394 };
1395
1396 /**
1397 * Explanation for a single feature.
1398 */
1399 type IExplanation = {
1400 /**
1401 * Attribution of feature.
1402 */
1403 attribution?: number;
1404 /**
1405 * The full feature name. For non-numerical features, will be formatted like `.`. Overall size of feature name will always be truncated to first 120 characters.
1406 */
1407 featureName?: string;
1408 };
1409
1410 /**
1411 * Statistics for the EXPORT DATA statement as part of Query Job. EXTRACT JOB statistics are populated in JobStatistics4.
1412 */
1413 type IExportDataStatistics = {
1414 /**
1415 * Number of destination files generated in case of EXPORT DATA statement only.
1416 */
1417 fileCount?: string;
1418 /**
1419 * [Alpha] Number of destination rows generated in case of EXPORT DATA statement only.
1420 */
1421 rowCount?: string;
1422 };
1423
1424 /**
1425 * Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1426 */
1427 type IExpr = {
1428 /**
1429 * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1430 */
1431 description?: string;
1432 /**
1433 * Textual representation of an expression in Common Expression Language syntax.
1434 */
1435 expression?: string;
1436 /**
1437 * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1438 */
1439 location?: string;
1440 /**
1441 * Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1442 */
1443 title?: string;
1444 };
1445
1446 type IExternalDataConfiguration = {
1447 /**
1448 * Try to detect schema and format options automatically. Any option specified explicitly will be honored.
1449 */
1450 autodetect?: boolean;
1451 /**
1452 * Optional. Additional properties to set if sourceFormat is set to AVRO.
1453 */
1454 avroOptions?: IAvroOptions;
1455 /**
1456 * Optional. Additional options if sourceFormat is set to BIGTABLE.
1457 */
1458 bigtableOptions?: IBigtableOptions;
1459 /**
1460 * Optional. The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups, Avro, ORC and Parquet formats. An empty string is an invalid value.
1461 */
1462 compression?: string;
1463 /**
1464 * Optional. The connection specifying the credentials to be used to read external storage, such as Azure Blob, Cloud Storage, or S3. The connection_id can have the form "<project\_id>.<location\_id>.<connection\_id>" or "projects/<project\_id>/locations/<location\_id>/connections/<connection\_id>".
1465 */
1466 connectionId?: string;
1467 /**
1468 * Optional. Additional properties to set if sourceFormat is set to CSV.
1469 */
1470 csvOptions?: ICsvOptions;
1471 /**
1472 * Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is ["NUMERIC", "BIGNUMERIC"]. If (precision,scale) is: * (38,9) -> NUMERIC; * (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer digits); * (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); * (76,38) -> BIGNUMERIC; * (77,38) -> BIGNUMERIC (error if value exeeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, ["BIGNUMERIC", "NUMERIC"] is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to ["NUMERIC", "STRING"] for ORC and ["NUMERIC"] for the other file formats.
1473 */
1474 decimalTargetTypes?: Array<
1475 'DECIMAL_TARGET_TYPE_UNSPECIFIED' | 'NUMERIC' | 'BIGNUMERIC' | 'STRING'
1476 >;
1477 /**
1478 * Optional. Specifies how source URIs are interpreted for constructing the file set to load. By default source URIs are expanded against the underlying storage. Other options include specifying manifest files. Only applicable to object storage systems.
1479 */
1480 fileSetSpecType?:
1481 | 'FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH'
1482 | 'FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST';
1483 /**
1484 * Optional. Additional options if sourceFormat is set to GOOGLE_SHEETS.
1485 */
1486 googleSheetsOptions?: IGoogleSheetsOptions;
1487 /**
1488 * Optional. When set, configures hive partitioning support. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error, as will providing an invalid specification.
1489 */
1490 hivePartitioningOptions?: IHivePartitioningOptions;
1491 /**
1492 * Optional. Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored. ORC: This setting is ignored. Parquet: This setting is ignored.
1493 */
1494 ignoreUnknownValues?: boolean;
1495 /**
1496 * Optional. Load option to be used together with source_format newline-delimited JSON to indicate that a variant of JSON is being loaded. To load newline-delimited GeoJSON, specify GEOJSON (and source_format must be set to NEWLINE_DELIMITED_JSON).
1497 */
1498 jsonExtension?: 'JSON_EXTENSION_UNSPECIFIED' | 'GEOJSON';
1499 /**
1500 * Optional. Additional properties to set if sourceFormat is set to JSON.
1501 */
1502 jsonOptions?: IJsonOptions;
1503 /**
1504 * Optional. The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups, Avro, ORC and Parquet formats.
1505 */
1506 maxBadRecords?: number;
1507 /**
1508 * Optional. Metadata Cache Mode for the table. Set this to enable caching of metadata from external data source.
1509 */
1510 metadataCacheMode?:
1511 | 'METADATA_CACHE_MODE_UNSPECIFIED'
1512 | 'AUTOMATIC'
1513 | 'MANUAL';
1514 /**
1515 * Optional. ObjectMetadata is used to create Object Tables. Object Tables contain a listing of objects (with their metadata) found at the source_uris. If ObjectMetadata is set, source_format should be omitted. Currently SIMPLE is the only supported Object Metadata type.
1516 */
1517 objectMetadata?: 'OBJECT_METADATA_UNSPECIFIED' | 'DIRECTORY' | 'SIMPLE';
1518 /**
1519 * Optional. Additional properties to set if sourceFormat is set to PARQUET.
1520 */
1521 parquetOptions?: IParquetOptions;
1522 /**
1523 * Optional. When creating an external table, the user can provide a reference file with the table schema. This is enabled for the following formats: AVRO, PARQUET, ORC.
1524 */
1525 referenceFileSchemaUri?: string;
1526 /**
1527 * Optional. The schema for the data. Schema is required for CSV and JSON formats if autodetect is not on. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, Avro, ORC and Parquet formats.
1528 */
1529 schema?: ITableSchema;
1530 /**
1531 * [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". For Apache Iceberg tables, specify "ICEBERG". For ORC files, specify "ORC". For Parquet files, specify "PARQUET". [Beta] For Google Cloud Bigtable, specify "BIGTABLE".
1532 */
1533 sourceFormat?: string;
1534 /**
1535 * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed.
1536 */
1537 sourceUris?: Array<string>;
1538 };
1539
1540 /**
1541 * Configures the access a dataset defined in an external metadata storage.
1542 */
1543 type IExternalDatasetReference = {
1544 /**
1545 * Required. The connection id that is used to access the external_source. Format: projects/{project_id}/locations/{location_id}/connections/{connection_id}
1546 */
1547 connection?: string;
1548 /**
1549 * Required. External source that backs this dataset.
1550 */
1551 externalSource?: string;
1552 };
1553
1554 /**
1555 * The external service cost is a portion of the total cost, these costs are not additive with total_bytes_billed. Moreover, this field only track external service costs that will show up as BigQuery costs (e.g. training BigQuery ML job with google cloud CAIP or Automl Tables services), not other costs which may be accrued by running the query (e.g. reading from Bigtable or Cloud Storage). The external service costs with different billing sku (e.g. CAIP job is charged based on VM usage) are converted to BigQuery billed_bytes and slot_ms with equivalent amount of US dollars. Services may not directly correlate to these metrics, but these are the equivalents for billing purposes. Output only.
1556 */
1557 type IExternalServiceCost = {
1558 /**
1559 * External service cost in terms of bigquery bytes billed.
1560 */
1561 bytesBilled?: string;
1562 /**
1563 * External service cost in terms of bigquery bytes processed.
1564 */
1565 bytesProcessed?: string;
1566 /**
1567 * External service name.
1568 */
1569 externalService?: string;
1570 /**
1571 * Non-preemptable reserved slots used for external job. For example, reserved slots for Cloua AI Platform job are the VM usages converted to BigQuery slot with equivalent mount of price.
1572 */
1573 reservedSlotCount?: string;
1574 /**
1575 * External service cost in terms of bigquery slot milliseconds.
1576 */
1577 slotMs?: string;
1578 };
1579
1580 /**
1581 * Representative value of a single feature within the cluster.
1582 */
1583 type IFeatureValue = {
1584 /**
1585 * The categorical feature value.
1586 */
1587 categoricalValue?: ICategoricalValue;
1588 /**
1589 * The feature column name.
1590 */
1591 featureColumn?: string;
1592 /**
1593 * The numerical feature value. This is the centroid value for this feature.
1594 */
1595 numericalValue?: number;
1596 };
1597
1598 /**
1599 * Request message for `GetIamPolicy` method.
1600 */
1601 type IGetIamPolicyRequest = {
1602 /**
1603 * OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
1604 */
1605 options?: IGetPolicyOptions;
1606 };
1607
1608 /**
1609 * Encapsulates settings provided to GetIamPolicy.
1610 */
1611 type IGetPolicyOptions = {
1612 /**
1613 * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1614 */
1615 requestedPolicyVersion?: number;
1616 };
1617
1618 /**
1619 * Response object of GetQueryResults.
1620 */
1621 type IGetQueryResultsResponse = {
1622 /**
1623 * Whether the query result was fetched from the query cache.
1624 */
1625 cacheHit?: boolean;
1626 /**
1627 * Output only. The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. For more information about error messages, see [Error messages](https://cloud.google.com/bigquery/docs/error-messages).
1628 */
1629 errors?: Array<IErrorProto>;
1630 /**
1631 * A hash of this response.
1632 */
1633 etag?: string;
1634 /**
1635 * Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
1636 */
1637 jobComplete?: boolean;
1638 /**
1639 * Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
1640 */
1641 jobReference?: IJobReference;
1642 /**
1643 * The resource type of the response.
1644 */
1645 kind?: string;
1646 /**
1647 * Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
1648 */
1649 numDmlAffectedRows?: string;
1650 /**
1651 * A token used for paging results. When this token is non-empty, it indicates additional results are available.
1652 */
1653 pageToken?: string;
1654 /**
1655 * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Present only when the query completes successfully. The REST-based representation of this data leverages a series of JSON f,v objects for indicating fields and values.
1656 */
1657 rows?: Array<ITableRow>;
1658 /**
1659 * The schema of the results. Present only when the query completes successfully.
1660 */
1661 schema?: ITableSchema;
1662 /**
1663 * The total number of bytes processed for this query.
1664 */
1665 totalBytesProcessed?: string;
1666 /**
1667 * The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when the query completes successfully.
1668 */
1669 totalRows?: string;
1670 };
1671
1672 /**
1673 * Response object of GetServiceAccount
1674 */
1675 type IGetServiceAccountResponse = {
1676 /**
1677 * The service account email address.
1678 */
1679 email?: string;
1680 /**
1681 * The resource type of the response.
1682 */
1683 kind?: string;
1684 };
1685
1686 /**
1687 * Global explanations containing the top most important features after training.
1688 */
1689 type IGlobalExplanation = {
1690 /**
1691 * Class label for this set of global explanations. Will be empty/null for binary logistic and linear regression models. Sorted alphabetically in descending order.
1692 */
1693 classLabel?: string;
1694 /**
1695 * A list of the top global explanations. Sorted by absolute value of attribution in descending order.
1696 */
1697 explanations?: Array<IExplanation>;
1698 };
1699
1700 /**
1701 * Options specific to Google Sheets data sources.
1702 */
1703 type IGoogleSheetsOptions = {
1704 /**
1705 * Optional. Range of a sheet to query from. Only used when non-empty. Typical format: sheet_name!top_left_cell_id:bottom_right_cell_id For example: sheet1!A1:B20
1706 */
1707 range?: string;
1708 /**
1709 * Optional. The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, the behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
1710 */
1711 skipLeadingRows?: string;
1712 };
1713
1714 /**
1715 * High cardinality join detailed information.
1716 */
1717 type IHighCardinalityJoin = {
1718 /**
1719 * Output only. Count of left input rows.
1720 */
1721 leftRows?: string;
1722 /**
1723 * Output only. Count of the output rows.
1724 */
1725 outputRows?: string;
1726 /**
1727 * Output only. Count of right input rows.
1728 */
1729 rightRows?: string;
1730 /**
1731 * Output only. The index of the join operator in the ExplainQueryStep lists.
1732 */
1733 stepIndex?: number;
1734 };
1735
1736 /**
1737 * Options for configuring hive partitioning detect.
1738 */
1739 type IHivePartitioningOptions = {
1740 /**
1741 * Output only. For permanent external tables, this field is populated with the hive partition keys in the order they were inferred. The types of the partition keys can be deduced by checking the table schema (which will include the partition keys). Not every API will populate this field in the output. For example, Tables.Get will populate it, but Tables.List will not contain this field.
1742 */
1743 fields?: Array<string>;
1744 /**
1745 * Optional. When set, what mode of hive partitioning to use when reading data. The following modes are supported: * AUTO: automatically infer partition key name(s) and type(s). * STRINGS: automatically infer partition key name(s). All types are strings. * CUSTOM: partition key schema is encoded in the source URI prefix. Not all storage formats support hive partitioning. Requesting hive partitioning on an unsupported format will lead to an error. Currently supported formats are: JSON, CSV, ORC, Avro and Parquet.
1746 */
1747 mode?: string;
1748 /**
1749 * Optional. If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified. Note that this field should only be true when creating a permanent external table or querying a temporary external table. Hive-partitioned loads with require_partition_filter explicitly set to true will fail.
1750 */
1751 requirePartitionFilter?: boolean;
1752 /**
1753 * Optional. When hive partition detection is requested, a common prefix for all source uris must be required. The prefix must end immediately before the partition key encoding begins. For example, consider files following this data layout: gs://bucket/path_to_table/dt=2019-06-01/country=USA/id=7/file.avro gs://bucket/path_to_table/dt=2019-05-31/country=CA/id=3/file.avro When hive partitioning is requested with either AUTO or STRINGS detection, the common prefix can be either of gs://bucket/path_to_table or gs://bucket/path_to_table/. CUSTOM detection requires encoding the partitioning schema immediately after the common prefix. For CUSTOM, any of * gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:INTEGER} * gs://bucket/path_to_table/{dt:STRING}/{country:STRING}/{id:INTEGER} * gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:STRING} would all be valid source URI prefixes.
1754 */
1755 sourceUriPrefix?: string;
1756 };
1757
1758 /**
1759 * Hyperparameter search spaces. These should be a subset of training_options.
1760 */
1761 type IHparamSearchSpaces = {
1762 /**
1763 * Activation functions of neural network models.
1764 */
1765 activationFn?: IStringHparamSearchSpace;
1766 /**
1767 * Mini batch sample size.
1768 */
1769 batchSize?: IIntHparamSearchSpace;
1770 /**
1771 * Booster type for boosted tree models.
1772 */
1773 boosterType?: IStringHparamSearchSpace;
1774 /**
1775 * Subsample ratio of columns for each level for boosted tree models.
1776 */
1777 colsampleBylevel?: IDoubleHparamSearchSpace;
1778 /**
1779 * Subsample ratio of columns for each node(split) for boosted tree models.
1780 */
1781 colsampleBynode?: IDoubleHparamSearchSpace;
1782 /**
1783 * Subsample ratio of columns when constructing each tree for boosted tree models.
1784 */
1785 colsampleBytree?: IDoubleHparamSearchSpace;
1786 /**
1787 * Dart normalization type for boosted tree models.
1788 */
1789 dartNormalizeType?: IStringHparamSearchSpace;
1790 /**
1791 * Dropout probability for dnn model training and boosted tree models using dart booster.
1792 */
1793 dropout?: IDoubleHparamSearchSpace;
1794 /**
1795 * Hidden units for neural network models.
1796 */
1797 hiddenUnits?: IIntArrayHparamSearchSpace;
1798 /**
1799 * L1 regularization coefficient.
1800 */
1801 l1Reg?: IDoubleHparamSearchSpace;
1802 /**
1803 * L2 regularization coefficient.
1804 */
1805 l2Reg?: IDoubleHparamSearchSpace;
1806 /**
1807 * Learning rate of training jobs.
1808 */
1809 learnRate?: IDoubleHparamSearchSpace;
1810 /**
1811 * Maximum depth of a tree for boosted tree models.
1812 */
1813 maxTreeDepth?: IIntHparamSearchSpace;
1814 /**
1815 * Minimum split loss for boosted tree models.
1816 */
1817 minSplitLoss?: IDoubleHparamSearchSpace;
1818 /**
1819 * Minimum sum of instance weight needed in a child for boosted tree models.
1820 */
1821 minTreeChildWeight?: IIntHparamSearchSpace;
1822 /**
1823 * Number of clusters for k-means.
1824 */
1825 numClusters?: IIntHparamSearchSpace;
1826 /**
1827 * Number of latent factors to train on.
1828 */
1829 numFactors?: IIntHparamSearchSpace;
1830 /**
1831 * Number of parallel trees for boosted tree models.
1832 */
1833 numParallelTree?: IIntHparamSearchSpace;
1834 /**
1835 * Optimizer of TF models.
1836 */
1837 optimizer?: IStringHparamSearchSpace;
1838 /**
1839 * Subsample the training data to grow tree to prevent overfitting for boosted tree models.
1840 */
1841 subsample?: IDoubleHparamSearchSpace;
1842 /**
1843 * Tree construction algorithm for boosted tree models.
1844 */
1845 treeMethod?: IStringHparamSearchSpace;
1846 /**
1847 * Hyperparameter for matrix factoration when implicit feedback type is specified.
1848 */
1849 walsAlpha?: IDoubleHparamSearchSpace;
1850 };
1851
1852 /**
1853 * Training info of a trial in [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models.
1854 */
1855 type IHparamTuningTrial = {
1856 /**
1857 * Ending time of the trial.
1858 */
1859 endTimeMs?: string;
1860 /**
1861 * Error message for FAILED and INFEASIBLE trial.
1862 */
1863 errorMessage?: string;
1864 /**
1865 * Loss computed on the eval data at the end of trial.
1866 */
1867 evalLoss?: number;
1868 /**
1869 * Evaluation metrics of this trial calculated on the test data. Empty in Job API.
1870 */
1871 evaluationMetrics?: IEvaluationMetrics;
1872 /**
1873 * Hyperparameter tuning evaluation metrics of this trial calculated on the eval data. Unlike evaluation_metrics, only the fields corresponding to the hparam_tuning_objectives are set.
1874 */
1875 hparamTuningEvaluationMetrics?: IEvaluationMetrics;
1876 /**
1877 * The hyperprameters selected for this trial.
1878 */
1879 hparams?: ITrainingOptions;
1880 /**
1881 * Starting time of the trial.
1882 */
1883 startTimeMs?: string;
1884 /**
1885 * The status of the trial.
1886 */
1887 status?:
1888 | 'TRIAL_STATUS_UNSPECIFIED'
1889 | 'NOT_STARTED'
1890 | 'RUNNING'
1891 | 'SUCCEEDED'
1892 | 'FAILED'
1893 | 'INFEASIBLE'
1894 | 'STOPPED_EARLY';
1895 /**
1896 * Loss computed on the training data at the end of trial.
1897 */
1898 trainingLoss?: number;
1899 /**
1900 * 1-based index of the trial.
1901 */
1902 trialId?: string;
1903 };
1904
1905 /**
1906 * Reason about why no search index was used in the search query (or sub-query).
1907 */
1908 type IIndexUnusedReason = {
1909 /**
1910 * Specifies the base table involved in the reason that no search index was used.
1911 */
1912 baseTable?: ITableReference;
1913 /**
1914 * Specifies the high-level reason for the scenario when no search index was used.
1915 */
1916 code?:
1917 | 'CODE_UNSPECIFIED'
1918 | 'INDEX_CONFIG_NOT_AVAILABLE'
1919 | 'PENDING_INDEX_CREATION'
1920 | 'BASE_TABLE_TRUNCATED'
1921 | 'INDEX_CONFIG_MODIFIED'
1922 | 'TIME_TRAVEL_QUERY'
1923 | 'NO_PRUNING_POWER'
1924 | 'UNINDEXED_SEARCH_FIELDS'
1925 | 'UNSUPPORTED_SEARCH_PATTERN'
1926 | 'OPTIMIZED_WITH_MATERIALIZED_VIEW'
1927 | 'SECURED_BY_DATA_MASKING'
1928 | 'MISMATCHED_TEXT_ANALYZER'
1929 | 'BASE_TABLE_TOO_SMALL'
1930 | 'BASE_TABLE_TOO_LARGE'
1931 | 'ESTIMATED_PERFORMANCE_GAIN_TOO_LOW'
1932 | 'NOT_SUPPORTED_IN_STANDARD_EDITION'
1933 | 'INDEX_SUPPRESSED_BY_FUNCTION_OPTION'
1934 | 'QUERY_CACHE_HIT'
1935 | 'INTERNAL_ERROR'
1936 | 'OTHER_REASON';
1937 /**
1938 * Specifies the name of the unused search index, if available.
1939 */
1940 indexName?: string;
1941 /**
1942 * Free form human-readable reason for the scenario when no search index was used.
1943 */
1944 message?: string;
1945 };
1946
1947 /**
1948 * Details about the input data change insight.
1949 */
1950 type IInputDataChange = {
1951 /**
1952 * Output only. Records read difference percentage compared to a previous run.
1953 */
1954 recordsReadDiffPercentage?: number;
1955 };
1956
1957 /**
1958 * An array of int.
1959 */
1960 type IIntArray = {
1961 /**
1962 * Elements in the int array.
1963 */
1964 elements?: Array<string>;
1965 };
1966
1967 /**
1968 * Search space for int array.
1969 */
1970 type IIntArrayHparamSearchSpace = {
1971 /**
1972 * Candidates for the int array parameter.
1973 */
1974 candidates?: Array<IIntArray>;
1975 };
1976
1977 /**
1978 * Discrete candidates of an int hyperparameter.
1979 */
1980 type IIntCandidates = {
1981 /**
1982 * Candidates for the int parameter in increasing order.
1983 */
1984 candidates?: Array<string>;
1985 };
1986
1987 /**
1988 * Search space for an int hyperparameter.
1989 */
1990 type IIntHparamSearchSpace = {
1991 /**
1992 * Candidates of the int hyperparameter.
1993 */
1994 candidates?: IIntCandidates;
1995 /**
1996 * Range of the int hyperparameter.
1997 */
1998 range?: IIntRange;
1999 };
2000
2001 /**
2002 * Range of an int hyperparameter.
2003 */
2004 type IIntRange = {
2005 /**
2006 * Max value of the int parameter.
2007 */
2008 max?: string;
2009 /**
2010 * Min value of the int parameter.
2011 */
2012 min?: string;
2013 };
2014
2015 /**
2016 * Information about a single iteration of the training run.
2017 */
2018 type IIterationResult = {
2019 /**
2020 * Arima result.
2021 */
2022 arimaResult?: IArimaResult;
2023 /**
2024 * Information about top clusters for clustering models.
2025 */
2026 clusterInfos?: Array<IClusterInfo>;
2027 /**
2028 * Time taken to run the iteration in milliseconds.
2029 */
2030 durationMs?: string;
2031 /**
2032 * Loss computed on the eval data at the end of iteration.
2033 */
2034 evalLoss?: number;
2035 /**
2036 * Index of the iteration, 0 based.
2037 */
2038 index?: number;
2039 /**
2040 * Learn rate used for this iteration.
2041 */
2042 learnRate?: number;
2043 /**
2044 * The information of the principal components.
2045 */
2046 principalComponentInfos?: Array<IPrincipalComponentInfo>;
2047 /**
2048 * Loss computed on the training data at the end of iteration.
2049 */
2050 trainingLoss?: number;
2051 };
2052
2053 type IJob = {
2054 /**
2055 * Required. Describes the job configuration.
2056 */
2057 configuration?: IJobConfiguration;
2058 /**
2059 * Output only. A hash of this resource.
2060 */
2061 etag?: string;
2062 /**
2063 * Output only. Opaque ID field of the job.
2064 */
2065 id?: string;
2066 /**
2067 * Output only. If set, it provides the reason why a Job was created. If not set, it should be treated as the default: REQUESTED. This feature is not yet available. Jobs will always be created.
2068 */
2069 jobCreationReason?: IJobCreationReason;
2070 /**
2071 * Optional. Reference describing the unique-per-user name of the job.
2072 */
2073 jobReference?: IJobReference;
2074 /**
2075 * Output only. The type of the resource.
2076 */
2077 kind?: string;
2078 /**
2079 * Output only. [Full-projection-only] String representation of identity of requesting party. Populated for both first- and third-party identities. Only present for APIs that support third-party identities.
2080 */
2081 principal_subject?: string;
2082 /**
2083 * Output only. A URL that can be used to access the resource again.
2084 */
2085 selfLink?: string;
2086 /**
2087 * Output only. Information about the job, including starting time and ending time of the job.
2088 */
2089 statistics?: IJobStatistics;
2090 /**
2091 * Output only. The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
2092 */
2093 status?: IJobStatus;
2094 /**
2095 * Output only. Email address of the user who ran the job.
2096 */
2097 user_email?: string;
2098 };
2099
2100 /**
2101 * Describes format of a jobs cancellation response.
2102 */
2103 type IJobCancelResponse = {
2104 /**
2105 * The final state of the job.
2106 */
2107 job?: IJob;
2108 /**
2109 * The resource type of the response.
2110 */
2111 kind?: string;
2112 };
2113
2114 type IJobConfiguration = {
2115 /**
2116 * [Pick one] Copies a table.
2117 */
2118 copy?: IJobConfigurationTableCopy;
2119 /**
2120 * Optional. If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined.
2121 */
2122 dryRun?: boolean;
2123 /**
2124 * [Pick one] Configures an extract job.
2125 */
2126 extract?: IJobConfigurationExtract;
2127 /**
2128 * Optional. Job timeout in milliseconds. If this time limit is exceeded, BigQuery might attempt to stop the job.
2129 */
2130 jobTimeoutMs?: string;
2131 /**
2132 * Output only. The type of the job. Can be QUERY, LOAD, EXTRACT, COPY or UNKNOWN.
2133 */
2134 jobType?: string;
2135 /**
2136 * The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
2137 */
2138 labels?: {[key: string]: string};
2139 /**
2140 * [Pick one] Configures a load job.
2141 */
2142 load?: IJobConfigurationLoad;
2143 /**
2144 * [Pick one] Configures a query job.
2145 */
2146 query?: IJobConfigurationQuery;
2147 };
2148
2149 /**
2150 * JobConfigurationExtract configures a job that exports data from a BigQuery table into Google Cloud Storage.
2151 */
2152 type IJobConfigurationExtract = {
2153 /**
2154 * Optional. The compression type to use for exported files. Possible values include DEFLATE, GZIP, NONE, SNAPPY, and ZSTD. The default value is NONE. Not all compression formats are support for all file formats. DEFLATE is only supported for Avro. ZSTD is only supported for Parquet. Not applicable when extracting models.
2155 */
2156 compression?: string;
2157 /**
2158 * Optional. The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON, PARQUET, or AVRO for tables and ML_TF_SAVED_MODEL or ML_XGBOOST_BOOSTER 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 ML_TF_SAVED_MODEL.
2159 */
2160 destinationFormat?: string;
2161 /**
2162 * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
2163 */
2164 destinationUri?: string;
2165 /**
2166 * [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
2167 */
2168 destinationUris?: Array<string>;
2169 /**
2170 * Optional. When extracting data in CSV format, this defines the delimiter to use between fields in the exported data. Default is ','. Not applicable when extracting models.
2171 */
2172 fieldDelimiter?: string;
2173 /**
2174 * Optional. Model extract options only applicable when extracting models.
2175 */
2176 modelExtractOptions?: IModelExtractOptions;
2177 /**
2178 * Optional. Whether to print out a header row in the results. Default is true. Not applicable when extracting models.
2179 */
2180 printHeader?: boolean;
2181 /**
2182 * A reference to the model being exported.
2183 */
2184 sourceModel?: IModelReference;
2185 /**
2186 * A reference to the table being exported.
2187 */
2188 sourceTable?: ITableReference;
2189 /**
2190 * Whether to use logical types when extracting to AVRO format. Not applicable when extracting models.
2191 */
2192 useAvroLogicalTypes?: boolean;
2193 };
2194
2195 /**
2196 * JobConfigurationLoad contains the configuration properties for loading data into a destination table.
2197 */
2198 type IJobConfigurationLoad = {
2199 /**
2200 * Optional. Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
2201 */
2202 allowJaggedRows?: boolean;
2203 /**
2204 * Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
2205 */
2206 allowQuotedNewlines?: boolean;
2207 /**
2208 * Optional. Indicates if we should automatically infer the options and schema for CSV and JSON sources.
2209 */
2210 autodetect?: boolean;
2211 /**
2212 * Clustering specification for the destination table.
2213 */
2214 clustering?: IClustering;
2215 /**
2216 * Optional. Connection properties which can modify the load job behavior. Currently, only the 'session_id' connection property is supported, and is used to resolve _SESSION appearing as the dataset id.
2217 */
2218 connectionProperties?: Array<IConnectionProperty>;
2219 /**
2220 * Optional. [Experimental] Configures the load job to only copy files to the destination BigLake managed table with an external storage_uri, without reading file content and writing them to new files. Copying files only is supported when: * source_uris are in the same external storage system as the destination table but they do not overlap with storage_uri of the destination table. * source_format is the same file format as the destination table. * destination_table is an existing BigLake managed table. Its schema does not have default value expression. It schema does not have type parameters other than precision and scale. * No options other than the above are specified.
2221 */
2222 copyFilesOnly?: boolean;
2223 /**
2224 * Optional. Specifies whether the job is allowed to create new tables. The following values are supported: * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. * CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
2225 */
2226 createDisposition?: string;
2227 /**
2228 * Optional. If this property is true, the job creates a new session using a randomly generated session_id. To continue using a created session with subsequent queries, pass the existing session identifier as a `ConnectionProperty` value. The session identifier is returned as part of the `SessionInfo` message within the query statistics. The new session's location will be set to `Job.JobReference.location` if it is present, otherwise it's set to the default location based on existing routing logic.
2229 */
2230 createSession?: boolean;
2231 /**
2232 * Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is ["NUMERIC", "BIGNUMERIC"]. If (precision,scale) is: * (38,9) -> NUMERIC; * (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer digits); * (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); * (76,38) -> BIGNUMERIC; * (77,38) -> BIGNUMERIC (error if value exeeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, ["BIGNUMERIC", "NUMERIC"] is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to ["NUMERIC", "STRING"] for ORC and ["NUMERIC"] for the other file formats.
2233 */
2234 decimalTargetTypes?: Array<
2235 'DECIMAL_TARGET_TYPE_UNSPECIFIED' | 'NUMERIC' | 'BIGNUMERIC' | 'STRING'
2236 >;
2237 /**
2238 * Custom encryption configuration (e.g., Cloud KMS keys)
2239 */
2240 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2241 /**
2242 * [Required] The destination table to load the data into.
2243 */
2244 destinationTable?: ITableReference;
2245 /**
2246 * Optional. [Experimental] Properties with which to create the destination table if it is new.
2247 */
2248 destinationTableProperties?: IDestinationTableProperties;
2249 /**
2250 * Optional. The character encoding of the data. The supported values are UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-32BE, and UTF-32LE. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the `quote` and `fieldDelimiter` properties. If you don't specify an encoding, or if you specify a UTF-8 encoding when the CSV file is not UTF-8 encoded, BigQuery attempts to convert the data to UTF-8. Generally, your data loads successfully, but it may not match byte-for-byte what you expect. To avoid this, specify the correct encoding by using the `--encoding` flag. If BigQuery can't convert a character other than the ASCII `0` character, BigQuery converts the character to the standard Unicode replacement character: �.
2251 */
2252 encoding?: string;
2253 /**
2254 * Optional. The separator character for fields in a CSV file. The separator is interpreted as a single byte. For files encoded in ISO-8859-1, any single character can be used as a separator. For files encoded in UTF-8, characters represented in decimal range 1-127 (U+0001-U+007F) can be used without any modification. UTF-8 characters encoded with multiple bytes (i.e. U+0080 and above) will have only the first byte used for separating fields. The remaining bytes will be treated as a part of the field. BigQuery also supports the escape sequence "\t" (U+0009) to specify a tab separator. The default value is comma (",", U+002C).
2255 */
2256 fieldDelimiter?: string;
2257 /**
2258 * Optional. Specifies how source URIs are interpreted for constructing the file set to load. By default, source URIs are expanded against the underlying storage. You can also specify manifest files to control how the file set is constructed. This option is only applicable to object storage systems.
2259 */
2260 fileSetSpecType?:
2261 | 'FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH'
2262 | 'FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST';
2263 /**
2264 * Optional. When set, configures hive partitioning support. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error, as will providing an invalid specification.
2265 */
2266 hivePartitioningOptions?: IHivePartitioningOptions;
2267 /**
2268 * Optional. Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names in the table schema Avro, Parquet, ORC: Fields in the file schema that don't exist in the table schema.
2269 */
2270 ignoreUnknownValues?: boolean;
2271 /**
2272 * Optional. Load option to be used together with source_format newline-delimited JSON to indicate that a variant of JSON is being loaded. To load newline-delimited GeoJSON, specify GEOJSON (and source_format must be set to NEWLINE_DELIMITED_JSON).
2273 */
2274 jsonExtension?: 'JSON_EXTENSION_UNSPECIFIED' | 'GEOJSON';
2275 /**
2276 * Optional. The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid. This is only supported for CSV and NEWLINE_DELIMITED_JSON file formats.
2277 */
2278 maxBadRecords?: number;
2279 /**
2280 * Optional. Specifies a string that represents a null value in a CSV file. For example, if you specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default value is the empty string. If you set this property to a custom value, BigQuery throws an error if an empty string is present for all data types except for STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the empty string as an empty value.
2281 */
2282 nullMarker?: string;
2283 /**
2284 * Optional. Additional properties to set if sourceFormat is set to PARQUET.
2285 */
2286 parquetOptions?: IParquetOptions;
2287 /**
2288 * Optional. When sourceFormat is set to "CSV", this indicates whether the embedded ASCII control characters (the first 32 characters in the ASCII-table, from '\x00' to '\x1F') are preserved.
2289 */
2290 preserveAsciiControlCharacters?: boolean;
2291 /**
2292 * If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
2293 */
2294 projectionFields?: Array<string>;
2295 /**
2296 * Optional. The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true. To include the specific quote character within a quoted value, precede it with an additional matching quote character. For example, if you want to escape the default character ' " ', use ' "" '. @default "
2297 */
2298 quote?: string;
2299 /**
2300 * Range partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2301 */
2302 rangePartitioning?: IRangePartitioning;
2303 /**
2304 * Optional. The user can provide a reference file with the reader schema. This file is only loaded if it is part of source URIs, but is not loaded otherwise. It is enabled for the following formats: AVRO, PARQUET, ORC.
2305 */
2306 referenceFileSchemaUri?: string;
2307 /**
2308 * Optional. The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
2309 */
2310 schema?: ITableSchema;
2311 /**
2312 * [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
2313 */
2314 schemaInline?: string;
2315 /**
2316 * [Deprecated] The format of the schemaInline property.
2317 */
2318 schemaInlineFormat?: string;
2319 /**
2320 * Allows the schema of the destination table to be updated as a side effect of the load job if a schema is autodetected or supplied in the job configuration. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
2321 */
2322 schemaUpdateOptions?: Array<string>;
2323 /**
2324 * Optional. The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. When autodetect is on, the behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
2325 */
2326 skipLeadingRows?: number;
2327 /**
2328 * Optional. The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". For parquet, specify "PARQUET". For orc, specify "ORC". The default value is CSV.
2329 */
2330 sourceFormat?: string;
2331 /**
2332 * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one URI can be specified. Also, the '*' wildcard character is not allowed.
2333 */
2334 sourceUris?: Array<string>;
2335 /**
2336 * Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2337 */
2338 timePartitioning?: ITimePartitioning;
2339 /**
2340 * Optional. If sourceFormat is set to "AVRO", indicates whether to interpret logical types as the corresponding BigQuery data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER).
2341 */
2342 useAvroLogicalTypes?: boolean;
2343 /**
2344 * Optional. Specifies the action that occurs if the destination table already exists. The following values are supported: * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the data, removes the constraints and uses the schema from the load job. * WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_APPEND. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
2345 */
2346 writeDisposition?: string;
2347 };
2348
2349 /**
2350 * JobConfigurationQuery configures a BigQuery query job.
2351 */
2352 type IJobConfigurationQuery = {
2353 /**
2354 * Optional. If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For GoogleSQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size.
2355 */
2356 allowLargeResults?: boolean;
2357 /**
2358 * Clustering specification for the destination table.
2359 */
2360 clustering?: IClustering;
2361 /**
2362 * Connection properties which can modify the query behavior.
2363 */
2364 connectionProperties?: Array<IConnectionProperty>;
2365 /**
2366 * [Optional] Specifies whether the query should be executed as a continuous query. The default value is false.
2367 */
2368 continuous?: boolean;
2369 /**
2370 * Optional. Specifies whether the job is allowed to create new tables. The following values are supported: * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. * CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
2371 */
2372 createDisposition?: string;
2373 /**
2374 * If this property is true, the job creates a new session using a randomly generated session_id. To continue using a created session with subsequent queries, pass the existing session identifier as a `ConnectionProperty` value. The session identifier is returned as part of the `SessionInfo` message within the query statistics. The new session's location will be set to `Job.JobReference.location` if it is present, otherwise it's set to the default location based on existing routing logic.
2375 */
2376 createSession?: boolean;
2377 /**
2378 * Optional. Specifies the default dataset to use for unqualified table names in the query. This setting does not alter behavior of unqualified dataset names. Setting the system variable `@@dataset_id` achieves the same behavior. See https://cloud.google.com/bigquery/docs/reference/system-variables for more information on system variables.
2379 */
2380 defaultDataset?: IDatasetReference;
2381 /**
2382 * Custom encryption configuration (e.g., Cloud KMS keys)
2383 */
2384 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2385 /**
2386 * Optional. Describes the table where the query results should be stored. This property must be set for large results that exceed the maximum response size. For queries that produce anonymous (cached) results, this field will be populated by BigQuery.
2387 */
2388 destinationTable?: ITableReference;
2389 /**
2390 * Optional. If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For GoogleSQL queries, this flag is ignored and results are never flattened.
2391 */
2392 flattenResults?: boolean;
2393 /**
2394 * Optional. [Deprecated] Maximum billing tier allowed for this query. The billing tier controls the amount of compute resources allotted to the query, and multiplies the on-demand cost of the query accordingly. A query that runs within its allotted resources will succeed and indicate its billing tier in statistics.query.billingTier, but if the query exceeds its allotted resources, it will fail with billingTierLimitExceeded. WARNING: The billed byte amount can be multiplied by an amount up to this number! Most users should not need to alter this setting, and we recommend that you avoid introducing new uses of it.
2395 */
2396 maximumBillingTier?: number;
2397 /**
2398 * Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
2399 */
2400 maximumBytesBilled?: string;
2401 /**
2402 * GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
2403 */
2404 parameterMode?: string;
2405 /**
2406 * [Deprecated] This property is deprecated.
2407 */
2408 preserveNulls?: boolean;
2409 /**
2410 * Optional. Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
2411 */
2412 priority?: string;
2413 /**
2414 * [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or GoogleSQL.
2415 */
2416 query?: string;
2417 /**
2418 * Query parameters for GoogleSQL queries.
2419 */
2420 queryParameters?: Array<IQueryParameter>;
2421 /**
2422 * Range partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2423 */
2424 rangePartitioning?: IRangePartitioning;
2425 /**
2426 * Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
2427 */
2428 schemaUpdateOptions?: Array<string>;
2429 /**
2430 * Options controlling the execution of scripts.
2431 */
2432 scriptOptions?: IScriptOptions;
2433 /**
2434 * Output only. System variables for GoogleSQL queries. A system variable is output if the variable is settable and its value differs from the system default. "@@" prefix is not included in the name of the System variables.
2435 */
2436 systemVariables?: ISystemVariables;
2437 /**
2438 * Optional. You can specify external table definitions, which operate as ephemeral tables that can be queried. These definitions are configured using a JSON map, where the string key represents the table identifier, and the value is the corresponding external data configuration object.
2439 */
2440 tableDefinitions?: {[key: string]: IExternalDataConfiguration};
2441 /**
2442 * Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2443 */
2444 timePartitioning?: ITimePartitioning;
2445 /**
2446 * Optional. Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's GoogleSQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.
2447 */
2448 useLegacySql?: boolean;
2449 /**
2450 * Optional. Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true.
2451 */
2452 useQueryCache?: boolean;
2453 /**
2454 * Describes user-defined function resources used in the query.
2455 */
2456 userDefinedFunctionResources?: Array<IUserDefinedFunctionResource>;
2457 /**
2458 * Optional. Specifies the action that occurs if the destination table already exists. The following values are supported: * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the data, removes the constraints, and uses the schema from the query result. * WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
2459 */
2460 writeDisposition?: string;
2461 };
2462
2463 /**
2464 * JobConfigurationTableCopy configures a job that copies data from one table to another. For more information on copying tables, see [Copy a table](https://cloud.google.com/bigquery/docs/managing-tables#copy-table).
2465 */
2466 type IJobConfigurationTableCopy = {
2467 /**
2468 * Optional. Specifies whether the job is allowed to create new tables. The following values are supported: * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. * CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
2469 */
2470 createDisposition?: string;
2471 /**
2472 * Custom encryption configuration (e.g., Cloud KMS keys).
2473 */
2474 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2475 /**
2476 * Optional. The time when the destination table expires. Expired tables will be deleted and their storage reclaimed.
2477 */
2478 destinationExpirationTime?: string;
2479 /**
2480 * [Required] The destination table.
2481 */
2482 destinationTable?: ITableReference;
2483 /**
2484 * Optional. Supported operation types in table copy job.
2485 */
2486 operationType?:
2487 | 'OPERATION_TYPE_UNSPECIFIED'
2488 | 'COPY'
2489 | 'SNAPSHOT'
2490 | 'RESTORE'
2491 | 'CLONE';
2492 /**
2493 * [Pick one] Source table to copy.
2494 */
2495 sourceTable?: ITableReference;
2496 /**
2497 * [Pick one] Source tables to copy.
2498 */
2499 sourceTables?: Array<ITableReference>;
2500 /**
2501 * Optional. Specifies the action that occurs if the destination table already exists. The following values are supported: * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema and table constraints from the source table. * WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
2502 */
2503 writeDisposition?: string;
2504 };
2505
2506 /**
2507 * Reason about why a Job was created from a [`jobs.query`](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query) method when used with `JOB_CREATION_OPTIONAL` Job creation mode. For [`jobs.insert`](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert) method calls it will always be `REQUESTED`. This feature is not yet available. Jobs will always be created.
2508 */
2509 type IJobCreationReason = {
2510 /**
2511 * Output only. Specifies the high level reason why a Job was created.
2512 */
2513 code?:
2514 | 'CODE_UNSPECIFIED'
2515 | 'REQUESTED'
2516 | 'LONG_RUNNING'
2517 | 'LARGE_RESULTS'
2518 | 'OTHER';
2519 };
2520
2521 /**
2522 * JobList is the response format for a jobs.list call.
2523 */
2524 type IJobList = {
2525 /**
2526 * A hash of this page of results.
2527 */
2528 etag?: string;
2529 /**
2530 * List of jobs that were requested.
2531 */
2532 jobs?: Array<{
2533 /**
2534 * Required. Describes the job configuration.
2535 */
2536 configuration?: IJobConfiguration;
2537 /**
2538 * A result object that will be present only if the job has failed.
2539 */
2540 errorResult?: IErrorProto;
2541 /**
2542 * Unique opaque ID of the job.
2543 */
2544 id?: string;
2545 /**
2546 * Unique opaque ID of the job.
2547 */
2548 jobReference?: IJobReference;
2549 /**
2550 * The resource type.
2551 */
2552 kind?: string;
2553 /**
2554 * [Full-projection-only] String representation of identity of requesting party. Populated for both first- and third-party identities. Only present for APIs that support third-party identities.
2555 */
2556 principal_subject?: string;
2557 /**
2558 * Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed.
2559 */
2560 state?: string;
2561 /**
2562 * Output only. Information about the job, including starting time and ending time of the job.
2563 */
2564 statistics?: IJobStatistics;
2565 /**
2566 * [Full-projection-only] Describes the status of this job.
2567 */
2568 status?: IJobStatus;
2569 /**
2570 * [Full-projection-only] Email address of the user who ran the job.
2571 */
2572 user_email?: string;
2573 }>;
2574 /**
2575 * The resource type of the response.
2576 */
2577 kind?: string;
2578 /**
2579 * A token to request the next page of results.
2580 */
2581 nextPageToken?: string;
2582 /**
2583 * A list of skipped locations that were unreachable. For more information about BigQuery locations, see: https://cloud.google.com/bigquery/docs/locations. Example: "europe-west5"
2584 */
2585 unreachable?: Array<string>;
2586 };
2587
2588 /**
2589 * A job reference is a fully qualified identifier for referring to a job.
2590 */
2591 type IJobReference = {
2592 /**
2593 * Required. The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
2594 */
2595 jobId?: string;
2596 /**
2597 * Optional. The geographic location of the job. The default value is US. For more information about BigQuery locations, see: https://cloud.google.com/bigquery/docs/locations
2598 */
2599 location?: string;
2600 /**
2601 * Required. The ID of the project containing this job.
2602 */
2603 projectId?: string;
2604 };
2605
2606 /**
2607 * Statistics for a single job execution.
2608 */
2609 type IJobStatistics = {
2610 /**
2611 * Output only. [TrustedTester] Job progress (0.0 -> 1.0) for LOAD and EXTRACT jobs.
2612 */
2613 completionRatio?: number;
2614 /**
2615 * Output only. Statistics for a copy job.
2616 */
2617 copy?: IJobStatistics5;
2618 /**
2619 * Output only. Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
2620 */
2621 creationTime?: string;
2622 /**
2623 * Output only. Statistics for data-masking. Present only for query and extract jobs.
2624 */
2625 dataMaskingStatistics?: IDataMaskingStatistics;
2626 /**
2627 * Output only. End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
2628 */
2629 endTime?: string;
2630 /**
2631 * Output only. Statistics for an extract job.
2632 */
2633 extract?: IJobStatistics4;
2634 /**
2635 * Output only. The duration in milliseconds of the execution of the final attempt of this job, as BigQuery may internally re-attempt to execute the job.
2636 */
2637 finalExecutionDurationMs?: string;
2638 /**
2639 * Output only. Statistics for a load job.
2640 */
2641 load?: IJobStatistics3;
2642 /**
2643 * Output only. Number of child jobs executed.
2644 */
2645 numChildJobs?: string;
2646 /**
2647 * Output only. If this is a child job, specifies the job ID of the parent.
2648 */
2649 parentJobId?: string;
2650 /**
2651 * Output only. Statistics for a query job.
2652 */
2653 query?: IJobStatistics2;
2654 /**
2655 * Output only. Quotas which delayed this job's start time.
2656 */
2657 quotaDeferments?: Array<string>;
2658 /**
2659 * Output only. Job resource usage breakdown by reservation. This field reported misleading information and will no longer be populated.
2660 */
2661 reservationUsage?: Array<{
2662 /**
2663 * Reservation name or "unreserved" for on-demand resources usage.
2664 */
2665 name?: string;
2666 /**
2667 * Total slot milliseconds used by the reservation for a particular job.
2668 */
2669 slotMs?: string;
2670 }>;
2671 /**
2672 * Output only. Name of the primary reservation assigned to this job. Note that this could be different than reservations reported in the reservation usage field if parent reservations were used to execute this job.
2673 */
2674 reservation_id?: string;
2675 /**
2676 * Output only. Statistics for row-level security. Present only for query and extract jobs.
2677 */
2678 rowLevelSecurityStatistics?: IRowLevelSecurityStatistics;
2679 /**
2680 * Output only. If this a child job of a script, specifies information about the context of this job within the script.
2681 */
2682 scriptStatistics?: IScriptStatistics;
2683 /**
2684 * Output only. Information of the session if this job is part of one.
2685 */
2686 sessionInfo?: ISessionInfo;
2687 /**
2688 * Output only. Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
2689 */
2690 startTime?: string;
2691 /**
2692 * Output only. Total bytes processed for the job.
2693 */
2694 totalBytesProcessed?: string;
2695 /**
2696 * Output only. Slot-milliseconds for the job.
2697 */
2698 totalSlotMs?: string;
2699 /**
2700 * Output only. [Alpha] Information of the multi-statement transaction if this job is part of one. This property is only expected on a child job or a job that is in a session. A script parent job is not part of the transaction started in the script.
2701 */
2702 transactionInfo?: ITransactionInfo;
2703 };
2704
2705 /**
2706 * Statistics for a query job.
2707 */
2708 type IJobStatistics2 = {
2709 /**
2710 * Output only. BI Engine specific Statistics.
2711 */
2712 biEngineStatistics?: IBiEngineStatistics;
2713 /**
2714 * Output only. Billing tier for the job. This is a BigQuery-specific concept which is not related to the Google Cloud notion of "free tier". The value here is a measure of the query's resource consumption relative to the amount of data scanned. For on-demand queries, the limit is 100, and all queries within this limit are billed at the standard on-demand rates. On-demand queries that exceed this limit will fail with a billingTierLimitExceeded error.
2715 */
2716 billingTier?: number;
2717 /**
2718 * Output only. Whether the query result was fetched from the query cache.
2719 */
2720 cacheHit?: boolean;
2721 /**
2722 * Output only. Referenced dataset for DCL statement.
2723 */
2724 dclTargetDataset?: IDatasetReference;
2725 /**
2726 * Output only. Referenced table for DCL statement.
2727 */
2728 dclTargetTable?: ITableReference;
2729 /**
2730 * Output only. Referenced view for DCL statement.
2731 */
2732 dclTargetView?: ITableReference;
2733 /**
2734 * Output only. The number of row access policies affected by a DDL statement. Present only for DROP ALL ROW ACCESS POLICIES queries.
2735 */
2736 ddlAffectedRowAccessPolicyCount?: string;
2737 /**
2738 * Output only. The table after rename. Present only for ALTER TABLE RENAME TO query.
2739 */
2740 ddlDestinationTable?: ITableReference;
2741 /**
2742 * Output only. The DDL operation performed, possibly dependent on the pre-existence of the DDL target.
2743 */
2744 ddlOperationPerformed?: string;
2745 /**
2746 * Output only. The DDL target dataset. Present only for CREATE/ALTER/DROP SCHEMA(dataset) queries.
2747 */
2748 ddlTargetDataset?: IDatasetReference;
2749 /**
2750 * Output only. [Beta] The DDL target routine. Present only for CREATE/DROP FUNCTION/PROCEDURE queries.
2751 */
2752 ddlTargetRoutine?: IRoutineReference;
2753 /**
2754 * Output only. The DDL target row access policy. Present only for CREATE/DROP ROW ACCESS POLICY queries.
2755 */
2756 ddlTargetRowAccessPolicy?: IRowAccessPolicyReference;
2757 /**
2758 * Output only. The DDL target table. Present only for CREATE/DROP TABLE/VIEW and DROP ALL ROW ACCESS POLICIES queries.
2759 */
2760 ddlTargetTable?: ITableReference;
2761 /**
2762 * Output only. Detailed statistics for DML statements INSERT, UPDATE, DELETE, MERGE or TRUNCATE.
2763 */
2764 dmlStats?: IDmlStatistics;
2765 /**
2766 * Output only. The original estimate of bytes processed for the job.
2767 */
2768 estimatedBytesProcessed?: string;
2769 /**
2770 * Output only. Stats for EXPORT DATA statement.
2771 */
2772 exportDataStatistics?: IExportDataStatistics;
2773 /**
2774 * Output only. Job cost breakdown as bigquery internal cost and external service costs.
2775 */
2776 externalServiceCosts?: Array<IExternalServiceCost>;
2777 /**
2778 * Output only. Statistics for a LOAD query.
2779 */
2780 loadQueryStatistics?: ILoadQueryStatistics;
2781 /**
2782 * Output only. Statistics of materialized views of a query job.
2783 */
2784 materializedViewStatistics?: IMaterializedViewStatistics;
2785 /**
2786 * Output only. Statistics of metadata cache usage in a query for BigLake tables.
2787 */
2788 metadataCacheStatistics?: IMetadataCacheStatistics;
2789 /**
2790 * Output only. Statistics of a BigQuery ML training job.
2791 */
2792 mlStatistics?: IMlStatistics;
2793 /**
2794 * Deprecated.
2795 */
2796 modelTraining?: IBigQueryModelTraining;
2797 /**
2798 * Deprecated.
2799 */
2800 modelTrainingCurrentIteration?: number;
2801 /**
2802 * Deprecated.
2803 */
2804 modelTrainingExpectedTotalIteration?: string;
2805 /**
2806 * Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
2807 */
2808 numDmlAffectedRows?: string;
2809 /**
2810 * Output only. Performance insights.
2811 */
2812 performanceInsights?: IPerformanceInsights;
2813 /**
2814 * Output only. Query optimization information for a QUERY job.
2815 */
2816 queryInfo?: IQueryInfo;
2817 /**
2818 * Output only. Describes execution plan for the query.
2819 */
2820 queryPlan?: Array<IExplainQueryStage>;
2821 /**
2822 * Output only. Referenced routines for the job.
2823 */
2824 referencedRoutines?: Array<IRoutineReference>;
2825 /**
2826 * Output only. Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
2827 */
2828 referencedTables?: Array<ITableReference>;
2829 /**
2830 * Output only. Job resource usage breakdown by reservation. This field reported misleading information and will no longer be populated.
2831 */
2832 reservationUsage?: Array<{
2833 /**
2834 * Reservation name or "unreserved" for on-demand resources usage.
2835 */
2836 name?: string;
2837 /**
2838 * Total slot milliseconds used by the reservation for a particular job.
2839 */
2840 slotMs?: string;
2841 }>;
2842 /**
2843 * Output only. The schema of the results. Present only for successful dry run of non-legacy SQL queries.
2844 */
2845 schema?: ITableSchema;
2846 /**
2847 * Output only. Search query specific statistics.
2848 */
2849 searchStatistics?: ISearchStatistics;
2850 /**
2851 * Output only. Statistics of a Spark procedure job.
2852 */
2853 sparkStatistics?: ISparkStatistics;
2854 /**
2855 * Output only. The type of query statement, if valid. Possible values: * `SELECT`: [`SELECT`](/bigquery/docs/reference/standard-sql/query-syntax#select_list) statement. * `ASSERT`: [`ASSERT`](/bigquery/docs/reference/standard-sql/debugging-statements#assert) statement. * `INSERT`: [`INSERT`](/bigquery/docs/reference/standard-sql/dml-syntax#insert_statement) statement. * `UPDATE`: [`UPDATE`](/bigquery/docs/reference/standard-sql/query-syntax#update_statement) statement. * `DELETE`: [`DELETE`](/bigquery/docs/reference/standard-sql/data-manipulation-language) statement. * `MERGE`: [`MERGE`](/bigquery/docs/reference/standard-sql/data-manipulation-language) statement. * `CREATE_TABLE`: [`CREATE TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#create_table_statement) statement, without `AS SELECT`. * `CREATE_TABLE_AS_SELECT`: [`CREATE TABLE AS SELECT`](/bigquery/docs/reference/standard-sql/data-definition-language#query_statement) statement. * `CREATE_VIEW`: [`CREATE VIEW`](/bigquery/docs/reference/standard-sql/data-definition-language#create_view_statement) statement. * `CREATE_MODEL`: [`CREATE MODEL`](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-create#create_model_statement) statement. * `CREATE_MATERIALIZED_VIEW`: [`CREATE MATERIALIZED VIEW`](/bigquery/docs/reference/standard-sql/data-definition-language#create_materialized_view_statement) statement. * `CREATE_FUNCTION`: [`CREATE FUNCTION`](/bigquery/docs/reference/standard-sql/data-definition-language#create_function_statement) statement. * `CREATE_TABLE_FUNCTION`: [`CREATE TABLE FUNCTION`](/bigquery/docs/reference/standard-sql/data-definition-language#create_table_function_statement) statement. * `CREATE_PROCEDURE`: [`CREATE PROCEDURE`](/bigquery/docs/reference/standard-sql/data-definition-language#create_procedure) statement. * `CREATE_ROW_ACCESS_POLICY`: [`CREATE ROW ACCESS POLICY`](/bigquery/docs/reference/standard-sql/data-definition-language#create_row_access_policy_statement) statement. * `CREATE_SCHEMA`: [`CREATE SCHEMA`](/bigquery/docs/reference/standard-sql/data-definition-language#create_schema_statement) statement. * `CREATE_SNAPSHOT_TABLE`: [`CREATE SNAPSHOT TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#create_snapshot_table_statement) statement. * `CREATE_SEARCH_INDEX`: [`CREATE SEARCH INDEX`](/bigquery/docs/reference/standard-sql/data-definition-language#create_search_index_statement) statement. * `DROP_TABLE`: [`DROP TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_table_statement) statement. * `DROP_EXTERNAL_TABLE`: [`DROP EXTERNAL TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_external_table_statement) statement. * `DROP_VIEW`: [`DROP VIEW`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_view_statement) statement. * `DROP_MODEL`: [`DROP MODEL`](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-drop-model) statement. * `DROP_MATERIALIZED_VIEW`: [`DROP MATERIALIZED VIEW`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_materialized_view_statement) statement. * `DROP_FUNCTION` : [`DROP FUNCTION`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_function_statement) statement. * `DROP_TABLE_FUNCTION` : [`DROP TABLE FUNCTION`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_table_function) statement. * `DROP_PROCEDURE`: [`DROP PROCEDURE`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_procedure_statement) statement. * `DROP_SEARCH_INDEX`: [`DROP SEARCH INDEX`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_search_index) statement. * `DROP_SCHEMA`: [`DROP SCHEMA`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_schema_statement) statement. * `DROP_SNAPSHOT_TABLE`: [`DROP SNAPSHOT TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_snapshot_table_statement) statement. * `DROP_ROW_ACCESS_POLICY`: [`DROP [ALL] ROW ACCESS POLICY|POLICIES`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_row_access_policy_statement) statement. * `ALTER_TABLE`: [`ALTER TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#alter_table_set_options_statement) statement. * `ALTER_VIEW`: [`ALTER VIEW`](/bigquery/docs/reference/standard-sql/data-definition-language#alter_view_set_options_statement) statement. * `ALTER_MATERIALIZED_VIEW`: [`ALTER MATERIALIZED VIEW`](/bigquery/docs/reference/standard-sql/data-definition-language#alter_materialized_view_set_options_statement) statement. * `ALTER_SCHEMA`: [`ALTER SCHEMA`](/bigquery/docs/reference/standard-sql/data-definition-language#aalter_schema_set_options_statement) statement. * `SCRIPT`: [`SCRIPT`](/bigquery/docs/reference/standard-sql/procedural-language). * `TRUNCATE_TABLE`: [`TRUNCATE TABLE`](/bigquery/docs/reference/standard-sql/dml-syntax#truncate_table_statement) statement. * `CREATE_EXTERNAL_TABLE`: [`CREATE EXTERNAL TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#create_external_table_statement) statement. * `EXPORT_DATA`: [`EXPORT DATA`](/bigquery/docs/reference/standard-sql/other-statements#export_data_statement) statement. * `EXPORT_MODEL`: [`EXPORT MODEL`](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-export-model) statement. * `LOAD_DATA`: [`LOAD DATA`](/bigquery/docs/reference/standard-sql/other-statements#load_data_statement) statement. * `CALL`: [`CALL`](/bigquery/docs/reference/standard-sql/procedural-language#call) statement.
2856 */
2857 statementType?: string;
2858 /**
2859 * Output only. Describes a timeline of job execution.
2860 */
2861 timeline?: Array<IQueryTimelineSample>;
2862 /**
2863 * Output only. If the project is configured to use on-demand pricing, then this field contains the total bytes billed for the job. If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only.
2864 */
2865 totalBytesBilled?: string;
2866 /**
2867 * Output only. Total bytes processed for the job.
2868 */
2869 totalBytesProcessed?: string;
2870 /**
2871 * Output only. For dry-run jobs, totalBytesProcessed is an estimate and this field specifies the accuracy of the estimate. Possible values can be: UNKNOWN: accuracy of the estimate is unknown. PRECISE: estimate is precise. LOWER_BOUND: estimate is lower bound of what the query would cost. UPPER_BOUND: estimate is upper bound of what the query would cost.
2872 */
2873 totalBytesProcessedAccuracy?: string;
2874 /**
2875 * Output only. Total number of partitions processed from all partitioned tables referenced in the job.
2876 */
2877 totalPartitionsProcessed?: string;
2878 /**
2879 * Output only. Slot-milliseconds for the job.
2880 */
2881 totalSlotMs?: string;
2882 /**
2883 * Output only. Total bytes transferred for cross-cloud queries such as Cross Cloud Transfer and CREATE TABLE AS SELECT (CTAS).
2884 */
2885 transferredBytes?: string;
2886 /**
2887 * Output only. GoogleSQL only: list of undeclared query parameters detected during a dry run validation.
2888 */
2889 undeclaredQueryParameters?: Array<IQueryParameter>;
2890 /**
2891 * Output only. Vector Search query specific statistics.
2892 */
2893 vectorSearchStatistics?: IVectorSearchStatistics;
2894 };
2895
2896 /**
2897 * Statistics for a load job.
2898 */
2899 type IJobStatistics3 = {
2900 /**
2901 * Output only. The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed in the load job configuration, then this number can be less than the total number of bad records present in the input data.
2902 */
2903 badRecords?: string;
2904 /**
2905 * Output only. Number of bytes of source data in a load job.
2906 */
2907 inputFileBytes?: string;
2908 /**
2909 * Output only. Number of source files in a load job.
2910 */
2911 inputFiles?: string;
2912 /**
2913 * Output only. Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
2914 */
2915 outputBytes?: string;
2916 /**
2917 * Output only. Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
2918 */
2919 outputRows?: string;
2920 /**
2921 * Output only. Describes a timeline of job execution.
2922 */
2923 timeline?: Array<IQueryTimelineSample>;
2924 };
2925
2926 /**
2927 * Statistics for an extract job.
2928 */
2929 type IJobStatistics4 = {
2930 /**
2931 * Output only. Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
2932 */
2933 destinationUriFileCounts?: Array<string>;
2934 /**
2935 * Output only. Number of user bytes extracted into the result. This is the byte count as computed by BigQuery for billing purposes and doesn't have any relationship with the number of actual result bytes extracted in the desired format.
2936 */
2937 inputBytes?: string;
2938 /**
2939 * Output only. Describes a timeline of job execution.
2940 */
2941 timeline?: Array<IQueryTimelineSample>;
2942 };
2943
2944 /**
2945 * Statistics for a copy job.
2946 */
2947 type IJobStatistics5 = {
2948 /**
2949 * Output only. Number of logical bytes copied to the destination table.
2950 */
2951 copiedLogicalBytes?: string;
2952 /**
2953 * Output only. Number of rows copied to the destination table.
2954 */
2955 copiedRows?: string;
2956 };
2957
2958 type IJobStatus = {
2959 /**
2960 * Output only. Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
2961 */
2962 errorResult?: IErrorProto;
2963 /**
2964 * Output only. The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has not completed or was unsuccessful.
2965 */
2966 errors?: Array<IErrorProto>;
2967 /**
2968 * Output only. Running state of the job. Valid states include 'PENDING', 'RUNNING', and 'DONE'.
2969 */
2970 state?: string;
2971 };
2972
2973 /**
2974 * Represents a single JSON object.
2975 */
2976 type IJsonObject = {[key: string]: IJsonValue};
2977
2978 /**
2979 * Json Options for load and make external tables.
2980 */
2981 type IJsonOptions = {
2982 /**
2983 * Optional. The character encoding of the data. The supported values are UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, and UTF-32LE. The default value is UTF-8.
2984 */
2985 encoding?: string;
2986 };
2987
2988 type IJsonValue = any;
2989
2990 /**
2991 * A dataset source type which refers to another BigQuery dataset.
2992 */
2993 type ILinkedDatasetSource = {
2994 /**
2995 * The source dataset reference contains project numbers and not project ids.
2996 */
2997 sourceDataset?: IDatasetReference;
2998 };
2999
3000 /**
3001 * Response format for a single page when listing BigQuery ML models.
3002 */
3003 type IListModelsResponse = {
3004 /**
3005 * Models in the requested dataset. Only the following fields are populated: model_reference, model_type, creation_time, last_modified_time and labels.
3006 */
3007 models?: Array<IModel>;
3008 /**
3009 * A token to request the next page of results.
3010 */
3011 nextPageToken?: string;
3012 };
3013
3014 /**
3015 * Describes the format of a single result page when listing routines.
3016 */
3017 type IListRoutinesResponse = {
3018 /**
3019 * A token to request the next page of results.
3020 */
3021 nextPageToken?: string;
3022 /**
3023 * Routines in the requested dataset. Unless read_mask is set in the request, only the following fields are populated: etag, project_id, dataset_id, routine_id, routine_type, creation_time, last_modified_time, language, and remote_function_options.
3024 */
3025 routines?: Array<IRoutine>;
3026 };
3027
3028 /**
3029 * Response message for the ListRowAccessPolicies method.
3030 */
3031 type IListRowAccessPoliciesResponse = {
3032 /**
3033 * A token to request the next page of results.
3034 */
3035 nextPageToken?: string;
3036 /**
3037 * Row access policies on the requested table.
3038 */
3039 rowAccessPolicies?: Array<IRowAccessPolicy>;
3040 };
3041
3042 /**
3043 * Statistics for a LOAD query.
3044 */
3045 type ILoadQueryStatistics = {
3046 /**
3047 * Output only. The number of bad records encountered while processing a LOAD query. Note that if the job has failed because of more bad records encountered than the maximum allowed in the load job configuration, then this number can be less than the total number of bad records present in the input data.
3048 */
3049 badRecords?: string;
3050 /**
3051 * Output only. This field is deprecated. The number of bytes of source data copied over the network for a `LOAD` query. `transferred_bytes` has the canonical value for physical transferred bytes, which is used for BigQuery Omni billing.
3052 */
3053 bytesTransferred?: string;
3054 /**
3055 * Output only. Number of bytes of source data in a LOAD query.
3056 */
3057 inputFileBytes?: string;
3058 /**
3059 * Output only. Number of source files in a LOAD query.
3060 */
3061 inputFiles?: string;
3062 /**
3063 * Output only. Size of the loaded data in bytes. Note that while a LOAD query is in the running state, this value may change.
3064 */
3065 outputBytes?: string;
3066 /**
3067 * Output only. Number of rows imported in a LOAD query. Note that while a LOAD query is in the running state, this value may change.
3068 */
3069 outputRows?: string;
3070 };
3071
3072 /**
3073 * BigQuery-specific metadata about a location. This will be set on google.cloud.location.Location.metadata in Cloud Location API responses.
3074 */
3075 type ILocationMetadata = {
3076 /**
3077 * The legacy BigQuery location ID, e.g. “EU” for the “europe” location. This is for any API consumers that need the legacy “US” and “EU” locations.
3078 */
3079 legacyLocationId?: string;
3080 };
3081
3082 /**
3083 * A materialized view considered for a query job.
3084 */
3085 type IMaterializedView = {
3086 /**
3087 * Whether the materialized view is chosen for the query. A materialized view can be chosen to rewrite multiple parts of the same query. If a materialized view is chosen to rewrite any part of the query, then this field is true, even if the materialized view was not chosen to rewrite others parts.
3088 */
3089 chosen?: boolean;
3090 /**
3091 * If present, specifies a best-effort estimation of the bytes saved by using the materialized view rather than its base tables.
3092 */
3093 estimatedBytesSaved?: string;
3094 /**
3095 * If present, specifies the reason why the materialized view was not chosen for the query.
3096 */
3097 rejectedReason?:
3098 | 'REJECTED_REASON_UNSPECIFIED'
3099 | 'NO_DATA'
3100 | 'COST'
3101 | 'BASE_TABLE_TRUNCATED'
3102 | 'BASE_TABLE_DATA_CHANGE'
3103 | 'BASE_TABLE_PARTITION_EXPIRATION_CHANGE'
3104 | 'BASE_TABLE_EXPIRED_PARTITION'
3105 | 'BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE'
3106 | 'TIME_ZONE'
3107 | 'OUT_OF_TIME_TRAVEL_WINDOW'
3108 | 'BASE_TABLE_FINE_GRAINED_SECURITY_POLICY'
3109 | 'BASE_TABLE_TOO_STALE';
3110 /**
3111 * The candidate materialized view.
3112 */
3113 tableReference?: ITableReference;
3114 };
3115
3116 /**
3117 * Definition and configuration of a materialized view.
3118 */
3119 type IMaterializedViewDefinition = {
3120 /**
3121 * Optional. This option declares authors intention to construct a materialized view that will not be refreshed incrementally.
3122 */
3123 allowNonIncrementalDefinition?: boolean;
3124 /**
3125 * Optional. Enable automatic refresh of the materialized view when the base table is updated. The default value is "true".
3126 */
3127 enableRefresh?: boolean;
3128 /**
3129 * Output only. The time when this materialized view was last refreshed, in milliseconds since the epoch.
3130 */
3131 lastRefreshTime?: string;
3132 /**
3133 * [Optional] Max staleness of data that could be returned when materizlized view is queried (formatted as Google SQL Interval type).
3134 */
3135 maxStaleness?: string;
3136 /**
3137 * Required. A query whose results are persisted.
3138 */
3139 query?: string;
3140 /**
3141 * Optional. The maximum frequency at which this materialized view will be refreshed. The default value is "1800000" (30 minutes).
3142 */
3143 refreshIntervalMs?: string;
3144 };
3145
3146 /**
3147 * Statistics of materialized views considered in a query job.
3148 */
3149 type IMaterializedViewStatistics = {
3150 /**
3151 * Materialized views considered for the query job. Only certain materialized views are used. For a detailed list, see the child message. If many materialized views are considered, then the list might be incomplete.
3152 */
3153 materializedView?: Array<IMaterializedView>;
3154 };
3155
3156 /**
3157 * Status of a materialized view. The last refresh timestamp status is omitted here, but is present in the MaterializedViewDefinition message.
3158 */
3159 type IMaterializedViewStatus = {
3160 /**
3161 * Output only. Error result of the last automatic refresh. If present, indicates that the last automatic refresh was unsuccessful.
3162 */
3163 lastRefreshStatus?: IErrorProto;
3164 /**
3165 * Output only. Refresh watermark of materialized view. The base tables' data were collected into the materialized view cache until this time.
3166 */
3167 refreshWatermark?: string;
3168 };
3169
3170 /**
3171 * Statistics for metadata caching in BigLake tables.
3172 */
3173 type IMetadataCacheStatistics = {
3174 /**
3175 * Set for the Metadata caching eligible tables referenced in the query.
3176 */
3177 tableMetadataCacheUsage?: Array<ITableMetadataCacheUsage>;
3178 };
3179
3180 /**
3181 * Job statistics specific to a BigQuery ML training job.
3182 */
3183 type IMlStatistics = {
3184 /**
3185 * Output only. Trials of a [hyperparameter tuning job](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) sorted by trial_id.
3186 */
3187 hparamTrials?: Array<IHparamTuningTrial>;
3188 /**
3189 * Results for all completed iterations. Empty for [hyperparameter tuning jobs](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview).
3190 */
3191 iterationResults?: Array<IIterationResult>;
3192 /**
3193 * Output only. Maximum number of iterations specified as max_iterations in the 'CREATE MODEL' query. The actual number of iterations may be less than this number due to early stop.
3194 */
3195 maxIterations?: string;
3196 /**
3197 * Output only. The type of the model that is being trained.
3198 */
3199 modelType?:
3200 | 'MODEL_TYPE_UNSPECIFIED'
3201 | 'LINEAR_REGRESSION'
3202 | 'LOGISTIC_REGRESSION'
3203 | 'KMEANS'
3204 | 'MATRIX_FACTORIZATION'
3205 | 'DNN_CLASSIFIER'
3206 | 'TENSORFLOW'
3207 | 'DNN_REGRESSOR'
3208 | 'XGBOOST'
3209 | 'BOOSTED_TREE_REGRESSOR'
3210 | 'BOOSTED_TREE_CLASSIFIER'
3211 | 'ARIMA'
3212 | 'AUTOML_REGRESSOR'
3213 | 'AUTOML_CLASSIFIER'
3214 | 'PCA'
3215 | 'DNN_LINEAR_COMBINED_CLASSIFIER'
3216 | 'DNN_LINEAR_COMBINED_REGRESSOR'
3217 | 'AUTOENCODER'
3218 | 'ARIMA_PLUS'
3219 | 'ARIMA_PLUS_XREG'
3220 | 'RANDOM_FOREST_REGRESSOR'
3221 | 'RANDOM_FOREST_CLASSIFIER'
3222 | 'TENSORFLOW_LITE'
3223 | 'ONNX';
3224 /**
3225 * Output only. Training type of the job.
3226 */
3227 trainingType?:
3228 | 'TRAINING_TYPE_UNSPECIFIED'
3229 | 'SINGLE_TRAINING'
3230 | 'HPARAM_TUNING';
3231 };
3232
3233 type IModel = {
3234 /**
3235 * The best trial_id across all training runs.
3236 */
3237 bestTrialId?: string;
3238 /**
3239 * Output only. The time when this model was created, in millisecs since the epoch.
3240 */
3241 creationTime?: string;
3242 /**
3243 * Output only. The default trial_id to use in TVFs when the trial_id is not passed in. For single-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, this is the best trial ID. For multi-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, this is the smallest trial ID among all Pareto optimal trials.
3244 */
3245 defaultTrialId?: string;
3246 /**
3247 * Optional. A user-friendly description of this model.
3248 */
3249 description?: string;
3250 /**
3251 * Custom encryption configuration (e.g., Cloud KMS keys). This shows the encryption configuration of the model data while stored in BigQuery storage. This field can be used with PatchModel to update encryption key for an already encrypted model.
3252 */
3253 encryptionConfiguration?: IEncryptionConfiguration;
3254 /**
3255 * Output only. A hash of this resource.
3256 */
3257 etag?: string;
3258 /**
3259 * Optional. The time when this model expires, in milliseconds since the epoch. If not present, the model will persist indefinitely. Expired models will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created models.
3260 */
3261 expirationTime?: string;
3262 /**
3263 * Output only. Input feature columns for the model inference. If the model is trained with TRANSFORM clause, these are the input of the TRANSFORM clause.
3264 */
3265 featureColumns?: Array<IStandardSqlField>;
3266 /**
3267 * Optional. A descriptive name for this model.
3268 */
3269 friendlyName?: string;
3270 /**
3271 * Output only. All hyperparameter search spaces in this model.
3272 */
3273 hparamSearchSpaces?: IHparamSearchSpaces;
3274 /**
3275 * Output only. Trials of a [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) model sorted by trial_id.
3276 */
3277 hparamTrials?: Array<IHparamTuningTrial>;
3278 /**
3279 * Output only. Label columns that were used to train this model. The output of the model will have a "predicted_" prefix to these columns.
3280 */
3281 labelColumns?: Array<IStandardSqlField>;
3282 /**
3283 * The labels associated with this model. You can use these to organize and group your models. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
3284 */
3285 labels?: {[key: string]: string};
3286 /**
3287 * Output only. The time when this model was last modified, in millisecs since the epoch.
3288 */
3289 lastModifiedTime?: string;
3290 /**
3291 * Output only. The geographic location where the model resides. This value is inherited from the dataset.
3292 */
3293 location?: string;
3294 /**
3295 * Required. Unique identifier for this model.
3296 */
3297 modelReference?: IModelReference;
3298 /**
3299 * Output only. Type of the model resource.
3300 */
3301 modelType?:
3302 | 'MODEL_TYPE_UNSPECIFIED'
3303 | 'LINEAR_REGRESSION'
3304 | 'LOGISTIC_REGRESSION'
3305 | 'KMEANS'
3306 | 'MATRIX_FACTORIZATION'
3307 | 'DNN_CLASSIFIER'
3308 | 'TENSORFLOW'
3309 | 'DNN_REGRESSOR'
3310 | 'XGBOOST'
3311 | 'BOOSTED_TREE_REGRESSOR'
3312 | 'BOOSTED_TREE_CLASSIFIER'
3313 | 'ARIMA'
3314 | 'AUTOML_REGRESSOR'
3315 | 'AUTOML_CLASSIFIER'
3316 | 'PCA'
3317 | 'DNN_LINEAR_COMBINED_CLASSIFIER'
3318 | 'DNN_LINEAR_COMBINED_REGRESSOR'
3319 | 'AUTOENCODER'
3320 | 'ARIMA_PLUS'
3321 | 'ARIMA_PLUS_XREG'
3322 | 'RANDOM_FOREST_REGRESSOR'
3323 | 'RANDOM_FOREST_CLASSIFIER'
3324 | 'TENSORFLOW_LITE'
3325 | 'ONNX';
3326 /**
3327 * Output only. For single-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, it only contains the best trial. For multi-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, it contains all Pareto optimal trials sorted by trial_id.
3328 */
3329 optimalTrialIds?: Array<string>;
3330 /**
3331 * Output only. Remote model info
3332 */
3333 remoteModelInfo?: IRemoteModelInfo;
3334 /**
3335 * Information for all training runs in increasing order of start_time.
3336 */
3337 trainingRuns?: Array<ITrainingRun>;
3338 /**
3339 * Output only. This field will be populated if a TRANSFORM clause was used to train a model. TRANSFORM clause (if used) takes feature_columns as input and outputs transform_columns. transform_columns then are used to train the model.
3340 */
3341 transformColumns?: Array<ITransformColumn>;
3342 };
3343
3344 type IModelDefinition = {
3345 /**
3346 * Deprecated.
3347 */
3348 modelOptions?: {
3349 labels?: Array<string>;
3350 lossType?: string;
3351 modelType?: string;
3352 };
3353 /**
3354 * Deprecated.
3355 */
3356 trainingRuns?: Array<IBqmlTrainingRun>;
3357 };
3358
3359 /**
3360 * Options related to model extraction.
3361 */
3362 type IModelExtractOptions = {
3363 /**
3364 * The 1-based ID of the trial to be exported from a hyperparameter tuning model. If not specified, the trial with id = [Model](/bigquery/docs/reference/rest/v2/models#resource:-model).defaultTrialId is exported. This field is ignored for models not trained with hyperparameter tuning.
3365 */
3366 trialId?: string;
3367 };
3368
3369 /**
3370 * Id path of a model.
3371 */
3372 type IModelReference = {
3373 /**
3374 * Required. The ID of the dataset containing this model.
3375 */
3376 datasetId?: string;
3377 /**
3378 * Required. The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
3379 */
3380 modelId?: string;
3381 /**
3382 * Required. The ID of the project containing this model.
3383 */
3384 projectId?: string;
3385 };
3386
3387 /**
3388 * Evaluation metrics for multi-class classification/classifier models.
3389 */
3390 type IMultiClassClassificationMetrics = {
3391 /**
3392 * Aggregate classification metrics.
3393 */
3394 aggregateClassificationMetrics?: IAggregateClassificationMetrics;
3395 /**
3396 * Confusion matrix at different thresholds.
3397 */
3398 confusionMatrixList?: Array<IConfusionMatrix>;
3399 };
3400
3401 /**
3402 * Parquet Options for load and make external tables.
3403 */
3404 type IParquetOptions = {
3405 /**
3406 * Optional. Indicates whether to use schema inference specifically for Parquet LIST logical type.
3407 */
3408 enableListInference?: boolean;
3409 /**
3410 * Optional. Indicates whether to infer Parquet ENUM logical type as STRING instead of BYTES by default.
3411 */
3412 enumAsString?: boolean;
3413 };
3414
3415 /**
3416 * Performance insights for the job.
3417 */
3418 type IPerformanceInsights = {
3419 /**
3420 * Output only. Average execution ms of previous runs. Indicates the job ran slow compared to previous executions. To find previous executions, use INFORMATION_SCHEMA tables and filter jobs with same query hash.
3421 */
3422 avgPreviousExecutionMs?: string;
3423 /**
3424 * Output only. Query stage performance insights compared to previous runs, for diagnosing performance regression.
3425 */
3426 stagePerformanceChangeInsights?: Array<IStagePerformanceChangeInsight>;
3427 /**
3428 * Output only. Standalone query stage performance insights, for exploring potential improvements.
3429 */
3430 stagePerformanceStandaloneInsights?: Array<IStagePerformanceStandaloneInsight>;
3431 };
3432
3433 /**
3434 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
3435 */
3436 type IPolicy = {
3437 /**
3438 * Specifies cloud audit logging configuration for this policy.
3439 */
3440 auditConfigs?: Array<IAuditConfig>;
3441 /**
3442 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
3443 */
3444 bindings?: Array<IBinding>;
3445 /**
3446 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
3447 */
3448 etag?: string;
3449 /**
3450 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
3451 */
3452 version?: number;
3453 };
3454
3455 /**
3456 * Principal component infos, used only for eigen decomposition based models, e.g., PCA. Ordered by explained_variance in the descending order.
3457 */
3458 type IPrincipalComponentInfo = {
3459 /**
3460 * The explained_variance is pre-ordered in the descending order to compute the cumulative explained variance ratio.
3461 */
3462 cumulativeExplainedVarianceRatio?: number;
3463 /**
3464 * Explained variance by this principal component, which is simply the eigenvalue.
3465 */
3466 explainedVariance?: number;
3467 /**
3468 * Explained_variance over the total explained variance.
3469 */
3470 explainedVarianceRatio?: number;
3471 /**
3472 * Id of the principal component.
3473 */
3474 principalComponentId?: string;
3475 };
3476
3477 /**
3478 * Represents privacy policy that contains the privacy requirements specified by the data owner. Currently, this is only supported on views.
3479 */
3480 type IPrivacyPolicy = {
3481 /**
3482 * Optional. Policy used for aggregation thresholds.
3483 */
3484 aggregationThresholdPolicy?: IAggregationThresholdPolicy;
3485 };
3486
3487 /**
3488 * Response object of ListProjects
3489 */
3490 type IProjectList = {
3491 /**
3492 * A hash of the page of results.
3493 */
3494 etag?: string;
3495 /**
3496 * The resource type of the response.
3497 */
3498 kind?: string;
3499 /**
3500 * Use this token to request the next page of results.
3501 */
3502 nextPageToken?: string;
3503 /**
3504 * Projects to which the user has at least READ access.
3505 */
3506 projects?: Array<{
3507 /**
3508 * A descriptive name for this project. A wrapper is used here because friendlyName can be set to the empty string.
3509 */
3510 friendlyName?: string;
3511 /**
3512 * An opaque ID of this project.
3513 */
3514 id?: string;
3515 /**
3516 * The resource type.
3517 */
3518 kind?: string;
3519 /**
3520 * The numeric ID of this project.
3521 */
3522 numericId?: string;
3523 /**
3524 * A unique reference to this project.
3525 */
3526 projectReference?: IProjectReference;
3527 }>;
3528 /**
3529 * The total number of projects in the page. A wrapper is used here because the field should still be in the response when the value is 0.
3530 */
3531 totalItems?: number;
3532 };
3533
3534 /**
3535 * A unique reference to a project.
3536 */
3537 type IProjectReference = {
3538 /**
3539 * Required. ID of the project. Can be either the numeric ID or the assigned ID of the project.
3540 */
3541 projectId?: string;
3542 };
3543
3544 /**
3545 * Query optimization information for a QUERY job.
3546 */
3547 type IQueryInfo = {
3548 /**
3549 * Output only. Information about query optimizations.
3550 */
3551 optimizationDetails?: {[key: string]: any};
3552 };
3553
3554 /**
3555 * A parameter given to a query.
3556 */
3557 type IQueryParameter = {
3558 /**
3559 * Optional. If unset, this is a positional parameter. Otherwise, should be unique within a query.
3560 */
3561 name?: string;
3562 /**
3563 * Required. The type of this parameter.
3564 */
3565 parameterType?: IQueryParameterType;
3566 /**
3567 * Required. The value of this parameter.
3568 */
3569 parameterValue?: IQueryParameterValue;
3570 };
3571
3572 /**
3573 * The type of a query parameter.
3574 */
3575 type IQueryParameterType = {
3576 /**
3577 * Optional. The type of the array's elements, if this is an array.
3578 */
3579 arrayType?: IQueryParameterType;
3580 /**
3581 * Optional. The element type of the range, if this is a range.
3582 */
3583 rangeElementType?: IQueryParameterType;
3584 /**
3585 * Optional. The types of the fields of this struct, in order, if this is a struct.
3586 */
3587 structTypes?: Array<{
3588 /**
3589 * Optional. Human-oriented description of the field.
3590 */
3591 description?: string;
3592 /**
3593 * Optional. The name of this field.
3594 */
3595 name?: string;
3596 /**
3597 * Required. The type of this field.
3598 */
3599 type?: IQueryParameterType;
3600 }>;
3601 /**
3602 * Required. The top level type of this field.
3603 */
3604 type?: string;
3605 };
3606
3607 /**
3608 * The value of a query parameter.
3609 */
3610 type IQueryParameterValue = {
3611 /**
3612 * Optional. The array values, if this is an array type.
3613 */
3614 arrayValues?: Array<IQueryParameterValue>;
3615 /**
3616 * Optional. The range value, if this is a range type.
3617 */
3618 rangeValue?: IRangeValue;
3619 /**
3620 * The struct field values.
3621 */
3622 structValues?: {[key: string]: IQueryParameterValue};
3623 /**
3624 * Optional. The value of this value, if a simple scalar type.
3625 */
3626 value?: string;
3627 };
3628
3629 /**
3630 * Describes the format of the jobs.query request.
3631 */
3632 type IQueryRequest = {
3633 /**
3634 * Optional. Connection properties which can modify the query behavior.
3635 */
3636 connectionProperties?: Array<IConnectionProperty>;
3637 /**
3638 * [Optional] Specifies whether the query should be executed as a continuous query. The default value is false.
3639 */
3640 continuous?: boolean;
3641 /**
3642 * Optional. If true, creates a new session using a randomly generated session_id. If false, runs query with an existing session_id passed in ConnectionProperty, otherwise runs query in non-session mode. The session location will be set to QueryRequest.location if it is present, otherwise it's set to the default location based on existing routing logic.
3643 */
3644 createSession?: boolean;
3645 /**
3646 * Optional. Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'.
3647 */
3648 defaultDataset?: IDatasetReference;
3649 /**
3650 * Optional. If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false.
3651 */
3652 dryRun?: boolean;
3653 /**
3654 * Optional. Output format adjustments.
3655 */
3656 formatOptions?: IDataFormatOptions;
3657 /**
3658 * Optional. If not set, jobs are always required. If set, the query request will follow the behavior described JobCreationMode. This feature is not yet available. Jobs will always be created.
3659 */
3660 jobCreationMode?:
3661 | 'JOB_CREATION_MODE_UNSPECIFIED'
3662 | 'JOB_CREATION_REQUIRED'
3663 | 'JOB_CREATION_OPTIONAL';
3664 /**
3665 * The resource type of the request.
3666 */
3667 kind?: string;
3668 /**
3669 * Optional. The labels associated with this query. Labels can be used to organize and group query jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label keys must start with a letter and each label in the list must have a different key.
3670 */
3671 labels?: {[key: string]: string};
3672 /**
3673 * The geographic location where the job should run. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
3674 */
3675 location?: string;
3676 /**
3677 * Optional. The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies.
3678 */
3679 maxResults?: number;
3680 /**
3681 * Optional. Limits the bytes billed for this query. Queries with bytes billed above this limit will fail (without incurring a charge). If unspecified, the project default is used.
3682 */
3683 maximumBytesBilled?: string;
3684 /**
3685 * GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
3686 */
3687 parameterMode?: string;
3688 /**
3689 * This property is deprecated.
3690 */
3691 preserveNulls?: boolean;
3692 /**
3693 * Required. A query string to execute, using Google Standard SQL or legacy SQL syntax. Example: "SELECT COUNT(f1) FROM myProjectId.myDatasetId.myTableId".
3694 */
3695 query?: string;
3696 /**
3697 * Query parameters for GoogleSQL queries.
3698 */
3699 queryParameters?: Array<IQueryParameter>;
3700 /**
3701 * Optional. A unique user provided identifier to ensure idempotent behavior for queries. Note that this is different from the job_id. It has the following properties: 1. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended. 2. Read only queries can ignore this token since they are nullipotent by definition. 3. For the purposes of idempotency ensured by the request_id, a request is considered duplicate of another only if they have the same request_id and are actually duplicates. When determining whether a request is a duplicate of another request, all parameters in the request that may affect the result are considered. For example, query, connection_properties, query_parameters, use_legacy_sql are parameters that affect the result and are considered when determining whether a request is a duplicate, but properties like timeout_ms don't affect the result and are thus not considered. Dry run query requests are never considered duplicate of another request. 4. When a duplicate mutating query request is detected, it returns: a. the results of the mutation if it completes successfully within the timeout. b. the running operation if it is still in progress at the end of the timeout. 5. Its lifetime is limited to 15 minutes. In other words, if two requests are sent with the same request_id, but more than 15 minutes apart, idempotency is not guaranteed.
3702 */
3703 requestId?: string;
3704 /**
3705 * Optional. Optional: Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 10 seconds (10,000 milliseconds). If the query is complete, the jobComplete field in the response is true. If the query has not yet completed, jobComplete is false. You can request a longer timeout period in the timeoutMs field. However, the call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete. If jobComplete is false, you can continue to wait for the query to complete by calling the getQueryResults method until the jobComplete field in the getQueryResults response is true.
3706 */
3707 timeoutMs?: number;
3708 /**
3709 * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's GoogleSQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.
3710 */
3711 useLegacySql?: boolean;
3712 /**
3713 * Optional. Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. The default value is true.
3714 */
3715 useQueryCache?: boolean;
3716 };
3717
3718 type IQueryResponse = {
3719 /**
3720 * Whether the query result was fetched from the query cache.
3721 */
3722 cacheHit?: boolean;
3723 /**
3724 * Output only. Detailed statistics for DML statements INSERT, UPDATE, DELETE, MERGE or TRUNCATE.
3725 */
3726 dmlStats?: IDmlStatistics;
3727 /**
3728 * Output only. The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. For more information about error messages, see [Error messages](https://cloud.google.com/bigquery/docs/error-messages).
3729 */
3730 errors?: Array<IErrorProto>;
3731 /**
3732 * Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
3733 */
3734 jobComplete?: boolean;
3735 /**
3736 * Optional. Only relevant when a job_reference is present in the response. If job_reference is not present it will always be unset. When job_reference is present, this field should be interpreted as follows: If set, it will provide the reason of why a Job was created. If not set, it should be treated as the default: REQUESTED. This feature is not yet available. Jobs will always be created.
3737 */
3738 jobCreationReason?: IJobCreationReason;
3739 /**
3740 * Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
3741 */
3742 jobReference?: IJobReference;
3743 /**
3744 * The resource type.
3745 */
3746 kind?: string;
3747 /**
3748 * Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
3749 */
3750 numDmlAffectedRows?: string;
3751 /**
3752 * A token used for paging results. A non-empty token indicates that additional results are available. To see additional results, query the [`jobs.getQueryResults`](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/getQueryResults) method. For more information, see [Paging through table data](https://cloud.google.com/bigquery/docs/paging-results).
3753 */
3754 pageToken?: string;
3755 /**
3756 * Query ID for the completed query. This ID will be auto-generated. This field is not yet available and it is currently not guaranteed to be populated.
3757 */
3758 queryId?: string;
3759 /**
3760 * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.
3761 */
3762 rows?: Array<ITableRow>;
3763 /**
3764 * The schema of the results. Present only when the query completes successfully.
3765 */
3766 schema?: ITableSchema;
3767 /**
3768 * Output only. Information of the session if this job is part of one.
3769 */
3770 sessionInfo?: ISessionInfo;
3771 /**
3772 * The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run.
3773 */
3774 totalBytesProcessed?: string;
3775 /**
3776 * The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.
3777 */
3778 totalRows?: string;
3779 };
3780
3781 /**
3782 * Summary of the state of query execution at a given time.
3783 */
3784 type IQueryTimelineSample = {
3785 /**
3786 * Total number of active workers. This does not correspond directly to slot usage. This is the largest value observed since the last sample.
3787 */
3788 activeUnits?: string;
3789 /**
3790 * Total parallel units of work completed by this query.
3791 */
3792 completedUnits?: string;
3793 /**
3794 * Milliseconds elapsed since the start of query execution.
3795 */
3796 elapsedMs?: string;
3797 /**
3798 * Units of work that can be scheduled immediately. Providing additional slots for these units of work will accelerate the query, if no other query in the reservation needs additional slots.
3799 */
3800 estimatedRunnableUnits?: string;
3801 /**
3802 * Total units of work remaining for the query. This number can be revised (increased or decreased) while the query is running.
3803 */
3804 pendingUnits?: string;
3805 /**
3806 * Cumulative slot-ms consumed by the query.
3807 */
3808 totalSlotMs?: string;
3809 };
3810
3811 type IRangePartitioning = {
3812 /**
3813 * Required. [Experimental] The table is partitioned by this field. The field must be a top-level NULLABLE/REQUIRED field. The only supported type is INTEGER/INT64.
3814 */
3815 field?: string;
3816 /**
3817 * [Experimental] Defines the ranges for range partitioning.
3818 */
3819 range?: {
3820 /**
3821 * [Experimental] The end of range partitioning, exclusive.
3822 */
3823 end?: string;
3824 /**
3825 * [Experimental] The width of each interval.
3826 */
3827 interval?: string;
3828 /**
3829 * [Experimental] The start of range partitioning, inclusive.
3830 */
3831 start?: string;
3832 };
3833 };
3834
3835 /**
3836 * Represents the value of a range.
3837 */
3838 type IRangeValue = {
3839 /**
3840 * Optional. The end value of the range. A missing value represents an unbounded end.
3841 */
3842 end?: IQueryParameterValue;
3843 /**
3844 * Optional. The start value of the range. A missing value represents an unbounded start.
3845 */
3846 start?: IQueryParameterValue;
3847 };
3848
3849 /**
3850 * Evaluation metrics used by weighted-ALS models specified by feedback_type=implicit.
3851 */
3852 type IRankingMetrics = {
3853 /**
3854 * Determines the goodness of a ranking by computing the percentile rank from the predicted confidence and dividing it by the original rank.
3855 */
3856 averageRank?: number;
3857 /**
3858 * Calculates a precision per user for all the items by ranking them and then averages all the precisions across all the users.
3859 */
3860 meanAveragePrecision?: number;
3861 /**
3862 * Similar to the mean squared error computed in regression and explicit recommendation models except instead of computing the rating directly, the output from evaluate is computed against a preference which is 1 or 0 depending on if the rating exists or not.
3863 */
3864 meanSquaredError?: number;
3865 /**
3866 * A metric to determine the goodness of a ranking calculated from the predicted confidence by comparing it to an ideal rank measured by the original ratings.
3867 */
3868 normalizedDiscountedCumulativeGain?: number;
3869 };
3870
3871 /**
3872 * Evaluation metrics for regression and explicit feedback type matrix factorization models.
3873 */
3874 type IRegressionMetrics = {
3875 /**
3876 * Mean absolute error.
3877 */
3878 meanAbsoluteError?: number;
3879 /**
3880 * Mean squared error.
3881 */
3882 meanSquaredError?: number;
3883 /**
3884 * Mean squared log error.
3885 */
3886 meanSquaredLogError?: number;
3887 /**
3888 * Median absolute error.
3889 */
3890 medianAbsoluteError?: number;
3891 /**
3892 * R^2 score. This corresponds to r2_score in ML.EVALUATE.
3893 */
3894 rSquared?: number;
3895 };
3896
3897 /**
3898 * Options for a remote user-defined function.
3899 */
3900 type IRemoteFunctionOptions = {
3901 /**
3902 * Fully qualified name of the user-provided connection object which holds the authentication information to send requests to the remote service. Format: ```"projects/{projectId}/locations/{locationId}/connections/{connectionId}"```
3903 */
3904 connection?: string;
3905 /**
3906 * Endpoint of the user-provided remote service, e.g. ```https://us-east1-my_gcf_project.cloudfunctions.net/remote_add```
3907 */
3908 endpoint?: string;
3909 /**
3910 * Max number of rows in each batch sent to the remote service. If absent or if 0, BigQuery dynamically decides the number of rows in a batch.
3911 */
3912 maxBatchingRows?: string;
3913 /**
3914 * User-defined context as a set of key/value pairs, which will be sent as function invocation context together with batched arguments in the requests to the remote service. The total number of bytes of keys and values must be less than 8KB.
3915 */
3916 userDefinedContext?: {[key: string]: string};
3917 };
3918
3919 /**
3920 * Remote Model Info
3921 */
3922 type IRemoteModelInfo = {
3923 /**
3924 * Output only. Fully qualified name of the user-provided connection object of the remote model. Format: ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"```
3925 */
3926 connection?: string;
3927 /**
3928 * Output only. The endpoint for remote model.
3929 */
3930 endpoint?: string;
3931 /**
3932 * Output only. Max number of rows in each batch sent to the remote service. If unset, the number of rows in each batch is set dynamically.
3933 */
3934 maxBatchingRows?: string;
3935 /**
3936 * Output only. The model version for LLM.
3937 */
3938 remoteModelVersion?: string;
3939 /**
3940 * Output only. The remote service type for remote model.
3941 */
3942 remoteServiceType?:
3943 | 'REMOTE_SERVICE_TYPE_UNSPECIFIED'
3944 | 'CLOUD_AI_TRANSLATE_V3'
3945 | 'CLOUD_AI_VISION_V1'
3946 | 'CLOUD_AI_NATURAL_LANGUAGE_V1'
3947 | 'CLOUD_AI_SPEECH_TO_TEXT_V2';
3948 /**
3949 * Output only. The name of the speech recognizer to use for speech recognition. The expected format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. Customers can specify this field at model creation. If not specified, a default recognizer `projects/{model project}/locations/global/recognizers/_` will be used. See more details at [recognizers](https://cloud.google.com/speech-to-text/v2/docs/reference/rest/v2/projects.locations.recognizers)
3950 */
3951 speechRecognizer?: string;
3952 };
3953
3954 /**
3955 * A user-defined function or a stored procedure.
3956 */
3957 type IRoutine = {
3958 /**
3959 * Optional.
3960 */
3961 arguments?: Array<IArgument>;
3962 /**
3963 * Output only. The time when this routine was created, in milliseconds since the epoch.
3964 */
3965 creationTime?: string;
3966 /**
3967 * Optional. If set to `DATA_MASKING`, the function is validated and made available as a masking function. For more information, see [Create custom masking routines](https://cloud.google.com/bigquery/docs/user-defined-functions#custom-mask).
3968 */
3969 dataGovernanceType?: 'DATA_GOVERNANCE_TYPE_UNSPECIFIED' | 'DATA_MASKING';
3970 /**
3971 * Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks.
3972 */
3973 definitionBody?: string;
3974 /**
3975 * Optional. The description of the routine, if defined.
3976 */
3977 description?: string;
3978 /**
3979 * Optional. The determinism level of the JavaScript UDF, if defined.
3980 */
3981 determinismLevel?:
3982 | 'DETERMINISM_LEVEL_UNSPECIFIED'
3983 | 'DETERMINISTIC'
3984 | 'NOT_DETERMINISTIC';
3985 /**
3986 * Output only. A hash of this resource.
3987 */
3988 etag?: string;
3989 /**
3990 * Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries.
3991 */
3992 importedLibraries?: Array<string>;
3993 /**
3994 * Optional. Defaults to "SQL" if remote_function_options field is absent, not set otherwise.
3995 */
3996 language?:
3997 | 'LANGUAGE_UNSPECIFIED'
3998 | 'SQL'
3999 | 'JAVASCRIPT'
4000 | 'PYTHON'
4001 | 'JAVA'
4002 | 'SCALA';
4003 /**
4004 * Output only. The time when this routine was last modified, in milliseconds since the epoch.
4005 */
4006 lastModifiedTime?: string;
4007 /**
4008 * Optional. Remote function specific options.
4009 */
4010 remoteFunctionOptions?: IRemoteFunctionOptions;
4011 /**
4012 * Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specified in return table type, at query time.
4013 */
4014 returnTableType?: IStandardSqlTableType;
4015 /**
4016 * Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64.
4017 */
4018 returnType?: IStandardSqlDataType;
4019 /**
4020 * Required. Reference describing the ID of this routine.
4021 */
4022 routineReference?: IRoutineReference;
4023 /**
4024 * Required. The type of routine.
4025 */
4026 routineType?:
4027 | 'ROUTINE_TYPE_UNSPECIFIED'
4028 | 'SCALAR_FUNCTION'
4029 | 'PROCEDURE'
4030 | 'TABLE_VALUED_FUNCTION'
4031 | 'AGGREGATE_FUNCTION';
4032 /**
4033 * Optional. The security mode of the routine, if defined. If not defined, the security mode is automatically determined from the routine's configuration.
4034 */
4035 securityMode?: 'SECURITY_MODE_UNSPECIFIED' | 'DEFINER' | 'INVOKER';
4036 /**
4037 * Optional. Spark specific options.
4038 */
4039 sparkOptions?: ISparkOptions;
4040 /**
4041 * Optional. Use this option to catch many common errors. Error checking is not exhaustive, and successfully creating a procedure doesn't guarantee that the procedure will successfully execute at runtime. If `strictMode` is set to `TRUE`, the procedure body is further checked for errors such as non-existent tables or columns. The `CREATE PROCEDURE` statement fails if the body fails any of these checks. If `strictMode` is set to `FALSE`, the procedure body is checked only for syntax. For procedures that invoke themselves recursively, specify `strictMode=FALSE` to avoid non-existent procedure errors during validation. Default value is `TRUE`.
4042 */
4043 strictMode?: boolean;
4044 };
4045
4046 /**
4047 * Id path of a routine.
4048 */
4049 type IRoutineReference = {
4050 /**
4051 * Required. The ID of the dataset containing this routine.
4052 */
4053 datasetId?: string;
4054 /**
4055 * Required. The ID of the project containing this routine.
4056 */
4057 projectId?: string;
4058 /**
4059 * Required. The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
4060 */
4061 routineId?: string;
4062 };
4063
4064 /**
4065 * A single row in the confusion matrix.
4066 */
4067 type IRow = {
4068 /**
4069 * The original label of this row.
4070 */
4071 actualLabel?: string;
4072 /**
4073 * Info describing predicted label distribution.
4074 */
4075 entries?: Array<IEntry>;
4076 };
4077
4078 /**
4079 * Represents access on a subset of rows on the specified table, defined by its filter predicate. Access to the subset of rows is controlled by its IAM policy.
4080 */
4081 type IRowAccessPolicy = {
4082 /**
4083 * Output only. The time when this row access policy was created, in milliseconds since the epoch.
4084 */
4085 creationTime?: string;
4086 /**
4087 * Output only. A hash of this resource.
4088 */
4089 etag?: string;
4090 /**
4091 * Required. A SQL boolean expression that represents the rows defined by this row access policy, similar to the boolean expression in a WHERE clause of a SELECT query on a table. References to other tables, routines, and temporary functions are not supported. Examples: region="EU" date_field = CAST('2019-9-27' as DATE) nullable_field is not NULL numeric_field BETWEEN 1.0 AND 5.0
4092 */
4093 filterPredicate?: string;
4094 /**
4095 * Output only. The time when this row access policy was last modified, in milliseconds since the epoch.
4096 */
4097 lastModifiedTime?: string;
4098 /**
4099 * Required. Reference describing the ID of this row access policy.
4100 */
4101 rowAccessPolicyReference?: IRowAccessPolicyReference;
4102 };
4103
4104 /**
4105 * Id path of a row access policy.
4106 */
4107 type IRowAccessPolicyReference = {
4108 /**
4109 * Required. The ID of the dataset containing this row access policy.
4110 */
4111 datasetId?: string;
4112 /**
4113 * Required. The ID of the row access policy. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
4114 */
4115 policyId?: string;
4116 /**
4117 * Required. The ID of the project containing this row access policy.
4118 */
4119 projectId?: string;
4120 /**
4121 * Required. The ID of the table containing this row access policy.
4122 */
4123 tableId?: string;
4124 };
4125
4126 /**
4127 * Statistics for row-level security.
4128 */
4129 type IRowLevelSecurityStatistics = {
4130 /**
4131 * Whether any accessed data was protected by row access policies.
4132 */
4133 rowLevelSecurityApplied?: boolean;
4134 };
4135
4136 /**
4137 * Options related to script execution.
4138 */
4139 type IScriptOptions = {
4140 /**
4141 * Determines which statement in the script represents the "key result", used to populate the schema and query results of the script job. Default is LAST.
4142 */
4143 keyResultStatement?:
4144 | 'KEY_RESULT_STATEMENT_KIND_UNSPECIFIED'
4145 | 'LAST'
4146 | 'FIRST_SELECT';
4147 /**
4148 * Limit on the number of bytes billed per statement. Exceeding this budget results in an error.
4149 */
4150 statementByteBudget?: string;
4151 /**
4152 * Timeout period for each statement in a script.
4153 */
4154 statementTimeoutMs?: string;
4155 };
4156
4157 /**
4158 * Represents the location of the statement/expression being evaluated. Line and column numbers are defined as follows: - Line and column numbers start with one. That is, line 1 column 1 denotes the start of the script. - When inside a stored procedure, all line/column numbers are relative to the procedure body, not the script in which the procedure was defined. - Start/end positions exclude leading/trailing comments and whitespace. The end position always ends with a ";", when present. - Multi-byte Unicode characters are treated as just one column. - If the original script (or procedure definition) contains TAB characters, a tab "snaps" the indentation forward to the nearest multiple of 8 characters, plus 1. For example, a TAB on column 1, 2, 3, 4, 5, 6 , or 8 will advance the next character to column 9. A TAB on column 9, 10, 11, 12, 13, 14, 15, or 16 will advance the next character to column 17.
4159 */
4160 type IScriptStackFrame = {
4161 /**
4162 * Output only. One-based end column.
4163 */
4164 endColumn?: number;
4165 /**
4166 * Output only. One-based end line.
4167 */
4168 endLine?: number;
4169 /**
4170 * Output only. Name of the active procedure, empty if in a top-level script.
4171 */
4172 procedureId?: string;
4173 /**
4174 * Output only. One-based start column.
4175 */
4176 startColumn?: number;
4177 /**
4178 * Output only. One-based start line.
4179 */
4180 startLine?: number;
4181 /**
4182 * Output only. Text of the current statement/expression.
4183 */
4184 text?: string;
4185 };
4186
4187 /**
4188 * Job statistics specific to the child job of a script.
4189 */
4190 type IScriptStatistics = {
4191 /**
4192 * Whether this child job was a statement or expression.
4193 */
4194 evaluationKind?: 'EVALUATION_KIND_UNSPECIFIED' | 'STATEMENT' | 'EXPRESSION';
4195 /**
4196 * Stack trace showing the line/column/procedure name of each frame on the stack at the point where the current evaluation happened. The leaf frame is first, the primary script is last. Never empty.
4197 */
4198 stackFrames?: Array<IScriptStackFrame>;
4199 };
4200
4201 /**
4202 * Statistics for a search query. Populated as part of JobStatistics2.
4203 */
4204 type ISearchStatistics = {
4205 /**
4206 * When `indexUsageMode` is `UNUSED` or `PARTIALLY_USED`, this field explains why indexes were not used in all or part of the search query. If `indexUsageMode` is `FULLY_USED`, this field is not populated.
4207 */
4208 indexUnusedReasons?: Array<IIndexUnusedReason>;
4209 /**
4210 * Specifies the index usage mode for the query.
4211 */
4212 indexUsageMode?:
4213 | 'INDEX_USAGE_MODE_UNSPECIFIED'
4214 | 'UNUSED'
4215 | 'PARTIALLY_USED'
4216 | 'FULLY_USED';
4217 };
4218
4219 /**
4220 * [Preview] Information related to sessions.
4221 */
4222 type ISessionInfo = {
4223 /**
4224 * Output only. The id of the session.
4225 */
4226 sessionId?: string;
4227 };
4228
4229 /**
4230 * Request message for `SetIamPolicy` method.
4231 */
4232 type ISetIamPolicyRequest = {
4233 /**
4234 * REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud services (such as Projects) might reject them.
4235 */
4236 policy?: IPolicy;
4237 /**
4238 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: `paths: "bindings, etag"`
4239 */
4240 updateMask?: string;
4241 };
4242
4243 /**
4244 * Information about base table and snapshot time of the snapshot.
4245 */
4246 type ISnapshotDefinition = {
4247 /**
4248 * Required. Reference describing the ID of the table that was snapshot.
4249 */
4250 baseTableReference?: ITableReference;
4251 /**
4252 * Required. The time at which the base table was snapshot. This value is reported in the JSON response using RFC3339 format.
4253 */
4254 snapshotTime?: string;
4255 };
4256
4257 /**
4258 * Spark job logs can be filtered by these fields in Cloud Logging.
4259 */
4260 type ISparkLoggingInfo = {
4261 /**
4262 * Output only. Project ID where the Spark logs were written.
4263 */
4264 projectId?: string;
4265 /**
4266 * Output only. Resource type used for logging.
4267 */
4268 resourceType?: string;
4269 };
4270
4271 /**
4272 * Options for a user-defined Spark routine.
4273 */
4274 type ISparkOptions = {
4275 /**
4276 * Archive files to be extracted into the working directory of each executor. For more information about Apache Spark, see [Apache Spark](https://spark.apache.org/docs/latest/index.html).
4277 */
4278 archiveUris?: Array<string>;
4279 /**
4280 * Fully qualified name of the user-provided Spark connection object. Format: ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"```
4281 */
4282 connection?: string;
4283 /**
4284 * Custom container image for the runtime environment.
4285 */
4286 containerImage?: string;
4287 /**
4288 * Files to be placed in the working directory of each executor. For more information about Apache Spark, see [Apache Spark](https://spark.apache.org/docs/latest/index.html).
4289 */
4290 fileUris?: Array<string>;
4291 /**
4292 * JARs to include on the driver and executor CLASSPATH. For more information about Apache Spark, see [Apache Spark](https://spark.apache.org/docs/latest/index.html).
4293 */
4294 jarUris?: Array<string>;
4295 /**
4296 * The fully qualified name of a class in jar_uris, for example, com.example.wordcount. Exactly one of main_class and main_jar_uri field should be set for Java/Scala language type.
4297 */
4298 mainClass?: string;
4299 /**
4300 * The main file/jar URI of the Spark application. Exactly one of the definition_body field and the main_file_uri field must be set for Python. Exactly one of main_class and main_file_uri field should be set for Java/Scala language type.
4301 */
4302 mainFileUri?: string;
4303 /**
4304 * Configuration properties as a set of key/value pairs, which will be passed on to the Spark application. For more information, see [Apache Spark](https://spark.apache.org/docs/latest/index.html) and the [procedure option list](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#procedure_option_list).
4305 */
4306 properties?: {[key: string]: string};
4307 /**
4308 * Python files to be placed on the PYTHONPATH for PySpark application. Supported file types: `.py`, `.egg`, and `.zip`. For more information about Apache Spark, see [Apache Spark](https://spark.apache.org/docs/latest/index.html).
4309 */
4310 pyFileUris?: Array<string>;
4311 /**
4312 * Runtime version. If not specified, the default runtime version is used.
4313 */
4314 runtimeVersion?: string;
4315 };
4316
4317 /**
4318 * Statistics for a BigSpark query. Populated as part of JobStatistics2
4319 */
4320 type ISparkStatistics = {
4321 /**
4322 * Output only. Endpoints returned from Dataproc. Key list: - history_server_endpoint: A link to Spark job UI.
4323 */
4324 endpoints?: {[key: string]: string};
4325 /**
4326 * Output only. The Google Cloud Storage bucket that is used as the default filesystem by the Spark application. This fields is only filled when the Spark procedure uses the INVOKER security mode. It is inferred from the system variable @@spark_proc_properties.staging_bucket if it is provided. Otherwise, BigQuery creates a default staging bucket for the job and returns the bucket name in this field. Example: * `gs://[bucket_name]`
4327 */
4328 gcsStagingBucket?: string;
4329 /**
4330 * Output only. The Cloud KMS encryption key that is used to protect the resources created by the Spark job. If the Spark procedure uses DEFINER security mode, the Cloud KMS key is inferred from the Spark connection associated with the procedure if it is provided. Otherwise the key is inferred from the default key of the Spark connection's project if the CMEK organization policy is enforced. If the Spark procedure uses INVOKER security mode, the Cloud KMS encryption key is inferred from the system variable @@spark_proc_properties.kms_key_name if it is provided. Otherwise, the key is inferred fromt he default key of the BigQuery job's project if the CMEK organization policy is enforced. Example: * `projects/[kms_project_id]/locations/[region]/keyRings/[key_region]/cryptoKeys/[key]`
4331 */
4332 kmsKeyName?: string;
4333 /**
4334 * Output only. Logging info is used to generate a link to Cloud Logging.
4335 */
4336 loggingInfo?: ISparkLoggingInfo;
4337 /**
4338 * Output only. Spark job ID if a Spark job is created successfully.
4339 */
4340 sparkJobId?: string;
4341 /**
4342 * Output only. Location where the Spark job is executed. A location is selected by BigQueury for jobs configured to run in a multi-region.
4343 */
4344 sparkJobLocation?: string;
4345 };
4346
4347 /**
4348 * Performance insights compared to the previous executions for a specific stage.
4349 */
4350 type IStagePerformanceChangeInsight = {
4351 /**
4352 * Output only. Input data change insight of the query stage.
4353 */
4354 inputDataChange?: IInputDataChange;
4355 /**
4356 * Output only. The stage id that the insight mapped to.
4357 */
4358 stageId?: string;
4359 };
4360
4361 /**
4362 * Standalone performance insights for a specific stage.
4363 */
4364 type IStagePerformanceStandaloneInsight = {
4365 /**
4366 * Output only. If present, the stage had the following reasons for being disqualified from BI Engine execution.
4367 */
4368 biEngineReasons?: Array<IBiEngineReason>;
4369 /**
4370 * Output only. High cardinality joins in the stage.
4371 */
4372 highCardinalityJoins?: Array<IHighCardinalityJoin>;
4373 /**
4374 * Output only. True if the stage has insufficient shuffle quota.
4375 */
4376 insufficientShuffleQuota?: boolean;
4377 /**
4378 * Output only. True if the stage has a slot contention issue.
4379 */
4380 slotContention?: boolean;
4381 /**
4382 * Output only. The stage id that the insight mapped to.
4383 */
4384 stageId?: string;
4385 };
4386
4387 /**
4388 * The data type of a variable such as a function argument. Examples include: * INT64: `{"typeKind": "INT64"}` * ARRAY: { "typeKind": "ARRAY", "arrayElementType": {"typeKind": "STRING"} } * STRUCT>: { "typeKind": "STRUCT", "structType": { "fields": [ { "name": "x", "type": {"typeKind": "STRING"} }, { "name": "y", "type": { "typeKind": "ARRAY", "arrayElementType": {"typeKind": "DATE"} } } ] } }
4389 */
4390 type IStandardSqlDataType = {
4391 /**
4392 * The type of the array's elements, if type_kind = "ARRAY".
4393 */
4394 arrayElementType?: IStandardSqlDataType;
4395 /**
4396 * The type of the range's elements, if type_kind = "RANGE".
4397 */
4398 rangeElementType?: IStandardSqlDataType;
4399 /**
4400 * The fields of this struct, in order, if type_kind = "STRUCT".
4401 */
4402 structType?: IStandardSqlStructType;
4403 /**
4404 * Required. The top level type of this field. Can be any GoogleSQL data type (e.g., "INT64", "DATE", "ARRAY").
4405 */
4406 typeKind?:
4407 | 'TYPE_KIND_UNSPECIFIED'
4408 | 'INT64'
4409 | 'BOOL'
4410 | 'FLOAT64'
4411 | 'STRING'
4412 | 'BYTES'
4413 | 'TIMESTAMP'
4414 | 'DATE'
4415 | 'TIME'
4416 | 'DATETIME'
4417 | 'INTERVAL'
4418 | 'GEOGRAPHY'
4419 | 'NUMERIC'
4420 | 'BIGNUMERIC'
4421 | 'JSON'
4422 | 'ARRAY'
4423 | 'STRUCT'
4424 | 'RANGE';
4425 };
4426
4427 /**
4428 * A field or a column.
4429 */
4430 type IStandardSqlField = {
4431 /**
4432 * Optional. The name of this field. Can be absent for struct fields.
4433 */
4434 name?: string;
4435 /**
4436 * Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field).
4437 */
4438 type?: IStandardSqlDataType;
4439 };
4440
4441 /**
4442 * The representation of a SQL STRUCT type.
4443 */
4444 type IStandardSqlStructType = {
4445 /**
4446 * Fields within the struct.
4447 */
4448 fields?: Array<IStandardSqlField>;
4449 };
4450
4451 /**
4452 * A table type
4453 */
4454 type IStandardSqlTableType = {
4455 /**
4456 * The columns in this table type
4457 */
4458 columns?: Array<IStandardSqlField>;
4459 };
4460
4461 type IStreamingbuffer = {
4462 /**
4463 * Output only. A lower-bound estimate of the number of bytes currently in the streaming buffer.
4464 */
4465 estimatedBytes?: string;
4466 /**
4467 * Output only. A lower-bound estimate of the number of rows currently in the streaming buffer.
4468 */
4469 estimatedRows?: string;
4470 /**
4471 * Output only. Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
4472 */
4473 oldestEntryTime?: string;
4474 };
4475
4476 /**
4477 * Search space for string and enum.
4478 */
4479 type IStringHparamSearchSpace = {
4480 /**
4481 * Canididates for the string or enum parameter in lower case.
4482 */
4483 candidates?: Array<string>;
4484 };
4485
4486 /**
4487 * System variables given to a query.
4488 */
4489 type ISystemVariables = {
4490 /**
4491 * Output only. Data type for each system variable.
4492 */
4493 types?: {[key: string]: IStandardSqlDataType};
4494 /**
4495 * Output only. Value for each system variable.
4496 */
4497 values?: {[key: string]: any};
4498 };
4499
4500 type ITable = {
4501 /**
4502 * Optional. Specifies the configuration of a BigLake managed table.
4503 */
4504 biglakeConfiguration?: IBigLakeConfiguration;
4505 /**
4506 * Output only. Contains information about the clone. This value is set via the clone operation.
4507 */
4508 cloneDefinition?: ICloneDefinition;
4509 /**
4510 * Clustering specification for the table. Must be specified with time-based partitioning, data in the table will be first partitioned and subsequently clustered.
4511 */
4512 clustering?: IClustering;
4513 /**
4514 * Output only. The time when this table was created, in milliseconds since the epoch.
4515 */
4516 creationTime?: string;
4517 /**
4518 * Optional. Defines the default collation specification of new STRING fields in the table. During table creation or update, if a STRING field is added to this table without explicit collation specified, then the table inherits the table default collation. A change to this field affects only fields added afterwards, and does not alter the existing fields. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.
4519 */
4520 defaultCollation?: string;
4521 /**
4522 * Optional. Defines the default rounding mode specification of new decimal fields (NUMERIC OR BIGNUMERIC) in the table. During table creation or update, if a decimal field is added to this table without an explicit rounding mode specified, then the field inherits the table default rounding mode. Changing this field doesn't affect existing fields.
4523 */
4524 defaultRoundingMode?:
4525 | 'ROUNDING_MODE_UNSPECIFIED'
4526 | 'ROUND_HALF_AWAY_FROM_ZERO'
4527 | 'ROUND_HALF_EVEN';
4528 /**
4529 * Optional. A user-friendly description of this table.
4530 */
4531 description?: string;
4532 /**
4533 * Custom encryption configuration (e.g., Cloud KMS keys).
4534 */
4535 encryptionConfiguration?: IEncryptionConfiguration;
4536 /**
4537 * Output only. A hash of this resource.
4538 */
4539 etag?: string;
4540 /**
4541 * Optional. The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created tables.
4542 */
4543 expirationTime?: string;
4544 /**
4545 * Optional. Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
4546 */
4547 externalDataConfiguration?: IExternalDataConfiguration;
4548 /**
4549 * Optional. A descriptive name for this table.
4550 */
4551 friendlyName?: string;
4552 /**
4553 * Output only. An opaque ID uniquely identifying the table.
4554 */
4555 id?: string;
4556 /**
4557 * The type of resource ID.
4558 */
4559 kind?: string;
4560 /**
4561 * The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
4562 */
4563 labels?: {[key: string]: string};
4564 /**
4565 * Output only. The time when this table was last modified, in milliseconds since the epoch.
4566 */
4567 lastModifiedTime?: string;
4568 /**
4569 * Output only. The geographic location where the table resides. This value is inherited from the dataset.
4570 */
4571 location?: string;
4572 /**
4573 * Optional. The materialized view definition.
4574 */
4575 materializedView?: IMaterializedViewDefinition;
4576 /**
4577 * Output only. The materialized view status.
4578 */
4579 materializedViewStatus?: IMaterializedViewStatus;
4580 /**
4581 * Optional. The maximum staleness of data that could be returned when the table (or stale MV) is queried. Staleness encoded as a string encoding of sql IntervalValue type.
4582 */
4583 maxStaleness?: string;
4584 /**
4585 * Deprecated.
4586 */
4587 model?: IModelDefinition;
4588 /**
4589 * Output only. Number of logical bytes that are less than 90 days old.
4590 */
4591 numActiveLogicalBytes?: string;
4592 /**
4593 * Output only. Number of physical bytes less than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
4594 */
4595 numActivePhysicalBytes?: string;
4596 /**
4597 * Output only. The size of this table in logical bytes, excluding any data in the streaming buffer.
4598 */
4599 numBytes?: string;
4600 /**
4601 * Output only. The number of logical bytes in the table that are considered "long-term storage".
4602 */
4603 numLongTermBytes?: string;
4604 /**
4605 * Output only. Number of logical bytes that are more than 90 days old.
4606 */
4607 numLongTermLogicalBytes?: string;
4608 /**
4609 * Output only. Number of physical bytes more than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
4610 */
4611 numLongTermPhysicalBytes?: string;
4612 /**
4613 * Output only. The number of partitions present in the table or materialized view. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
4614 */
4615 numPartitions?: string;
4616 /**
4617 * Output only. The physical size of this table in bytes. This includes storage used for time travel.
4618 */
4619 numPhysicalBytes?: string;
4620 /**
4621 * Output only. The number of rows of data in this table, excluding any data in the streaming buffer.
4622 */
4623 numRows?: string;
4624 /**
4625 * Output only. Number of physical bytes used by time travel storage (deleted or changed data). This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
4626 */
4627 numTimeTravelPhysicalBytes?: string;
4628 /**
4629 * Output only. Total number of logical bytes in the table or materialized view.
4630 */
4631 numTotalLogicalBytes?: string;
4632 /**
4633 * Output only. The physical size of this table in bytes. This also includes storage used for time travel. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
4634 */
4635 numTotalPhysicalBytes?: string;
4636 /**
4637 * If specified, configures range partitioning for this table.
4638 */
4639 rangePartitioning?: IRangePartitioning;
4640 /**
4641 * Optional. Output only. Table references of all replicas currently active on the table.
4642 */
4643 replicas?: Array<ITableReference>;
4644 /**
4645 * Optional. If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.
4646 */
4647 requirePartitionFilter?: boolean;
4648 /**
4649 * [Optional] The tags associated with this table. Tag keys are globally unique. See additional information on [tags](https://cloud.google.com/iam/docs/tags-access-control#definitions). An object containing a list of "key": value pairs. The key is the namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is parent id. The value is the friendly short name of the tag value, e.g. "production".
4650 */
4651 resourceTags?: {[key: string]: string};
4652 /**
4653 * Optional. Describes the schema of this table.
4654 */
4655 schema?: ITableSchema;
4656 /**
4657 * Output only. A URL that can be used to access this resource again.
4658 */
4659 selfLink?: string;
4660 /**
4661 * Output only. Contains information about the snapshot. This value is set via snapshot creation.
4662 */
4663 snapshotDefinition?: ISnapshotDefinition;
4664 /**
4665 * Output only. Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
4666 */
4667 streamingBuffer?: IStreamingbuffer;
4668 /**
4669 * Optional. Tables Primary Key and Foreign Key information
4670 */
4671 tableConstraints?: ITableConstraints;
4672 /**
4673 * Required. Reference describing the ID of this table.
4674 */
4675 tableReference?: ITableReference;
4676 /**
4677 * Optional. Table replication info for table created `AS REPLICA` DDL like: `CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv`
4678 */
4679 tableReplicationInfo?: ITableReplicationInfo;
4680 /**
4681 * If specified, configures time-based partitioning for this table.
4682 */
4683 timePartitioning?: ITimePartitioning;
4684 /**
4685 * Output only. Describes the table type. The following values are supported: * `TABLE`: A normal BigQuery table. * `VIEW`: A virtual table defined by a SQL query. * `EXTERNAL`: A table that references data stored in an external storage system, such as Google Cloud Storage. * `MATERIALIZED_VIEW`: A precomputed view defined by a SQL query. * `SNAPSHOT`: An immutable BigQuery table that preserves the contents of a base table at a particular time. See additional information on [table snapshots](/bigquery/docs/table-snapshots-intro). The default value is `TABLE`.
4686 */
4687 type?: string;
4688 /**
4689 * Optional. The view definition.
4690 */
4691 view?: IViewDefinition;
4692 };
4693
4694 type ITableCell = {v?: any};
4695
4696 /**
4697 * The TableConstraints defines the primary key and foreign key.
4698 */
4699 type ITableConstraints = {
4700 /**
4701 * Optional. Present only if the table has a foreign key. The foreign key is not enforced.
4702 */
4703 foreignKeys?: Array<{
4704 /**
4705 * Required. The columns that compose the foreign key.
4706 */
4707 columnReferences?: Array<{
4708 /**
4709 * Required. The column in the primary key that are referenced by the referencing_column.
4710 */
4711 referencedColumn?: string;
4712 /**
4713 * Required. The column that composes the foreign key.
4714 */
4715 referencingColumn?: string;
4716 }>;
4717 /**
4718 * Optional. Set only if the foreign key constraint is named.
4719 */
4720 name?: string;
4721 referencedTable?: {
4722 datasetId?: string;
4723 projectId?: string;
4724 tableId?: string;
4725 };
4726 }>;
4727 /**
4728 * Represents the primary key constraint on a table's columns.
4729 */
4730 primaryKey?: {
4731 /**
4732 * Required. The columns that are composed of the primary key constraint.
4733 */
4734 columns?: Array<string>;
4735 };
4736 };
4737
4738 /**
4739 * Request for sending a single streaming insert.
4740 */
4741 type ITableDataInsertAllRequest = {
4742 /**
4743 * Optional. Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors.
4744 */
4745 ignoreUnknownValues?: boolean;
4746 /**
4747 * Optional. The resource type of the response. The value is not checked at the backend. Historically, it has been set to "bigquery#tableDataInsertAllRequest" but you are not required to set it.
4748 */
4749 kind?: string;
4750 rows?: Array<{
4751 /**
4752 * Insertion ID for best-effort deduplication. This feature is not recommended, and users seeking stronger insertion semantics are encouraged to use other mechanisms such as the BigQuery Write API.
4753 */
4754 insertId?: string;
4755 /**
4756 * Data for a single row.
4757 */
4758 json?: IJsonObject;
4759 }>;
4760 /**
4761 * Optional. Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist.
4762 */
4763 skipInvalidRows?: boolean;
4764 /**
4765 * Optional. If specified, treats the destination table as a base template, and inserts the rows into an instance table named "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables.
4766 */
4767 templateSuffix?: string;
4768 /**
4769 * Optional. Unique request trace id. Used for debugging purposes only. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended.
4770 */
4771 traceId?: string;
4772 };
4773
4774 /**
4775 * Describes the format of a streaming insert response.
4776 */
4777 type ITableDataInsertAllResponse = {
4778 /**
4779 * Describes specific errors encountered while processing the request.
4780 */
4781 insertErrors?: Array<{
4782 /**
4783 * Error information for the row indicated by the index property.
4784 */
4785 errors?: Array<IErrorProto>;
4786 /**
4787 * The index of the row that error applies to.
4788 */
4789 index?: number;
4790 }>;
4791 /**
4792 * Returns "bigquery#tableDataInsertAllResponse".
4793 */
4794 kind?: string;
4795 };
4796
4797 type ITableDataList = {
4798 /**
4799 * A hash of this page of results.
4800 */
4801 etag?: string;
4802 /**
4803 * The resource type of the response.
4804 */
4805 kind?: string;
4806 /**
4807 * A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table is changing.
4808 */
4809 pageToken?: string;
4810 /**
4811 * Rows of results.
4812 */
4813 rows?: Array<ITableRow>;
4814 /**
4815 * Total rows of the entire table. In order to show default value 0 we have to present it as string.
4816 */
4817 totalRows?: string;
4818 };
4819
4820 /**
4821 * A field in TableSchema
4822 */
4823 type ITableFieldSchema = {
4824 /**
4825 * Deprecated.
4826 */
4827 categories?: {
4828 /**
4829 * Deprecated.
4830 */
4831 names?: Array<string>;
4832 };
4833 /**
4834 * Optional. Field collation can be set only when the type of field is STRING. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.
4835 */
4836 collation?: string;
4837 /**
4838 * Optional. A SQL expression to specify the [default value] (https://cloud.google.com/bigquery/docs/default-values) for this field.
4839 */
4840 defaultValueExpression?: string;
4841 /**
4842 * Optional. The field description. The maximum length is 1,024 characters.
4843 */
4844 description?: string;
4845 /**
4846 * Optional. Describes the nested schema fields if the type property is set to RECORD.
4847 */
4848 fields?: Array<ITableFieldSchema>;
4849 /**
4850 * Optional. Maximum length of values of this field for STRINGS or BYTES. If max_length is not specified, no maximum length constraint is imposed on this field. If type = "STRING", then max_length represents the maximum UTF-8 length of strings in this field. If type = "BYTES", then max_length represents the maximum number of bytes in this field. It is invalid to set this field if type ≠ "STRING" and ≠ "BYTES".
4851 */
4852 maxLength?: string;
4853 /**
4854 * Optional. The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
4855 */
4856 mode?: string;
4857 /**
4858 * Required. The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 300 characters.
4859 */
4860 name?: string;
4861 /**
4862 * Optional. The policy tags attached to this field, used for field-level access control. If not set, defaults to empty policy_tags.
4863 */
4864 policyTags?: {
4865 /**
4866 * A list of policy tag resource names. For example, "projects/1/locations/eu/taxonomies/2/policyTags/3". At most 1 policy tag is currently allowed.
4867 */
4868 names?: Array<string>;
4869 };
4870 /**
4871 * Optional. Precision (maximum number of total digits in base 10) and scale (maximum number of digits in the fractional part in base 10) constraints for values of this field for NUMERIC or BIGNUMERIC. It is invalid to set precision or scale if type ≠ "NUMERIC" and ≠ "BIGNUMERIC". If precision and scale are not specified, no value range constraint is imposed on this field insofar as values are permitted by the type. Values of this NUMERIC or BIGNUMERIC field must be in this range when: * Precision (P) and scale (S) are specified: [-10P-S + 10-S, 10P-S - 10-S] * Precision (P) is specified but not scale (and thus scale is interpreted to be equal to zero): [-10P + 1, 10P - 1]. Acceptable values for precision and scale if both are specified: * If type = "NUMERIC": 1 ≤ precision - scale ≤ 29 and 0 ≤ scale ≤ 9. * If type = "BIGNUMERIC": 1 ≤ precision - scale ≤ 38 and 0 ≤ scale ≤ 38. Acceptable values for precision if only precision is specified but not scale (and thus scale is interpreted to be equal to zero): * If type = "NUMERIC": 1 ≤ precision ≤ 29. * If type = "BIGNUMERIC": 1 ≤ precision ≤ 38. If scale is specified but not precision, then it is invalid.
4872 */
4873 precision?: string;
4874 /**
4875 * Represents the type of a field element.
4876 */
4877 rangeElementType?: {
4878 /**
4879 * Required. The type of a field element. See TableFieldSchema.type.
4880 */
4881 type?: string;
4882 };
4883 /**
4884 * Optional. Specifies the rounding mode to be used when storing values of NUMERIC and BIGNUMERIC type.
4885 */
4886 roundingMode?:
4887 | 'ROUNDING_MODE_UNSPECIFIED'
4888 | 'ROUND_HALF_AWAY_FROM_ZERO'
4889 | 'ROUND_HALF_EVEN';
4890 /**
4891 * Optional. See documentation for precision.
4892 */
4893 scale?: string;
4894 /**
4895 * Required. The field data type. Possible values include: * STRING * BYTES * INTEGER (or INT64) * FLOAT (or FLOAT64) * BOOLEAN (or BOOL) * TIMESTAMP * DATE * TIME * DATETIME * GEOGRAPHY * NUMERIC * BIGNUMERIC * JSON * RECORD (or STRUCT) Use of RECORD/STRUCT indicates that the field contains a nested schema.
4896 */
4897 type?: string;
4898 };
4899
4900 /**
4901 * Partial projection of the metadata for a given table in a list response.
4902 */
4903 type ITableList = {
4904 /**
4905 * A hash of this page of results.
4906 */
4907 etag?: string;
4908 /**
4909 * The type of list.
4910 */
4911 kind?: string;
4912 /**
4913 * A token to request the next page of results.
4914 */
4915 nextPageToken?: string;
4916 /**
4917 * Tables in the requested dataset.
4918 */
4919 tables?: Array<{
4920 /**
4921 * Clustering specification for this table, if configured.
4922 */
4923 clustering?: IClustering;
4924 /**
4925 * Output only. The time when this table was created, in milliseconds since the epoch.
4926 */
4927 creationTime?: string;
4928 /**
4929 * The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
4930 */
4931 expirationTime?: string;
4932 /**
4933 * The user-friendly name for this table.
4934 */
4935 friendlyName?: string;
4936 /**
4937 * An opaque ID of the table.
4938 */
4939 id?: string;
4940 /**
4941 * The resource type.
4942 */
4943 kind?: string;
4944 /**
4945 * The labels associated with this table. You can use these to organize and group your tables.
4946 */
4947 labels?: {[key: string]: string};
4948 /**
4949 * The range partitioning for this table.
4950 */
4951 rangePartitioning?: IRangePartitioning;
4952 /**
4953 * Optional. If set to true, queries including this table must specify a partition filter. This filter is used for partition elimination.
4954 */
4955 requirePartitionFilter?: boolean;
4956 /**
4957 * A reference uniquely identifying table.
4958 */
4959 tableReference?: ITableReference;
4960 /**
4961 * The time-based partitioning for this table.
4962 */
4963 timePartitioning?: ITimePartitioning;
4964 /**
4965 * The type of table.
4966 */
4967 type?: string;
4968 /**
4969 * Information about a logical view.
4970 */
4971 view?: {
4972 /**
4973 * Specifices the privacy policy for the view.
4974 */
4975 privacyPolicy?: IPrivacyPolicy;
4976 /**
4977 * True if view is defined in legacy SQL dialect, false if in GoogleSQL.
4978 */
4979 useLegacySql?: boolean;
4980 };
4981 }>;
4982 /**
4983 * The total number of tables in the dataset.
4984 */
4985 totalItems?: number;
4986 };
4987
4988 /**
4989 * Table level detail on the usage of metadata caching. Only set for Metadata caching eligible tables referenced in the query.
4990 */
4991 type ITableMetadataCacheUsage = {
4992 /**
4993 * Free form human-readable reason metadata caching was unused for the job.
4994 */
4995 explanation?: string;
4996 /**
4997 * Metadata caching eligible table referenced in the query.
4998 */
4999 tableReference?: ITableReference;
5000 /**
5001 * [Table type](/bigquery/docs/reference/rest/v2/tables#Table.FIELDS.type).
5002 */
5003 tableType?: string;
5004 /**
5005 * Reason for not using metadata caching for the table.
5006 */
5007 unusedReason?:
5008 | 'UNUSED_REASON_UNSPECIFIED'
5009 | 'EXCEEDED_MAX_STALENESS'
5010 | 'METADATA_CACHING_NOT_ENABLED'
5011 | 'OTHER_REASON';
5012 };
5013
5014 type ITableReference = {
5015 /**
5016 * Required. The ID of the dataset containing this table.
5017 */
5018 datasetId?: string;
5019 /**
5020 * Required. The ID of the project containing this table.
5021 */
5022 projectId?: string;
5023 /**
5024 * Required. The ID of the table. The ID can contain Unicode characters in category L (letter), M (mark), N (number), Pc (connector, including underscore), Pd (dash), and Zs (space). For more information, see [General Category](https://wikipedia.org/wiki/Unicode_character_property#General_Category). The maximum length is 1,024 characters. Certain operations allow suffixing of the table ID with a partition decorator, such as `sample_table$20190123`.
5025 */
5026 tableId?: string;
5027 };
5028
5029 /**
5030 * Replication info of a table created using `AS REPLICA` DDL like: `CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv`
5031 */
5032 type ITableReplicationInfo = {
5033 /**
5034 * Optional. Output only. If source is a materialized view, this field signifies the last refresh time of the source.
5035 */
5036 replicatedSourceLastRefreshTime?: string;
5037 /**
5038 * Optional. Output only. Replication error that will permanently stopped table replication.
5039 */
5040 replicationError?: IErrorProto;
5041 /**
5042 * Required. Specifies the interval at which the source table is polled for updates.
5043 */
5044 replicationIntervalMs?: string;
5045 /**
5046 * Optional. Output only. Replication status of configured replication.
5047 */
5048 replicationStatus?:
5049 | 'REPLICATION_STATUS_UNSPECIFIED'
5050 | 'ACTIVE'
5051 | 'SOURCE_DELETED'
5052 | 'PERMISSION_DENIED'
5053 | 'UNSUPPORTED_CONFIGURATION';
5054 /**
5055 * Required. Source table reference that is replicated.
5056 */
5057 sourceTable?: ITableReference;
5058 };
5059
5060 type ITableRow = {
5061 /**
5062 * Represents a single row in the result set, consisting of one or more fields.
5063 */
5064 f?: Array<ITableCell>;
5065 };
5066
5067 /**
5068 * Schema of a table
5069 */
5070 type ITableSchema = {
5071 /**
5072 * Describes the fields in a table.
5073 */
5074 fields?: Array<ITableFieldSchema>;
5075 };
5076
5077 /**
5078 * Request message for `TestIamPermissions` method.
5079 */
5080 type ITestIamPermissionsRequest = {
5081 /**
5082 * The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
5083 */
5084 permissions?: Array<string>;
5085 };
5086
5087 /**
5088 * Response message for `TestIamPermissions` method.
5089 */
5090 type ITestIamPermissionsResponse = {
5091 /**
5092 * A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
5093 */
5094 permissions?: Array<string>;
5095 };
5096
5097 type ITimePartitioning = {
5098 /**
5099 * Optional. Number of milliseconds for which to keep the storage for a partition. A wrapper is used here because 0 is an invalid value.
5100 */
5101 expirationMs?: string;
5102 /**
5103 * Optional. If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if set, the table is partitioned by this field. The field must be a top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED. A wrapper is used here because an empty string is an invalid value.
5104 */
5105 field?: string;
5106 /**
5107 * If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified. This field is deprecated; please set the field with the same name on the table itself instead. This field needs a wrapper because we want to output the default value, false, if the user explicitly set it.
5108 */
5109 requirePartitionFilter?: boolean;
5110 /**
5111 * Required. The supported types are DAY, HOUR, MONTH, and YEAR, which will generate one partition per day, hour, month, and year, respectively.
5112 */
5113 type?: string;
5114 };
5115
5116 /**
5117 * Options used in model training.
5118 */
5119 type ITrainingOptions = {
5120 /**
5121 * Activation function of the neural nets.
5122 */
5123 activationFn?: string;
5124 /**
5125 * If true, detect step changes and make data adjustment in the input time series.
5126 */
5127 adjustStepChanges?: boolean;
5128 /**
5129 * Whether to use approximate feature contribution method in XGBoost model explanation for global explain.
5130 */
5131 approxGlobalFeatureContrib?: boolean;
5132 /**
5133 * Whether to enable auto ARIMA or not.
5134 */
5135 autoArima?: boolean;
5136 /**
5137 * The max value of the sum of non-seasonal p and q.
5138 */
5139 autoArimaMaxOrder?: string;
5140 /**
5141 * The min value of the sum of non-seasonal p and q.
5142 */
5143 autoArimaMinOrder?: string;
5144 /**
5145 * Whether to calculate class weights automatically based on the popularity of each label.
5146 */
5147 autoClassWeights?: boolean;
5148 /**
5149 * Batch size for dnn models.
5150 */
5151 batchSize?: string;
5152 /**
5153 * Booster type for boosted tree models.
5154 */
5155 boosterType?: 'BOOSTER_TYPE_UNSPECIFIED' | 'GBTREE' | 'DART';
5156 /**
5157 * Budget in hours for AutoML training.
5158 */
5159 budgetHours?: number;
5160 /**
5161 * Whether or not p-value test should be computed for this model. Only available for linear and logistic regression models.
5162 */
5163 calculatePValues?: boolean;
5164 /**
5165 * Categorical feature encoding method.
5166 */
5167 categoryEncodingMethod?:
5168 | 'ENCODING_METHOD_UNSPECIFIED'
5169 | 'ONE_HOT_ENCODING'
5170 | 'LABEL_ENCODING'
5171 | 'DUMMY_ENCODING';
5172 /**
5173 * If true, clean spikes and dips in the input time series.
5174 */
5175 cleanSpikesAndDips?: boolean;
5176 /**
5177 * Enums for color space, used for processing images in Object Table. See more details at https://www.tensorflow.org/io/tutorials/colorspace.
5178 */
5179 colorSpace?:
5180 | 'COLOR_SPACE_UNSPECIFIED'
5181 | 'RGB'
5182 | 'HSV'
5183 | 'YIQ'
5184 | 'YUV'
5185 | 'GRAYSCALE';
5186 /**
5187 * Subsample ratio of columns for each level for boosted tree models.
5188 */
5189 colsampleBylevel?: number;
5190 /**
5191 * Subsample ratio of columns for each node(split) for boosted tree models.
5192 */
5193 colsampleBynode?: number;
5194 /**
5195 * Subsample ratio of columns when constructing each tree for boosted tree models.
5196 */
5197 colsampleBytree?: number;
5198 /**
5199 * Type of normalization algorithm for boosted tree models using dart booster.
5200 */
5201 dartNormalizeType?: 'DART_NORMALIZE_TYPE_UNSPECIFIED' | 'TREE' | 'FOREST';
5202 /**
5203 * The data frequency of a time series.
5204 */
5205 dataFrequency?:
5206 | 'DATA_FREQUENCY_UNSPECIFIED'
5207 | 'AUTO_FREQUENCY'
5208 | 'YEARLY'
5209 | 'QUARTERLY'
5210 | 'MONTHLY'
5211 | 'WEEKLY'
5212 | 'DAILY'
5213 | 'HOURLY'
5214 | 'PER_MINUTE';
5215 /**
5216 * The column to split data with. This column won't be used as a feature. 1. When data_split_method is CUSTOM, the corresponding column should be boolean. The rows with true value tag are eval data, and the false are training data. 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION rows (from smallest to largest) in the corresponding column are used as training data, and the rest are eval data. It respects the order in Orderable data types: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
5217 */
5218 dataSplitColumn?: string;
5219 /**
5220 * The fraction of evaluation data over the whole input data. The rest of data will be used as training data. The format should be double. Accurate to two decimal places. Default value is 0.2.
5221 */
5222 dataSplitEvalFraction?: number;
5223 /**
5224 * The data split type for training and evaluation, e.g. RANDOM.
5225 */
5226 dataSplitMethod?:
5227 | 'DATA_SPLIT_METHOD_UNSPECIFIED'
5228 | 'RANDOM'
5229 | 'CUSTOM'
5230 | 'SEQUENTIAL'
5231 | 'NO_SPLIT'
5232 | 'AUTO_SPLIT';
5233 /**
5234 * If true, perform decompose time series and save the results.
5235 */
5236 decomposeTimeSeries?: boolean;
5237 /**
5238 * Distance type for clustering models.
5239 */
5240 distanceType?: 'DISTANCE_TYPE_UNSPECIFIED' | 'EUCLIDEAN' | 'COSINE';
5241 /**
5242 * Dropout probability for dnn models.
5243 */
5244 dropout?: number;
5245 /**
5246 * Whether to stop early when the loss doesn't improve significantly any more (compared to min_relative_progress). Used only for iterative training algorithms.
5247 */
5248 earlyStop?: boolean;
5249 /**
5250 * If true, enable global explanation during training.
5251 */
5252 enableGlobalExplain?: boolean;
5253 /**
5254 * Feedback type that specifies which algorithm to run for matrix factorization.
5255 */
5256 feedbackType?: 'FEEDBACK_TYPE_UNSPECIFIED' | 'IMPLICIT' | 'EXPLICIT';
5257 /**
5258 * Whether the model should include intercept during model training.
5259 */
5260 fitIntercept?: boolean;
5261 /**
5262 * Hidden units for dnn models.
5263 */
5264 hiddenUnits?: Array<string>;
5265 /**
5266 * The geographical region based on which the holidays are considered in time series modeling. If a valid value is specified, then holiday effects modeling is enabled.
5267 */
5268 holidayRegion?:
5269 | 'HOLIDAY_REGION_UNSPECIFIED'
5270 | 'GLOBAL'
5271 | 'NA'
5272 | 'JAPAC'
5273 | 'EMEA'
5274 | 'LAC'
5275 | 'AE'
5276 | 'AR'
5277 | 'AT'
5278 | 'AU'
5279 | 'BE'
5280 | 'BR'
5281 | 'CA'
5282 | 'CH'
5283 | 'CL'
5284 | 'CN'
5285 | 'CO'
5286 | 'CS'
5287 | 'CZ'
5288 | 'DE'
5289 | 'DK'
5290 | 'DZ'
5291 | 'EC'
5292 | 'EE'
5293 | 'EG'
5294 | 'ES'
5295 | 'FI'
5296 | 'FR'
5297 | 'GB'
5298 | 'GR'
5299 | 'HK'
5300 | 'HU'
5301 | 'ID'
5302 | 'IE'
5303 | 'IL'
5304 | 'IN'
5305 | 'IR'
5306 | 'IT'
5307 | 'JP'
5308 | 'KR'
5309 | 'LV'
5310 | 'MA'
5311 | 'MX'
5312 | 'MY'
5313 | 'NG'
5314 | 'NL'
5315 | 'NO'
5316 | 'NZ'
5317 | 'PE'
5318 | 'PH'
5319 | 'PK'
5320 | 'PL'
5321 | 'PT'
5322 | 'RO'
5323 | 'RS'
5324 | 'RU'
5325 | 'SA'
5326 | 'SE'
5327 | 'SG'
5328 | 'SI'
5329 | 'SK'
5330 | 'TH'
5331 | 'TR'
5332 | 'TW'
5333 | 'UA'
5334 | 'US'
5335 | 'VE'
5336 | 'VN'
5337 | 'ZA';
5338 /**
5339 * A list of geographical regions that are used for time series modeling.
5340 */
5341 holidayRegions?: Array<
5342 | 'HOLIDAY_REGION_UNSPECIFIED'
5343 | 'GLOBAL'
5344 | 'NA'
5345 | 'JAPAC'
5346 | 'EMEA'
5347 | 'LAC'
5348 | 'AE'
5349 | 'AR'
5350 | 'AT'
5351 | 'AU'
5352 | 'BE'
5353 | 'BR'
5354 | 'CA'
5355 | 'CH'
5356 | 'CL'
5357 | 'CN'
5358 | 'CO'
5359 | 'CS'
5360 | 'CZ'
5361 | 'DE'
5362 | 'DK'
5363 | 'DZ'
5364 | 'EC'
5365 | 'EE'
5366 | 'EG'
5367 | 'ES'
5368 | 'FI'
5369 | 'FR'
5370 | 'GB'
5371 | 'GR'
5372 | 'HK'
5373 | 'HU'
5374 | 'ID'
5375 | 'IE'
5376 | 'IL'
5377 | 'IN'
5378 | 'IR'
5379 | 'IT'
5380 | 'JP'
5381 | 'KR'
5382 | 'LV'
5383 | 'MA'
5384 | 'MX'
5385 | 'MY'
5386 | 'NG'
5387 | 'NL'
5388 | 'NO'
5389 | 'NZ'
5390 | 'PE'
5391 | 'PH'
5392 | 'PK'
5393 | 'PL'
5394 | 'PT'
5395 | 'RO'
5396 | 'RS'
5397 | 'RU'
5398 | 'SA'
5399 | 'SE'
5400 | 'SG'
5401 | 'SI'
5402 | 'SK'
5403 | 'TH'
5404 | 'TR'
5405 | 'TW'
5406 | 'UA'
5407 | 'US'
5408 | 'VE'
5409 | 'VN'
5410 | 'ZA'
5411 >;
5412 /**
5413 * The number of periods ahead that need to be forecasted.
5414 */
5415 horizon?: string;
5416 /**
5417 * The target evaluation metrics to optimize the hyperparameters for.
5418 */
5419 hparamTuningObjectives?: Array<
5420 | 'HPARAM_TUNING_OBJECTIVE_UNSPECIFIED'
5421 | 'MEAN_ABSOLUTE_ERROR'
5422 | 'MEAN_SQUARED_ERROR'
5423 | 'MEAN_SQUARED_LOG_ERROR'
5424 | 'MEDIAN_ABSOLUTE_ERROR'
5425 | 'R_SQUARED'
5426 | 'EXPLAINED_VARIANCE'
5427 | 'PRECISION'
5428 | 'RECALL'
5429 | 'ACCURACY'
5430 | 'F1_SCORE'
5431 | 'LOG_LOSS'
5432 | 'ROC_AUC'
5433 | 'DAVIES_BOULDIN_INDEX'
5434 | 'MEAN_AVERAGE_PRECISION'
5435 | 'NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN'
5436 | 'AVERAGE_RANK'
5437 >;
5438 /**
5439 * Include drift when fitting an ARIMA model.
5440 */
5441 includeDrift?: boolean;
5442 /**
5443 * Specifies the initial learning rate for the line search learn rate strategy.
5444 */
5445 initialLearnRate?: number;
5446 /**
5447 * Name of input label columns in training data.
5448 */
5449 inputLabelColumns?: Array<string>;
5450 /**
5451 * Name of the instance weight column for training data. This column isn't be used as a feature.
5452 */
5453 instanceWeightColumn?: string;
5454 /**
5455 * Number of integral steps for the integrated gradients explain method.
5456 */
5457 integratedGradientsNumSteps?: string;
5458 /**
5459 * Item column specified for matrix factorization models.
5460 */
5461 itemColumn?: string;
5462 /**
5463 * The column used to provide the initial centroids for kmeans algorithm when kmeans_initialization_method is CUSTOM.
5464 */
5465 kmeansInitializationColumn?: string;
5466 /**
5467 * The method used to initialize the centroids for kmeans algorithm.
5468 */
5469 kmeansInitializationMethod?:
5470 | 'KMEANS_INITIALIZATION_METHOD_UNSPECIFIED'
5471 | 'RANDOM'
5472 | 'CUSTOM'
5473 | 'KMEANS_PLUS_PLUS';
5474 /**
5475 * L1 regularization coefficient to activations.
5476 */
5477 l1RegActivation?: number;
5478 /**
5479 * L1 regularization coefficient.
5480 */
5481 l1Regularization?: number;
5482 /**
5483 * L2 regularization coefficient.
5484 */
5485 l2Regularization?: number;
5486 /**
5487 * Weights associated with each label class, for rebalancing the training data. Only applicable for classification models.
5488 */
5489 labelClassWeights?: {[key: string]: number};
5490 /**
5491 * Learning rate in training. Used only for iterative training algorithms.
5492 */
5493 learnRate?: number;
5494 /**
5495 * The strategy to determine learn rate for the current iteration.
5496 */
5497 learnRateStrategy?:
5498 | 'LEARN_RATE_STRATEGY_UNSPECIFIED'
5499 | 'LINE_SEARCH'
5500 | 'CONSTANT';
5501 /**
5502 * Type of loss function used during training run.
5503 */
5504 lossType?: 'LOSS_TYPE_UNSPECIFIED' | 'MEAN_SQUARED_LOSS' | 'MEAN_LOG_LOSS';
5505 /**
5506 * The maximum number of iterations in training. Used only for iterative training algorithms.
5507 */
5508 maxIterations?: string;
5509 /**
5510 * Maximum number of trials to run in parallel.
5511 */
5512 maxParallelTrials?: string;
5513 /**
5514 * The maximum number of time points in a time series that can be used in modeling the trend component of the time series. Don't use this option with the `timeSeriesLengthFraction` or `minTimeSeriesLength` options.
5515 */
5516 maxTimeSeriesLength?: string;
5517 /**
5518 * Maximum depth of a tree for boosted tree models.
5519 */
5520 maxTreeDepth?: string;
5521 /**
5522 * When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'. Used only for iterative training algorithms.
5523 */
5524 minRelativeProgress?: number;
5525 /**
5526 * Minimum split loss for boosted tree models.
5527 */
5528 minSplitLoss?: number;
5529 /**
5530 * The minimum number of time points in a time series that are used in modeling the trend component of the time series. If you use this option you must also set the `timeSeriesLengthFraction` option. This training option ensures that enough time points are available when you use `timeSeriesLengthFraction` in trend modeling. This is particularly important when forecasting multiple time series in a single query using `timeSeriesIdColumn`. If the total number of time points is less than the `minTimeSeriesLength` value, then the query uses all available time points.
5531 */
5532 minTimeSeriesLength?: string;
5533 /**
5534 * Minimum sum of instance weight needed in a child for boosted tree models.
5535 */
5536 minTreeChildWeight?: string;
5537 /**
5538 * The model registry.
5539 */
5540 modelRegistry?: 'MODEL_REGISTRY_UNSPECIFIED' | 'VERTEX_AI';
5541 /**
5542 * Google Cloud Storage URI from which the model was imported. Only applicable for imported models.
5543 */
5544 modelUri?: string;
5545 /**
5546 * A specification of the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order, the degree of differencing, and the MA order.
5547 */
5548 nonSeasonalOrder?: IArimaOrder;
5549 /**
5550 * Number of clusters for clustering models.
5551 */
5552 numClusters?: string;
5553 /**
5554 * Num factors specified for matrix factorization models.
5555 */
5556 numFactors?: string;
5557 /**
5558 * Number of parallel trees constructed during each iteration for boosted tree models.
5559 */
5560 numParallelTree?: string;
5561 /**
5562 * Number of principal components to keep in the PCA model. Must be <= the number of features.
5563 */
5564 numPrincipalComponents?: string;
5565 /**
5566 * Number of trials to run this hyperparameter tuning job.
5567 */
5568 numTrials?: string;
5569 /**
5570 * Optimization strategy for training linear regression models.
5571 */
5572 optimizationStrategy?:
5573 | 'OPTIMIZATION_STRATEGY_UNSPECIFIED'
5574 | 'BATCH_GRADIENT_DESCENT'
5575 | 'NORMAL_EQUATION';
5576 /**
5577 * Optimizer used for training the neural nets.
5578 */
5579 optimizer?: string;
5580 /**
5581 * The minimum ratio of cumulative explained variance that needs to be given by the PCA model.
5582 */
5583 pcaExplainedVarianceRatio?: number;
5584 /**
5585 * The solver for PCA.
5586 */
5587 pcaSolver?: 'UNSPECIFIED' | 'FULL' | 'RANDOMIZED' | 'AUTO';
5588 /**
5589 * Number of paths for the sampled Shapley explain method.
5590 */
5591 sampledShapleyNumPaths?: string;
5592 /**
5593 * If true, scale the feature values by dividing the feature standard deviation. Currently only apply to PCA.
5594 */
5595 scaleFeatures?: boolean;
5596 /**
5597 * Whether to standardize numerical features. Default to true.
5598 */
5599 standardizeFeatures?: boolean;
5600 /**
5601 * Subsample fraction of the training data to grow tree to prevent overfitting for boosted tree models.
5602 */
5603 subsample?: number;
5604 /**
5605 * Based on the selected TF version, the corresponding docker image is used to train external models.
5606 */
5607 tfVersion?: string;
5608 /**
5609 * Column to be designated as time series data for ARIMA model.
5610 */
5611 timeSeriesDataColumn?: string;
5612 /**
5613 * The time series id column that was used during ARIMA model training.
5614 */
5615 timeSeriesIdColumn?: string;
5616 /**
5617 * The time series id columns that were used during ARIMA model training.
5618 */
5619 timeSeriesIdColumns?: Array<string>;
5620 /**
5621 * The fraction of the interpolated length of the time series that's used to model the time series trend component. All of the time points of the time series are used to model the non-trend component. This training option accelerates modeling training without sacrificing much forecasting accuracy. You can use this option with `minTimeSeriesLength` but not with `maxTimeSeriesLength`.
5622 */
5623 timeSeriesLengthFraction?: number;
5624 /**
5625 * Column to be designated as time series timestamp for ARIMA model.
5626 */
5627 timeSeriesTimestampColumn?: string;
5628 /**
5629 * Tree construction algorithm for boosted tree models.
5630 */
5631 treeMethod?:
5632 | 'TREE_METHOD_UNSPECIFIED'
5633 | 'AUTO'
5634 | 'EXACT'
5635 | 'APPROX'
5636 | 'HIST';
5637 /**
5638 * Smoothing window size for the trend component. When a positive value is specified, a center moving average smoothing is applied on the history trend. When the smoothing window is out of the boundary at the beginning or the end of the trend, the first element or the last element is padded to fill the smoothing window before the average is applied.
5639 */
5640 trendSmoothingWindowSize?: string;
5641 /**
5642 * User column specified for matrix factorization models.
5643 */
5644 userColumn?: string;
5645 /**
5646 * The version aliases to apply in Vertex AI model registry. Always overwrite if the version aliases exists in a existing model.
5647 */
5648 vertexAiModelVersionAliases?: Array<string>;
5649 /**
5650 * Hyperparameter for matrix factoration when implicit feedback type is specified.
5651 */
5652 walsAlpha?: number;
5653 /**
5654 * Whether to train a model from the last checkpoint.
5655 */
5656 warmStart?: boolean;
5657 /**
5658 * User-selected XGBoost versions for training of XGBoost models.
5659 */
5660 xgboostVersion?: string;
5661 };
5662
5663 /**
5664 * Information about a single training query run for the model.
5665 */
5666 type ITrainingRun = {
5667 /**
5668 * Output only. Global explanation contains the explanation of top features on the class level. Applies to classification models only.
5669 */
5670 classLevelGlobalExplanations?: Array<IGlobalExplanation>;
5671 /**
5672 * Output only. Data split result of the training run. Only set when the input data is actually split.
5673 */
5674 dataSplitResult?: IDataSplitResult;
5675 /**
5676 * Output only. The evaluation metrics over training/eval data that were computed at the end of training.
5677 */
5678 evaluationMetrics?: IEvaluationMetrics;
5679 /**
5680 * Output only. Global explanation contains the explanation of top features on the model level. Applies to both regression and classification models.
5681 */
5682 modelLevelGlobalExplanation?: IGlobalExplanation;
5683 /**
5684 * Output only. Output of each iteration run, results.size() <= max_iterations.
5685 */
5686 results?: Array<IIterationResult>;
5687 /**
5688 * Output only. The start time of this training run.
5689 */
5690 startTime?: string;
5691 /**
5692 * Output only. Options that were used for this training run, includes user specified and default options that were used.
5693 */
5694 trainingOptions?: ITrainingOptions;
5695 /**
5696 * Output only. The start time of this training run, in milliseconds since epoch.
5697 */
5698 trainingStartTime?: string;
5699 /**
5700 * The model id in the [Vertex AI Model Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction) for this training run.
5701 */
5702 vertexAiModelId?: string;
5703 /**
5704 * Output only. The model version in the [Vertex AI Model Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction) for this training run.
5705 */
5706 vertexAiModelVersion?: string;
5707 };
5708
5709 /**
5710 * [Alpha] Information of a multi-statement transaction.
5711 */
5712 type ITransactionInfo = {
5713 /**
5714 * Output only. [Alpha] Id of the transaction.
5715 */
5716 transactionId?: string;
5717 };
5718
5719 /**
5720 * Information about a single transform column.
5721 */
5722 type ITransformColumn = {
5723 /**
5724 * Output only. Name of the column.
5725 */
5726 name?: string;
5727 /**
5728 * Output only. The SQL expression used in the column transform.
5729 */
5730 transformSql?: string;
5731 /**
5732 * Output only. Data type of the column after the transform.
5733 */
5734 type?: IStandardSqlDataType;
5735 };
5736
5737 /**
5738 * Request format for undeleting a dataset.
5739 */
5740 type IUndeleteDatasetRequest = {
5741 /**
5742 * Optional. The exact time when the dataset was deleted. If not specified, it will undelete the most recently deleted version.
5743 */
5744 deletionTime?: string;
5745 };
5746
5747 /**
5748 * This is used for defining User Defined Function (UDF) resources only when using legacy SQL. Users of GoogleSQL should leverage either DDL (e.g. CREATE [TEMPORARY] FUNCTION ... ) or the Routines API to define UDF resources. For additional information on migrating, see: https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#differences_in_user-defined_javascript_functions
5749 */
5750 type IUserDefinedFunctionResource = {
5751 /**
5752 * [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
5753 */
5754 inlineCode?: string;
5755 /**
5756 * [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
5757 */
5758 resourceUri?: string;
5759 };
5760
5761 /**
5762 * Statistics for a vector search query. Populated as part of JobStatistics2.
5763 */
5764 type IVectorSearchStatistics = {
5765 /**
5766 * When `indexUsageMode` is `UNUSED` or `PARTIALLY_USED`, this field explains why indexes were not used in all or part of the vector search query. If `indexUsageMode` is `FULLY_USED`, this field is not populated.
5767 */
5768 indexUnusedReasons?: Array<IIndexUnusedReason>;
5769 /**
5770 * Specifies the index usage mode for the query.
5771 */
5772 indexUsageMode?:
5773 | 'INDEX_USAGE_MODE_UNSPECIFIED'
5774 | 'UNUSED'
5775 | 'PARTIALLY_USED'
5776 | 'FULLY_USED';
5777 };
5778
5779 /**
5780 * Describes the definition of a logical view.
5781 */
5782 type IViewDefinition = {
5783 /**
5784 * Optional. Specifices the privacy policy for the view.
5785 */
5786 privacyPolicy?: IPrivacyPolicy;
5787 /**
5788 * Required. A query that BigQuery executes when the view is referenced.
5789 */
5790 query?: string;
5791 /**
5792 * True if the column names are explicitly specified. For example by using the 'CREATE VIEW v(c1, c2) AS ...' syntax. Can only be set for GoogleSQL views.
5793 */
5794 useExplicitColumnNames?: boolean;
5795 /**
5796 * Specifies whether to use BigQuery's legacy SQL for this view. The default value is true. If set to false, the view will use BigQuery's GoogleSQL: https://cloud.google.com/bigquery/sql-reference/ Queries and views that reference this view must use the same flag value. A wrapper is used here because the default value is True.
5797 */
5798 useLegacySql?: boolean;
5799 /**
5800 * Describes user-defined function resources used in the query.
5801 */
5802 userDefinedFunctionResources?: Array<IUserDefinedFunctionResource>;
5803 };
5804
5805 namespace datasets {
5806 /**
5807 * Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
5808 */
5809 type IDeleteParams = {
5810 /**
5811 * If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False
5812 */
5813 deleteContents?: boolean;
5814 };
5815
5816 /**
5817 * Returns the dataset specified by datasetID.
5818 */
5819 type IGetParams = {
5820 /**
5821 * Optional. Specifies the view that determines which dataset information is returned. By default, metadata and ACL information are returned.
5822 */
5823 datasetView?: 'DATASET_VIEW_UNSPECIFIED' | 'METADATA' | 'ACL' | 'FULL';
5824 };
5825
5826 /**
5827 * Lists all datasets in the specified project to which the user has been granted the READER dataset role.
5828 */
5829 type IListParams = {
5830 /**
5831 * Whether to list all datasets, including hidden ones
5832 */
5833 all?: boolean;
5834 /**
5835 * An expression for filtering the results of the request by label. The syntax is \"labels.<name>[:<value>]\". Multiple filters can be ANDed together by connecting with a space. Example: \"labels.department:receiving labels.active\". See [Filtering datasets using labels](/bigquery/docs/labeling-datasets#filtering_datasets_using_labels) for details.
5836 */
5837 filter?: string;
5838 /**
5839 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
5840 */
5841 maxResults?: number;
5842 /**
5843 * Page token, returned by a previous call, to request the next page of results
5844 */
5845 pageToken?: string;
5846 };
5847 }
5848
5849 namespace jobs {
5850 /**
5851 * Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
5852 */
5853 type ICancelParams = {
5854 /**
5855 * The geographic location of the job. You must specify the location to run the job for the following scenarios: - If the location to run a job is not in the `us` or the `eu` multi-regional location - If the job's location is in a single region (for example, `us-central1`) For more information, see https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
5856 */
5857 location?: string;
5858 };
5859
5860 /**
5861 * Requests the deletion of the metadata of a job. This call returns when the job's metadata is deleted.
5862 */
5863 type IDeleteParams = {
5864 /**
5865 * The geographic location of the job. Required. See details at: https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
5866 */
5867 location?: string;
5868 };
5869
5870 /**
5871 * Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
5872 */
5873 type IGetParams = {
5874 /**
5875 * The geographic location of the job. You must specify the location to run the job for the following scenarios: - If the location to run a job is not in the `us` or the `eu` multi-regional location - If the job's location is in a single region (for example, `us-central1`) For more information, see https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
5876 */
5877 location?: string;
5878 };
5879
5880 /**
5881 * RPC to get the results of a query job.
5882 */
5883 type IGetQueryResultsParams = {
5884 /**
5885 * Optional. Output timestamp as usec int64. Default is false.
5886 */
5887 'formatOptions.useInt64Timestamp'?: boolean;
5888 /**
5889 * The geographic location of the job. You must specify the location to run the job for the following scenarios: - If the location to run a job is not in the `us` or the `eu` multi-regional location - If the job's location is in a single region (for example, `us-central1`) For more information, see https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
5890 */
5891 location?: string;
5892 /**
5893 * Maximum number of results to read.
5894 */
5895 maxResults?: number;
5896 /**
5897 * Page token, returned by a previous call, to request the next page of results.
5898 */
5899 pageToken?: string;
5900 /**
5901 * Zero-based index of the starting row.
5902 */
5903 startIndex?: string;
5904 /**
5905 * Optional: Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 10 seconds (10,000 milliseconds). If the query is complete, the jobComplete field in the response is true. If the query has not yet completed, jobComplete is false. You can request a longer timeout period in the timeoutMs field. However, the call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete. If jobComplete is false, you can continue to wait for the query to complete by calling the getQueryResults method until the jobComplete field in the getQueryResults response is true.
5906 */
5907 timeoutMs?: number;
5908 };
5909
5910 /**
5911 * Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
5912 */
5913 type IListParams = {
5914 /**
5915 * Whether to display jobs owned by all users in the project. Default False.
5916 */
5917 allUsers?: boolean;
5918 /**
5919 * Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned.
5920 */
5921 maxCreationTime?: string;
5922 /**
5923 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
5924 */
5925 maxResults?: number;
5926 /**
5927 * Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned.
5928 */
5929 minCreationTime?: string;
5930 /**
5931 * Page token, returned by a previous call, to request the next page of results.
5932 */
5933 pageToken?: string;
5934 /**
5935 * If set, show only child jobs of the specified parent. Otherwise, show all top-level jobs.
5936 */
5937 parentJobId?: string;
5938 /**
5939 * Restrict information returned to a set of selected fields
5940 */
5941 projection?: 'full' | 'minimal';
5942 /**
5943 * Filter for job state
5944 */
5945 stateFilter?: Array<'done' | 'pending' | 'running'>;
5946 };
5947 }
5948
5949 namespace models {
5950 /**
5951 * Lists all models in the specified dataset. Requires the READER dataset role. After retrieving the list of models, you can get information about a particular model by calling the models.get method.
5952 */
5953 type IListParams = {
5954 /**
5955 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
5956 */
5957 maxResults?: number;
5958 /**
5959 * Page token, returned by a previous call to request the next page of results
5960 */
5961 pageToken?: string;
5962 };
5963 }
5964
5965 namespace projects {
5966 /**
5967 * RPC to list projects to which the user has been granted any project role. Users of this method are encouraged to consider the [Resource Manager](https://cloud.google.com/resource-manager/docs/) API, which provides the underlying data for this method and has more capabilities.
5968 */
5969 type IListParams = {
5970 /**
5971 * `maxResults` unset returns all results, up to 50 per page. Additionally, the number of projects in a page may be fewer than `maxResults` because projects are retrieved and then filtered to only projects with the BigQuery API enabled.
5972 */
5973 maxResults?: number;
5974 /**
5975 * Page token, returned by a previous call, to request the next page of results. If not present, no further pages are present.
5976 */
5977 pageToken?: string;
5978 };
5979 }
5980
5981 namespace routines {
5982 /**
5983 * Gets the specified routine resource by routine ID.
5984 */
5985 type IGetParams = {
5986 /**
5987 * If set, only the Routine fields in the field mask are returned in the response. If unset, all Routine fields are returned.
5988 */
5989 readMask?: string;
5990 };
5991
5992 /**
5993 * Lists all routines in the specified dataset. Requires the READER dataset role.
5994 */
5995 type IListParams = {
5996 /**
5997 * If set, then only the Routines matching this filter are returned. The supported format is `routineType:{RoutineType}`, where `{RoutineType}` is a RoutineType enum. For example: `routineType:SCALAR_FUNCTION`.
5998 */
5999 filter?: string;
6000 /**
6001 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
6002 */
6003 maxResults?: number;
6004 /**
6005 * Page token, returned by a previous call, to request the next page of results
6006 */
6007 pageToken?: string;
6008 /**
6009 * If set, then only the Routine fields in the field mask, as well as project_id, dataset_id and routine_id, are returned in the response. If unset, then the following Routine fields are returned: etag, project_id, dataset_id, routine_id, routine_type, creation_time, last_modified_time, and language.
6010 */
6011 readMask?: string;
6012 };
6013 }
6014
6015 namespace rowAccessPolicies {
6016 /**
6017 * Lists all row access policies on the specified table.
6018 */
6019 type IListParams = {
6020 /**
6021 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
6022 */
6023 pageSize?: number;
6024 /**
6025 * Page token, returned by a previous call, to request the next page of results.
6026 */
6027 pageToken?: string;
6028 };
6029 }
6030
6031 namespace tabledata {
6032 /**
6033 * List the content of a table in rows.
6034 */
6035 type IListParams = {
6036 /**
6037 * Optional. Output timestamp as usec int64. Default is false.
6038 */
6039 'formatOptions.useInt64Timestamp'?: boolean;
6040 /**
6041 * Row limit of the table.
6042 */
6043 maxResults?: number;
6044 /**
6045 * To retrieve the next page of table data, set this field to the string provided in the pageToken field of the response body from your previous call to tabledata.list.
6046 */
6047 pageToken?: string;
6048 /**
6049 * Subset of fields to return, supports select into sub fields. Example: selected_fields = "a,e.d.f";
6050 */
6051 selectedFields?: string;
6052 /**
6053 * Start row index of the table.
6054 */
6055 startIndex?: string;
6056 };
6057 }
6058
6059 namespace tables {
6060 /**
6061 * Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
6062 */
6063 type IGetParams = {
6064 /**
6065 * List of table schema fields to return (comma-separated). If unspecified, all fields are returned. A fieldMask cannot be used here because the fields will automatically be converted from camelCase to snake_case and the conversion will fail if there are underscores. Since these are fields in BigQuery table schemas, underscores are allowed.
6066 */
6067 selectedFields?: string;
6068 /**
6069 * Optional. Specifies the view that determines which table information is returned. By default, basic table information and storage statistics (STORAGE_STATS) are returned.
6070 */
6071 view?:
6072 | 'TABLE_METADATA_VIEW_UNSPECIFIED'
6073 | 'BASIC'
6074 | 'STORAGE_STATS'
6075 | 'FULL';
6076 };
6077
6078 /**
6079 * Lists all tables in the specified dataset. Requires the READER dataset role.
6080 */
6081 type IListParams = {
6082 /**
6083 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
6084 */
6085 maxResults?: number;
6086 /**
6087 * Page token, returned by a previous call, to request the next page of results
6088 */
6089 pageToken?: string;
6090 };
6091
6092 /**
6093 * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports RFC5789 patch semantics.
6094 */
6095 type IPatchParams = {
6096 /**
6097 * Optional. When true will autodetect schema, else will keep original schema
6098 */
6099 autodetect_schema?: boolean;
6100 };
6101
6102 /**
6103 * Updates information in an existing table. The update method replaces the entire Table resource, whereas the patch method only replaces fields that are provided in the submitted Table resource.
6104 */
6105 type IUpdateParams = {
6106 /**
6107 * Optional. When true will autodetect schema, else will keep original schema
6108 */
6109 autodetect_schema?: boolean;
6110 };
6111 }
6112}
6113
6114export default bigquery;