[Groonga-commit] groonga/groonga at d91ae73 [master] test: add test case when match_columns is changed

Back to archive index

Kentaro Hayashi null+****@clear*****
Mon Apr 17 12:05:20 JST 2017


Kentaro Hayashi	2017-04-17 12:05:20 +0900 (Mon, 17 Apr 2017)

  New Revision: d91ae73eae1fba9f55342f76e3b181d4020aae66
  https://github.com/groonga/groonga/commit/d91ae73eae1fba9f55342f76e3b181d4020aae66

  Merged decf1de: Merge pull request #651 from kenhys/test-cache-match-columns

  Message:
    test: add test case when match_columns is changed
    
    When the value of --match_columms parameter is changed, Groonga
    returns result without using cache.

  Added files:
    test/command/suite/sharding/logical_select/cache/match_columns.expected
    test/command/suite/sharding/logical_select/cache/match_columns.test

  Added: test/command/suite/sharding/logical_select/cache/match_columns.expected (+138 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/cache/match_columns.expected    2017-04-17 12:05:20 +0900 (7edee9e)
@@ -0,0 +1,138 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Memos_20170416 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos_20170416 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Memos_20170416 title COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+column_create Memos_20170416 content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create Memos_20170417 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos_20170417 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Memos_20170417 title COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+column_create Memos_20170417 content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+load --table Memos_20170416
+[
+{"timestamp": "2017/04/16 10:00:00", "title": "Easy PGroonga", "content": "PGroonga is fast and easy to use."},
+{"timestamp": "2017/04/16 11:00:00", "title": "Easy Rroonga", "content": "Rroonga is fast and easy to use."}
+]
+[[0,0.0,0.0],2]
+load --table Memos_20170417
+[
+{"timestamp": "2017/04/17 00:00:00", "title": "Easy Groonga", "content": "Groonga is fast."},
+{"timestamp": "2017/04/17 01:00:00", "title": "Easy Mroonga", "content": "Mroonga is fast and easy to use."}
+]
+[[0,0.0,0.0],2]
+logical_select Memos   --shard_key timestamp   --query easy   --match_columns 'title'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        4
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "Text"
+        ],
+        [
+          "timestamp",
+          "Time"
+        ],
+        [
+          "title",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        "PGroonga is fast and easy to use.",
+        1492304400.0,
+        "Easy PGroonga"
+      ],
+      [
+        2,
+        "Rroonga is fast and easy to use.",
+        1492308000.0,
+        "Easy Rroonga"
+      ],
+      [
+        1,
+        "Groonga is fast.",
+        1492354800.0,
+        "Easy Groonga"
+      ],
+      [
+        2,
+        "Mroonga is fast and easy to use.",
+        1492358400.0,
+        "Easy Mroonga"
+      ]
+    ]
+  ]
+]
+logical_select Memos   --shard_key timestamp   --query easy   --match_columns 'content'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        3
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "Text"
+        ],
+        [
+          "timestamp",
+          "Time"
+        ],
+        [
+          "title",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        "PGroonga is fast and easy to use.",
+        1492304400.0,
+        "Easy PGroonga"
+      ],
+      [
+        2,
+        "Rroonga is fast and easy to use.",
+        1492308000.0,
+        "Easy Rroonga"
+      ],
+      [
+        2,
+        "Mroonga is fast and easy to use.",
+        1492358400.0,
+        "Easy Mroonga"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/sharding/logical_select/cache/match_columns.test (+35 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/cache/match_columns.test    2017-04-17 12:05:20 +0900 (4b847b0)
@@ -0,0 +1,35 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Memos_20170416 TABLE_NO_KEY
+column_create Memos_20170416 timestamp COLUMN_SCALAR Time
+column_create Memos_20170416 title COLUMN_SCALAR Text
+column_create Memos_20170416 content COLUMN_SCALAR Text
+
+table_create Memos_20170417 TABLE_NO_KEY
+column_create Memos_20170417 timestamp COLUMN_SCALAR Time
+column_create Memos_20170417 title COLUMN_SCALAR Text
+column_create Memos_20170417 content COLUMN_SCALAR Text
+
+load --table Memos_20170416
+[
+{"timestamp": "2017/04/16 10:00:00", "title": "Easy PGroonga", "content": "PGroonga is fast and easy to use."},
+{"timestamp": "2017/04/16 11:00:00", "title": "Easy Rroonga", "content": "Rroonga is fast and easy to use."}
+]
+
+load --table Memos_20170417
+[
+{"timestamp": "2017/04/17 00:00:00", "title": "Easy Groonga", "content": "Groonga is fast."},
+{"timestamp": "2017/04/17 01:00:00", "title": "Easy Mroonga", "content": "Mroonga is fast and easy to use."}
+]
+
+logical_select Memos \
+  --shard_key timestamp \
+  --query easy \
+  --match_columns 'title'
+
+logical_select Memos \
+  --shard_key timestamp \
+  --query easy \
+  --match_columns 'content'
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index