| 1 |
plugin_register functions/time |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
table_create Logs TABLE_NO_KEY |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
column_create Logs timestamp COLUMN_SCALAR Time |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
column_create Logs price COLUMN_SCALAR UInt32 |
| 8 |
[[0,0.0,0.0],true] |
| 9 |
load --table Logs |
| 10 |
[ |
| 11 |
{"timestamp": "2017/03/15 00:00:00", "price": 1000}, |
| 12 |
{"timestamp": "2017/03/15 11:00:00", "price": 900}, |
| 13 |
{"timestamp": "2017/03/15 12:00:00", "price": 300}, |
| 14 |
{"timestamp": "2017/03/15 13:00:00", "price": 200} |
| 15 |
] |
| 16 |
[[0,0.0,0.0],4] |
| 17 |
log_level --level dump |
| 18 |
[[0,0.0,0.0],true] |
| 19 |
select Logs --columns[price_per_day].stage filtered --columns[price_per_day].type UInt32 --columns[price_per_day].flags COLUMN_SCALAR --columns[price_per_day].value 'window_sum(price)' --columns[price_per_day].window.group_keys 'timestamp' --output_columns _id |
| 20 |
[[0,0.0,0.0],[[[4],[["_id","UInt32"]],[1],[2],[3],[4]]]] |
| 21 |
#|-| [obj][open] <266>(<Logs>):<51>(<table:no_key>) |
| 22 |
#|-| [obj][open] <268>(<Logs.price>):<64>(<column:fix_size>) |
| 23 |
#|-| [obj][open] <267>(<Logs.timestamp>):<64>(<column:fix_size>) |
| 24 |
#|-| [obj][close] <268>(<Logs.price>):<64>(<column:fix_size>) |
| 25 |
#|-| [obj][close] <267>(<Logs.timestamp>):<64>(<column:fix_size>) |
| 26 |
#|-| [obj][close] <266>(<Logs>):<51>(<table:no_key>) |
| 27 |
log_level --level notice |
| 28 |
[[0,0.0,0.0],true] |