File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1919 "actions.createTable" : " Create table..." ,
2020 "actions.createExternalTable" : " Create external table..." ,
2121 "actions.createTopic" : " Create topic..." ,
22+ "actions.createColumnTable" : " Create column table..." ,
2223 "actions.createView" : " Create view..." ,
2324 "actions.dropTable" : " Drop table..." ,
2425 "actions.dropTopic" : " Drop topic..." ,
Original file line number Diff line number Diff line change @@ -30,6 +30,18 @@ WITH (
3030 -- if some keys are missing in a table when making multiple single queries by the primary key.
3131)` ;
3232} ;
33+ export const createColumnTableTemplate = ( path : string ) => {
34+ return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/create_table#olap-tables
35+ CREATE TABLE \`${ path } /ydb_column_table\` (
36+ id Int64 NOT NULL,
37+ author Text,
38+ title Text,
39+ body Text,
40+ PRIMARY KEY (id)
41+ )
42+ PARTITION BY HASH(id)
43+ WITH (STORE = COLUMN)` ;
44+ } ;
3345export const alterTableTemplate = ( path : string ) => {
3446 return `ALTER TABLE \`${ path } \`
3547 ADD COLUMN is_deleted Bool;` ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import i18n from '../i18n';
1111import {
1212 alterTableTemplate ,
1313 alterTopicTemplate ,
14+ createColumnTableTemplate ,
1415 createExternalTableTemplate ,
1516 createTableTemplate ,
1617 createTopicTemplate ,
@@ -47,6 +48,7 @@ const bindActions = (
4748
4849 return {
4950 createTable : inputQuery ( createTableTemplate , 'script' ) ,
51+ createColumnTable : inputQuery ( createColumnTableTemplate , 'script' ) ,
5052 alterTable : inputQuery ( alterTableTemplate , 'script' ) ,
5153 selectQuery : inputQuery ( selectQueryTemplate ) ,
5254 upsertQuery : inputQuery ( upsertQueryTemplate ) ,
@@ -89,6 +91,7 @@ export const getActions =
8991 [ copyItem ] ,
9092 [
9193 { text : i18n ( 'actions.createTable' ) , action : actions . createTable } ,
94+ { text : i18n ( 'actions.createColumnTable' ) , action : actions . createColumnTable } ,
9295 { text : i18n ( 'actions.createTopic' ) , action : actions . createTopic } ,
9396 { text : i18n ( 'actions.createView' ) , action : actions . createView } ,
9497 ] ,
You can’t perform that action at this time.
0 commit comments