Skip to content

Sharded Tables

These functions support profiling and working with date-sharded tables.

Functions

get_date_shards

Attribute Value
Function Name get_date_shards
ID bqtools.[region].get_date_shards
Description Returns an array of shard_dates corresponding to all existing date shards in a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, OUT shard_dates ARRAY<DATE>
Returns OUT shard_dates ARRAY<DATE>
Dependencies bqtools-qb.[region].get_date_shards

execution: get_date_shards

CALL bqtools.eu.get_date_shards(sharded_table_dataset_id, sharded_table_prefix, shard_dates);
CALL bqtools.us.get_date_shards(sharded_table_dataset_id, sharded_table_prefix, shard_dates);

get_date_shard_ids

Attribute Value
Function Name get_date_shard_ids
ID bqtools.[region].get_date_shard_ids
Description Returns an array of shard_ids corresponding to all existing date shards in a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, OUT shard_ids ARRAY<STRING>
Returns OUT shard_ids ARRAY<STRING>
Dependencies bqtools-qb.[region].get_date_shards

execution: get_date_shard_ids

CALL bqtools.eu.get_date_shard_ids(sharded_table_dataset_id, sharded_table_prefix, shard_ids);
CALL bqtools.us.get_date_shard_ids(sharded_table_dataset_id, sharded_table_prefix, shard_ids);

get_first_date_shard

Attribute Value
Function Name get_first_date_shard
ID bqtools.[region].get_first_date_shard
Description Returns the first shard_date from a single sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, OUT first_shard DATE
Returns OUT first_shard DATE
Dependencies bqtools.[region].get_date_shards, bqtools-qb.[region].get_date_shards

execution: get_first_date_shard

CALL bqtools.eu.get_first_date_shard(sharded_table_dataset_id, sharded_table_prefix, first_shard);
CALL bqtools.us.get_first_date_shard(sharded_table_dataset_id, sharded_table_prefix, first_shard);

get_first_date_shard_id

Attribute Value
Function Name get_first_date_shard_id
ID bqtools.[region].get_first_date_shard_id
Description Returns the first shard_id from a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, OUT first_shard_id STRING
Returns OUT first_shard_id STRING
Dependencies bqtools.[region].get_date_shard_ids, bqtools-qb.[region].get_date_shards

execution: get_first_date_shard_id

CALL bqtools.eu.get_first_date_shard_id(sharded_table_dataset_id, sharded_table_prefix, first_shard_id);
CALL bqtools.us.get_first_date_shard_id(sharded_table_dataset_id, sharded_table_prefix, first_shard_id);

get_last_date_shard

Attribute Value
Function Name get_last_date_shard
ID bqtools.[region].get_last_date_shard
Description Returns the last shard_date from a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, OUT last_shard DATE
Returns OUT last_shard DATE
Dependencies bqtools.[region].get_date_shards, bqtools-qb.[region].get_date_shards

execution: get_last_date_shard

CALL bqtools.eu.get_last_date_shard(sharded_table_dataset_id, sharded_table_prefix, last_shard);
CALL bqtools.us.get_last_date_shard(sharded_table_dataset_id, sharded_table_prefix, last_shard);

get_last_date_shard_id

Attribute Value
Function Name get_last_date_shard_id
ID bqtools.[region].get_last_date_shard_id
Description Returns the last shard_id from a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, OUT last_shard_id STRING
Returns OUT last_shard_id STRING
Dependencies bqtools.[region].get_date_shard_ids, bqtools-qb.[region].get_date_shard_ids

execution: get_last_date_shard_id

CALL bqtools.eu.get_last_date_shard_id(sharded_table_dataset_id, sharded_table_prefix, last_shard_id);
CALL bqtools.us.get_last_date_shard_id(sharded_table_dataset_id, sharded_table_prefix, last_shard_id);

get_missing_date_shards

Attribute Value
Function Name get_missing_date_shards
ID bqtools.[region].get_missing_date_shards
Description Returns an array containing the missing date_shards between the start_date and end_date in a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, start_date DATE, end_date DATE, OUT missing_shards ARRAY<DATE>
Returns OUT missing_shards ARRAY<DATE>
Dependencies bqtools.[region].get_date_shards, bqtools-qb.[region].get_date_shards

execution: get_missing_date_shards

CALL bqtools.eu.get_missing_date_shards(sharded_table_dataset_id, sharded_table_prefix, start_date, end_date, missing_shards);
CALL bqtools.us.get_missing_date_shards(sharded_table_dataset_id, sharded_table_prefix, start_date, end_date, missing_shards);

get_missing_date_shard_ids

Attribute Value
Function Name get_missing_date_shard_ids
ID bqtools.[region].get_missing_date_shard_ids
Description Returns an array containing the missing shard_ids between the start_date and end_date in a single date-sharded table.
Type PROCEDURE
Arguments sharded_table_dataset_id STRING, sharded_table_prefix STRING, start_date DATE, end_date DATE, OUT missing_shard_ids ARRAY<STRING>
Returns OUT missing_shard_ids ARRAY<STRING>
Dependencies bqtools.[region].get_date_shard_ids, bqtools-qb.[region].get_date_shard_ids

execution: get_missing_date_shard_ids

CALL bqtools.eu.get_missing_date_shard_ids(sharded_table_dataset_id, sharded_table_prefix, start_date, end_date, missing_shard_ids);
CALL bqtools.us.get_missing_date_shard_ids(sharded_table_dataset_id, sharded_table_prefix, start_date, end_date, missing_shard_ids);