[Groonga-commit] groonga/groonga at f888887 [master] test logical_range_filter: add tests for between() by range-index/select

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jul 10 11:25:52 JST 2015


Kouhei Sutou	2015-07-10 11:25:52 +0900 (Fri, 10 Jul 2015)

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

  Message:
    test logical_range_filter: add tests for between() by range-index/select

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

  Added: test/command/suite/sharding/logical_range_filter/filter/between/range_index.expected (+76 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/between/range_index.expected    2015-07-10 11:25:52 +0900 (b27b223)
@@ -0,0 +1,76 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram
+[[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 action 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,action
+[[0,0.0,0.0],true]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+     "action": "Start"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+     "action": "Shutdown"
+}
+]
+[[0,0.0,0.0],4]
+log_level --level debug
+[[0,0.0,0.0],true]
+logical_range_filter Logs timestamp   --limit 1   --filter 'between(timestamp, "2015-02-05 13:50:00", "include", "2015-02-05 13:52:00", "exclude")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        "action",
+        "Text"
+      ],
+      [
+        "memo",
+        "ShortText"
+      ],
+      [
+        "timestamp",
+        "Time"
+      ]
+    ],
+    [
+      "Running",
+      "2015-02-05 13:50:00",
+      1423111800.0
+    ]
+  ]
+]
+#|d| [logical_range_filter][range-index] <Logs_20150205>: hit ratio (0.75=3/4)>= threshold (0.2)
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/sharding/logical_range_filter/filter/between/range_index.test (+50 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/between/range_index.test    2015-07-10 11:25:52 +0900 (d9a9bae)
@@ -0,0 +1,50 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram
+
+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 action 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,action
+
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+     "action": "Start"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+     "action": "Shutdown"
+}
+]
+
+#@add-important-log-levels debug
+log_level --level debug
+logical_range_filter Logs timestamp \
+  --limit 1 \
+  --filter 'between(timestamp, "2015-02-05 13:50:00", "include", "2015-02-05 13:52:00", "exclude")'
+log_level --level notice
+#@remove-important-log-levels debug

  Added: test/command/suite/sharding/logical_range_filter/filter/between/select.expected (+81 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/between/select.expected    2015-07-10 11:25:52 +0900 (3895a85)
@@ -0,0 +1,81 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram
+[[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 action 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,action
+[[0,0.0,0.0],true]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+     "action": "Start"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+     "action": "Shutdown"
+}
+]
+[[0,0.0,0.0],4]
+log_level --level debug
+[[0,0.0,0.0],true]
+logical_range_filter Logs timestamp   --limit -1   --filter 'between(timestamp, "2015-02-05 13:50:00", "include", "2015-02-05 13:52:00", "exclude")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        "action",
+        "Text"
+      ],
+      [
+        "memo",
+        "ShortText"
+      ],
+      [
+        "timestamp",
+        "Time"
+      ]
+    ],
+    [
+      "Running",
+      "2015-02-05 13:50:00",
+      1423111800.0
+    ],
+    [
+      "Running",
+      "2015-02-05 13:51:00",
+      1423111860.0
+    ]
+  ]
+]
+#|d| [logical_range_filter][select] <Logs_20150205>: limit is negative: <-1>
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/sharding/logical_range_filter/filter/between/select.test (+50 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_range_filter/filter/between/select.test    2015-07-10 11:25:52 +0900 (b3b21d4)
@@ -0,0 +1,50 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram
+
+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 action 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,action
+
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+       "memo": "2015-02-05 13:49:00",
+     "action": "Start"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+       "memo": "2015-02-05 13:50:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+       "memo": "2015-02-05 13:51:00",
+     "action": "Running"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+       "memo": "2015-02-05 13:52:00",
+     "action": "Shutdown"
+}
+]
+
+#@add-important-log-levels debug
+log_level --level debug
+logical_range_filter Logs timestamp \
+  --limit -1 \
+  --filter 'between(timestamp, "2015-02-05 13:50:00", "include", "2015-02-05 13:52:00", "exclude")'
+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