create_projection
- create_projection(
table_name: string,
projection_name: string,
column_names: string[],
options?: Record<string, string>,
callback?: GPUdbCallback,
): Promise<CreateProjectionResponse>Parameters
- table_name: string
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.
- projection_name: string
Name of the projection to be created, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria.
- column_names: string[]
List of columns from
table_nameto be included in the projection. Can include derived columns. Can be specified as aliased via the syntax ‘column_name as alias’. Optionaloptions: Record<string, string>Optional parameters.
Optionalcallback: GPUdbCallbackOptional callback function
Returns Promise<CreateProjectionResponse>
Promise<Types.CreateProjectionResponse> - Promise resolving to the response
- Defined in src/GPUdb.ts:6325
- table_name: string
create_projection_request
- create_projection_request(
request: CreateProjectionRequest,
callback?: GPUdbCallback,
): Promise<CreateProjectionResponse>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
get_records_by_column.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
table_nameis 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)).Parameters
- request: CreateProjectionRequest
Request object containing the parameters for the operation
Optionalcallback: GPUdbCallbackOptional callback function
Returns Promise<CreateProjectionResponse>
Promise<Types.CreateProjectionResponse> - Promise resolving to the response
- Defined in src/GPUdb.ts:6280
- request: CreateProjectionRequest
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
get_records_by_column.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
table_nameis 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)).