createTable
Creates a new table with the given type (definition of columns). The type is specified intypeIdas either a numerical type ID (as returned bycreateType) or as a list of columns, each specified as a list of the column name, data type, and any column attributes.Example of a type definition with some parameters:
Each column definition consists of the column name (which should meet the standard column naming criteria), the column’s specific type (int, long, float, double, string, bytes, or any of the properties map values fromcreateType), and any data handling, data key, or data replacement properties.A table may optionally be designated to use a replicated distribution scheme, or be assigned: foreign keys to other tables, a partitioning scheme, and/or a tier strategy.
Parameters:request-Requestobject containing the parameters for the operation.Returns:Responseobject containing the results of the operation.Throws:GPUdbException- if an error occurs during the operation.createTable
public CreateTableResponse createTable(String tableName, String typeId, Map<String, String> options) throws GPUdbException Creates a new table with the given type (definition of columns). The type is specified intypeIdas either a numerical type ID (as returned bycreateType) or as a list of columns, each specified as a list of the column name, data type, and any column attributes.Example of a type definition with some parameters:
Each column definition consists of the column name (which should meet the standard column naming criteria), the column’s specific type (int, long, float, double, string, bytes, or any of the properties map values fromcreateType), and any data handling, data key, or data replacement properties.A table may optionally be designated to use a replicated distribution scheme, or be assigned: foreign keys to other tables, a partitioning scheme, and/or a tier strategy.
Parameters:tableName- Name of the table to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. Error for requests with existing table of the same name and type ID may be suppressed by using theNO_ERROR_IF_EXISTSoption.typeId- The type for the table, specified as either an existing table’s numerical type ID (as returned bycreateType) or a type definition (as described above).options- Optional parameters.NO_ERROR_IF_EXISTS: IfTRUE, prevents an error from occurring if the table already exists and is of the given type. If a table with the same ID but a different type exists, it is still an error. Supported values:The default value isFALSE.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place oftableName. IfIS_RESULT_TABLEisTRUE, then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_TABLE_NAME. Supported values:The default value isFALSE.COLLECTION_NAME: [DEPRECATED—please specify the containing schema as part oftableNameand usecreateSchemato create the schema if non-existent] Name of a schema which is to contain the newly created table. If the schema is non-existent, it will be automatically created.IS_COLLECTION: [DEPRECATED—please usecreateSchemato create a schema instead] Indicates whether to create a schema instead of a table. Supported values:The default value isFALSE.IS_REPLICATED: Affects the distribution scheme for the table’s data. IfTRUEand the given type has no explicit shard key defined, the table will be replicated. IfFALSE, the table will be sharded according to the shard key specified in the giventypeId, or randomly sharded, if no shard key is specified. Note that a type containing a shard key cannot be used to create a replicated table. Supported values:The default value isFALSE.FOREIGN_KEYS: Semicolon-separated list of foreign keys, of the format ‘(source_column_name [, …]) references target_table_name(primary_key_column_name [, …]) [as foreign_key_name]’.FOREIGN_SHARD_KEY: Foreign shard key of the format ‘source_column references shard_by_column from target_table(primary_key_column)’.PARTITION_TYPE: Partitioning scheme to use. Supported values:RANGE: Use range partitioning.INTERVAL: Use interval partitioning.LIST: Use list partitioning.HASH: Use hash partitioning.SERIES: Use series partitioning.
PARTITION_KEYS: Comma-separated list of partition keys, which are the columns or column expressions by which records will be assigned to partitions defined byPARTITION_DEFINITIONS.PARTITION_DEFINITIONS: Comma-separated list of partition definitions, whose format depends on the choice ofPARTITION_TYPE. See range partitioning, interval partitioning, list partitioning, hash partitioning, or series partitioning for example formats.IS_AUTOMATIC_PARTITION: IfTRUE, a new partition will be created for values which don’t fall into an existing partition. Currently only supported for list partitions. Supported values:The default value isFALSE.TTL: Sets the TTL of the table specified intableName.CHUNK_SIZE: Indicates the number of records per chunk to be used for this table.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for this table.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for this table.IS_RESULT_TABLE: Indicates whether the table is a memory-only table. A result table cannot contain columns with text_search data-handling, and it will not be retained if the server is restarted. Supported values:The default value isFALSE.STRATEGY_DEFINITION: The tier strategy for the table and its columns.COMPRESSION_CODEC: The default compression codec for this table’s columns.LOAD_VECTORS_POLICY: Set startup data loading scheme for the table. Supported values:ALWAYS: Load as much vector data as possible into memory before accepting requests.LAZY: Load the necessary vector data at start, and load the remainder lazily.ON_DEMAND: Load vector data as requests use it.SYSTEM: Load vector data using the system-configured default.
SYSTEM.BUILD_PK_INDEX_POLICY: Set startup primary-key index generation scheme for the table. Supported values:ALWAYS: Generate as much primary key index data as possible before accepting requests.LAZY: Generate the necessary primary key index data at start, and load the remainder lazily.ON_DEMAND: Generate primary key index data as requests use it.SYSTEM: Generate primary key index data using the system-configured default.
SYSTEM.
Map.Returns:Responseobject containing the results of the operation.Throws:GPUdbException- if an error occurs during the operation.