Skip to main content

Constants for the fields of the /alter/table request.

Option fields

action

Constants for action.

pub const ADD_COLUMN: &str = “add_column”;

Adds the column specified in value to the table specified in table_name. Use column_type and column_properties in options to set the column’s type and properties, respectively.

pub const ADD_COMMENT: &str = “add_comment”;

Adds the comment specified in value to the table specified in table_name. Use column_name to set the comment for a column.

pub const ADD_PARTITION: &str = “add_partition”;

Adds the partition specified in value, to either a range-partitioned or manual list-partitioned table.

pub const CANCEL_DATASOURCE_SUBSCRIPTION: &str = “cancel_datasource_subscription”;

Permanently unsubscribe a data source that is loading continuously as a stream. The data source can be Kafka / S3 / Azure / GCS.

pub const CHANGE_COLUMN: &str = “change_column”;

Changes type and properties of the column specified in value. Use column_type and column_properties in options to set the column’s type and properties, respectively. Note that primary key and/or shard key columns cannot be changed. All unchanging column properties must be listed for the change to take place, e.g., to add dictionary encoding to an existing ‘char4’ column, both ‘char4’ and ‘dict’ must be specified in the options map.

pub const CHANGE_OWNER: &str = “change_owner”;

Change the owner resource group of the table.

pub const CREATE_FOREIGN_KEY: &str = “create_foreign_key”;

Creates a foreign key specified in value using the format ‘(source_column_name [, …]) references target_table_name(primary_key_column_name [, …]) [as foreign_key_name]’.

pub const CREATE_INDEX: &str = “create_index”;

Creates a column (attribute) index, low-cardinality index, chunk skip index, geospatial index, CAGRA index, or HNSW index (depending on the specified index_type), on the column name specified in value. If this column already has the specified index, an error will be returned.

pub const DELETE_COLUMN: &str = “delete_column”;

Deletes the column specified in value from the table specified in table_name.

pub const DELETE_DEFAULT: &str = “delete_default”;

Removes the default value expression from the column specified in value. Other column properties are preserved.

pub const DELETE_FOREIGN_KEY: &str = “delete_foreign_key”;

Deletes a foreign key. The value should be the foreign_key_name specified when creating the key or the complete string used to define it.

pub const DELETE_INDEX: &str = “delete_index”;

Deletes a column (attribute) index, low-cardinality index, chunk skip index, geospatial index, CAGRA index, or HNSW index (depending on the specified index_type), on the column name specified in value. If this column does not have the specified index, an error will be returned.

pub const DELETE_PARTITION: &str = “delete_partition”;

Deletes the partition specified in value (and all of its data) from either a range-partitioned or manual list-partitioned table.

pub const DROP_DATASOURCE_SUBSCRIPTION: &str = “drop_datasource_subscription”;

Permanently delete a cancelled data source subscription.

pub const MOVE_TO_COLLECTION: &str = “move_to_collection”;

[DEPRECATED–please use move_to_schema and use /create/schema to create the schema if non-existent] Moves a table or view into a schema named value. If the schema provided is non-existent, it will be automatically created.

pub const MOVE_TO_SCHEMA: &str = “move_to_schema”;

Moves a table or view into a schema named value. If the schema provided is nonexistent, an error will be thrown. If value is empty, then the table or view will be placed in the user’s default schema.

pub const PAUSE_DATASOURCE_SUBSCRIPTION: &str = “pause_datasource_subscription”;

Temporarily unsubscribe a data source that is loading continuously as a stream. The data source can be Kafka / S3 / Azure / GCS.

pub const PROTECTED: &str = “protected”;

No longer used. Previously set whether the given table_name should be protected or not. The value would have been either ‘true’ or ‘false’.

pub const REBUILD_TEXT_SEARCH_INDEX: &str = “rebuild_text_search_index”;

Drops and rebuilds the text search index for the table from current type metadata and chunk storage. Use this to repair a text-search index left incomplete by an interrupted or failed rebuild (for example, after a crash during an add-column that requested text search): re-running the original add_column will not work because the column already exists. This action is also dispatched automatically by /alter/table/columns after add_column completions that require a full re-index. The value is ignored.

pub const REFRESH: &str = “refresh”;

For a materialized view, replays all the table creation commands required to create the view. For an external table, reloads all data in the table from its associated source files or data source.

pub const REFRESH_INDEX: &str = “refresh_index”;

Refreshes an index identified by index_type, on the column name specified in value. Currently applicable only to CAGRA indices.

pub const REMOVE_PARTITION: &str = “remove_partition”;

Removes the partition specified in value (and relocates all of its data to the default partition) from either a range-partitioned or manual list-partitioned table.

pub const REMOVE_SHARD_KEYS: &str = “remove_shard_keys”;

Removes the shard key property from all columns, so that the table will be considered randomly sharded. The data is not moved. The value is ignored.

pub const REMOVE_TEXT_SEARCH_ATTRIBUTES: &str = “remove_text_search_attributes”;

Removes text search attribute from all columns.

pub const RENAME_TABLE: &str = “rename_table”;

Renames a table or view to value. Has the same naming restrictions as tables.

pub const RESUME_DATASOURCE_SUBSCRIPTION: &str = “resume_datasource_subscription”;

Resubscribe to a paused data source subscription. The data source can be Kafka / S3 / Azure / GCS.

pub const SET_BUILD_MATERIALIZED_VIEW_POLICY: &str = “set_build_materialized_view_policy”;

Set startup rebuilding scheme for the materialized view; see description of ‘build_materialized_view_policy’ in /create/materializedview for possible values for value.

pub const SET_BUILD_PK_INDEX_POLICY: &str = “set_build_pk_index_policy”;

