Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logical_count: add post_filter and filtered stage dynamic columns
- Loading branch information
Showing
9 changed files
with
477 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
test/command/suite/sharding/logical_count/post_filter/filtered_column.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| plugin_register sharding | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170315 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170315 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170315 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170316 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170316 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170316 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170317 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170317 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170317 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| load --table Logs_20170315 | ||
| [ | ||
| {"timestamp": "2017/03/15 00:00:00", "price": 1000}, | ||
| {"timestamp": "2017/03/15 01:00:00", "price": 900}, | ||
| {"timestamp": "2017/03/15 02:00:00", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170316 | ||
| [ | ||
| {"timestamp": "2017/03/16 10:00:00", "price": 530}, | ||
| {"timestamp": "2017/03/16 11:00:00", "price": 520}, | ||
| {"timestamp": "2017/03/16 12:00:00", "price": 110} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170317 | ||
| [ | ||
| {"timestamp": "2017/03/17 20:00:00", "price": 800}, | ||
| {"timestamp": "2017/03/17 21:00:00", "price": 400}, | ||
| {"timestamp": "2017/03/17 22:00:00", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| table_create Times TABLE_PAT_KEY Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170315 COLUMN_INDEX Logs_20170315 timestamp | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170316 COLUMN_INDEX Logs_20170316 timestamp | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170317 COLUMN_INDEX Logs_20170317 timestamp | ||
| [[0,0.0,0.0],true] | ||
| log_level --level debug | ||
| [[0,0.0,0.0],true] | ||
| logical_count Logs --shard_key timestamp --columns[filtered_id].stage filtered --columns[filtered_id].type UInt32 --columns[filtered_id].flags COLUMN_SCALAR --columns[filtered_id].value '_id' --filter 'price >= 200' --post_filter 'filtered_id > 1' | ||
| [[0,0.0,0.0],5] | ||
| #|d| [logical_count][select] <Logs_20170315>: covered | ||
| #|d| [logical_count][select] <Logs_20170316>: covered | ||
| #|d| [logical_count][select] <Logs_20170317>: covered | ||
| log_level --level notice | ||
| [[0,0.0,0.0],true] |
54 changes: 54 additions & 0 deletions
54
test/command/suite/sharding/logical_count/post_filter/filtered_column.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #@on-error omit | ||
| plugin_register sharding | ||
| #@on-error default | ||
|
|
||
| table_create Logs_20170315 TABLE_NO_KEY | ||
| column_create Logs_20170315 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170315 price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Logs_20170316 TABLE_NO_KEY | ||
| column_create Logs_20170316 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170316 price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Logs_20170317 TABLE_NO_KEY | ||
| column_create Logs_20170317 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170317 price COLUMN_SCALAR UInt32 | ||
|
|
||
| load --table Logs_20170315 | ||
| [ | ||
| {"timestamp": "2017/03/15 00:00:00", "price": 1000}, | ||
| {"timestamp": "2017/03/15 01:00:00", "price": 900}, | ||
| {"timestamp": "2017/03/15 02:00:00", "price": 300} | ||
| ] | ||
|
|
||
| load --table Logs_20170316 | ||
| [ | ||
| {"timestamp": "2017/03/16 10:00:00", "price": 530}, | ||
| {"timestamp": "2017/03/16 11:00:00", "price": 520}, | ||
| {"timestamp": "2017/03/16 12:00:00", "price": 110} | ||
| ] | ||
|
|
||
| load --table Logs_20170317 | ||
| [ | ||
| {"timestamp": "2017/03/17 20:00:00", "price": 800}, | ||
| {"timestamp": "2017/03/17 21:00:00", "price": 400}, | ||
| {"timestamp": "2017/03/17 22:00:00", "price": 300} | ||
| ] | ||
|
|
||
| table_create Times TABLE_PAT_KEY Time | ||
| column_create Times logs_20170315 COLUMN_INDEX Logs_20170315 timestamp | ||
| column_create Times logs_20170316 COLUMN_INDEX Logs_20170316 timestamp | ||
| column_create Times logs_20170317 COLUMN_INDEX Logs_20170317 timestamp | ||
|
|
||
| #@add-important-log-levels debug | ||
| log_level --level debug | ||
| logical_count Logs \ | ||
| --shard_key timestamp \ | ||
| --columns[filtered_id].stage filtered \ | ||
| --columns[filtered_id].type UInt32 \ | ||
| --columns[filtered_id].flags COLUMN_SCALAR \ | ||
| --columns[filtered_id].value '_id' \ | ||
| --filter 'price >= 200' \ | ||
| --post_filter 'filtered_id > 1' | ||
| log_level --level notice | ||
| #@remove-important-log-levels debug |
58 changes: 58 additions & 0 deletions
58
test/command/suite/sharding/logical_count/post_filter/min.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| plugin_register sharding | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170315 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170315 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170315 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170316 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170316 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170316 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170317 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170317 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170317 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| load --table Logs_20170315 | ||
| [ | ||
| {"timestamp": "2017/03/15 00:00:00", "price": 1000}, | ||
| {"timestamp": "2017/03/15 01:00:00", "price": 900}, | ||
| {"timestamp": "2017/03/15 02:00:00", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170316 | ||
| [ | ||
| {"timestamp": "2017/03/16 10:00:00", "price": 530}, | ||
| {"timestamp": "2017/03/16 11:00:00", "price": 520}, | ||
| {"timestamp": "2017/03/16 12:00:00", "price": 110} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170317 | ||
| [ | ||
| {"timestamp": "2017/03/17 20:00:00", "price": 800}, | ||
| {"timestamp": "2017/03/17 21:00:00", "price": 400}, | ||
| {"timestamp": "2017/03/17 22:00:00", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| table_create Times TABLE_PAT_KEY Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170315 COLUMN_INDEX Logs_20170315 timestamp | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170316 COLUMN_INDEX Logs_20170316 timestamp | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170317 COLUMN_INDEX Logs_20170317 timestamp | ||
| [[0,0.0,0.0],true] | ||
| log_level --level debug | ||
| [[0,0.0,0.0],true] | ||
| logical_count Logs --shard_key timestamp --min "2017/03/15 01:00:00" --min_border "include" --columns[filtered_id].stage filtered --columns[filtered_id].type UInt32 --columns[filtered_id].flags COLUMN_SCALAR --columns[filtered_id].value '_id' --filter 'price >= 200' --post_filter 'filtered_id < 3' | ||
| [[0,0.0,0.0],5] | ||
| #|d| [logical_count][select] <Logs_20170315>: need filter | ||
| #|d| [logical_count][select] <Logs_20170316>: covered | ||
| #|d| [logical_count][select] <Logs_20170317>: covered | ||
| log_level --level notice | ||
| [[0,0.0,0.0],true] |
56 changes: 56 additions & 0 deletions
56
test/command/suite/sharding/logical_count/post_filter/min.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #@on-error omit | ||
| plugin_register sharding | ||
| #@on-error default | ||
|
|
||
| table_create Logs_20170315 TABLE_NO_KEY | ||
| column_create Logs_20170315 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170315 price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Logs_20170316 TABLE_NO_KEY | ||
| column_create Logs_20170316 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170316 price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Logs_20170317 TABLE_NO_KEY | ||
| column_create Logs_20170317 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170317 price COLUMN_SCALAR UInt32 | ||
|
|
||
| load --table Logs_20170315 | ||
| [ | ||
| {"timestamp": "2017/03/15 00:00:00", "price": 1000}, | ||
| {"timestamp": "2017/03/15 01:00:00", "price": 900}, | ||
| {"timestamp": "2017/03/15 02:00:00", "price": 300} | ||
| ] | ||
|
|
||
| load --table Logs_20170316 | ||
| [ | ||
| {"timestamp": "2017/03/16 10:00:00", "price": 530}, | ||
| {"timestamp": "2017/03/16 11:00:00", "price": 520}, | ||
| {"timestamp": "2017/03/16 12:00:00", "price": 110} | ||
| ] | ||
|
|
||
| load --table Logs_20170317 | ||
| [ | ||
| {"timestamp": "2017/03/17 20:00:00", "price": 800}, | ||
| {"timestamp": "2017/03/17 21:00:00", "price": 400}, | ||
| {"timestamp": "2017/03/17 22:00:00", "price": 300} | ||
| ] | ||
|
|
||
| table_create Times TABLE_PAT_KEY Time | ||
| column_create Times logs_20170315 COLUMN_INDEX Logs_20170315 timestamp | ||
| column_create Times logs_20170316 COLUMN_INDEX Logs_20170316 timestamp | ||
| column_create Times logs_20170317 COLUMN_INDEX Logs_20170317 timestamp | ||
|
|
||
| #@add-important-log-levels debug | ||
| log_level --level debug | ||
| logical_count Logs \ | ||
| --shard_key timestamp \ | ||
| --min "2017/03/15 01:00:00" \ | ||
| --min_border "include" \ | ||
| --columns[filtered_id].stage filtered \ | ||
| --columns[filtered_id].type UInt32 \ | ||
| --columns[filtered_id].flags COLUMN_SCALAR \ | ||
| --columns[filtered_id].value '_id' \ | ||
| --filter 'price >= 200' \ | ||
| --post_filter 'filtered_id < 3' | ||
| log_level --level notice | ||
| #@remove-important-log-levels debug |
58 changes: 58 additions & 0 deletions
58
test/command/suite/sharding/logical_count/post_filter/no_filter.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| plugin_register sharding | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170315 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170315 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170315 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170316 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170316 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170316 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170317 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170317 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170317 price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| load --table Logs_20170315 | ||
| [ | ||
| {"timestamp": "2017/03/15 00:00:00", "price": 1000}, | ||
| {"timestamp": "2017/03/15 01:00:00", "price": 900}, | ||
| {"timestamp": "2017/03/15 02:00:00", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170316 | ||
| [ | ||
| {"timestamp": "2017/03/16 10:00:00", "price": 530}, | ||
| {"timestamp": "2017/03/16 11:00:00", "price": 520}, | ||
| {"timestamp": "2017/03/16 12:00:00", "price": 110} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170317 | ||
| [ | ||
| {"timestamp": "2017/03/17 20:00:00", "price": 800}, | ||
| {"timestamp": "2017/03/17 21:00:00", "price": 400}, | ||
| {"timestamp": "2017/03/17 22:00:00", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| table_create Times TABLE_PAT_KEY Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170315 COLUMN_INDEX Logs_20170315 timestamp | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170316 COLUMN_INDEX Logs_20170316 timestamp | ||
| [[0,0.0,0.0],true] | ||
| column_create Times logs_20170317 COLUMN_INDEX Logs_20170317 timestamp | ||
| [[0,0.0,0.0],true] | ||
| log_level --level debug | ||
| [[0,0.0,0.0],true] | ||
| logical_count Logs --shard_key timestamp --post_filter '_id < 3' | ||
| [[0,0.0,0.0],6] | ||
| #|d| [logical_count][select] <Logs_20170315>: covered | ||
| #|d| [logical_count][select] <Logs_20170316>: covered | ||
| #|d| [logical_count][select] <Logs_20170317>: covered | ||
| log_level --level notice | ||
| [[0,0.0,0.0],true] |
Oops, something went wrong.