| 1 |
#@on-error omit |
| 2 |
plugin_register sharding |
| 3 |
#@on-error default |
| 4 |
|
| 5 |
table_create Logs_20150203 TABLE_NO_KEY |
| 6 |
column_create Logs_20150203 timestamp COLUMN_SCALAR Time |
| 7 |
|
| 8 |
table_create Logs_20150204 TABLE_NO_KEY |
| 9 |
column_create Logs_20150204 timestamp COLUMN_SCALAR Time |
| 10 |
|
| 11 |
table_create Logs TABLE_NO_KEY |
| 12 |
column_create Logs original_id COLUMN_SCALAR UInt32 |
| 13 |
column_create Logs timestamp_text COLUMN_SCALAR ShortText |
| 14 |
|
| 15 |
load --table Logs_20150203 |
| 16 |
[ |
| 17 |
{ |
| 18 |
"timestamp": "2015-02-03 10:49:00" |
| 19 |
}, |
| 20 |
{ |
| 21 |
"timestamp": "2015-02-03 12:49:00" |
| 22 |
} |
| 23 |
] |
| 24 |
|
| 25 |
load --table Logs_20150204 |
| 26 |
[ |
| 27 |
{ |
| 28 |
"timestamp": "2015-02-04 00:00:00" |
| 29 |
} |
| 30 |
] |
| 31 |
|
| 32 |
logical_select \ |
| 33 |
--logical_table Logs \ |
| 34 |
--shard_key timestamp \ |
| 35 |
--load_table Logs \ |
| 36 |
--load_columns "original_id, timestamp_text" \ |
| 37 |
--load_values "_id, timestamp" \ |
| 38 |
--limit 0 |
| 39 |
|
| 40 |
select --table Logs |