Set startup primary key generation scheme for the table; see description of ‘build_pk_index_policy’ in /create/table for possible values for value.

pub const SET_DEFAULT: &str = “set_default”;

Sets or replaces the default value expression for the column specified in value. The new default is taken from add_column_expression. Existing properties on the column are preserved.

pub const SET_GLOBAL_ACCESS_MODE: &str = “set_global_access_mode”;

Sets the global access mode (i.e. locking) for the table specified in table_name. Specify the access mode in value. Valid modes are ‘no_access’, ‘read_only’, ‘write_only’ and ‘read_write’.

pub const SET_LOAD_VECTORS_POLICY: &str = “set_load_vectors_policy”;

Set startup data loading scheme for the table; see description of ‘load_vectors_policy’ in /create/table for possible values for value.

pub const SET_REFRESH_EXECUTE_AS: &str = “set_refresh_execute_as”;

Sets the user name to refresh this materialized view to the value specified in value.

pub const SET_REFRESH_METHOD: &str = “set_refresh_method”;

For a materialized view, sets the method by which the view is refreshed to the method specified in value - one of ‘manual’, ‘periodic’, or ‘on_change’. For an external table, sets the method by which the table is refreshed to the method specified in value - either ‘manual’ or ‘on_start’.

pub const SET_REFRESH_PERIOD: &str = “set_refresh_period”;

Sets the time interval in seconds at which to refresh this materialized view to the value specified in value. Also, sets the refresh method to periodic if not already set.

pub const SET_REFRESH_SPAN: &str = “set_refresh_span”;

Sets the future time-offset(in seconds) for the view refresh to stop.

pub const SET_REFRESH_START_TIME: &str = “set_refresh_start_time”;

Sets the time to start periodic refreshes of this materialized view to the datetime string specified in value with format ‘YYYY-MM-DD HH:MM:SS’. Subsequent refreshes occur at the specified time + N * the refresh period.

pub const SET_REFRESH_STOP_TIME: &str = “set_refresh_stop_time”;

Sets the time to stop periodic refreshes of this materialized view to the datetime string specified in value with format ‘YYYY-MM-DD HH:MM:SS’.

pub const SET_STRATEGY_DEFINITION: &str = “set_strategy_definition”;

Sets the tier strategy for the table and its columns to the one specified in value, replacing the existing tier strategy in its entirety.

pub const TTL: &str = “ttl”;

Sets the time-to-live in minutes of the table or view specified in table_name.

options

Constants for options.

pub const ACTION: &str = “action”;
pub const ADD_COLUMN_EXPRESSION: &str = “add_column_expression”;

When adding a column or setting a new default with action set to set_default, the new default expression (GPUdb-syntax) for the column. Any valid expression may be used, including one containing references to existing columns in the same table. Persisted as the column’s default for future inserts that omit the column; for add_column, also used to backfill existing rows.

pub const ADD_COLUMN_EXPRESSION_SQL: &str = “add_column_expression_sql”;

Optional SQL-syntax form of add_column_expression, used only when the SQL syntax differs from the GPUdb syntax. Persisted alongside the GPUdb form so SHOW CREATE TABLE / information_schema can reproduce the original SQL.

pub const CAGRA: &str = “cagra”;

Create or delete a CAGRA index on a vector column.

pub const CHUNK_SKIP: &str = “chunk_skip”;

Create or delete a chunk skip index.

pub const COLUMN: &str = “column”;

Create or delete a column (attribute) index.

pub const COLUMN_DEFAULT_VALUE: &str = “column_default_value”;

When adding a column, set a literal default value for existing records. For nullable columns, the default value will be null, regardless of data type. Also persisted as the column’s default for future inserts that omit the column.

pub const COLUMN_NAME: &str = “column_name”;
pub const COLUMN_PROPERTIES: &str = “column_properties”;

When adding or changing a column, set the column properties (strings, separated by a comma: data, text_search, char8, int8 etc).

pub const COLUMN_TYPE: &str = “column_type”;

When adding or changing a column, set the column type (strings, separated by a comma: int, double, string, null etc).

pub const COPY_VALUES_FROM_COLUMN: &str = “copy_values_from_column”;

[DEPRECATED] Please use add_column_expression instead.

pub const FALSE: &str = “false”;

Don’t reset the timer; expiration countdown will continue from where it is, as if the table had not been accessed.

pub const GEOSPATIAL: &str = “geospatial”;

Create or delete a geospatial index.

pub const HNSW: &str = “hnsw”;

Create or delete an HNSW index on a vector column.

pub const INDEX_OPTIONS: &str = “index_options”;

Options to use when creating an index, in the format “key: value [, key: value [, …]]”. Valid options vary by index type.

pub const INDEX_TYPE: &str = “index_type”;

Type of index to create, when action is create_index; to refresh, when action is refresh_index; or to delete, when action is delete_index.

pub const LOW_CARDINALITY: &str = “low_cardinality”;

Create a low-cardinality column (attribute) index.

pub const RENAME_COLUMN: &str = “rename_column”;

When changing a column, specify new column name.

pub const STRATEGY_DEFINITION: &str = “strategy_definition”;

Parameter for specifying the tier strategy for the table and its columns when action is set_strategy_definition, replacing the existing tier strategy in its entirety.

pub const TABLE_NAME: &str = “table_name”;
pub const TRUE: &str = “true”;

Reset the expiration countdown timer to the table’s configured TTL.

pub const UPDATE_LAST_ACCESS_TIME: &str = “update_last_access_time”;

Indicates whether the time-to-live (TTL) expiration countdown timer should be reset to the table’s TTL.

pub const VALIDATE_CHANGE_COLUMN: &str = “validate_change_column”;

When changing a column, validate the change before applying it (or not).