Navigation Menu

Skip to content

Commit

Permalink
Remove trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 29, 2015
1 parent 13001c4 commit c68fa1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions en/_posts/2015-01-29-release.md
Expand Up @@ -35,11 +35,11 @@ Try to pass following parameter to select command:
Here is the simple example which use MAX.

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},
Expand All @@ -52,14 +52,14 @@ Here is the simple example which use MAX.
{"_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

Here is the drilldown results.

{
Expand Down Expand Up @@ -97,7 +97,7 @@ The data is grouped by tag, there are three groups - "Groonga", "Mroonga" and "R
If you want to get not only max value, but also min value, specify multiple types for calc_types.
Here is the example which gets max value and min value:

--drilldown[tag].calc_types MAX,MIN
--drilldown[tag].calc_types MAX,MIN

Don't forget to specify pseudo column name "_min".

Expand Down
10 changes: 5 additions & 5 deletions ja/_posts/2015-01-29-release.md
Expand Up @@ -44,11 +44,11 @@ drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、
具体的な例をみてみましょう。MAXを使ってグループごとの最大値を取得する例です。

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},
Expand All @@ -61,14 +61,14 @@ drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、
{"_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

結果は次のようになります。

{
Expand Down Expand Up @@ -104,7 +104,7 @@ drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、
3つにグループ化され、タグとグループごとの最大値が返ってくるのがわかります。
最大値だけでなく最小値も取得したいなら、`calc_types`に複数カンマ区切りで指定します。

--drilldown[tag].calc_types MAX,MIN
--drilldown[tag].calc_types MAX,MIN

`output_columns``_min` 疑似カラムの指定も忘れないようにしましょう。

Expand Down

0 comments on commit c68fa1b

Please sign in to comment.