Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

/**
* Discovery Revision: 20250912
* Discovery Revision: 20251102
*/

/**
Expand Down Expand Up @@ -458,7 +458,7 @@ declare namespace bigquery {
*/
type IBigtableColumn = {
/**
* 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.
* 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. PROTO_BINARY - indicates values are encoded using serialized proto messages. This can only be used in combination with JSON type. '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.
*/
encoding?: string;
/**
Expand All @@ -469,6 +469,10 @@ declare namespace bigquery {
* 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.
*/
onlyReadLatest?: boolean;
/**
* Optional. Protobuf-specific configurations, only takes effect when the encoding is PROTO_BINARY.
*/
protoConfig?: IBigtableProtoConfig;
/**
* [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.
*/
Expand All @@ -492,7 +496,7 @@ declare namespace bigquery {
*/
columns?: Array<IBigtableColumn>;
/**
* 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.
* 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. PROTO_BINARY - indicates values are encoded using serialized proto messages. This can only be used in combination with JSON type. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
*/
encoding?: string;
/**
Expand All @@ -503,6 +507,10 @@ declare namespace bigquery {
* 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.
*/
onlyReadLatest?: boolean;
/**
* Optional. Protobuf-specific configurations, only takes effect when the encoding is PROTO_BINARY.
*/
protoConfig?: IBigtableProtoConfig;
/**
* 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.
*/
Expand Down Expand Up @@ -531,6 +539,20 @@ declare namespace bigquery {
readRowkeyAsString?: boolean;
};

/**
* Information related to a Bigtable protobuf column.
*/
type IBigtableProtoConfig = {
/**
* Optional. The fully qualified proto message name of the protobuf. In the format of "foo.bar.Message".
*/
protoMessageName?: string;
/**
* Optional. The ID of the Bigtable SchemaBundle resource associated with this protobuf. The ID should be referred to within the parent table, e.g., `foo` rather than `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/foo`.
*/
schemaBundleId?: string;
};

/**
* Evaluation metrics for binary classification/classifier models.
*/
Expand Down Expand Up @@ -1706,6 +1728,10 @@ declare namespace bigquery {
* Optional. Format used to parse TIMESTAMP values. Supports C-style and SQL-style values.
*/
timestampFormat?: string;
/**
* Precisions (maximum number of total digits in base 10) for seconds of TIMESTAMP types that are allowed to the destination table for autodetection mode. Available for the formats: CSV. For the CSV Format, Possible values include: Not Specified, [], or [6]: timestamp(6) for all auto detected TIMESTAMP columns [6, 12]: timestamp(6) for all auto detected TIMESTAMP columns that have less than 6 digits of subseconds. timestamp(12) for all auto detected TIMESTAMP columns that have more than 6 digits of subseconds. [12]: timestamp(12) for all auto detected TIMESTAMP columns. The order of the elements in this array is ignored. Inputs that have higher precision than the highest target precision in this array will be truncated.
*/
timestampTargetPrecision?: Array<number>;
};

/**
Expand Down Expand Up @@ -2153,6 +2179,10 @@ declare namespace bigquery {
* The base table reference.
*/
baseTable?: ITableReference;
/**
* The index id.
*/
indexId?: string;
/**
* The number of parallel inputs after index pruning.
*/
Expand Down Expand Up @@ -2404,7 +2434,7 @@ declare namespace bigquery {
*/
load?: IJobConfigurationLoad;
/**
* Optional. INTERNAL: DO NOT USE. The maximum rate of slot consumption to allow for this job. If set, the number of slots used to execute the job will be throttled to try and keep its slot consumption below the requested rate.
* Optional. A target limit on the rate of slot consumption by this job. If set to a value > 0, BigQuery will attempt to limit the rate of slot consumption by this job to keep it below the configured limit, even if the job is eligible for more slots based on fair scheduling. The unused slots will be available for other jobs and queries to use. Note: This feature is not yet generally available.
*/
maxSlots?: number;
/**
Expand Down Expand Up @@ -2643,6 +2673,10 @@ declare namespace bigquery {
* Optional. Date format used for parsing TIMESTAMP values.
*/
timestampFormat?: string;
/**
* Precisions (maximum number of total digits in base 10) for seconds of TIMESTAMP types that are allowed to the destination table for autodetection mode. Available for the formats: CSV. For the CSV Format, Possible values include: Not Specified, [], or [6]: timestamp(6) for all auto detected TIMESTAMP columns [6, 12]: timestamp(6) for all auto detected TIMESTAMP columns that have less than 6 digits of subseconds. timestamp(12) for all auto detected TIMESTAMP columns that have more than 6 digits of subseconds. [12]: timestamp(12) for all auto detected TIMESTAMP columns. The order of the elements in this array is ignored. Inputs that have higher precision than the highest target precision in this array will be truncated.
*/
timestampTargetPrecision?: Array<number>;
/**
* 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).
*/
Expand Down Expand Up @@ -2974,6 +3008,10 @@ declare namespace bigquery {
* Output only. Quotas which delayed this job's start time.
*/
quotaDeferments?: Array<string>;
/**
* Output only. The reservation group path of the reservation assigned to this job. This field has a limit of 10 nested reservation groups. This is to maintain consistency between reservatins info schema and jobs info schema. The first reservation group is the root reservation group and the last is the leaf or lowest level reservation group.
*/
reservationGroupPath?: Array<string>;
/**
* Output only. Job resource usage breakdown by reservation. This field reported misleading information and will no longer be populated.
*/
Expand Down Expand Up @@ -4124,7 +4162,7 @@ declare namespace bigquery {
*/
maxResults?: number;
/**
* Optional. INTERNAL: DO NOT USE. The maximum rate of slot consumption to allow for this job. If set, the number of slots used to execute the job will be throttled to try and keep its slot consumption below the requested rate. This limit is best effort.
* Optional. A target limit on the rate of slot consumption by this query. If set to a value > 0, BigQuery will attempt to limit the rate of slot consumption by this query to keep it below the configured limit, even if the query is eligible for more slots based on fair scheduling. The unused slots will be available for other jobs and queries to use. Note: This feature is not yet generally available.
*/
maxSlots?: number;
/**
Expand Down Expand Up @@ -5525,6 +5563,10 @@ declare namespace bigquery {
* Optional. See documentation for precision.
*/
scale?: string;
/**
* Optional. Precision (maximum number of total digits in base 10) for seconds of TIMESTAMP type. Possible values include: * 6 (Default, for TIMESTAMP type with microsecond precision) * 12 (For TIMESTAMP type with picosecond precision)
*/
timestampPrecision?: string;
/**
* 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) * RANGE Use of RECORD/STRUCT indicates that the field contains a nested schema.
*/
Expand Down
10 changes: 4 additions & 6 deletions system-test/bigquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,8 @@ describe('BigQuery', () => {
const QUERY = `SELECT * FROM \`${table.id}\``;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const SCHEMA = require('../../system-test/data/schema.json');
const TEST_DATA_FILE = require.resolve(
'../../system-test/data/location-test-data.json',
);
const TEST_DATA_FILE =
require.resolve('../../system-test/data/location-test-data.json');

before(async () => {
// create a dataset in a certain location will cascade the location
Expand Down Expand Up @@ -880,9 +879,8 @@ describe('BigQuery', () => {
});

describe('BigQuery/Table', () => {
const TEST_DATA_JSON_PATH = require.resolve(
'../../system-test/data/kitten-test-data.json',
);
const TEST_DATA_JSON_PATH =
require.resolve('../../system-test/data/kitten-test-data.json');

it('should have created the correct schema', () => {
assert.deepStrictEqual(table.metadata.schema.fields, SCHEMA);
Expand Down