| 1 |
plugin_register sharding |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
table_create Logs_20170415 TABLE_NO_KEY |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
column_create Logs_20170415 timestamp COLUMN_SCALAR Time |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
column_create Logs_20170415 price COLUMN_SCALAR UInt32 |
| 8 |
[[0,0.0,0.0],true] |
| 9 |
column_create Logs_20170415 n_likes COLUMN_SCALAR UInt32 |
| 10 |
[[0,0.0,0.0],true] |
| 11 |
table_create Logs_20170416 TABLE_NO_KEY |
| 12 |
[[0,0.0,0.0],true] |
| 13 |
column_create Logs_20170416 timestamp COLUMN_SCALAR Time |
| 14 |
[[0,0.0,0.0],true] |
| 15 |
column_create Logs_20170416 price COLUMN_SCALAR UInt32 |
| 16 |
[[0,0.0,0.0],true] |
| 17 |
column_create Logs_20170416 n_likes COLUMN_SCALAR UInt32 |
| 18 |
[[0,0.0,0.0],true] |
| 19 |
load --table Logs_20170415 |
| 20 |
[ |
| 21 |
{"timestamp": "2017/04/15 00:00:00", "n_likes": 2, "price": 100}, |
| 22 |
{"timestamp": "2017/04/15 01:00:00", "n_likes": 1, "price": 100}, |
| 23 |
{"timestamp": "2017/04/15 01:00:00", "n_likes": 2, "price": 200} |
| 24 |
] |
| 25 |
[[0,0.0,0.0],3] |
| 26 |
load --table Logs_20170416 |
| 27 |
[ |
| 28 |
{"timestamp": "2017/04/16 10:00:00", "n_likes": 1, "price": 200}, |
| 29 |
{"timestamp": "2017/04/16 11:00:00", "n_likes": 2, "price": 300}, |
| 30 |
{"timestamp": "2017/04/16 11:00:00", "n_likes": 1, "price": 300} |
| 31 |
] |
| 32 |
[[0,0.0,0.0],3] |
| 33 |
logical_select Logs --shard_key timestamp --columns[sum].stage initial --columns[sum].type UInt32 --columns[sum].flags COLUMN_SCALAR --columns[sum].value 'window_sum(price)' --columns[sum].window.group_keys n_likes --output_columns price,sum |
| 34 |
[ |
| 35 |
[ |
| 36 |
0, |
| 37 |
0.0, |
| 38 |
0.0 |
| 39 |
], |
| 40 |
[ |
| 41 |
[ |
| 42 |
[ |
| 43 |
6 |
| 44 |
], |
| 45 |
[ |
| 46 |
[ |
| 47 |
"price", |
| 48 |
"UInt32" |
| 49 |
], |
| 50 |
[ |
| 51 |
"sum", |
| 52 |
"UInt32" |
| 53 |
] |
| 54 |
], |
| 55 |
[ |
| 56 |
100, |
| 57 |
600 |
| 58 |
], |
| 59 |
[ |
| 60 |
100, |
| 61 |
600 |
| 62 |
], |
| 63 |
[ |
| 64 |
200, |
| 65 |
600 |
| 66 |
], |
| 67 |
[ |
| 68 |
200, |
| 69 |
600 |
| 70 |
], |
| 71 |
[ |
| 72 |
300, |
| 73 |
600 |
| 74 |
], |
| 75 |
[ |
| 76 |
300, |
| 77 |
600 |
| 78 |
] |
| 79 |
] |
| 80 |
] |
| 81 |
] |
| 82 |
logical_select Logs --shard_key timestamp --columns[sum].stage initial --columns[sum].type UInt32 --columns[sum].flags COLUMN_SCALAR --columns[sum].value 'window_sum(price)' --columns[sum].window.group_keys price --output_columns price,sum |
| 83 |
[ |
| 84 |
[ |
| 85 |
0, |
| 86 |
0.0, |
| 87 |
0.0 |
| 88 |
], |
| 89 |
[ |
| 90 |
[ |
| 91 |
[ |
| 92 |
6 |
| 93 |
], |
| 94 |
[ |
| 95 |
[ |
| 96 |
"price", |
| 97 |
"UInt32" |
| 98 |
], |
| 99 |
[ |
| 100 |
"sum", |
| 101 |
"UInt32" |
| 102 |
] |
| 103 |
], |
| 104 |
[ |
| 105 |
100, |
| 106 |
200 |
| 107 |
], |
| 108 |
[ |
| 109 |
100, |
| 110 |
200 |
| 111 |
], |
| 112 |
[ |
| 113 |
200, |
| 114 |
400 |
| 115 |
], |
| 116 |
[ |
| 117 |
200, |
| 118 |
400 |
| 119 |
], |
| 120 |
[ |
| 121 |
300, |
| 122 |
600 |
| 123 |
], |
| 124 |
[ |
| 125 |
300, |
| 126 |
600 |
| 127 |
] |
| 128 |
] |
| 129 |
] |
| 130 |
] |