Debian Codegraph @

test/command/suite/select/slices/command_version_3.test

raw
1 plugin_register functions/time
2
3 table_create Tags TABLE_PAT_KEY ShortText
4
5 table_create Memos TABLE_HASH_KEY ShortText
6 column_create Memos date COLUMN_SCALAR Time
7 column_create Memos tag COLUMN_SCALAR Tags
8
9 load --table Memos
10 [
11 {"_key": "Groonga is fast!", "date": "2016-05-19 12:00:00", "tag": "Groonga"},
12 {"_key": "Mroonga is fast!", "date": "2016-05-19 12:00:01", "tag": "Mroonga"},
13 {"_key": "Groonga sticker!", "date": "2016-05-20 12:00:02", "tag": "Groonga"},
14 {"_key": "Rroonga is fast!", "date": "2016-05-21 12:00:03", "tag": "Rroonga"}
15 ]
16
17 select Memos \
18 --slices[groonga].filter 'tag == "Groonga"' \
19 --slices[groonga].sort_keys 'date' \
20 --slices[groonga].output_columns '_key, date' \
21 --slices[groonga].columns[date_day].stage filtered \
22 --slices[groonga].columns[date_day].type Time \
23 --slices[groonga].columns[date_day].value 'time_classify_day(date)' \
24 --slices[groonga].drilldowns[day].keys 'date_day' \
25 --command_version 3