Skip to content

Commit

Permalink
test: add drilldowns[LABEL].filter test case without cache
Browse files Browse the repository at this point in the history
When the value of drilldowns[LABEL].filter parameter is changed,
Groonga returns result without using cache.
  • Loading branch information
kenhys committed Apr 17, 2017
1 parent eb8f465 commit f42a293
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 0 deletions.
@@ -0,0 +1,299 @@
plugin_register sharding
[[0,0.0,0.0],true]
table_create Logs_20150203 TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Logs_20150203 timestamp COLUMN_SCALAR Time
[[0,0.0,0.0],true]
column_create Logs_20150203 memo COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
column_create Logs_20150203 action COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
table_create Logs_20150204 TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Logs_20150204 timestamp COLUMN_SCALAR Time
[[0,0.0,0.0],true]
column_create Logs_20150204 memo COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
column_create Logs_20150204 action COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
table_create Logs_20150205 TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Logs_20150205 timestamp COLUMN_SCALAR Time
[[0,0.0,0.0],true]
column_create Logs_20150205 memo COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
column_create Logs_20150205 action COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
load --table Logs_20150203
[
{
"timestamp": "2015-02-03 12:49:00",
"memo": "2015-02-03 12:49:00",
"action": "Start"
},
{
"timestamp": "2015-02-03 23:59:59",
"memo": "2015-02-03 23:59:59",
"action": "Shutdown"
}
]
[[0,0.0,0.0],2]
load --table Logs_20150204
[
{
"timestamp": "2015-02-04 00:00:00",
"memo": "2015-02-04 00:00:00",
"action": "Start"
},
{
"timestamp": "2015-02-04 13:49:00",
"memo": "2015-02-04 13:49:00",
"action": "Restart"
},
{
"timestamp": "2015-02-04 13:50:00",
"memo": "2015-02-04 13:50:00",
"action": "Restart"
}
]
[[0,0.0,0.0],3]
load --table Logs_20150205
[
{
"timestamp": "2015-02-05 13:49:00",
"memo": "2015-02-05 13:49:00",
"action": "Restart"
},
{
"timestamp": "2015-02-05 13:50:00",
"memo": "2015-02-05 13:50:00",
"action": "Restart"
},
{
"timestamp": "2015-02-05 13:51:00",
"memo": "2015-02-05 13:51:00",
"action": "Restart"
},
{
"timestamp": "2015-02-05 13:52:00",
"memo": "2015-02-05 13:52:00",
"action": "Restart"
}
]
[[0,0.0,0.0],4]
logical_select Logs --shard_key timestamp --drilldowns[category].stage initial --drilldowns[category].keys 'action' --drilldowns[category].filter "_key @ 'Restart'" --drilldowns[category].output_columns _key,_nsubrecs
[
[
0,
0.0,
0.0
],
[
[
[
9
],
[
[
"_id",
"UInt32"
],
[
"action",
"ShortText"
],
[
"memo",
"ShortText"
],
[
"timestamp",
"Time"
]
],
[
1,
"Start",
"2015-02-03 12:49:00",
1422935340.0
],
[
2,
"Shutdown",
"2015-02-03 23:59:59",
1422975599.0
],
[
1,
"Start",
"2015-02-04 00:00:00",
1422975600.0
],
[
2,
"Restart",
"2015-02-04 13:49:00",
1423025340.0
],
[
3,
"Restart",
"2015-02-04 13:50:00",
1423025400.0
],
[
1,
"Restart",
"2015-02-05 13:49:00",
1423111740.0
],
[
2,
"Restart",
"2015-02-05 13:50:00",
1423111800.0
],
[
3,
"Restart",
"2015-02-05 13:51:00",
1423111860.0
],
[
4,
"Restart",
"2015-02-05 13:52:00",
1423111920.0
]
],
{
"category": [
[
1
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
]
],
[
"Restart",
6
]
]
}
]
]
logical_select Logs --shard_key timestamp --drilldowns[category].stage initial --drilldowns[category].keys 'action' --drilldowns[category].filter "_key @ 'Shutdown'" --drilldowns[category].output_columns _key,_nsubrecs
[
[
0,
0.0,
0.0
],
[
[
[
9
],
[
[
"_id",
"UInt32"
],
[
"action",
"ShortText"
],
[
"memo",
"ShortText"
],
[
"timestamp",
"Time"
]
],
[
1,
"Start",
"2015-02-03 12:49:00",
1422935340.0
],
[
2,
"Shutdown",
"2015-02-03 23:59:59",
1422975599.0
],
[
1,
"Start",
"2015-02-04 00:00:00",
1422975600.0
],
[
2,
"Restart",
"2015-02-04 13:49:00",
1423025340.0
],
[
3,
"Restart",
"2015-02-04 13:50:00",
1423025400.0
],
[
1,
"Restart",
"2015-02-05 13:49:00",
1423111740.0
],
[
2,
"Restart",
"2015-02-05 13:50:00",
1423111800.0
],
[
3,
"Restart",
"2015-02-05 13:51:00",
1423111860.0
],
[
4,
"Restart",
"2015-02-05 13:52:00",
1423111920.0
]
],
{
"category": [
[
1
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
]
],
[
"Shutdown",
1
]
]
}
]
]
@@ -0,0 +1,89 @@
#@on-error omit
plugin_register sharding
#@on-error default

