Kouhei Sutou
null+****@clear*****
Mon Jan 26 10:35:55 JST 2015
Kouhei Sutou 2015-01-26 10:35:55 +0900 (Mon, 26 Jan 2015) New Revision: 66fe88f99d69eea26ef0d614b8efc84eb07dbf81 https://github.com/groonga/groonga/commit/66fe88f99d69eea26ef0d614b8efc84eb07dbf81 Message: test drilldown clac: add tests for multiple keys Added files: test/command/suite/select/drilldown/labeled/calc_types/multiple/all.expected test/command/suite/select/drilldown/labeled/calc_types/multiple/all.test test/command/suite/select/drilldown/labeled/calc_types/multiple/avg.expected test/command/suite/select/drilldown/labeled/calc_types/multiple/avg.test test/command/suite/select/drilldown/labeled/calc_types/multiple/max.expected test/command/suite/select/drilldown/labeled/calc_types/multiple/max.test test/command/suite/select/drilldown/labeled/calc_types/multiple/min.expected test/command/suite/select/drilldown/labeled/calc_types/multiple/min.test test/command/suite/select/drilldown/labeled/calc_types/multiple/sum.expected test/command/suite/select/drilldown/labeled/calc_types/multiple/sum.test Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/all.expected (+128 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/all.expected 2015-01-26 10:35:55 +0900 (e759f48) @@ -0,0 +1,128 @@ +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 user COLUMN_SCALAR ShortText +[[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", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] +[[0,0.0,0.0],12] +select Memos --limit 0 --drilldown[tag].keys tag,user --drilldown[tag].calc_types 'AVG, MAX, MIN, SUM' --drilldown[tag].calc_target priority --drilldown[tag].output_columns _value.tag,_value.user,_max,_min,_sum,_avg +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 12 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "priority", + "Int64" + ], + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ] + ] + ], + { + "tag": [ + [ + 4 + ], + [ + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ], + [ + "_max", + "Int64" + ], + [ + "_min", + "Int64" + ], + [ + "_sum", + "Int64" + ], + [ + "_avg", + "Float" + ] + ], + [ + "Groonga", + "user1", + 60, + 10, + 90, + 30.0 + ], + [ + "Groonga", + "user2", + 61, + 8, + 93, + 31.0 + ], + [ + "Mroonga", + "user3", + 7, + -4, + 6, + 2.0 + ], + [ + "Mroonga", + "user4", + -1, + -3, + -6, + -2.0 + ] + ] + } + ] +] Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/all.test (+29 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/all.test 2015-01-26 10:35:55 +0900 (10c3c69) @@ -0,0 +1,29 @@ +table_create Tags TABLE_PAT_KEY ShortText + +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tag COLUMN_SCALAR Tags +column_create Memos user COLUMN_SCALAR ShortText +column_create Memos priority COLUMN_SCALAR Int64 + +load --table Memos +[ +{"_key": "Groonga1", "tag": "Groonga", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] + +select Memos \ + --limit 0 \ + --drilldown[tag].keys tag,user \ + --drilldown[tag].calc_types 'AVG, MAX, MIN, SUM' \ + --drilldown[tag].calc_target priority \ + --drilldown[tag].output_columns _value.tag,_value.user,_max,_min,_sum,_avg Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/avg.expected (+104 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/avg.expected 2015-01-26 10:35:55 +0900 (5b199a1) @@ -0,0 +1,104 @@ +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 user COLUMN_SCALAR ShortText +[[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", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] +[[0,0.0,0.0],12] +select Memos --limit 0 --drilldown[tag].keys tag,user --drilldown[tag].calc_types AVG --drilldown[tag].calc_target priority --drilldown[tag].output_columns _value.tag,_value.user,_avg +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 12 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "priority", + "Int64" + ], + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ] + ] + ], + { + "tag": [ + [ + 4 + ], + [ + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ], + [ + "_avg", + "Float" + ] + ], + [ + "Groonga", + "user1", + 30.0 + ], + [ + "Groonga", + "user2", + 31.0 + ], + [ + "Mroonga", + "user3", + 2.0 + ], + [ + "Mroonga", + "user4", + -2.0 + ] + ] + } + ] +] Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/avg.test (+29 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/avg.test 2015-01-26 10:35:55 +0900 (a988e53) @@ -0,0 +1,29 @@ +table_create Tags TABLE_PAT_KEY ShortText + +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tag COLUMN_SCALAR Tags +column_create Memos user COLUMN_SCALAR ShortText +column_create Memos priority COLUMN_SCALAR Int64 + +load --table Memos +[ +{"_key": "Groonga1", "tag": "Groonga", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] + +select Memos \ + --limit 0 \ + --drilldown[tag].keys tag,user \ + --drilldown[tag].calc_types AVG \ + --drilldown[tag].calc_target priority \ + --drilldown[tag].output_columns _value.tag,_value.user,_avg Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/max.expected (+104 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/max.expected 2015-01-26 10:35:55 +0900 (696f4a5) @@ -0,0 +1,104 @@ +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 user COLUMN_SCALAR ShortText +[[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", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] +[[0,0.0,0.0],12] +select Memos --limit 0 --drilldown[tag].keys tag,user --drilldown[tag].calc_types MAX --drilldown[tag].calc_target priority --drilldown[tag].output_columns _value.tag,_value.user,_max +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 12 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "priority", + "Int64" + ], + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ] + ] + ], + { + "tag": [ + [ + 4 + ], + [ + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ], + [ + "_max", + "Int64" + ] + ], + [ + "Groonga", + "user1", + 60 + ], + [ + "Groonga", + "user2", + 61 + ], + [ + "Mroonga", + "user3", + 7 + ], + [ + "Mroonga", + "user4", + -1 + ] + ] + } + ] +] Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/max.test (+29 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/max.test 2015-01-26 10:35:55 +0900 (6eebb6e) @@ -0,0 +1,29 @@ +table_create Tags TABLE_PAT_KEY ShortText + +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tag COLUMN_SCALAR Tags +column_create Memos user COLUMN_SCALAR ShortText +column_create Memos priority COLUMN_SCALAR Int64 + +load --table Memos +[ +{"_key": "Groonga1", "tag": "Groonga", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] + +select Memos \ + --limit 0 \ + --drilldown[tag].keys tag,user \ + --drilldown[tag].calc_types MAX \ + --drilldown[tag].calc_target priority \ + --drilldown[tag].output_columns _value.tag,_value.user,_max Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/min.expected (+104 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/min.expected 2015-01-26 10:35:55 +0900 (08e346e) @@ -0,0 +1,104 @@ +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 user COLUMN_SCALAR ShortText +[[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", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] +[[0,0.0,0.0],12] +select Memos --limit 0 --drilldown[tag].keys tag,user --drilldown[tag].calc_types MIN --drilldown[tag].calc_target priority --drilldown[tag].output_columns _value.tag,_value.user,_min +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 12 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "priority", + "Int64" + ], + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ] + ] + ], + { + "tag": [ + [ + 4 + ], + [ + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ], + [ + "_min", + "Int64" + ] + ], + [ + "Groonga", + "user1", + 10 + ], + [ + "Groonga", + "user2", + 8 + ], + [ + "Mroonga", + "user3", + -4 + ], + [ + "Mroonga", + "user4", + -3 + ] + ] + } + ] +] Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/min.test (+29 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/min.test 2015-01-26 10:35:55 +0900 (b7e0bda) @@ -0,0 +1,29 @@ +table_create Tags TABLE_PAT_KEY ShortText + +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tag COLUMN_SCALAR Tags +column_create Memos user COLUMN_SCALAR ShortText +column_create Memos priority COLUMN_SCALAR Int64 + +load --table Memos +[ +{"_key": "Groonga1", "tag": "Groonga", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] + +select Memos \ + --limit 0 \ + --drilldown[tag].keys tag,user \ + --drilldown[tag].calc_types MIN \ + --drilldown[tag].calc_target priority \ + --drilldown[tag].output_columns _value.tag,_value.user,_min Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/sum.expected (+104 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/sum.expected 2015-01-26 10:35:55 +0900 (6bd4228) @@ -0,0 +1,104 @@ +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 user COLUMN_SCALAR ShortText +[[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", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] +[[0,0.0,0.0],12] +select Memos --limit 0 --drilldown[tag].keys tag,user --drilldown[tag].calc_types SUM --drilldown[tag].calc_target priority --drilldown[tag].output_columns _value.tag,_value.user,_sum +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 12 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "priority", + "Int64" + ], + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ] + ] + ], + { + "tag": [ + [ + 4 + ], + [ + [ + "tag", + "Tags" + ], + [ + "user", + "ShortText" + ], + [ + "_sum", + "Int64" + ] + ], + [ + "Groonga", + "user1", + 90 + ], + [ + "Groonga", + "user2", + 93 + ], + [ + "Mroonga", + "user3", + 6 + ], + [ + "Mroonga", + "user4", + -6 + ] + ] + } + ] +] Added: test/command/suite/select/drilldown/labeled/calc_types/multiple/sum.test (+29 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/calc_types/multiple/sum.test 2015-01-26 10:35:55 +0900 (ac523ff) @@ -0,0 +1,29 @@ +table_create Tags TABLE_PAT_KEY ShortText + +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tag COLUMN_SCALAR Tags +column_create Memos user COLUMN_SCALAR ShortText +column_create Memos priority COLUMN_SCALAR Int64 + +load --table Memos +[ +{"_key": "Groonga1", "tag": "Groonga", "user": "user1", "priority": 10}, +{"_key": "Groonga2", "tag": "Groonga", "user": "user1", "priority": 20}, +{"_key": "Groonga3", "tag": "Groonga", "user": "user1", "priority": 60}, +{"_key": "Groonga4", "tag": "Groonga", "user": "user2", "priority": 61}, +{"_key": "Groonga5", "tag": "Groonga", "user": "user2", "priority": 24}, +{"_key": "Groonga6", "tag": "Groonga", "user": "user2", "priority": 8}, +{"_key": "Mroonga1", "tag": "Mroonga", "user": "user3", "priority": 7}, +{"_key": "Mroonga2", "tag": "Mroonga", "user": "user3", "priority": 3}, +{"_key": "Mroonga3", "tag": "Mroonga", "user": "user3", "priority": -4}, +{"_key": "Mroonga4", "tag": "Mroonga", "user": "user4", "priority": -1}, +{"_key": "Mroonga5", "tag": "Mroonga", "user": "user4", "priority": -2}, +{"_key": "Mroonga6", "tag": "Mroonga", "user": "user4", "priority": -3} +] + +select Memos \ + --limit 0 \ + --drilldown[tag].keys tag,user \ + --drilldown[tag].calc_types SUM \ + --drilldown[tag].calc_target priority \ + --drilldown[tag].output_columns _value.tag,_value.user,_sum -------------- next part -------------- HTML����������������������������... 下载