droonga-engine 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +7 -0
- data/Rakefile +6 -2
- data/bin/droonga-engine +2 -2
- data/bin/{droonga-catalog-generate → droonga-engine-catalog-generate} +15 -3
- data/bin/droonga-engine-serf-event-handler +20 -0
- data/bin/droonga-engine-service +2 -2
- data/doc/text/news.md +21 -1
- data/droonga-engine.gemspec +5 -2
- data/lib/droonga/catalog/collection_volume.rb +12 -0
- data/lib/droonga/catalog/dataset.rb +25 -0
- data/lib/droonga/catalog/single_volume.rb +10 -0
- data/lib/droonga/catalog/slice.rb +4 -0
- data/lib/droonga/catalog/version1.rb +59 -48
- data/lib/droonga/catalog/version2.rb +10 -20
- data/lib/droonga/catalog/volume_collection.rb +27 -4
- data/lib/droonga/catalog_generator.rb +12 -5
- data/lib/droonga/catalog_observer.rb +17 -35
- data/lib/droonga/command/droonga_engine.rb +436 -0
- data/lib/droonga/command/droonga_engine_service.rb +273 -0
- data/lib/droonga/command/serf_event_handler.rb +85 -0
- data/lib/droonga/dispatcher.rb +8 -8
- data/lib/droonga/engine.rb +90 -26
- data/lib/droonga/engine/version.rb +1 -1
- data/lib/droonga/engine_state.rb +29 -3
- data/lib/droonga/internal_fluent_message_receiver.rb +100 -0
- data/lib/droonga/live_nodes_list_loader.rb +48 -0
- data/lib/droonga/live_nodes_list_observer.rb +72 -0
- data/lib/droonga/path.rb +47 -0
- data/lib/droonga/plugins/dump.rb +279 -38
- data/lib/droonga/plugins/groonga/select.rb +26 -14
- data/lib/droonga/plugins/search.rb +30 -2
- data/lib/droonga/plugins/search/distributed_search_planner.rb +28 -11
- data/lib/droonga/processor.rb +4 -0
- data/lib/droonga/searcher.rb +26 -0
- data/lib/droonga/serf.rb +119 -0
- data/lib/droonga/serf_downloader.rb +90 -0
- data/lib/droonga/server.rb +2 -2
- data/lib/droonga/service_control_protocol.rb +26 -0
- data/sample/cluster/catalog.json +1 -1
- data/test/command/config/default/catalog.json +2 -2
- data/test/command/config/version1/catalog.json +1 -1
- data/test/command/fixture/documents.jsons +18 -18
- data/test/command/fixture/event.jsons +4 -4
- data/test/command/fixture/user-table-array.jsons +4 -4
- data/test/command/fixture/user-table.jsons +5 -5
- data/test/command/suite/add/dimension/column.catalog.json +1 -1
- data/test/command/suite/add/dimension/column.test +4 -4
- data/test/command/suite/add/dimension/integer.catalog.json +1 -1
- data/test/command/suite/add/dimension/integer.test +4 -4
- data/test/command/suite/add/error/invalid-integer.test +1 -1
- data/test/command/suite/add/error/invalid-time.test +1 -1
- data/test/command/suite/add/error/missing-key.test +1 -1
- data/test/command/suite/add/error/missing-table.test +1 -1
- data/test/command/suite/add/error/unknown-column.test +1 -1
- data/test/command/suite/add/error/unknown-table.test +1 -1
- data/test/command/suite/add/minimum.test +1 -1
- data/test/command/suite/add/vector/short_text.catalog.json +26 -0
- data/test/command/suite/add/vector/short_text.expected +42 -0
- data/test/command/suite/add/vector/short_text.test +35 -0
- data/test/command/suite/add/with-values.test +1 -1
- data/test/command/suite/add/without-key.test +1 -1
- data/test/command/suite/dump/column/index.catalog.json +40 -0
- data/test/command/suite/dump/column/index.expected +195 -0
- data/test/command/suite/dump/column/index.test +5 -0
- data/test/command/suite/dump/column/scalar.catalog.json +19 -0
- data/test/command/suite/dump/column/scalar.expected +99 -0
- data/test/command/suite/dump/column/scalar.test +5 -0
- data/test/command/suite/dump/column/vector.catalog.json +22 -0
- data/test/command/suite/dump/column/vector.expected +108 -0
- data/test/command/suite/dump/column/vector.test +5 -0
- data/test/command/suite/dump/record/vector/reference.catalog.json +27 -0
- data/test/command/suite/dump/record/vector/reference.expected +213 -0
- data/test/command/suite/dump/record/vector/reference.test +21 -0
- data/test/command/suite/dump/table/array.catalog.json +13 -0
- data/test/command/suite/dump/table/array.expected +63 -0
- data/test/command/suite/dump/table/array.test +5 -0
- data/test/command/suite/dump/table/double_array_trie.catalog.json +14 -0
- data/test/command/suite/dump/table/double_array_trie.expected +66 -0
- data/test/command/suite/dump/table/double_array_trie.test +5 -0
- data/test/command/suite/dump/table/hash.catalog.json +14 -0
- data/test/command/suite/dump/table/hash.expected +66 -0
- data/test/command/suite/dump/table/hash.test +5 -0
- data/test/command/suite/dump/table/patricia_trie.catalog.json +14 -0
- data/test/command/suite/dump/table/patricia_trie.expected +66 -0
- data/test/command/suite/dump/table/patricia_trie.test +5 -0
- data/test/command/suite/groonga/column_create/scalar.test +2 -2
- data/test/command/suite/groonga/column_create/unknown-table.test +1 -1
- data/test/command/suite/groonga/column_create/vector.test +2 -2
- data/test/command/suite/groonga/column_list/success.test +3 -3
- data/test/command/suite/groonga/column_list/unknown-table.test +1 -1
- data/test/command/suite/groonga/column_remove/success.test +3 -3
- data/test/command/suite/groonga/column_remove/unknown-column.test +2 -2
- data/test/command/suite/groonga/column_remove/unknown-table.test +1 -1
- data/test/command/suite/groonga/column_rename/success.test +3 -3
- data/test/command/suite/groonga/column_rename/unknown-column.test +2 -2
- data/test/command/suite/groonga/column_rename/unknown-table.test +1 -1
- data/test/command/suite/groonga/delete/duplicated-identifiers.test +2 -2
- data/test/command/suite/groonga/delete/filter.test +2 -2
- data/test/command/suite/groonga/delete/invalid-filter.test +1 -1
- data/test/command/suite/groonga/delete/no-identifier.test +2 -2
- data/test/command/suite/groonga/delete/success.test +2 -2
- data/test/command/suite/groonga/delete/unknown-table.test +1 -1
- data/test/command/suite/groonga/select/minimum.expected +24 -1
- data/test/command/suite/groonga/select/minimum.test +1 -1
- data/test/command/suite/groonga/select/type/time.catalog.json +19 -0
- data/test/command/suite/groonga/select/type/time.expected +37 -0
- data/test/command/suite/groonga/select/type/time.test +35 -0
- data/test/command/suite/groonga/table_create/array.test +1 -1
- data/test/command/suite/groonga/table_create/hash.test +1 -1
- data/test/command/suite/groonga/table_list/success.test +2 -2
- data/test/command/suite/groonga/table_remove/success.test +1 -1
- data/test/command/suite/groonga/table_remove/unknown-table.test +1 -1
- data/test/command/suite/message/error/unknown-type.expected +1 -1
- data/test/command/suite/message/error/unknown-type.test +1 -1
- data/test/command/suite/search/adjusters/multiple.catalog.json +1 -1
- data/test/command/suite/search/adjusters/multiple.test +3 -3
- data/test/command/suite/search/adjusters/one.catalog.json +1 -1
- data/test/command/suite/search/adjusters/one.test +3 -3
- data/test/command/suite/search/attributes/array.expected +7 -0
- data/test/command/suite/search/attributes/array.test +1 -1
- data/test/command/suite/search/attributes/hash.expected +18 -0
- data/test/command/suite/search/attributes/hash.test +1 -1
- data/test/command/suite/search/complex.expected +12 -0
- data/test/command/suite/search/complex.test +1 -1
- data/test/command/suite/search/condition/nested.catalog.json +37 -0
- data/test/command/suite/search/condition/nested.expected +7 -0
- data/test/command/suite/search/condition/nested.test +103 -2
- data/test/command/suite/search/condition/query.catalog.json +37 -0
- data/test/command/suite/search/condition/query.expected +7 -0
- data/test/command/suite/search/condition/query.test +103 -2
- data/test/command/suite/search/condition/query/nonexistent_column.catalog.json +1 -1
- data/test/command/suite/search/condition/query/nonexistent_column.test +2 -2
- data/test/command/suite/search/condition/query/syntax_error.catalog.json +1 -1
- data/test/command/suite/search/condition/query/syntax_error.test +2 -2
- data/test/command/suite/search/condition/script.catalog.json +37 -0
- data/test/command/suite/search/condition/script.expected +7 -0
- data/test/command/suite/search/condition/script.test +103 -2
- data/test/command/suite/search/error/cyclic-source.test +1 -1
- data/test/command/suite/search/error/deeply-cyclic-source.test +1 -1
- data/test/command/suite/search/error/missing-source-parameter.test +1 -1
- data/test/command/suite/search/error/no-query.test +1 -1
- data/test/command/suite/search/error/unknown-source.test +1 -1
- data/test/command/suite/search/group/count.test +1 -1
- data/test/command/suite/search/group/limit.test +1 -1
- data/test/command/suite/search/group/string.catalog.json +41 -0
- data/test/command/suite/search/group/string.expected +18 -18
- data/test/command/suite/search/group/string.test +67 -22
- data/test/command/suite/search/group/subrecord/with-sort.catalog.json +1 -1
- data/test/command/suite/search/group/subrecord/with-sort.test +5 -5
- data/test/command/suite/search/multiple/chained.catalog.json +37 -0
- data/test/command/suite/search/multiple/chained.expected +14 -0
- data/test/command/suite/search/multiple/chained.test +103 -2
- data/test/command/suite/search/multiple/parallel.expected +14 -0
- data/test/command/suite/search/multiple/parallel.test +1 -1
- data/test/command/suite/search/output/attributes/invalid.catalog.json +1 -1
- data/test/command/suite/search/output/attributes/invalid.test +2 -2
- data/test/command/suite/search/output/attributes/star.catalog.json +23 -0
- data/test/command/suite/search/output/attributes/star.expected +27 -0
- data/test/command/suite/search/output/attributes/star.test +32 -0
- data/test/command/suite/search/range/only-output.expected +7 -0
- data/test/command/suite/search/range/only-output.test +1 -1
- data/test/command/suite/search/range/only-sort.expected +7 -0
- data/test/command/suite/search/range/only-sort.test +1 -1
- data/test/command/suite/search/range/sort-and-output.expected +7 -0
- data/test/command/suite/search/range/sort-and-output.test +1 -1
- data/test/command/suite/search/range/too-large-output-offset.expected +8 -0
- data/test/command/suite/search/range/too-large-output-offset.test +1 -1
- data/test/command/suite/search/range/too-large-sort-offset.expected +8 -0
- data/test/command/suite/search/range/too-large-sort-offset.test +1 -1
- data/test/command/suite/search/response/elapsed_time.catalog.json +1 -1
- data/test/command/suite/search/response/elapsed_time.test +2 -2
- data/test/command/suite/search/response/records/value/time.expected +12 -0
- data/test/command/suite/search/response/records/value/time.test +1 -1
- data/test/command/suite/search/simple.expected +12 -0
- data/test/command/suite/search/simple.test +1 -1
- data/test/command/suite/search/sort/default-offset-limit.expected +7 -0
- data/test/command/suite/search/sort/default-offset-limit.test +1 -1
- data/test/command/suite/search/sort/invisible-column.expected +7 -0
- data/test/command/suite/search/sort/invisible-column.test +1 -1
- data/test/unit/catalog/test_collection_volume.rb +16 -0
- data/test/unit/catalog/test_dataset.rb +36 -0
- data/test/unit/catalog/test_single_volume.rb +9 -0
- data/test/unit/catalog/test_slice.rb +11 -0
- data/test/unit/catalog/test_version1.rb +7 -12
- data/test/unit/catalog/test_version2.rb +7 -0
- data/test/unit/catalog/test_volume_collection.rb +28 -0
- data/test/unit/fixtures/catalog/version1.json +10 -3
- data/test/unit/fixtures/catalog/version2.json +2 -2
- data/test/unit/plugins/groonga/select/test_adapter_output.rb +8 -14
- data/test/unit/plugins/groonga/test_column_create.rb +5 -5
- data/test/unit/plugins/groonga/test_column_remove.rb +2 -2
- data/test/unit/plugins/groonga/test_column_rename.rb +2 -2
- data/test/unit/plugins/groonga/test_delete.rb +2 -2
- data/test/unit/plugins/groonga/test_table_create.rb +9 -9
- data/test/unit/plugins/groonga/test_table_remove.rb +1 -1
- data/test/unit/test_catalog_generator.rb +1 -1
- data/test/unit/test_schema_applier.rb +2 -2
- data/test/unit/test_watch_schema.rb +4 -4
- metadata +241 -72
- data/lib/droonga/engine/command/droonga_engine.rb +0 -441
@@ -5,6 +5,18 @@
|
|
5
5
|
"body": {
|
6
6
|
"result": {
|
7
7
|
"count": 2,
|
8
|
+
"attributes": [
|
9
|
+
{
|
10
|
+
"name": "_key",
|
11
|
+
"type": "ShortText",
|
12
|
+
"vector": false
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "start",
|
16
|
+
"type": "Time",
|
17
|
+
"vector": false
|
18
|
+
}
|
19
|
+
],
|
8
20
|
"records": [
|
9
21
|
[
|
10
22
|
"Groonga Night 3",
|
@@ -100,4 +100,20 @@ class CatalogSingleVolumeTest < Test::Unit::TestCase
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
103
|
+
|
104
|
+
class NodesTest < self
|
105
|
+
def test_all_nodes
|
106
|
+
data = {
|
107
|
+
"slices" => [
|
108
|
+
{ "volume" => { "address" => "127.0.0.1:23003/droonga.000" } },
|
109
|
+
{ "volume" => { "address" => "127.0.0.1:23003/droonga.001" } },
|
110
|
+
{ "volume" => { "address" => "127.0.0.1:23004/droonga.100" } },
|
111
|
+
{ "volume" => { "address" => "127.0.0.1:23004/droonga.101" } },
|
112
|
+
],
|
113
|
+
}
|
114
|
+
volume = create_collection_volume(data)
|
115
|
+
assert_equal(["127.0.0.1:23003/droonga", "127.0.0.1:23004/droonga"],
|
116
|
+
volume.all_nodes)
|
117
|
+
end
|
118
|
+
end
|
103
119
|
end
|
@@ -101,4 +101,40 @@ class CatalogDatasetTest < Test::Unit::TestCase
|
|
101
101
|
dataset.replicas)
|
102
102
|
end
|
103
103
|
end
|
104
|
+
|
105
|
+
class NodesTest < self
|
106
|
+
def test_all_nodes
|
107
|
+
data = {
|
108
|
+
"replicas" => [
|
109
|
+
{
|
110
|
+
"dimension" =>"_key",
|
111
|
+
"slicer" =>"hash",
|
112
|
+
"slices" =>[
|
113
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23003/droonga.000" } },
|
114
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23004/droonga.001" } },
|
115
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23003/droonga.002" } },
|
116
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23005/droonga.003" } },
|
117
|
+
],
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"dimension" =>"_key",
|
121
|
+
"slicer" =>"hash",
|
122
|
+
"slices" =>[
|
123
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23004/droonga.000" } },
|
124
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23005/droonga.001" } },
|
125
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23003/droonga.002" } },
|
126
|
+
{ "volume" =>{ "address" =>"127.0.0.1:23004/droonga.003" } },
|
127
|
+
],
|
128
|
+
},
|
129
|
+
],
|
130
|
+
}
|
131
|
+
dataset = create_dataset(data)
|
132
|
+
assert_equal([
|
133
|
+
"127.0.0.1:23003/droonga",
|
134
|
+
"127.0.0.1:23004/droonga",
|
135
|
+
"127.0.0.1:23005/droonga",
|
136
|
+
],
|
137
|
+
dataset.all_nodes)
|
138
|
+
end
|
139
|
+
end
|
104
140
|
end
|
@@ -28,4 +28,13 @@ class CatalogSingleVolumeTest < Test::Unit::TestCase
|
|
28
28
|
assert_equal("127.0.0.1:10047/volume.000",
|
29
29
|
volume.address)
|
30
30
|
end
|
31
|
+
|
32
|
+
def test_all_nodes
|
33
|
+
data = {
|
34
|
+
"address" => "127.0.0.1:10047/volume.000",
|
35
|
+
}
|
36
|
+
volume = create_single_volume(data)
|
37
|
+
assert_equal(["127.0.0.1:10047/volume"],
|
38
|
+
volume.all_nodes)
|
39
|
+
end
|
31
40
|
end
|
@@ -88,5 +88,16 @@ class CatalogSliceTest < Test::Unit::TestCase
|
|
88
88
|
assert_equal("127.0.0.1:10047/volume.000",
|
89
89
|
slice.volume.address)
|
90
90
|
end
|
91
|
+
|
92
|
+
def test_all_nodes
|
93
|
+
data = {
|
94
|
+
"volume" => {
|
95
|
+
"address" => "127.0.0.1:10047/volume.000",
|
96
|
+
},
|
97
|
+
}
|
98
|
+
slice = create_slice(data)
|
99
|
+
assert_equal(["127.0.0.1:10047/volume"],
|
100
|
+
slice.all_nodes)
|
101
|
+
end
|
91
102
|
end
|
92
103
|
end
|
@@ -51,24 +51,12 @@ class CatalogVersion1Test < Test::Unit::TestCase
|
|
51
51
|
:plugins => ["for_dataset"],
|
52
52
|
:n_workers => 0
|
53
53
|
},
|
54
|
-
"localhost:23003/test.001" => {
|
55
|
-
:database => "#{base_path}/001/db",
|
56
|
-
:dataset => "Test",
|
57
|
-
:plugins => ["for_dataset"],
|
58
|
-
:n_workers => 0
|
59
|
-
},
|
60
54
|
"localhost:23003/test.002" => {
|
61
55
|
:database => "#{base_path}/002/db",
|
62
56
|
:dataset => "Test",
|
63
57
|
:plugins => ["for_dataset"],
|
64
58
|
:n_workers => 0
|
65
59
|
},
|
66
|
-
"localhost:23003/test.003" => {
|
67
|
-
:database => "#{base_path}/003/db",
|
68
|
-
:dataset => "Test",
|
69
|
-
:plugins => ["for_dataset"],
|
70
|
-
:n_workers => 0
|
71
|
-
},
|
72
60
|
},
|
73
61
|
partitions)
|
74
62
|
end
|
@@ -135,6 +123,13 @@ class CatalogVersion1Test < Test::Unit::TestCase
|
|
135
123
|
|
136
124
|
end
|
137
125
|
end
|
126
|
+
|
127
|
+
class NodesTest < self
|
128
|
+
def test_all_nodes
|
129
|
+
assert_equal(["localhost:23003/test", "localhost:23004/test"],
|
130
|
+
@catalog.all_nodes)
|
131
|
+
end
|
132
|
+
end
|
138
133
|
end
|
139
134
|
|
140
135
|
class DataSetTest < self
|
@@ -120,5 +120,12 @@ class CatalogVersion2Test < Test::Unit::TestCase
|
|
120
120
|
|
121
121
|
end
|
122
122
|
end
|
123
|
+
|
124
|
+
class NodesTest < self
|
125
|
+
def test_all_nodes
|
126
|
+
assert_equal(["localhost:23003/test", "localhost:23004/test"],
|
127
|
+
@catalog.all_nodes)
|
128
|
+
end
|
129
|
+
end
|
123
130
|
end
|
124
131
|
end
|
@@ -47,4 +47,32 @@ class CatalogVolumeCollectionTest < Test::Unit::TestCase
|
|
47
47
|
@collection.select(:all))
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
class NodesTest < self
|
52
|
+
def create_volume_collection(volumes)
|
53
|
+
volumes = volumes.collect do |volume|
|
54
|
+
create_single_volume(volume)
|
55
|
+
end
|
56
|
+
super(volumes)
|
57
|
+
end
|
58
|
+
|
59
|
+
def create_single_volume(data)
|
60
|
+
Droonga::Catalog::SingleVolume.new(data)
|
61
|
+
end
|
62
|
+
|
63
|
+
def setup
|
64
|
+
volumes = [
|
65
|
+
{ "address" => "volume1:10047/droonga.000" },
|
66
|
+
{ "address" => "volume1:10047/droonga.001" },
|
67
|
+
{ "address" => "volume2:10047/droonga.002" },
|
68
|
+
{ "address" => "volume2:10047/droonga.003" },
|
69
|
+
]
|
70
|
+
@collection = create_volume_collection(volumes)
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_all_nodes
|
74
|
+
assert_equal(["volume1:10047/droonga", "volume2:10047/droonga"],
|
75
|
+
@collection.all_nodes)
|
76
|
+
end
|
77
|
+
end
|
50
78
|
end
|
@@ -1,10 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"effective_date": "2013-09-01T00:00:00Z",
|
3
|
-
"zones": [
|
3
|
+
"zones": [
|
4
|
+
"localhost:23003/test",
|
5
|
+
"localhost:23004/test"
|
6
|
+
],
|
4
7
|
"farms": {
|
5
8
|
"localhost:23003/test": {
|
6
9
|
"device": ".",
|
7
10
|
"capacity": 10
|
11
|
+
},
|
12
|
+
"localhost:23004/test": {
|
13
|
+
"device": ".",
|
14
|
+
"capacity": 10
|
8
15
|
}
|
9
16
|
},
|
10
17
|
"datasets": {
|
@@ -21,7 +28,7 @@
|
|
21
28
|
"partitions": {
|
22
29
|
"2013-09-01": [
|
23
30
|
"localhost:23003/test.000",
|
24
|
-
"localhost:
|
31
|
+
"localhost:23004/test.001"
|
25
32
|
]
|
26
33
|
}
|
27
34
|
},
|
@@ -30,7 +37,7 @@
|
|
30
37
|
"partitions": {
|
31
38
|
"2013-09-01": [
|
32
39
|
"localhost:23003/test.002",
|
33
|
-
"localhost:
|
40
|
+
"localhost:23004/test.003"
|
34
41
|
]
|
35
42
|
}
|
36
43
|
}
|
@@ -127,11 +127,9 @@ class GroongaSelectAdapterOutputTest < Test::Unit::TestCase
|
|
127
127
|
[
|
128
128
|
[3],
|
129
129
|
headers,
|
130
|
-
[
|
131
|
-
|
132
|
-
|
133
|
-
[3, "a3", 30],
|
134
|
-
],
|
130
|
+
[1, "a1", 10],
|
131
|
+
[2, "a2", 20],
|
132
|
+
[3, "a3", 30],
|
135
133
|
],
|
136
134
|
],
|
137
135
|
]
|
@@ -178,19 +176,15 @@ class GroongaSelectAdapterOutputTest < Test::Unit::TestCase
|
|
178
176
|
[
|
179
177
|
[3],
|
180
178
|
headers,
|
181
|
-
[
|
182
|
-
|
183
|
-
|
184
|
-
["a3", 30],
|
185
|
-
],
|
179
|
+
["a1", 10],
|
180
|
+
["a2", 20],
|
181
|
+
["a3", 30],
|
186
182
|
],
|
187
183
|
[
|
188
184
|
[2],
|
189
185
|
headers,
|
190
|
-
[
|
191
|
-
|
192
|
-
["b2", 20],
|
193
|
-
],
|
186
|
+
["b1", 10],
|
187
|
+
["b2", 20],
|
194
188
|
],
|
195
189
|
],
|
196
190
|
]
|
@@ -57,7 +57,7 @@ class ColumnCreateTest < GroongaHandlerTest
|
|
57
57
|
process(:column_create,
|
58
58
|
{"table" => "Books", "name" => "title", "type" => "ShortText"})
|
59
59
|
assert_equal(<<-SCHEMA, dump)
|
60
|
-
table_create Books TABLE_HASH_KEY
|
60
|
+
table_create Books TABLE_HASH_KEY ShortText
|
61
61
|
column_create Books title COLUMN_SCALAR ShortText
|
62
62
|
SCHEMA
|
63
63
|
end
|
@@ -69,7 +69,7 @@ column_create Books title COLUMN_SCALAR ShortText
|
|
69
69
|
process(:column_create,
|
70
70
|
{"table" => "Books", "name" => "main_text", "type" => "LongText"})
|
71
71
|
assert_equal(<<-SCHEMA, dump)
|
72
|
-
table_create Books TABLE_HASH_KEY
|
72
|
+
table_create Books TABLE_HASH_KEY ShortText
|
73
73
|
column_create Books main_text COLUMN_SCALAR LongText
|
74
74
|
SCHEMA
|
75
75
|
end
|
@@ -99,7 +99,7 @@ column_create Books main_text COLUMN_SCALAR LongText
|
|
99
99
|
end
|
100
100
|
process(:column_create, request)
|
101
101
|
assert_equal(<<-EXPECTED, dump)
|
102
|
-
table_create Books TABLE_HASH_KEY
|
102
|
+
table_create Books TABLE_HASH_KEY ShortText
|
103
103
|
column_create Books title #{data[:flags]} ShortText
|
104
104
|
EXPECTED
|
105
105
|
end
|
@@ -128,7 +128,7 @@ column_create Books title #{data[:flags]} ShortText
|
|
128
128
|
}
|
129
129
|
process(:column_create, request)
|
130
130
|
assert_equal(<<-EXPECTED, dump)
|
131
|
-
table_create Books TABLE_HASH_KEY
|
131
|
+
table_create Books TABLE_HASH_KEY ShortText
|
132
132
|
column_create Books title COLUMN_SCALAR ShortText
|
133
133
|
|
134
134
|
column_create Books entry_title #{data[:flags]} Books title
|
@@ -160,7 +160,7 @@ column_create Books entry_title #{data[:flags]} Books title
|
|
160
160
|
}
|
161
161
|
process(:column_create, request)
|
162
162
|
assert_equal(<<-EXPECTED, dump)
|
163
|
-
table_create Books TABLE_HASH_KEY
|
163
|
+
table_create Books TABLE_HASH_KEY ShortText
|
164
164
|
column_create Books title COLUMN_SCALAR ShortText
|
165
165
|
|
166
166
|
column_create Books entry_title #{flags} Books title
|
@@ -77,7 +77,7 @@ class ColumnRemoveTest < GroongaHandlerTest
|
|
77
77
|
process(:column_remove,
|
78
78
|
{"table" => "Books", "name" => "title"})
|
79
79
|
assert_equal(<<-SCHEMA, dump)
|
80
|
-
table_create Books TABLE_HASH_KEY
|
80
|
+
table_create Books TABLE_HASH_KEY ShortText
|
81
81
|
SCHEMA
|
82
82
|
end
|
83
83
|
|
@@ -92,7 +92,7 @@ table_create Books TABLE_HASH_KEY --key_type ShortText
|
|
92
92
|
process(:column_remove,
|
93
93
|
{"table" => "Books", "name" => "title"})
|
94
94
|
assert_equal(<<-SCHEMA, dump)
|
95
|
-
table_create Books TABLE_HASH_KEY
|
95
|
+
table_create Books TABLE_HASH_KEY ShortText
|
96
96
|
SCHEMA
|
97
97
|
end
|
98
98
|
end
|