This command creates a projection in a VAST Database table. A projection is a set of selected columns in a table. You can specify columns in the projection that are used to sort the rows of the projection.
Up to 64 projections can be created in a single table.
Usage
projection create --database-name DATABASE --schema-name SCHEMA --table-name TABLE --name PROJECTION --sorted-columns SORTED_COLUMNS [--unsorted-columns UNSORTED_COLUMNS]
Required Parameters
| Specifies the name of the database containing the table. |
| Specifies the name of the schema containing the table. |
| Specifies the name of the table containing the columns. |
| Specifies the name of the projection. This is used to refer to the projection in other commands, such as projection show. |
| Specifies the columns in the projection (from the table) that are used to sort the projection. The rows of the projection are sorted by these columns, in the order they appear in the list. For example, for --sorted-columns a,b,c,d, the rows in the projection are sorted first by the value in column a, then b, then c, and, finally, by d. Any other columns in the projection (from the unsorted-columns list) would are not used for sorting. Specify SORTED_COLUMNS as a comma-separated list of column names, with no spaces. You can specify up to four columns to sort the projection by. |
Options
| Specifies additional columns in the projection (from the table) that are not used to sort the projection. Specify the columns as a comma-separated list, with no spaces. You can specify any number of unsorted columns for the projection, but they cannot include columns included in the sorted-columns list. Columns that are not in the sorted or unsorted list are not included in the projection (and cannot, therefore, be included in queries on the projection). |
Examples
This example includes a list of sorted columns only. The projection includes only these columns, and is sorted according to all of them in the order they appear in the list.
vcli: admin> projection create --database-name tabular --schema-name vast --table-name tab1--name myProj --sorted-columns id,logtime,user_id,currency Projection has been created
This example includes a list of unsorted columns as well. The projection includes the sorted and unsorted columns, but is sorted only according to the sorted list.
vcli: admin> projection create --database-name tabular --schema-name vast --table-name tab1 --name myProj2 --sorted-columns id,logtime,user_id,currency --unsorted-columns session_id,is_nha,language,member_id Projection has been created