[Groonga-commit] groonga/groonga at 9e4ee90 [master] column_rename test: add

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Feb 12 17:39:00 JST 2014


Kouhei Sutou	2014-02-12 17:39:00 +0900 (Wed, 12 Feb 2014)

  New Revision: 9e4ee90bde5ef6ebd6046efb77860cdf85ce6cbd
  https://github.com/groonga/groonga/commit/9e4ee90bde5ef6ebd6046efb77860cdf85ce6cbd

  Message:
    column_rename test: add

  Added files:
    test/command/suite/column_rename/index/fulltext.actual
    test/command/suite/column_rename/index/fulltext.test
    test/command/suite/column_rename/index/multiple_columns.expected
    test/command/suite/column_rename/index/multiple_columns.test
    test/command/suite/column_rename/index/tag.expected
    test/command/suite/column_rename/index/tag.test
    test/command/suite/column_rename/scalar.expected
    test/command/suite/column_rename/scalar.test
    test/command/suite/column_rename/vector.expected
    test/command/suite/column_rename/vector.test

  Added: test/command/suite/column_rename/index/fulltext.actual (+63 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/index/fulltext.actual    2014-02-12 17:39:00 +0900 (1c835fe)
@@ -0,0 +1,63 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --normalizer NormalizerAuto   --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Terms memos_content COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga is fast."}
+]
+[[0,0.0,0.0],1]
+column_rename Terms memos_content memos_content_index
+[[0,0.0,0.0],true]
+dump
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+column_create Terms memos_content_index COLUMN_INDEX|WITH_POSITION Memos content
+load --table Memos
+[
+["_id","content"],
+[1,"Groonga is fast."]
+]
+load --table Terms
+[
+["_key"],
+["."],
+["fast"],
+["groonga"],
+["is"]
+]
+
+select Memos --query "content:@groonga"
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        "Groonga is fast."
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/column_rename/index/fulltext.test (+18 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/index/fulltext.test    2014-02-12 17:39:00 +0900 (6c1d1c0)
@@ -0,0 +1,18 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --normalizer NormalizerAuto \
+  --default_tokenizer TokenBigram
+column_create Terms memos_content COLUMN_INDEX|WITH_POSITION Memos content
+
+load --table Memos
+[
+{"content": "Groonga is fast."}
+]
+
+column_rename Terms memos_content memos_content_index
+
+dump
+
+select Memos --query "content:@groonga"

  Added: test/command/suite/column_rename/index/multiple_columns.expected (+71 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/index/multiple_columns.expected    2014-02-12 17:39:00 +0900 (e727c34)
@@ -0,0 +1,71 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos title COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --normalizer NormalizerAuto   --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Terms memos COLUMN_INDEX|WITH_SECTION|WITH_POSITION   Memos title,content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"title": "Groonga", "content": "Groonga is fast."}
+]
+[[0,0.0,0.0],1]
+column_rename Terms memos memos_index
+[[0,0.0,0.0],true]
+dump
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+column_create Memos title COLUMN_SCALAR ShortText
+table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+column_create Terms memos_index COLUMN_INDEX|WITH_SECTION|WITH_POSITION Memos title,content
+load --table Memos
+[
+["_id","content","title"],
+[1,"Groonga is fast.","Groonga"]
+]
+load --table Terms
+[
+["_key"],
+["."],
+["fast"],
+["groonga"],
+["is"]
+]
+
+select Memos --query "content:@groonga"
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "Text"
+        ],
+        [
+          "title",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "Groonga is fast.",
+        "Groonga"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/column_rename/index/multiple_columns.test (+20 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/index/multiple_columns.test    2014-02-12 17:39:00 +0900 (7414aef)
@@ -0,0 +1,20 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos title COLUMN_SCALAR ShortText
+column_create Memos content COLUMN_SCALAR Text
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --normalizer NormalizerAuto \
+  --default_tokenizer TokenBigram
+column_create Terms memos COLUMN_INDEX|WITH_SECTION|WITH_POSITION \
+  Memos title,content
+
+load --table Memos
+[
+{"title": "Groonga", "content": "Groonga is fast."}
+]
+
+column_rename Terms memos memos_index
+
+dump
+
+select Memos --query "content:@groonga"

  Added: test/command/suite/column_rename/index/tag.expected (+65 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/index/tag.expected    2014-02-12 17:39:00 +0900 (2663360)
@@ -0,0 +1,65 @@
+table_create Tags TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Memos TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Memos tag COLUMN_SCALAR Tags
+[[0,0.0,0.0],true]
+column_create Tags memos_tag COLUMN_INDEX Memos tag
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"_key": "Groonga is fast.", "tag": "groonga"}
+]
+[[0,0.0,0.0],1]
+column_rename Tags memos_tag memos_tag_index
+[[0,0.0,0.0],true]
+dump
+table_create Tags TABLE_PAT_KEY ShortText
+table_create Memos TABLE_HASH_KEY ShortText
+column_create Memos tag COLUMN_SCALAR Tags
+column_create Tags memos_tag_index COLUMN_INDEX Memos tag
+load --table Tags
+[
+["_key"],
+["groonga"]
+]
+load --table Memos
+[
+["_key","tag"],
+["Groonga is fast.","groonga"]
+]
+
+select Memos --query "tag:@groonga"
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "tag",
+          "Tags"
+        ]
+      ],
+      [
+        1,
+        "Groonga is fast.",
+        "groonga"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/column_rename/index/tag.test (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/index/tag.test    2014-02-12 17:39:00 +0900 (85e568e)
@@ -0,0 +1,17 @@
+table_create Tags TABLE_PAT_KEY ShortText
+
+table_create Memos TABLE_HASH_KEY ShortText
+column_create Memos tag COLUMN_SCALAR Tags
+
+column_create Tags memos_tag COLUMN_INDEX Memos tag
+
+load --table Memos
+[
+{"_key": "Groonga is fast.", "tag": "groonga"}
+]
+
+column_rename Tags memos_tag memos_tag_index
+
+dump
+
+select Memos --query "tag:@groonga"

  Added: test/command/suite/column_rename/scalar.expected (+45 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/scalar.expected    2014-02-12 17:39:00 +0900 (85cc785)
@@ -0,0 +1,45 @@
+table_create Users TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Users age COLUMN_SCALAR UInt8
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"_key": "alice", "age": 29}
+]
+[[0,0.0,0.0],1]
+column_rename Users age age_new
+[[0,0.0,0.0],true]
+select Users
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "age_new",
+          "UInt8"
+        ]
+      ],
+      [
+        1,
+        "alice",
+        29
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/column_rename/scalar.test (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/scalar.test    2014-02-12 17:39:00 +0900 (fed6140)
@@ -0,0 +1,11 @@
+table_create Users TABLE_HASH_KEY ShortText
+column_create Users age COLUMN_SCALAR UInt8
+
+load --table Users
+[
+{"_key": "alice", "age": 29}
+]
+
+column_rename Users age age_new
+
+select Users

  Added: test/command/suite/column_rename/vector.expected (+48 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/vector.expected    2014-02-12 17:39:00 +0900 (c9c4e43)
@@ -0,0 +1,48 @@
+table_create Items TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Items prices COLUMN_VECTOR UInt16
+[[0,0.0,0.0],true]
+load --table Items
+[
+{"_key": "Groogna book", "prices": [1029, 2029]}
+]
+[[0,0.0,0.0],1]
+column_rename Items prices new_prices
+[[0,0.0,0.0],true]
+select Items
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "new_prices",
+          "UInt16"
+        ]
+      ],
+      [
+        1,
+        "Groogna book",
+        [
+          1029,
+          2029
+        ]
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/column_rename/vector.test (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_rename/vector.test    2014-02-12 17:39:00 +0900 (5051a57)
@@ -0,0 +1,11 @@
+table_create Items TABLE_HASH_KEY ShortText
+column_create Items prices COLUMN_VECTOR UInt16
+
+load --table Items
+[
+{"_key": "Groogna book", "prices": [1029, 2029]}
+]
+
+column_rename Items prices new_prices
+
+select Items
-------------- next part --------------
HTML����������������������������...
Download 



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