Navigation Menu

Skip to content

Commit

Permalink
test: add a test for max in drilldown
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 19, 2015
1 parent 111e785 commit d352b7d
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
@@ -0,0 +1,83 @@
table_create Tags TABLE_PAT_KEY ShortText
[[0,0.0,0.0],true]
table_create Memos TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Memos tag COLUMN_SCALAR Tags
[[0,0.0,0.0],true]
column_create Memos priority COLUMN_SCALAR Int64
[[0,0.0,0.0],true]
load --table Memos
[
{"_key": "Groonga1", "tag": "Groonga", "priority": 10},
{"_key": "Groonga2", "tag": "Groonga", "priority": 20},
{"_key": "Groonga3", "tag": "Groonga", "priority": 40},
{"_key": "Mroonga1", "tag": "Mroonga", "priority": 50},
{"_key": "Mroonga2", "tag": "Mroonga", "priority": 25},
{"_key": "Mroonga3", "tag": "Mroonga", "priority": 10},
{"_key": "Rroonga1", "tag": "Rroonga", "priority": 25},
{"_key": "Rroonga2", "tag": "Rroonga", "priority": -25},
{"_key": "Rroonga3", "tag": "Rroonga", "priority": 0}
]
[[0,0.0,0.0],9]
select Memos --limit 0 --drilldown[tag].keys tag --drilldown[tag].calc_types MAX --drilldown[tag].calc_target priority --drilldown[tag].output_columns _key,_max
[
[
0,
0.0,
0.0
],
[
[
[
9
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"priority",
"Int64"
],
[
"tag",
"Tags"
]
]
],
{
"tag": [
[
3
],
[
[
"_key",
"ShortText"
],
[
"_max",
"Int64"
]
],
[
"Groonga",
40
],
[
"Mroonga",
50
],
[
"Rroonga",
25
]
]
}
]
]
25 changes: 25 additions & 0 deletions test/command/suite/select/drilldown/labeled/calc_types/max.test
@@ -0,0 +1,25 @@
table_create Tags TABLE_PAT_KEY ShortText

table_create Memos TABLE_HASH_KEY ShortText
column_create Memos tag COLUMN_SCALAR Tags
column_create Memos priority COLUMN_SCALAR Int64

load --table Memos
[
{"_key": "Groonga1", "tag": "Groonga", "priority": 10},
{"_key": "Groonga2", "tag": "Groonga", "priority": 20},
{"_key": "Groonga3", "tag": "Groonga", "priority": 40},
{"_key": "Mroonga1", "tag": "Mroonga", "priority": 50},
{"_key": "Mroonga2", "tag": "Mroonga", "priority": 25},
{"_key": "Mroonga3", "tag": "Mroonga", "priority": 10},
{"_key": "Rroonga1", "tag": "Rroonga", "priority": 25},
{"_key": "Rroonga2", "tag": "Rroonga", "priority": -25},
{"_key": "Rroonga3", "tag": "Rroonga", "priority": 0}
]

select Memos \
--limit 0 \
--drilldown[tag].keys tag \
--drilldown[tag].calc_types MAX \
--drilldown[tag].calc_target priority \
--drilldown[tag].output_columns _key,_max

0 comments on commit d352b7d

Please sign in to comment.