我無法找出劃分我的'列'表的語法。這是一個對我來說失敗的例子,以及它的許多變化。如何在SnappyData的列表中分區數據?
CREATE TABLE SENSOR_DATA_COL_BY_YEAR USING column OPTIONS(PARTITION_BY year_num, buckets '11') AS (SELECT sensor_id,metric,collection_time,value,sensor_time,year AS year_num, month AS month_num from STAGING_1);
而......錯誤。
ERROR 38000:(SQLSTATE = 38000嚴重性= -1) (服務器= 172.31.8.115 [1528],線程[DRDAConnThread_34,5,gemfirexd.daemons]) 異常「無效輸入 'C',預期dmlOperation,插入, withIdentifier,選擇或放(行1,列1):CREATE TABLE SENSOR_DATA_COL_BY_YEAR使用柱OPTIONS(PARTITION_BY YEAR_NUM,水桶 '11')AS(SELECT sensor_id,公制,collection_time,值,sensor_time, year AS year_num, month AS month_num from STAGING_1)^;'在評估 表達式時被拋出。在PARTITION_BY子句指定
這適用於一列。現在...當我嘗試對year_num和month_num進行分區時,但沒有嘗試使用過的語法。此語法是否支持多個分區列,如果是這樣,那麼這是什麼樣的? – Jason
多列分區by子句的語法是PARTITION_BY'year_num,sensor_id'。即逗號分隔列名引號。 – suranjan