public class CreateTableRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.createTable
.
Creates a new table. If a new table is being created, the type of the table
is given by typeId
, which must be the ID of a currently
registered type (i.e. one created via GPUdb.createType
).
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.
Modifier and Type | Class and Description |
---|---|
static class |
CreateTableRequest.Options
A set of string constants for the
CreateTableRequest parameter
options . |
Constructor and Description |
---|
CreateTableRequest()
Constructs a CreateTableRequest object with default parameters.
|
CreateTableRequest(String tableName,
String typeId,
Map<String,String> options)
Constructs a CreateTableRequest object with the specified parameters.
|
Modifier and Type | Method and Description | ||
---|---|---|---|
boolean |
equals(Object obj) |
||
Object |
get(int index)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
||
static org.apache.avro.Schema |
getClassSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
||
Map<String,String> |
getOptions()
Optional parameters.
|
||
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
||
String |
getTableName()
| ||
int |
hashCode() |
||
void |
put(int index,
Object value)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
||
CreateTableRequest |
setOptions(Map<String,String> options)
Optional parameters.
|
||
CreateTableRequest |
setTableName(String tableName)
Name of the table to be created, in [schema_name.]table_name format,
using standard
CreateTableRequest setTypeId(String typeId)
ID of a currently registered type.
| ||
String |
toString() |
public CreateTableRequest()
public CreateTableRequest(String tableName, String typeId, Map<String,String> options)
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 the NO_ERROR_IF_EXISTS
option.typeId
- ID of a currently registered type. All objects added to
the newly created table will be of this type.options
- Optional parameters.
NO_ERROR_IF_EXISTS
: If TRUE
, 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 is FALSE
.
CREATE_TEMP_TABLE
: If TRUE
, a unique temporary table name will be
generated in the sys_temp schema and used in
place of tableName
. If IS_RESULT_TABLE
is
TRUE
, then this is always
allowed even if the caller does not have
permission to create tables. The generated name
is returned in QUALIFIED_TABLE_NAME
.
Supported values:
The default value is FALSE
.
COLLECTION_NAME
:
[DEPRECATED--please specify the containing
schema as part of tableName
and use
GPUdb.createSchema
to 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 use GPUdb.createSchema
to create a schema instead]
Indicates whether to create a schema instead of
a table.
Supported values:
The default value is FALSE
.
DISALLOW_HOMOGENEOUS_TABLES
: No longer
supported; value will be ignored.
Supported values:
The default value is FALSE
.
IS_REPLICATED
:
Affects the distribution scheme for the
table's data. If TRUE
and
the given type has no explicit shard key defined, the table
will be replicated. If FALSE
, the table will be sharded according to the shard
key specified in the given typeId
, 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 is FALSE
.
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
by PARTITION_DEFINITIONS
.
PARTITION_DEFINITIONS
: Comma-separated list of
partition definitions, whose format depends on
the choice of PARTITION_TYPE
. See range partitioning, interval partitioning, list partitioning, hash partitioning, or series partitioning for
example formats.
IS_AUTOMATIC_PARTITION
: If TRUE
, 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 is FALSE
.
TTL
: Sets the TTL of the table specified in
tableName
.
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 store_only or
text_search data-handling or that are non-charN strings, and it will
not be retained if the server is restarted.
Supported values:
The default value is FALSE
.
STRATEGY_DEFINITION
: The tier strategy for the table
and its 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
.public static org.apache.avro.Schema getClassSchema()
public String getTableName()
NO_ERROR_IF_EXISTS
option.tableName
.public CreateTableRequest setTableName(String tableName)
NO_ERROR_IF_EXISTS
option.tableName
- The new value for tableName
.this
to mimic the builder pattern.public String getTypeId()
typeId
.public CreateTableRequest setTypeId(String typeId)
typeId
- The new value for typeId
.this
to mimic the builder pattern.public Map<String,String> getOptions()
NO_ERROR_IF_EXISTS
: If TRUE
, 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 is FALSE
.
CREATE_TEMP_TABLE
: If TRUE
, a unique temporary table name will be
generated in the sys_temp schema and used in place of tableName
. If IS_RESULT_TABLE
is TRUE
, then this is
always allowed even if the caller does not have permission to
create tables. The generated name is returned in QUALIFIED_TABLE_NAME
.
Supported values:
The default value is FALSE
.
COLLECTION_NAME
:
[DEPRECATED--please specify the containing schema as part of
tableName
and use GPUdb.createSchema
to 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
use GPUdb.createSchema
to create a schema instead] Indicates
whether to create a schema instead of a table.
Supported values:
The default value is FALSE
.
DISALLOW_HOMOGENEOUS_TABLES
: No longer supported; value will be
ignored.
Supported values:
The default value is FALSE
.
IS_REPLICATED
: Affects the distribution scheme for the table's data. If
TRUE
and the given type has no explicit shard key defined, the table will be replicated. If FALSE
,
the table will be sharded according to the shard key specified
in the given typeId
, 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 is FALSE
.
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 by PARTITION_DEFINITIONS
.
PARTITION_DEFINITIONS
:
Comma-separated list of partition definitions, whose format
depends on the choice of PARTITION_TYPE
. See range partitioning, interval partitioning, list partitioning, hash partitioning, or series partitioning for example formats.
IS_AUTOMATIC_PARTITION
:
If TRUE
, 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 is FALSE
.
TTL
: Sets the TTL of
the table specified in tableName
.
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 store_only or text_search data-handling or that are non-charN strings, and it will not be retained
if the server is restarted.
Supported values:
The default value is FALSE
.
STRATEGY_DEFINITION
: The tier strategy for the table and its 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
.options
.public CreateTableRequest setOptions(Map<String,String> options)
NO_ERROR_IF_EXISTS
: If TRUE
, 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 is FALSE
.
CREATE_TEMP_TABLE
: If TRUE
, a unique temporary table name will be
generated in the sys_temp schema and used in place of tableName
. If IS_RESULT_TABLE
is TRUE
, then this is
always allowed even if the caller does not have permission to
create tables. The generated name is returned in QUALIFIED_TABLE_NAME
.
Supported values:
The default value is FALSE
.
COLLECTION_NAME
:
[DEPRECATED--please specify the containing schema as part of
tableName
and use GPUdb.createSchema
to 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
use GPUdb.createSchema
to create a schema instead] Indicates
whether to create a schema instead of a table.
Supported values:
The default value is FALSE
.
DISALLOW_HOMOGENEOUS_TABLES
: No longer supported; value will be
ignored.
Supported values:
The default value is FALSE
.
IS_REPLICATED
: Affects the distribution scheme for the table's data. If
TRUE
and the given type has no explicit shard key defined, the table will be replicated. If FALSE
,
the table will be sharded according to the shard key specified
in the given typeId
, 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 is FALSE
.
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 by PARTITION_DEFINITIONS
.
PARTITION_DEFINITIONS
:
Comma-separated list of partition definitions, whose format
depends on the choice of PARTITION_TYPE
. See range partitioning, interval partitioning, list partitioning, hash partitioning, or series partitioning for example formats.
IS_AUTOMATIC_PARTITION
:
If TRUE
, 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 is FALSE
.
TTL
: Sets the TTL of
the table specified in tableName
.
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 store_only or text_search data-handling or that are non-charN strings, and it will not be retained
if the server is restarted.
Supported values:
The default value is FALSE
.
STRATEGY_DEFINITION
: The tier strategy for the table and its 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
.options
- The new value for options
.this
to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
public Object get(int index)
get
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to getIndexOutOfBoundsException
public void put(int index, Object value)
put
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to setvalue
- the value to setIndexOutOfBoundsException
Copyright © 2025. All rights reserved.