[Groonga-commit] groonga/groonga at 620fc9b [master] logical_count: support month and day mixed shards

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jun 23 17:43:23 JST 2015


Kouhei Sutou	2015-06-23 17:43:23 +0900 (Tue, 23 Jun 2015)

  New Revision: 620fc9b9361541fb4cff9e15456df7c5ddf72665
  https://github.com/groonga/groonga/commit/620fc9b9361541fb4cff9e15456df7c5ddf72665

  Message:
    logical_count: support month and day mixed shards
    
    In the same month, month shard must have earlier records rather than day
    shards in the same month.
    
    OK:
    
      * XXX_201506   <- includes only 2015-06-01 and 2015-06-02 records
      * XXX_20150603 <- includes only 2015-06-03 records
      * XXX_20150604 <- includes only 2015-06-04 records
      * ...
    
    OK:
    
      * XXX_201506   <- includes only 2015-06-01 and 2015-06-03 12:00:00 records
      * XXX_20150603 <- includes only 2015-06-03 12:00:01 or older records
      * XXX_20150604 <- includes only 2015-06-04 records
      * ...
    
    NG:
    
      * XXX_201506   <- includes only 2015-06-01 and 2015-06-04 records
      * XXX_20150603 <- includes only 2015-06-03 records
      * XXX_20150604 <- includes only 2015-06-04 records
      * ...
    
    You can change to day shard mode from month shard mode in the next
    month.
    
    OK:
    
      * XXX_201506   <- Month shard mode
      * XXX_20150603 <- Change to day shard mode
      * XXX_20150604 <- Day shard mode
      * XXX_201507   <- Change to month shard mode
      * XXX_20150703 <- Change to day shard mode
      * ...
    
    But you can't change to month shard mode from day shard mode.
    
    NG:
    
      * XXX_201506   <- Month shard mode
      * XXX_20150603 <- Change to day shard mode
      * XXX_20150604 <- Day shard mode
      * XXX_201506   <- Changed to month shard mode: NG!
      * ...

  Added files:
    test/command/suite/sharding/logical_count/no_condition/range/month_day/all.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/all.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/max_exclude.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/max_exclude.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/max_include.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/max_include.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_exclude.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_exclude.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_include.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_include.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_exclude.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_exclude.test
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_include.expected
    test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_include.test
  Modified files:
    plugins/sharding/logical_enumerator.rb

  Modified: plugins/sharding/logical_enumerator.rb (+135 -21)
===================================================================
--- plugins/sharding/logical_enumerator.rb    2015-06-22 21:16:36 +0900 (1aeafef)
+++ plugins/sharding/logical_enumerator.rb    2015-06-23 17:43:23 +0900 (3593418)
@@ -20,15 +20,37 @@ module Groonga
 
       private
       def each_internal(order)
-        prefix = "#{@logical_table}_"
         context = Context.instance
-        context.database.each_table(:prefix => prefix,
-                                    :order_by => :key,
-                                    :order => order) do |table|
-          shard_range_raw = table.name[prefix.size..-1]
+        each_shard_with_around(order) do |prev_shard, current_shard, next_shard|
+          table = current_shard.table
+          shard_range_data = current_shard.range_data
+          shard_range = nil
 
-          next unless /\A(\d{4})(\d{2})(\d{2})\z/ =~ shard_range_raw
-          shard_range = ShardRange.new($1.to_i, $2.to_i, $3.to_i)
+          if shard_range_data.day.nil?
+            if order == :ascending
+              if next_shard
+                next_shard_range_data = next_shard.range_data
+              else
+                next_shard_range_data = nil
+              end
+            else
+              if prev_shard
+                next_shard_range_data = prev_shard.range_data
+              else
+                next_shard_range_data = nil
+              end
+            end
+            max_day = compute_month_shard_max_day(shard_range_data.year,
+                                                  shard_range_data.month,
+                                                  next_shard_range_data)
+            shard_range = MonthShardRange.new(shard_range_data.year,
+                                              shard_range_data.month,
+                                              max_day)
+          else
+            shard_range = DayShardRange.new(shard_range_data.year,
+                                            shard_range_data.month,
+                                            shard_range_data.day)
+          end
 
           physical_shard_key_name = "#{table.name}.#{@shard_key_name}"
           shard_key = context[physical_shard_key_name]
@@ -43,6 +65,36 @@ module Groonga
         end
       end
 
+      def each_shard_with_around(order)
+        context = Context.instance
+        prefix = "#{@logical_table}_"
+
+        shards = [nil]
+        context.database.each_table(:prefix => prefix,
+                                    :order_by => :key,
+                                    :order => order) do |table|
+          shard_range_raw = table.name[prefix.size..-1]
+
+          case shard_range_raw
+          when /\A(\d{4})(\d{2})\z/
+            shard_range_data = ShardRangeData.new($1.to_i, $2.to_i, nil)
+          when /\A(\d{4})(\d{2})(\d{2})\z/
+            shard_range_data = ShardRangeData.new($1.to_i, $2.to_i, $3.to_i)
+          else
+            next
+          end
+
+          shards << Shard.new(table, shard_range_data)
+          next if shards.size < 3
+          yield(*shards)
+          shards.shift
+        end
+
+        if shards.size == 2
+          yield(shards[0], shards[1], nil)
+        end
+      end
+
       private
       def initialize_parameters
         @logical_table = @input[:logical_table]
