public class CreateTableRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.createTable(CreateTableRequest).
Creates a new table or collection. If a new table is being created, the type
of the table is given by typeId, which must the be the ID of a
currently registered type (i.e. one created via GPUdb.createType(CreateTypeRequest)). The table will be created
inside a collection if the option collection_name is specified. If
that collection does not already exist, it will be created.
To create a new collection, specify the name of the collection in tableName and set the is_collection option to true; typeId will be ignored.
| Modifier and Type | Class and Description |
|---|---|
static class |
CreateTableRequest.Options
Optional parameters.
|
| 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() |
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getTableName() |
String |
getTypeId() |
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) |
CreateTableRequest |
setTableName(String tableName) |
CreateTableRequest |
setTypeId(String typeId) |
String |
toString() |
public CreateTableRequest()
public CreateTableRequest(String tableName, String typeId, Map<String,String> options)
tableName - Name of the table to be created. Error for requests
with existing table of the same name and type id may
be suppressed by using the no_error_if_exists
option. See Tables for naming restrictions.typeId - ID of a currently registered type. All objects added to
the newly created table will be of this type. Ignored if
is_collection is true.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.
COLLECTION_NAME: Name of a collection which is to
contain the newly created table. If empty, then the
newly created table will be a top-level table. If the
collection does not allow duplicate types and it
contains a table of the same type as the given one, then
this table creation request will fail.
IS_COLLECTION: Indicates whether the new table to be
created will be a collection.
Supported values:
The default value is FALSE.
DISALLOW_HOMOGENEOUS_TABLES: For a collection,
indicates whether the collection prohibits containment
of multiple tables of exactly the same data type.
Supported values:
The default value is FALSE.
IS_REPLICATED: For a table, indicates whether the table
is to be replicated to all the database ranks. This may
be necessary when the table is to be joined with other
tables in a query.
Supported values:
The default value is FALSE.
FOREIGN_KEYS: Semicolon-separated list of foreign keys,
of the format 'source_column references
target_table(primary_key_column)'.
FOREIGN_SHARD_KEY: Foreign shard key of the format
'source_column references shard_by_column from
target_table(primary_key_column)'
TTL:
Sets the TTL of the table or collection specified in
tableName. The value must be the desired TTL in
minutes.
IS_RESULT_TABLE: For a table, indicates whether the
table is a non-persistent, memory-only table that will
store the output of a proc executed with GPUdb.executeProc(ExecuteProcRequest). A
result table cannot contain store_only, text_search, or
string columns (char columns are acceptable), records
cannot be inserted into it directly, and it will not be
retained if the server is restarted.
Supported values:
The default value is FALSE.
public static org.apache.avro.Schema getClassSchema()
public String getTableName()
no_error_if_exists option. See Tables for naming restrictions.public CreateTableRequest setTableName(String tableName)
tableName - Name of the table to be created. Error for requests
with existing table of the same name and type id may
be suppressed by using the no_error_if_exists
option. See Tables for naming restrictions.this to mimic the builder pattern.public String getTypeId()
is_collection is true.public CreateTableRequest setTypeId(String typeId)
typeId - ID of a currently registered type. All objects added to
the newly created table will be of this type. Ignored if
is_collection is true.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.
COLLECTION_NAME: Name of a collection which is to contain the
newly created table. If empty, then the newly created table will
be a top-level table. If the collection does not allow duplicate
types and it contains a table of the same type as the given one,
then this table creation request will fail.
IS_COLLECTION: Indicates whether the new table to be created
will be a collection.
Supported values:
The default value is FALSE.
DISALLOW_HOMOGENEOUS_TABLES: For a collection, indicates
whether the collection prohibits containment of multiple tables
of exactly the same data type.
Supported values:
The default value is FALSE.
IS_REPLICATED: For a table, indicates whether the table is to
be replicated to all the database ranks. This may be necessary
when the table is to be joined with other tables in a query.
Supported values:
The default value is FALSE.
FOREIGN_KEYS: Semicolon-separated list of foreign keys, of the
format 'source_column references
target_table(primary_key_column)'.
FOREIGN_SHARD_KEY: Foreign shard key of the format
'source_column references shard_by_column from
target_table(primary_key_column)'
TTL: Sets the
TTL of the table or collection specified in tableName.
The value must be the desired TTL in minutes.
IS_RESULT_TABLE: For a table, indicates whether the table is a
non-persistent, memory-only table that will store the output of
a proc executed with GPUdb.executeProc(ExecuteProcRequest). A result table
cannot contain store_only, text_search, or string columns (char
columns are acceptable), records cannot be inserted into it
directly, and it will not be retained if the server is
restarted.
Supported values:
The default value is FALSE.
public CreateTableRequest setOptions(Map<String,String> options)
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.
COLLECTION_NAME: Name of a collection which is to
contain the newly created table. If empty, then the
newly created table will be a top-level table. If the
collection does not allow duplicate types and it
contains a table of the same type as the given one, then
this table creation request will fail.
IS_COLLECTION: Indicates whether the new table to be
created will be a collection.
Supported values:
The default value is FALSE.
DISALLOW_HOMOGENEOUS_TABLES: For a collection,
indicates whether the collection prohibits containment
of multiple tables of exactly the same data type.
Supported values:
The default value is FALSE.
IS_REPLICATED: For a table, indicates whether the table
is to be replicated to all the database ranks. This may
be necessary when the table is to be joined with other
tables in a query.
Supported values:
The default value is FALSE.
FOREIGN_KEYS: Semicolon-separated list of foreign keys,
of the format 'source_column references
target_table(primary_key_column)'.
FOREIGN_SHARD_KEY: Foreign shard key of the format
'source_column references shard_by_column from
target_table(primary_key_column)'
TTL:
Sets the TTL of the table or collection specified in
tableName. The value must be the desired TTL in
minutes.
IS_RESULT_TABLE: For a table, indicates whether the
table is a non-persistent, memory-only table that will
store the output of a proc executed with GPUdb.executeProc(ExecuteProcRequest). A
result table cannot contain store_only, text_search, or
string columns (char columns are acceptable), records
cannot be inserted into it directly, and it will not be
retained if the server is restarted.
Supported values:
The default value is FALSE.
this to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema in interface org.apache.avro.generic.GenericContainerpublic Object get(int index)
get in interface org.apache.avro.generic.IndexedRecordindex - the position of the field to getIndexOutOfBoundsExceptionpublic void put(int index,
Object value)
put in interface org.apache.avro.generic.IndexedRecordindex - the position of the field to setvalue - the value to setIndexOutOfBoundsExceptionCopyright © 2017. All rights reserved.