Kouhei Sutou
null+****@clear*****
Thu Mar 16 15:17:47 JST 2017
Kouhei Sutou 2017-03-16 15:17:47 +0900 (Thu, 16 Mar 2017) New Revision: 6b19d47adefff9f19074981b7890e29903a97b9f https://github.com/groonga/groonga/commit/6b19d47adefff9f19074981b7890e29903a97b9f Message: logical_select: fix too much close problem Added files: test/command/suite/sharding/logical_select/columns/stage/initial/no_condition.expected test/command/suite/sharding/logical_select/columns/stage/initial/no_condition.test Modified files: plugins/sharding/logical_select.rb Modified: plugins/sharding/logical_select.rb (+1 -0) =================================================================== --- plugins/sharding/logical_select.rb 2017-03-16 14:48:33 +0900 (941e3b2) +++ plugins/sharding/logical_select.rb 2017-03-16 15:17:47 +0900 (216bf74) @@ -771,6 +771,7 @@ module Groonga def filter_shard_all(expression_builder) if****@query*****? and****@filte*****? add_result_set(@target_table, nil) + @context.temporary_tables.delete(@target_table) else filter_table do |expression| expression_builder.build_all(expression) Added: test/command/suite/sharding/logical_select/columns/stage/initial/no_condition.expected (+87 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_select/columns/stage/initial/no_condition.expected 2017-03-16 15:17:47 +0900 (b7c2be0) @@ -0,0 +1,87 @@ +plugin_register sharding +[[0,0.0,0.0],true] +table_create Logs_20170315 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20170315 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20170315 price COLUMN_SCALAR UInt32 +[[0,0.0,0.0],true] +table_create Logs_20170316 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20170316 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20170316 price COLUMN_SCALAR UInt32 +[[0,0.0,0.0],true] +table_create Logs_20170317 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20170317 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20170317 price COLUMN_SCALAR UInt32 +[[0,0.0,0.0],true] +load --table Logs_20170315 +[ +{"timestamp": "2017/03/15 00:00:00", "price": 1000}, +{"timestamp": "2017/03/15 01:00:00", "price": 900} +] +[[0,0.0,0.0],2] +load --table Logs_20170316 +[ +{"timestamp": "2017/03/16 10:00:00", "price": 520}, +{"timestamp": "2017/03/16 11:00:00", "price": 510} +] +[[0,0.0,0.0],2] +load --table Logs_20170317 +[ +{"timestamp": "2017/03/17 20:00:00", "price": 500}, +{"timestamp": "2017/03/17 20:00:00", "price": 300} +] +[[0,0.0,0.0],2] +logical_select Logs --shard_key timestamp --columns[price_with_tax].stage initial --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --output_columns price,price_with_tax +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 6 + ], + [ + [ + "price", + "UInt32" + ], + [ + "price_with_tax", + "UInt32" + ] + ], + [ + 1000, + 1080 + ], + [ + 900, + 972 + ], + [ + 520, + 561 + ], + [ + 510, + 550 + ], + [ + 500, + 540 + ], + [ + 300, + 324 + ] + ] + ] +] Added: test/command/suite/sharding/logical_select/columns/stage/initial/no_condition.test (+41 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_select/columns/stage/initial/no_condition.test 2017-03-16 15:17:47 +0900 (252edd0) @@ -0,0 +1,41 @@ +#@on-error omit +plugin_register sharding +#@on-error default + +table_create Logs_20170315 TABLE_NO_KEY +column_create Logs_20170315 timestamp COLUMN_SCALAR Time +column_create Logs_20170315 price COLUMN_SCALAR UInt32 + +table_create Logs_20170316 TABLE_NO_KEY +column_create Logs_20170316 timestamp COLUMN_SCALAR Time +column_create Logs_20170316 price COLUMN_SCALAR UInt32 + +table_create Logs_20170317 TABLE_NO_KEY +column_create Logs_20170317 timestamp COLUMN_SCALAR Time +column_create Logs_20170317 price COLUMN_SCALAR UInt32 + +load --table Logs_20170315 +[ +{"timestamp": "2017/03/15 00:00:00", "price": 1000}, +{"timestamp": "2017/03/15 01:00:00", "price": 900} +] + +load --table Logs_20170316 +[ +{"timestamp": "2017/03/16 10:00:00", "price": 520}, +{"timestamp": "2017/03/16 11:00:00", "price": 510} +] + +load --table Logs_20170317 +[ +{"timestamp": "2017/03/17 20:00:00", "price": 500}, +{"timestamp": "2017/03/17 20:00:00", "price": 300} +] + +logical_select Logs \ + --shard_key timestamp \ + --columns[price_with_tax].stage initial \ + --columns[price_with_tax].type UInt32 \ + --columns[price_with_tax].flags COLUMN_SCALAR \ + --columns[price_with_tax].value 'price * 1.08' \ + --output_columns price,price_with_tax -------------- next part -------------- HTML����������������������������... ダウンロード