@@ -58,13 +110,84 @@ module Groonga
         @target_range = TargetRange.new(@command_name, @input)
       end
 
-      class ShardRange
+      def compute_month_shard_max_day(year, month, next_shard_range)
+        return nil if next_shard_range.nil?
+
+        return nil if month != next_shard_range.month
+
+        next_shard_range.day
+      end
+
+      class Shard
+        attr_reader :table, :range_data
+        def initialize(table, range_data)
+          @table = table
+          @range_data = range_data
+        end
+      end
+
+      class ShardRangeData
+        attr_reader :year, :month, :day
+        def initialize(year, month, day)
+          @year = year
+          @month = month
+          @day = day
+        end
+      end
+
+      class DayShardRange
         attr_reader :year, :month, :day
         def initialize(year, month, day)
           @year = year
           @month = month
           @day = day
         end
+
+        def least_over_time
+          Time.local(@year, @month, @day + 1)
+        end
+
+        def min_time
+          Time.local(@year, @month, @day)
+        end
+
+        def include?(time)
+          @year == time.year and
+            @month == time.month and
+            @day == time.day
+        end
+      end
+
+      class MonthShardRange
+        attr_reader :year, :month, :max_day
+        def initialize(year, month, max_day)
+          @year = year
+          @month = month
+          @max_day = max_day
+        end
+
+        def least_over_time
+          if @max_day.nil?
+            Time.local(@year, @month + 1, 1)
+          else
+            Time.local(@year, @month, @max_day + 1)
+          end
+        end
+
+        def min_time
+          Time.local(@year, @month, 1)
+        end
+
+        def include?(time)
+          return false unless @year == time.year
+          return false unless @month == time.month
+
+          if @max_day.nil?
+            true
+          else
+            time.day <= @max_day
+          end
+        end
       end
 
       class TargetRange
@@ -139,16 +262,11 @@ module Groonga
         end
 
         def in_min?(shard_range)
-          base_time = Time.local(shard_range.year,
-                                 shard_range.month,
-                                 shard_range.day + 1)
-          @min < base_time
+          @min < shard_range.least_over_time
         end
 
         def in_min_partial?(shard_range)
-          return false unles****@min***** == shard_range.year
-          return false unles****@min***** == shard_range.month
-          return false unles****@min***** == shard_range.day
+          return false unless shard_range.include?(@min)
 
           return true if @min_border == :exclude
 
@@ -159,9 +277,7 @@ module Groonga
         end
 
         def in_max?(shard_range)
-          max_base_time = Time.local(shard_range.year,
-                                     shard_range.month,
-                                     shard_range.day)
+          max_base_time = shard_range.min_time
           if @max_border == :include
             @max >= max_base_time
           else
@@ -170,9 +286,7 @@ module Groonga
         end
 
         def in_max_partial?(shard_range)
