Skip to main content

Default Warehouse Override

View as Markdown

DefaultWarehouseOverride object​

Represents a per-user default warehouse override configuration. This resource allows users or administrators to customize how a user's default warehouse is selected for SQL operations. If no override exists for a user, the workspace default warehouse will be used.

namestringBetaIDImmutable

The resource name of the default warehouse override. Format: default-warehouse-overrides/{default_warehouse_override_id} Responses always contain the numeric user ID, even when the request used me.

default_warehouse_override_idstringBetaOutput only

The numeric ID of the user that the override applies to. It is the last component of name.

typestringBeta

The type of override behavior.

Values:

  • LAST_SELECTED
  • CUSTOM
warehouse_idstringBeta

The ID of the SQL warehouse to preselect when type is CUSTOM. It is required for CUSTOM and must be a valid warehouse ID. It is ignored for LAST_SELECTED and is not returned for that type.

Example: 0123456789abcdef

Get default warehouse override Beta​

GET /api/warehouses/v1/{name=default-warehouse-overrides/*}

Returns the default warehouse override for a user. Users can fetch their own override. Admins can fetch overrides for any user. If the user has no override, the request fails with NOT_FOUND and the workspace default warehouse is used.

API scopes: sql

Parameters​

namestringRequiredpath

Required. The resource name of the default warehouse override to retrieve. Format: default-warehouse-overrides/{default_warehouse_override_id} The default_warehouse_override_id can be a numeric user ID or the literal string "me" for the current user.

Response​

Returns the DefaultWarehouseOverride object.

List default warehouse overrides Beta​

GET /api/warehouses/v1/default-warehouse-overrides

Lists all default warehouse overrides in the workspace. Only workspace administrators can list all overrides.

API scopes: sql

Parameters​

page_sizeint32query

The maximum number of overrides to return. The service may return fewer than this value. If unspecified, at most 100 overrides will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

page_tokenstringquery

A page token, received from a previous ListDefaultWarehouseOverrides call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListDefaultWarehouseOverrides must match the call that provided the page token.

Response​

Returns a list of DefaultWarehouseOverride objects.

Create default warehouse override Beta​

POST /api/warehouses/v1/default-warehouse-overrides

Creates a new default warehouse override for a user. Users can create their own override. Admins can create overrides for any user. If the user already has an override, the request fails with ALREADY_EXISTS.

API scopes: sql

Parameters​

default_warehouse_override_idstringRequiredquery

Required. The ID to use for the override, which will become the final component of the override's resource name. Can be a numeric user ID or the literal string "me" for the current user.

Request body​

Required. The default warehouse override to create.

namestringIDImmutable

The resource name of the default warehouse override. Format: default-warehouse-overrides/{default_warehouse_override_id} Responses always contain the numeric user ID, even when the request used me.

typestringRequired

The type of override behavior.

Values:

  • LAST_SELECTED
  • CUSTOM
warehouse_idstring

The ID of the SQL warehouse to preselect when type is CUSTOM. It is required for CUSTOM and must be a valid warehouse ID. It is ignored for LAST_SELECTED and is not returned for that type.

Example: 0123456789abcdef

Response​

Returns the DefaultWarehouseOverride object.

Update default warehouse override Beta​

PATCH /api/warehouses/v1/{name=default-warehouse-overrides/*}

Updates an existing default warehouse override for a user. Users can update their own override. Admins can update overrides for any user. If the user has no override, the request fails with NOT_FOUND unless allow_missing is true.

API scopes: sql

Parameters​

namestringRequiredIDImmutablepath

The resource name of the default warehouse override. Format: default-warehouse-overrides/{default_warehouse_override_id} Responses always contain the numeric user ID, even when the request used me.

update_maskstringRequiredquery

Required. Field mask specifying which fields to update. Only the fields specified in the mask will be updated. Use "*" to update all fields. When allow_missing is true, this field is ignored and all fields are applied.

Example: type,warehouse_id

allow_missingbooleanquery

If set to true, and the override is not found, a new override will be created. Whenever allow_missing is true, update_mask is ignored and all fields are applied, whether or not the override already exists. Defaults to false.

Request body​

Required. The default warehouse override to update. The name field must be set in the format: default-warehouse-overrides/{default_warehouse_override_id} The default_warehouse_override_id can be a numeric user ID or the literal string "me" for the current user.

typestringRequired

The type of override behavior.

Values:

  • LAST_SELECTED
  • CUSTOM
warehouse_idstring

The ID of the SQL warehouse to preselect when type is CUSTOM. It is required for CUSTOM and must be a valid warehouse ID. It is ignored for LAST_SELECTED and is not returned for that type.

Example: 0123456789abcdef

Response​

Returns the DefaultWarehouseOverride object.

Delete default warehouse override Beta​

DELETE /api/warehouses/v1/{name=default-warehouse-overrides/*}

Deletes the default warehouse override for a user. Users can delete their own override. Admins can delete overrides for any user. After deletion, the workspace default warehouse will be used.

API scopes: sql

Parameters​

namestringRequiredpath

Required. The resource name of the default warehouse override to delete. Format: default-warehouse-overrides/{default_warehouse_override_id} The default_warehouse_override_id can be a numeric user ID or the literal string "me" for the current user.