table_create Logs_20150203 TABLE_NO_KEY
column_create Logs_20150203 timestamp COLUMN_SCALAR Time
column_create Logs_20150203 memo COLUMN_SCALAR ShortText
column_create Logs_20150203 action COLUMN_SCALAR ShortText

table_create Logs_20150204 TABLE_NO_KEY
column_create Logs_20150204 timestamp COLUMN_SCALAR Time
column_create Logs_20150204 memo COLUMN_SCALAR ShortText
column_create Logs_20150204 action COLUMN_SCALAR ShortText

table_create Logs_20150205 TABLE_NO_KEY
column_create Logs_20150205 timestamp COLUMN_SCALAR Time
column_create Logs_20150205 memo COLUMN_SCALAR ShortText
column_create Logs_20150205 action COLUMN_SCALAR ShortText

load --table Logs_20150203
[
{
"timestamp": "2015-02-03 12:49:00",
"memo": "2015-02-03 12:49:00",
"action": "Start"
},
{
"timestamp": "2015-02-03 23:59:59",
"memo": "2015-02-03 23:59:59",
"action": "Shutdown"
}
]

load --table Logs_20150204
[
{
"timestamp": "2015-02-04 00:00:00",
"memo": "2015-02-04 00:00:00",
"action": "Start"
},
{
"timestamp": "2015-02-04 13:49:00",
"memo": "2015-02-04 13:49:00",
"action": "Restart"
},
{
"timestamp": "2015-02-04 13:50:00",
"memo": "2015-02-04 13:50:00",
"action": "Restart"
}
]

load --table Logs_20150205
[
{
"timestamp": "2015-02-05 13:49:00",
"memo": "2015-02-05 13:49:00",
"action": "Restart"
},
{
"timestamp": "2015-02-05 13:50:00",
"memo": "2015-02-05 13:50:00",
"action": "Restart"
},
{
"timestamp": "2015-02-05 13:51:00",
"memo": "2015-02-05 13:51:00",
"action": "Restart"
},
{
"timestamp": "2015-02-05 13:52:00",
"memo": "2015-02-05 13:52:00",
"action": "Restart"
}
]

logical_select Logs \
--shard_key timestamp \
--drilldowns[category].stage initial \
--drilldowns[category].keys 'action' \
--drilldowns[category].filter "_key @ 'Restart'" \
--drilldowns[category].output_columns _key,_nsubrecs

logical_select Logs \
--shard_key timestamp \
--drilldowns[category].stage initial \
--drilldowns[category].keys 'action' \
--drilldowns[category].filter "_key @ 'Shutdown'" \
--drilldowns[category].output_columns _key,_nsubrecs

0 comments on commit f42a293

Please sign in to comment.