Class CreateProjectionRequest
- java.lang.Object
-
- com.gpudb.protocol.CreateProjectionRequest
-
- All Implemented Interfaces:
org.apache.avro.generic.GenericContainer,org.apache.avro.generic.IndexedRecord
public class CreateProjectionRequest extends Object implements org.apache.avro.generic.IndexedRecord
A set of parameters forGPUdb.createProjection.Creates a new projection of an existing table. A projection represents a subset of the columns (potentially including derived columns) of a table.
For projection details and examples, see Projections. For limitations, see Projection Limitations and Cautions.
Window functions, which can perform operations like moving averages, are available through this endpoint as well as
GPUdb.getRecordsByColumn.A projection can be created with a different shard key than the source table. By specifying
SHARD_KEY, the projection will be sharded according to the specified columns, regardless of how the source table is sharded. The source table can even be unsharded or replicated.If
tableNameis empty, selection is performed against a single-row virtual table. This can be useful in executing temporal (NOW()), identity (USER()), or constant-based functions (GEODIST(-77.11, 38.88, -71.06, 42.36)).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreateProjectionRequest.OptionsA set of string constants for theCreateProjectionRequestparameteroptions.
-
Constructor Summary
Constructors Constructor Description CreateProjectionRequest()Constructs a CreateProjectionRequest object with default parameters.CreateProjectionRequest(String tableName, String projectionName, List<String> columnNames, Map<String,String> options)Constructs a CreateProjectionRequest object with the specified parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Objectget(int index)This method supports the Avro framework and is not intended to be called directly by the user.static org.apache.avro.SchemagetClassSchema()This method supports the Avro framework and is not intended to be called directly by the user.List<String>getColumnNames()List of columns fromtableNameto be included in the projection.Map<String,String>getOptions()Optional parameters.StringgetProjectionName()Name of the projection to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.org.apache.avro.SchemagetSchema()This method supports the Avro framework and is not intended to be called directly by the user.StringgetTableName()Name of the existing table on which the projection is to be applied, in [schema_name.]table_name format, using standard name resolution rules.inthashCode()voidput(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.CreateProjectionRequestsetColumnNames(List<String> columnNames)List of columns fromtableNameto be included in the projection.CreateProjectionRequestsetOptions(Map<String,String> options)Optional parameters.CreateProjectionRequestsetProjectionName(String projectionName)Name of the projection to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.CreateProjectionRequestsetTableName(String tableName)Name of the existing table on which the projection is to be applied, in [schema_name.]table_name format, using standard name resolution rules.StringtoString()
-
-
-
Constructor Detail
-
CreateProjectionRequest
public CreateProjectionRequest()
Constructs a CreateProjectionRequest object with default parameters.
-
CreateProjectionRequest
public CreateProjectionRequest(String tableName, String projectionName, List<String> columnNames, Map<String,String> options)
Constructs a CreateProjectionRequest object with the specified parameters.- Parameters:
tableName- Name of the existing table on which the projection is to be applied, in [schema_name.]table_name format, using standard name resolution rules. An empty table name creates a projection from a single-row virtual table, where columns specified should be constants or constant expressions.projectionName- Name of the projection to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.columnNames- List of columns fromtableNameto be included in the projection. Can include derived columns. Can be specified as aliased via the syntax 'column_name as alias'.options- Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofprojectionName. IfPERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_PROJECTION_NAME. Supported values: The default value isFALSE.COLLECTION_NAME: [DEPRECATED--please specify the containing schema for the projection as part ofprojectionNameand useGPUdb.createSchemato create the schema if non-existent] Name of a schema for the projection. If the schema is non-existent, it will be automatically created. The default value is ''.EXPRESSION: An optional filter expression to be applied to the source table prior to the projection. The default value is ''.IS_REPLICATED: IfTRUEthen the projection will be replicated even if the source table is not. Supported values: The default value isFALSE.OFFSET: The number of initial results to skip (this can be useful for paging through the results). The default value is '0'.LIMIT: The number of records to keep. The default value is '-9999'.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. 'timestamp asc, x desc'. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ''.CHUNK_SIZE: Indicates the number of records per chunk to be used for this projection.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for this projection.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for this projection.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the projection. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name.TTL: Sets the TTL of the projection specified inprojectionName.SHARD_KEY: Comma-separated list of the columns to be sharded on; e.g. 'column1, column2'. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ''.PERSIST: IfTRUE, then the projection specified inprojectionNamewill be persisted and will not expire unless aTTLis specified. IfFALSE, then the projection will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values: The default value isFALSE.PRESERVE_DICT_ENCODING: IfTRUE, then columns that were dict encoded in the source table will be dict encoded in the projection. Supported values: The default value isTRUE.RETAIN_PARTITIONS: Determines whether the created projection will retain the partitioning scheme from the source table. Supported values: The default value isFALSE.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.VIEW_ID: ID of view of which this projection is a member. The default value is ''.STRATEGY_DEFINITION: The tier strategy for the table and its columns.COMPRESSION_CODEC: The default compression codec for the projection's columns.JOIN_WINDOW_FUNCTIONS: If set, window functions which require a reshard will be computed separately and joined back together, if the width of the projection is greater than the join_window_functions_threshold. The default value is 'true'.JOIN_WINDOW_FUNCTIONS_THRESHOLD: If the projection is greater than this width (in bytes), then window functions which require a reshard will be computed separately and joined back together. The default value is ''.
Map.
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
This method supports the Avro framework and is not intended to be called directly by the user.- Returns:
- The schema for the class.
-
getTableName
public String getTableName()
Name of the existing table on which the projection is to be applied, in [schema_name.]table_name format, using standard name resolution rules. An empty table name creates a projection from a single-row virtual table, where columns specified should be constants or constant expressions.- Returns:
- The current value of
tableName.
-
setTableName
public CreateProjectionRequest setTableName(String tableName)
Name of the existing table on which the projection is to be applied, in [schema_name.]table_name format, using standard name resolution rules. An empty table name creates a projection from a single-row virtual table, where columns specified should be constants or constant expressions.- Parameters:
tableName- The new value fortableName.- Returns:
thisto mimic the builder pattern.
-
getProjectionName
public String getProjectionName()
Name of the projection to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.- Returns:
- The current value of
projectionName.
-
setProjectionName
public CreateProjectionRequest setProjectionName(String projectionName)
Name of the projection to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.- Parameters:
projectionName- The new value forprojectionName.- Returns:
thisto mimic the builder pattern.
-
getColumnNames
public List<String> getColumnNames()
List of columns fromtableNameto be included in the projection. Can include derived columns. Can be specified as aliased via the syntax 'column_name as alias'.- Returns:
- The current value of
columnNames.
-
setColumnNames
public CreateProjectionRequest setColumnNames(List<String> columnNames)
List of columns fromtableNameto be included in the projection. Can include derived columns. Can be specified as aliased via the syntax 'column_name as alias'.- Parameters:
columnNames- The new value forcolumnNames.- Returns:
thisto mimic the builder pattern.
-
getOptions
public Map<String,String> getOptions()
Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofprojectionName. IfPERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_PROJECTION_NAME. Supported values: The default value isFALSE.COLLECTION_NAME: [DEPRECATED--please specify the containing schema for the projection as part ofprojectionNameand useGPUdb.createSchemato create the schema if non-existent] Name of a schema for the projection. If the schema is non-existent, it will be automatically created. The default value is ''.EXPRESSION: An optional filter expression to be applied to the source table prior to the projection. The default value is ''.IS_REPLICATED: IfTRUEthen the projection will be replicated even if the source table is not. Supported values: The default value isFALSE.OFFSET: The number of initial results to skip (this can be useful for paging through the results). The default value is '0'.LIMIT: The number of records to keep. The default value is '-9999'.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. 'timestamp asc, x desc'. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ''.CHUNK_SIZE: Indicates the number of records per chunk to be used for this projection.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for this projection.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for this projection.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the projection. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name.TTL: Sets the TTL of the projection specified inprojectionName.SHARD_KEY: Comma-separated list of the columns to be sharded on; e.g. 'column1, column2'. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ''.PERSIST: IfTRUE, then the projection specified inprojectionNamewill be persisted and will not expire unless aTTLis specified. IfFALSE, then the projection will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values: The default value isFALSE.PRESERVE_DICT_ENCODING: IfTRUE, then columns that were dict encoded in the source table will be dict encoded in the projection. Supported values: The default value isTRUE.RETAIN_PARTITIONS: Determines whether the created projection will retain the partitioning scheme from the source table. Supported values: The default value isFALSE.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.VIEW_ID: ID of view of which this projection is a member. The default value is ''.STRATEGY_DEFINITION: The tier strategy for the table and its columns.COMPRESSION_CODEC: The default compression codec for the projection's columns.JOIN_WINDOW_FUNCTIONS: If set, window functions which require a reshard will be computed separately and joined back together, if the width of the projection is greater than the join_window_functions_threshold. The default value is 'true'.JOIN_WINDOW_FUNCTIONS_THRESHOLD: If the projection is greater than this width (in bytes), then window functions which require a reshard will be computed separately and joined back together. The default value is ''.
Map.- Returns:
- The current value of
options.
-
setOptions
public CreateProjectionRequest setOptions(Map<String,String> options)
Optional parameters.CREATE_TEMP_TABLE: IfTRUE, a unique temporary table name will be generated in the sys_temp schema and used in place ofprojectionName. IfPERSISTisFALSE(or unspecified), then this is always allowed even if the caller does not have permission to create tables. The generated name is returned inQUALIFIED_PROJECTION_NAME. Supported values: The default value isFALSE.COLLECTION_NAME: [DEPRECATED--please specify the containing schema for the projection as part ofprojectionNameand useGPUdb.createSchemato create the schema if non-existent] Name of a schema for the projection. If the schema is non-existent, it will be automatically created. The default value is ''.EXPRESSION: An optional filter expression to be applied to the source table prior to the projection. The default value is ''.IS_REPLICATED: IfTRUEthen the projection will be replicated even if the source table is not. Supported values: The default value isFALSE.OFFSET: The number of initial results to skip (this can be useful for paging through the results). The default value is '0'.LIMIT: The number of records to keep. The default value is '-9999'.ORDER_BY: Comma-separated list of the columns to be sorted by; e.g. 'timestamp asc, x desc'. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ''.CHUNK_SIZE: Indicates the number of records per chunk to be used for this projection.CHUNK_COLUMN_MAX_MEMORY: Indicates the target maximum data size for each column in a chunk to be used for this projection.CHUNK_MAX_MEMORY: Indicates the target maximum data size for all columns in a chunk to be used for this projection.CREATE_INDEXES: Comma-separated list of columns on which to create indexes on the projection. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name.TTL: Sets the TTL of the projection specified inprojectionName.SHARD_KEY: Comma-separated list of the columns to be sharded on; e.g. 'column1, column2'. The columns specified must be present incolumnNames. If any alias is given for any column name, the alias must be used, rather than the original column name. The default value is ''.PERSIST: IfTRUE, then the projection specified inprojectionNamewill be persisted and will not expire unless aTTLis specified. IfFALSE, then the projection will be an in-memory table and will expire unless aTTLis specified otherwise. Supported values: The default value isFALSE.PRESERVE_DICT_ENCODING: IfTRUE, then columns that were dict encoded in the source table will be dict encoded in the projection. Supported values: The default value isTRUE.RETAIN_PARTITIONS: Determines whether the created projection will retain the partitioning scheme from the source table. Supported values: The default value isFALSE.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.VIEW_ID: ID of view of which this projection is a member. The default value is ''.STRATEGY_DEFINITION: The tier strategy for the table and its columns.COMPRESSION_CODEC: The default compression codec for the projection's columns.JOIN_WINDOW_FUNCTIONS: If set, window functions which require a reshard will be computed separately and joined back together, if the width of the projection is greater than the join_window_functions_threshold. The default value is 'true'.JOIN_WINDOW_FUNCTIONS_THRESHOLD: If the projection is greater than this width (in bytes), then window functions which require a reshard will be computed separately and joined back together. The default value is ''.
Map.- Parameters:
options- The new value foroptions.- Returns:
thisto mimic the builder pattern.
-
getSchema
public org.apache.avro.Schema getSchema()
This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Returns:
- The schema object describing this class.
-
get
public Object get(int index)
This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to get- Returns:
- value of the field with the given index.
- Throws:
IndexOutOfBoundsException
-
put
public void put(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to setvalue- the value to set- Throws:
IndexOutOfBoundsException
-
-