[Groonga-commit] groonga/groonga [master] table: add tests for group command.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 25日 (月) 20:18:06 JST


Daijiro MORI	2012-06-25 20:18:06 +0900 (Mon, 25 Jun 2012)

  New Revision: 29f5237496c9275661db91fd72794009997fda03
  https://github.com/groonga/groonga/commit/29f5237496c9275661db91fd72794009997fda03

  Log:
    table: add tests for group command.

  Added files:
    test/function/suite/table/group.expected
    test/function/suite/table/group.test

  Added: test/function/suite/table/group.expected (+236 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/table/group.expected    2012-06-25 20:18:06 +0900 (db68290)
@@ -0,0 +1,236 @@
+register table/table
+[[0,0.0,0.0],true]
+table_create Shops TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tags TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Shops tags COLUMN_VECTOR Tags
+[[0,0.0,0.0],true]
+column_create Tags shops_tag COLUMN_INDEX Shops tags
+[[0,0.0,0.0],true]
+column_create Shops budget COLUMN_SCALAR UInt32
+[[0,0.0,0.0],true]
+add Shops '{"_key":"くりこあん","tags":["たいやき","養殖"],"budget":180}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"なか一","tags":["季節料理"],"budget":800}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"魚寅食堂","tags":["漁師","季節料理"],"budget":750}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"DRAGON飯店","tags":["中華"],"budget":600}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"魚浜","tags":["回転寿司"],"budget":600}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"beanDaisy","tags":["caffe","カプチーノ"],"budget":650}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"維新","tags":["麺や"],"budget":800}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"ひづめ","tags":["とんかつ"],"budget":900}'
+[[0,0.0,0.0],true]
+add Shops '{"_key":"和互","tags":["魚"],"budget":1000}'
+[[0,0.0,0.0],true]
+group Shops tags
+[[0,0.0,0.0],2147483649]
+output 2147483649 _key,_nsubrecs
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      11
+    ],
+    [
+      [
+        "_key",
+        "ShortText"
+      ],
+      [
+        "_nsubrecs",
+        "Int32"
+      ]
+    ],
+    [
+      "中華",
+      1
+    ],
+    [
+      "caffe",
+      1
+    ],
+    [
+      "カプチーノ",
+      1
+    ],
+    [
+      "たいやき",
+      1
+    ],
+    [
+      "養殖",
+      1
+    ],
+    [
+      "季節料理",
+      2
+    ],
+    [
+      "とんかつ",
+      1
+    ],
+    [
+      "魚",
+      1
+    ],
+    [
+      "麺や",
+      1
+    ],
+    [
+      "漁師",
+      1
+    ]
+  ]
+]
+group Shops budget
+[[0,0.0,0.0],2147483650]
+output 2147483650 _key,_nsubrecs
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      7
+    ],
+    [
+      [
+        "_key",
+        "UInt32"
+      ],
+      [
+        "_nsubrecs",
+        "Int32"
+      ]
+    ],
+    [
+      600,
+      2
+    ],
+    [
+      650,
+      1
+    ],
+    [
+      180,
+      1
+    ],
+    [
+      800,
+      2
+    ],
+    [
+      900,
+      1
+    ],
+    [
+      1000,
+      1
+    ],
+    [
+      750,
+      1
+    ]
+  ]
+]
+filter_by_script Shops 'budget > 100'
+[[0,0.0,0.0],2147483652]
+group 2147483652 budget --range_gap 100
+[[0,0.0,0.0],2147483651]
+output 2147483651 _key,_nsubrecs
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      6
+    ],
+    [
+      [
+        "_key",
+        "UInt32"
+      ],
+      [
+        "_nsubrecs",
+        "Int32"
+      ]
+    ],
+    [
+      600,
+      3
+    ],
+    [
+      100,
+      1
+    ],
+    [
+      800,
+      2
+    ],
+    [
+      900,
+      1
+    ],
+    [
+      1000,
+      1
+    ],
+    [
+      700,
+      1
+    ]
+  ]
+]
+group 2147483652 budget --range_gap 500
+[[0,0.0,0.0],2147483653]
+output 2147483653 _key,_nsubrecs
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      3
+    ],
+    [
+      [
+        "_key",
+        "UInt32"
+      ],
+      [
+        "_nsubrecs",
+        "Int32"
+      ]
+    ],
+    [
+      500,
+      7
+    ],
+    [
+      0,
+      1
+    ],
+    [
+      1000,
+      1
+    ]
+  ]
+]

  Added: test/function/suite/table/group.test (+25 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/table/group.test    2012-06-25 20:18:06 +0900 (4fa8690)
@@ -0,0 +1,25 @@
+register table/table
+table_create Shops TABLE_PAT_KEY ShortText
+table_create Tags TABLE_PAT_KEY ShortText
+column_create Shops tags COLUMN_VECTOR Tags
+column_create Tags shops_tag COLUMN_INDEX Shops tags
+column_create Shops budget COLUMN_SCALAR UInt32
+
+add Shops '{"_key":"くりこあん","tags":["たいやき","養殖"],"budget":180}'
+add Shops '{"_key":"なか一","tags":["季節料理"],"budget":800}'
+add Shops '{"_key":"魚寅食堂","tags":["漁師","季節料理"],"budget":750}'
+add Shops '{"_key":"DRAGON飯店","tags":["中華"],"budget":600}'
+add Shops '{"_key":"魚浜","tags":["回転寿司"],"budget":600}'
+add Shops '{"_key":"beanDaisy","tags":["caffe","カプチーノ"],"budget":650}'
+add Shops '{"_key":"維新","tags":["麺や"],"budget":800}'
+add Shops '{"_key":"ひづめ","tags":["とんかつ"],"budget":900}'
+add Shops '{"_key":"和互","tags":["魚"],"budget":1000}'
+group Shops tags
+output 2147483649 _key,_nsubrecs
+group Shops budget
+output 2147483650 _key,_nsubrecs
+filter_by_script Shops 'budget > 100'
+group 2147483652 budget --range_gap 100
+output 2147483651 _key,_nsubrecs
+group 2147483652 budget --range_gap 500
+output 2147483653 _key,_nsubrecs
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index