[Groonga-commit] groonga/groonga at 5fdc16c [master] logical_range_filter: add tests for suffix search by regexp by range-index/select

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jul 9 23:31:56 JST 2015


Kouhei Sutou	2015-07-09 23:31:56 +0900 (Thu, 09 Jul 2015)

  New Revision: 5fdc16c5cb93bca4585d9c01d029fea4ebb2c8a9
  https://github.com/groonga/groonga/commit/5fdc16c5cb93bca4585d9c01d029fea4ebb2c8a9

  Message:
    logical_range_filter: add tests for suffix search by regexp by range-index/select

  Added files:
    test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/range_index.expected
    test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/range_index.test
    test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/select.expected
    test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/select.test

  Added: test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/range_index.expected (+76 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/range_index.expected    2015-07-09 23:31:56 +0900 (afe452d)
@@ -0,0 +1,76 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenRegexp
+[[0,0.0,0.0],true]
+table_create Logs_20150205 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150205 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150205 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150205 comment COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create Timestamp_20150205 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp
+[[0,0.0,0.0],true]
+column_create Terms index_20150205 COLUMN_INDEX|WITH_POSITION|WITH_SECTION   Logs_20150205 memo,comment
+[[0,0.0,0.0],true]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+    "comment": "abc"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+    "comment": "cab"
+}
+]
+[[0,0.0,0.0],4]
+log_level --level debug
+[[0,0.0,0.0],true]
+logical_range_filter Logs timestamp   --limit 1   --filter 'comment @~ "ca\\\\z"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        "comment",
+        "Text"
+      ],
+      [
+        "memo",
+        "ShortText"
+      ],
+      [
+        "timestamp",
+        "Time"
+      ]
+    ],
+    [
+      "bca",
+      "2015-02-05 13:50:00",
+      1423111800.0
+    ]
+  ]
+]
+#|d| [logical_range_filter][range-index] <Logs_20150205>: hit ratio (1.75=7/4)>= threshold (0.2)
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/range_index.test (+50 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/range_index.test    2015-07-09 23:31:56 +0900 (59ffdf4)
@@ -0,0 +1,50 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenRegexp
+
+table_create Logs_20150205 TABLE_NO_KEY
+column_create Logs_20150205 timestamp COLUMN_SCALAR Time
+column_create Logs_20150205 memo COLUMN_SCALAR ShortText
+column_create Logs_20150205 comment COLUMN_SCALAR Text
+
+table_create Timestamp_20150205 TABLE_PAT_KEY Time
+column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp
+
+column_create Terms index_20150205 COLUMN_INDEX|WITH_POSITION|WITH_SECTION \
+  Logs_20150205 memo,comment
+
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+    "comment": "abc"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+    "comment": "cab"
+}
+]
+
+#@add-important-log-levels debug
+log_level --level debug
+logical_range_filter Logs timestamp \
+  --limit 1 \
+  --filter 'comment @~ "ca\\\\z"'
+log_level --level notice
+#@remove-important-log-levels debug

  Added: test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/select.expected (+81 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/select.expected    2015-07-09 23:31:56 +0900 (5dd948e)
@@ -0,0 +1,81 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenRegexp
+[[0,0.0,0.0],true]
+table_create Logs_20150205 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150205 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150205 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150205 comment COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create Timestamp_20150205 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp
+[[0,0.0,0.0],true]
+column_create Terms index_20150205 COLUMN_INDEX|WITH_POSITION|WITH_SECTION   Logs_20150205 memo,comment
+[[0,0.0,0.0],true]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+    "comment": "abc"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+    "comment": "cab"
+}
+]
+[[0,0.0,0.0],4]
+log_level --level debug
+[[0,0.0,0.0],true]
+logical_range_filter Logs timestamp   --limit 4   --filter 'comment @~ "ca\\\\z"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        "comment",
+        "Text"
+      ],
+      [
+        "memo",
+        "ShortText"
+      ],
+      [
+        "timestamp",
+        "Time"
+      ]
+    ],
+    [
+      "bca",
+      "2015-02-05 13:50:00",
+      1423111800.0
+    ],
+    [
+      "bca",
+      "2015-02-05 13:51:00",
+      1423111860.0
+    ]
+  ]
+]
+#|d| [logical_range_filter][select] <Logs_20150205>: the number of required records (4) >= the number of records in shard (4)
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/select.test (+50 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/regexp/suffix/select.test    2015-07-09 23:31:56 +0900 (4aff034)
@@ -0,0 +1,50 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenRegexp
+
+table_create Logs_20150205 TABLE_NO_KEY
+column_create Logs_20150205 timestamp COLUMN_SCALAR Time
+column_create Logs_20150205 memo COLUMN_SCALAR ShortText
+column_create Logs_20150205 comment COLUMN_SCALAR Text
+
+table_create Timestamp_20150205 TABLE_PAT_KEY Time
+column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp
+
+column_create Terms index_20150205 COLUMN_INDEX|WITH_POSITION|WITH_SECTION \
+  Logs_20150205 memo,comment
+
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+    "comment": "abc"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+    "comment": "bca"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+    "comment": "cab"
+}
+]
+
+#@add-important-log-levels debug
+log_level --level debug
+logical_range_filter Logs timestamp \
+  --limit 4 \
+  --filter 'comment @~ "ca\\\\z"'
+log_level --level notice
+#@remove-important-log-levels debug
-------------- next part --------------
HTML����������������������������...
Download 



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