Navigation Menu

Skip to content

Commit

Permalink
test: add test case when --query parameter is changed
Browse files Browse the repository at this point in the history
When the value of --query parameter is changed, Groonga returns result
without using cache.
  • Loading branch information
kenhys committed Apr 17, 2017
1 parent eb8f465 commit 5bde6a3
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 0 deletions.
109 changes: 109 additions & 0 deletions test/command/suite/sharding/logical_select/cache/query.expected
@@ -0,0 +1,109 @@
plugin_register sharding
[[0,0.0,0.0],true]
table_create Memos_20170416 TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Memos_20170416 timestamp COLUMN_SCALAR Time
[[0,0.0,0.0],true]
column_create Memos_20170416 content COLUMN_SCALAR Text
[[0,0.0,0.0],true]
table_create Memos_20170417 TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Memos_20170417 timestamp COLUMN_SCALAR Time
[[0,0.0,0.0],true]
column_create Memos_20170417 content COLUMN_SCALAR Text
[[0,0.0,0.0],true]
load --table Memos_20170416
[
{"timestamp": "2017/04/16 00:00:00", "content": "Groonga is fast."},
{"timestamp": "2017/04/16 01:00:00", "content": "Mroonga is fast and easy to use."}
]
[[0,0.0,0.0],2]
load --table Memos_20170417
[
{"timestamp": "2017/04/17 10:00:00", "content": "PGroonga is fast and easy to use."},
{"timestamp": "2017/04/17 11:00:00", "content": "Rroonga is fast and easy to use."}
]
[[0,0.0,0.0],2]
logical_select Memos --shard_key timestamp --query 'content:@easy'
[
[
0,
0.0,
0.0
],
[
[
[
3
],
[
[
"_id",
"UInt32"
],
[
"content",
"Text"
],
[
"timestamp",
"Time"
]
],
[
2,
"Mroonga is fast and easy to use.",
1492272000.0
],
[
1,
"PGroonga is fast and easy to use.",
1492390800.0
],
[
2,
"Rroonga is fast and easy to use.",
1492394400.0
]
]
]
]
logical_select Memos --shard_key timestamp --query 'content:@groonga'
[
[
0,
0.0,
0.0
],
[
[
[
2
],
[
[
"_id",
"UInt32"
],
[
"content",
"Text"
],
[
"timestamp",
"Time"
]
],
[
1,
"Groonga is fast.",
1492268400.0
],
[
1,
"PGroonga is fast and easy to use.",
1492390800.0
]
]
]
]
31 changes: 31 additions & 0 deletions test/command/suite/sharding/logical_select/cache/query.test
@@ -0,0 +1,31 @@
#@on-error omit
plugin_register sharding
#@on-error default

table_create Memos_20170416 TABLE_NO_KEY
column_create Memos_20170416 timestamp COLUMN_SCALAR Time
column_create Memos_20170416 content COLUMN_SCALAR Text

table_create Memos_20170417 TABLE_NO_KEY
column_create Memos_20170417 timestamp COLUMN_SCALAR Time
column_create Memos_20170417 content COLUMN_SCALAR Text

load --table Memos_20170416
[
{"timestamp": "2017/04/16 00:00:00", "content": "Groonga is fast."},
{"timestamp": "2017/04/16 01:00:00", "content": "Mroonga is fast and easy to use."}
]

load --table Memos_20170417
[
{"timestamp": "2017/04/17 10:00:00", "content": "PGroonga is fast and easy to use."},
{"timestamp": "2017/04/17 11:00:00", "content": "Rroonga is fast and easy to use."}
]

logical_select Memos \
--shard_key timestamp \
--query 'content:@easy'

logical_select Memos \
--shard_key timestamp \
--query 'content:@groonga'

0 comments on commit 5bde6a3

Please sign in to comment.