[Groonga-commit] groonga/groonga at c453278 [master] logical_select: support --output_columns

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 29 22:59:29 JST 2015


Kouhei Sutou	2015-06-29 22:59:29 +0900 (Mon, 29 Jun 2015)

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

  Message:
    logical_select: support --output_columns

  Added files:
    test/command/suite/sharding/logical_select/output_columns/multiple.expected
    test/command/suite/sharding/logical_select/output_columns/multiple.test
    test/command/suite/sharding/logical_select/output_columns/single.expected
    test/command/suite/sharding/logical_select/output_columns/single.test
  Modified files:
    plugins/sharding/logical_select.rb

  Modified: plugins/sharding/logical_select.rb (+1 -0)
===================================================================
--- plugins/sharding/logical_select.rb    2015-06-29 22:54:39 +0900 (5a02a19)
+++ plugins/sharding/logical_select.rb    2015-06-29 22:59:29 +0900 (d1e37c9)
@@ -10,6 +10,7 @@ module Groonga
                  "max",
                  "max_border",
                  "filter",
+                 "output_columns",
                  "offset",
                  "limit",
                  "drilldown",

  Added: test/command/suite/sharding/logical_select/output_columns/multiple.expected (+154 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/output_columns/multiple.expected    2015-06-29 22:59:29 +0900 (853228f)
@@ -0,0 +1,154 @@
+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]
+table_create Times_20150203 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+[[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]
+table_create Times_20150204 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+[[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]
+table_create Times_20150205 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150205 timestamp_index COLUMN_INDEX Logs_20150205 timestamp
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59"
+}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00"
+}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00"
+}
+]
+[[0,0.0,0.0],4]
+logical_select Logs timestamp   --output_columns '_id, memo, timestamp'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        9
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "memo",
+          "ShortText"
+        ],
+        [
+          "timestamp",
+          "Time"
+        ]
+      ],
+      [
+        1,
+        "2015-02-03 12:49:00",
+        1422935340.0
+      ],
+      [
+        2,
+        "2015-02-03 23:59:59",
+        1422975599.0
+      ],
+      [
+        1,
+        "2015-02-04 00:00:00",
+        1422975600.0
+      ],
+      [
+        2,
+        "2015-02-04 13:49:00",
+        1423025340.0
+      ],
+      [
+        3,
+        "2015-02-04 13:50:00",
+        1423025400.0
+      ],
+      [
+        1,
+        "2015-02-05 13:49:00",
+        1423111740.0
+      ],
+      [
+        2,
+        "2015-02-05 13:50:00",
+        1423111800.0
+      ],
+      [
+        3,
+        "2015-02-05 13:51:00",
+        1423111860.0
+      ],
+      [
+        4,
+        "2015-02-05 13:52:00",
+        1423111920.0
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/sharding/logical_select/output_columns/multiple.test (+72 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/output_columns/multiple.test    2015-06-29 22:59:29 +0900 (2ff5759)
@@ -0,0 +1,72 @@
+#@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
+table_create Times_20150203 TABLE_PAT_KEY Time
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 memo COLUMN_SCALAR ShortText
+table_create Times_20150204 TABLE_PAT_KEY Time
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+
+table_create Logs_20150205 TABLE_NO_KEY
+column_create Logs_20150205 timestamp COLUMN_SCALAR Time
+column_create Logs_20150205 memo COLUMN_SCALAR ShortText
+table_create Times_20150205 TABLE_PAT_KEY Time
+column_create Times_20150205 timestamp_index COLUMN_INDEX Logs_20150205 timestamp
+
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59"
+}
+]
+
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00"
+}
+]
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00"
+}
+]
+
+logical_select Logs timestamp \
+  --output_columns '_id, memo, timestamp'

  Added: test/command/suite/sharding/logical_select/output_columns/single.expected (+128 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/output_columns/single.expected    2015-06-29 22:59:29 +0900 (5136cbd)
@@ -0,0 +1,128 @@
+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]
+table_create Times_20150203 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+[[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]
+table_create Times_20150204 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+[[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]
+table_create Times_20150205 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150205 timestamp_index COLUMN_INDEX Logs_20150205 timestamp
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59"
+}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00"
+}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00"
+}
+]
+[[0,0.0,0.0],4]
+logical_select Logs timestamp   --output_columns memo
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        9
+      ],
+      [
+        [
+          "memo",
+          "ShortText"
+        ]
+      ],
+      [
+        "2015-02-03 12:49:00"
+      ],
+      [
+        "2015-02-03 23:59:59"
+      ],
+      [
+        "2015-02-04 00:00:00"
+      ],
+      [
+        "2015-02-04 13:49:00"
+      ],
+      [
+        "2015-02-04 13:50:00"
+      ],
+      [
+        "2015-02-05 13:49:00"
+      ],
+      [
+        "2015-02-05 13:50:00"
+      ],
+      [
+        "2015-02-05 13:51:00"
+      ],
+      [
+        "2015-02-05 13:52:00"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/sharding/logical_select/output_columns/single.test (+72 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/output_columns/single.test    2015-06-29 22:59:29 +0900 (a0ce324)
@@ -0,0 +1,72 @@
+#@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
+table_create Times_20150203 TABLE_PAT_KEY Time
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 memo COLUMN_SCALAR ShortText
+table_create Times_20150204 TABLE_PAT_KEY Time
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+
+table_create Logs_20150205 TABLE_NO_KEY
+column_create Logs_20150205 timestamp COLUMN_SCALAR Time
+column_create Logs_20150205 memo COLUMN_SCALAR ShortText
+table_create Times_20150205 TABLE_PAT_KEY Time
+column_create Times_20150205 timestamp_index COLUMN_INDEX Logs_20150205 timestamp
+
+load --table Logs_20150203
+[
+{
+  "timestamp": "2015-02-03 12:49:00",
+  "memo":      "2015-02-03 12:49:00"
+},
+{
+  "timestamp": "2015-02-03 23:59:59",
+  "memo":      "2015-02-03 23:59:59"
+}
+]
+
+load --table Logs_20150204
+[
+{
+  "timestamp": "2015-02-04 00:00:00",
+  "memo":      "2015-02-04 00:00:00"
+},
+{
+  "timestamp": "2015-02-04 13:49:00",
+  "memo":      "2015-02-04 13:49:00"
+},
+{
+  "timestamp": "2015-02-04 13:50:00",
+  "memo":      "2015-02-04 13:50:00"
+}
+]
+
+load --table Logs_20150205
+[
+{
+  "timestamp": "2015-02-05 13:49:00",
+  "memo":      "2015-02-05 13:49:00"
+},
+{
+  "timestamp": "2015-02-05 13:50:00",
+  "memo":      "2015-02-05 13:50:00"
+},
+{
+  "timestamp": "2015-02-05 13:51:00",
+  "memo":      "2015-02-05 13:51:00"
+},
+{
+  "timestamp": "2015-02-05 13:52:00",
+  "memo":      "2015-02-05 13:52:00"
+}
+]
+
+logical_select Logs timestamp \
+  --output_columns memo
-------------- next part --------------
HTML����������������������������...
Download 



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