[Groonga-commit] groonga/groonga at 5a8255b [master] logical_select test: add tests for labeled drilldown with sortby

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jul 7 16:39:02 JST 2015


Kouhei Sutou	2015-07-07 16:39:02 +0900 (Tue, 07 Jul 2015)

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

  Message:
    logical_select test: add tests for labeled drilldown with sortby

  Added files:
    test/command/suite/sharding/logical_select/drilldown/labeled/sortby/multiple.expected
    test/command/suite/sharding/logical_select/drilldown/labeled/sortby/multiple.test
    test/command/suite/sharding/logical_select/drilldown/labeled/sortby/offset_limit.expected
    test/command/suite/sharding/logical_select/drilldown/labeled/sortby/offset_limit.test

  Added: test/command/suite/sharding/logical_select/drilldown/labeled/sortby/multiple.expected (+177 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/drilldown/labeled/sortby/multiple.expected    2015-07-07 16:39:02 +0900 (2cdca5a)
@@ -0,0 +1,177 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_20150203 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150203 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150203 date COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150203 action COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150204 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150204 date COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150204 action COLUMN_SCALAR ShortText
+[[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 date COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150205 action COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00",
+  "date":      "2015-02-03",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59",
+  "date":      "2015-02-03",
+  "action":    "Shutdown"
+}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00",
+  "date":      "2015-02-04",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+}
+]
+[[0,0.0,0.0],4]
+logical_select Logs timestamp   --limit 0   --drilldown[action_date].keys action,date   --drilldown[action_date].output_columns _value.action,_value.date,_nsubrecs   --drilldown[action_date].sortby -_nsubrecs,_value.date,_value.action
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        9
+      ],
+      [
+        [
+          "action",
+          "ShortText"
+        ],
+        [
+          "date",
+          "ShortText"
+        ],
+        [
+          "memo",
+          "ShortText"
+        ],
+        [
+          "timestamp",
+          "Time"
+        ]
+      ]
+    ],
+    {
+      "action_date": [
+        [
+          5
+        ],
+        [
+          [
+            "action",
+            "ShortText"
+          ],
+          [
+            "date",
+            "ShortText"
+          ],
+          [
+            "_nsubrecs",
+            "Int32"
+          ]
+        ],
+        [
+          "Restart",
+          "2015-02-05",
+          4
+        ],
+        [
+          "Restart",
+          "2015-02-04",
+          2
+        ],
+        [
+          "Shutdown",
+          "2015-02-03",
+          1
+        ],
+        [
+          "Start",
+          "2015-02-03",
+          1
+        ],
+        [
+          "Start",
+          "2015-02-04",
+          1
+        ]
+      ]
+    }
+  ]
+]

  Added: test/command/suite/sharding/logical_select/drilldown/labeled/sortby/multiple.test (+93 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/drilldown/labeled/sortby/multiple.test    2015-07-07 16:39:02 +0900 (eb7c87e)
@@ -0,0 +1,93 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+column_create Logs_20150203 memo COLUMN_SCALAR ShortText
+column_create Logs_20150203 date COLUMN_SCALAR ShortText
+column_create Logs_20150203 action COLUMN_SCALAR ShortText
+
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 memo COLUMN_SCALAR ShortText
+column_create Logs_20150204 date COLUMN_SCALAR ShortText
+column_create Logs_20150204 action COLUMN_SCALAR ShortText
+
+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 date COLUMN_SCALAR ShortText
+column_create Logs_20150205 action COLUMN_SCALAR ShortText
+
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00",
+  "date":      "2015-02-03",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59",
+  "date":      "2015-02-03",
+  "action":    "Shutdown"
+}
+]
+
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00",
+  "date":      "2015-02-04",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+}
+]
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+}
+]
+
+logical_select Logs timestamp \
+  --limit 0 \
+  --drilldown[action_date].keys action,date \
+  --drilldown[action_date].output_columns _value.action,_value.date,_nsubrecs \
+  --drilldown[action_date].sortby -_nsubrecs,_value.date,_value.action

  Added: test/command/suite/sharding/logical_select/drilldown/labeled/sortby/offset_limit.expected (+157 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/drilldown/labeled/sortby/offset_limit.expected    2015-07-07 16:39:02 +0900 (f6bee3d)
@@ -0,0 +1,157 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_20150203 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150203 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150203 date COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150203 action COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150204 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150204 date COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150204 action COLUMN_SCALAR ShortText
+[[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 date COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Logs_20150205 action COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00",
+  "date":      "2015-02-03",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59",
+  "date":      "2015-02-03",
+  "action":    "Shutdown"
+}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00",
+  "date":      "2015-02-04",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+}
+]
+[[0,0.0,0.0],4]
+logical_select Logs timestamp   --limit 0   --drilldown[action_date].keys action,date   --drilldown[action_date].output_columns _value.action,_value.date,_nsubrecs   --drilldown[action_date].sortby _nsubrecs   --drilldown[action_date].offset 1   --drilldown[action_date].limit 1
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        9
+      ],
+      [
+        [
+          "action",
+          "ShortText"
+        ],
+        [
+          "date",
+          "ShortText"
+        ],
+        [
+          "memo",
+          "ShortText"
+        ],
+        [
+          "timestamp",
+          "Time"
+        ]
+      ]
+    ],
+    {
+      "action_date": [
+        [
+          5
+        ],
+        [
+          [
+            "action",
+            "ShortText"
+          ],
+          [
+            "date",
+            "ShortText"
+          ],
+          [
+            "_nsubrecs",
+            "Int32"
+          ]
+        ],
+        [
+          "Shutdown",
+          "2015-02-03",
+          1
+        ]
+      ]
+    }
+  ]
+]

  Added: test/command/suite/sharding/logical_select/drilldown/labeled/sortby/offset_limit.test (+95 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/drilldown/labeled/sortby/offset_limit.test    2015-07-07 16:39:02 +0900 (2aac95e)
@@ -0,0 +1,95 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+column_create Logs_20150203 memo COLUMN_SCALAR ShortText
+column_create Logs_20150203 date COLUMN_SCALAR ShortText
+column_create Logs_20150203 action COLUMN_SCALAR ShortText
+
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 memo COLUMN_SCALAR ShortText
+column_create Logs_20150204 date COLUMN_SCALAR ShortText
+column_create Logs_20150204 action COLUMN_SCALAR ShortText
+
+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 date COLUMN_SCALAR ShortText
+column_create Logs_20150205 action COLUMN_SCALAR ShortText
+
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00",
+  "date":      "2015-02-03",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59",
+  "date":      "2015-02-03",
+  "action":    "Shutdown"
+}
+]
+
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00",
+  "date":      "2015-02-04",
+  "action":    "Start"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00",
+  "date":      "2015-02-04",
+  "action":    "Restart"
+}
+]
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00",
+  "date":      "2015-02-05",
+  "action":    "Restart"
+}
+]
+
+logical_select Logs timestamp \
+  --limit 0 \
+  --drilldown[action_date].keys action,date \
+  --drilldown[action_date].output_columns _value.action,_value.date,_nsubrecs \
+  --drilldown[action_date].sortby _nsubrecs \
+  --drilldown[action_date].offset 1 \
+  --drilldown[action_date].limit 1
-------------- next part --------------
HTML����������������������������...
Download 



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