-          @max.year == shard_range.year and
-            @max.month == shard_range.month and
-            @max.day == shard_range.day
+          shard_range.include?(@max)
         end
       end
     end

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/all.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/all.expected    2015-06-23 17:43:23 +0900 (6076244)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp
+[[0,0.0,0.0],20]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/all.test (+60 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/all.test    2015-06-23 17:43:23 +0900 (dfe04f2)
@@ -0,0 +1,60 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/max_exclude.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/max_exclude.expected    2015-06-23 17:43:23 +0900 (236d6b6)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --max "2015-03-01 00:00:00"   --max_border "exclude"
+[[0,0.0,0.0],14]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/max_exclude.test (+62 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/max_exclude.test    2015-06-23 17:43:23 +0900 (900595e)
@@ -0,0 +1,62 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --max "2015-03-01 00:00:00" \
+  --max_border "exclude"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/max_include.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/max_include.expected    2015-06-23 17:43:23 +0900 (8bce05f)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --max "2015-03-01 00:00:00"   --max_border "include"
+[[0,0.0,0.0],15]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/max_include.test (+62 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/max_include.test    2015-06-23 17:43:23 +0900 (509b625)
@@ -0,0 +1,62 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --max "2015-03-01 00:00:00" \
+  --max_border "include"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude.expected    2015-06-23 17:43:23 +0900 (7de9428)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --min "2015-02-01 00:00:00"   --min_border "exclude"
+[[0,0.0,0.0],17]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude.test (+62 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude.test    2015-06-23 17:43:23 +0900 (4c65b15)
@@ -0,0 +1,62 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --min "2015-02-01 00:00:00" \
+  --min_border "exclude"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_exclude.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_exclude.expected    2015-06-23 17:43:23 +0900 (f357b70)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --min "2015-02-01 00:00:00"   --min_border "exclude"   --max "2015-03-01 00:00:00"   --max_border "exclude"
+[[0,0.0,0.0],11]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_exclude.test (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_exclude.test    2015-06-23 17:43:23 +0900 (6b99a85)
@@ -0,0 +1,64 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --min "2015-02-01 00:00:00" \
+  --min_border "exclude" \
+  --max "2015-03-01 00:00:00" \
+  --max_border "exclude"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_include.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_include.expected    2015-06-23 17:43:23 +0900 (2e4af7c)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --min "2015-02-01 00:00:00"   --min_border "exclude"   --max "2015-03-01 00:00:00"   --max_border "include"
+[[0,0.0,0.0],12]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_include.test (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_exclude_max_include.test    2015-06-23 17:43:23 +0900 (b0acd4d)
@@ -0,0 +1,64 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --min "2015-02-01 00:00:00" \
+  --min_border "exclude" \
+  --max "2015-03-01 00:00:00" \
+  --max_border "include"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include.expected    2015-06-23 17:43:23 +0900 (2a22dfa)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --min "2015-02-01 00:00:00"   --min_border "include"
+[[0,0.0,0.0],18]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include.test (+62 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include.test    2015-06-23 17:43:23 +0900 (cbc7daa)
@@ -0,0 +1,62 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --min "2015-02-01 00:00:00" \
+  --min_border "include"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_exclude.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_exclude.expected    2015-06-23 17:43:23 +0900 (a45cffb)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --min "2015-02-01 00:00:00"   --min_border "include"   --max "2015-03-01 00:00:00"   --max_border "exclude"
+[[0,0.0,0.0],12]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_exclude.test (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_exclude.test    2015-06-23 17:43:23 +0900 (8e87f2b)
@@ -0,0 +1,64 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --min "2015-02-01 00:00:00" \
+  --min_border "include" \
+  --max "2015-03-01 00:00:00" \
+  --max_border "exclude"

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_include.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_include.expected    2015-06-23 17:43:23 +0900 (e106f50)
@@ -0,0 +1,64 @@
+register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201501 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201502 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150202 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_20150228 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+table_create Logs_201503 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+[[0,0.0,0.0],3]
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+[[0,0.0,0.0],4]
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+[[0,0.0,0.0],5]
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+[[0,0.0,0.0],6]
+logical_count Logs timestamp   --min "2015-02-01 00:00:00"   --min_border "include"   --max "2015-03-01 00:00:00"   --max_border "include"
+[[0,0.0,0.0],13]

  Added: test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_include.test (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_condition/range/month_day/min_include_max_include.test    2015-06-23 17:43:23 +0900 (c351010)
@@ -0,0 +1,64 @@
+#@on-error omit
+register sharding
+#@on-error default
+
+table_create Logs_201501 TABLE_NO_KEY
+column_create Logs_201501 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201502 TABLE_NO_KEY
+column_create Logs_201502 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150202 TABLE_NO_KEY
+column_create Logs_20150202 timestamp COLUMN_SCALAR Time
+
+table_create Logs_20150228 TABLE_NO_KEY
+column_create Logs_20150228 timestamp COLUMN_SCALAR Time
+
+table_create Logs_201503 TABLE_NO_KEY
+column_create Logs_201503 timestamp COLUMN_SCALAR Time
+
+load --table Logs_201501
+[
+{"timestamp": "2015-01-31 12:49:00"},
+{"timestamp": "2015-01-31 23:59:59"}
+]
+
+load --table Logs_201502
+[
+{"timestamp": "2015-02-01 00:00:00"},
+{"timestamp": "2015-02-01 13:49:00"},
+{"timestamp": "2015-02-01 23:59:59"}
+]
+
+load --table Logs_20150202
+[
+{"timestamp": "2015-02-02 00:00:00"},
+{"timestamp": "2015-02-02 13:50:00"},
+{"timestamp": "2015-02-02 13:51:00"},
+{"timestamp": "2015-02-02 23:59:59"}
+]
+
+load --table Logs_20150228
+[
+{"timestamp": "2015-02-28 00:00:00"},
+{"timestamp": "2015-02-28 13:50:00"},
+{"timestamp": "2015-02-28 13:51:00"},
+{"timestamp": "2015-02-28 13:52:00"},
+{"timestamp": "2015-02-28 23:59:59"}
+]
+
+load --table Logs_201503
+[
+{"timestamp": "2015-03-01 00:00:00"},
+{"timestamp": "2015-03-02 00:00:00"},
+{"timestamp": "2015-03-03 00:00:00"},
+{"timestamp": "2015-03-04 00:00:00"},
+{"timestamp": "2015-03-05 00:00:00"},
+{"timestamp": "2015-03-06 00:00:00"}
+]
+
+logical_count Logs timestamp \
+  --min "2015-02-01 00:00:00" \
+  --min_border "include" \
+  --max "2015-03-01 00:00:00" \
+  --max_border "include"
-------------- next part --------------
HTML����������������������������...
Download 



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