[Groonga-commit] groonga/groonga [master] Add min() function

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Sep 23 18:03:27 JST 2012


Kouhei Sutou	2012-09-23 18:03:27 +0900 (Sun, 23 Sep 2012)

  New Revision: 904916edcd21dc5924f3026fdd274e806ec5b95f
  https://github.com/groonga/groonga/commit/904916edcd21dc5924f3026fdd274e806ec5b95f

  Log:
    Add min() function

  Added files:
    test/function/suite/select/function/min/mix_float.expected
    test/function/suite/select/function/min/mix_float.test
    test/function/suite/select/function/min/mix_int.expected
    test/function/suite/select/function/min/mix_int.test
    test/function/suite/select/function/min/mix_time.expected
    test/function/suite/select/function/min/mix_time.test
    test/function/suite/select/function/min/no_argument.expected
    test/function/suite/select/function/min/no_argument.test
    test/function/suite/select/function/min/one_argument_float.expected
    test/function/suite/select/function/min/one_argument_float.test
    test/function/suite/select/function/min/one_argument_int16.expected
    test/function/suite/select/function/min/one_argument_int16.test
    test/function/suite/select/function/min/one_argument_int32.expected
    test/function/suite/select/function/min/one_argument_int32.test
    test/function/suite/select/function/min/one_argument_int64.expected
    test/function/suite/select/function/min/one_argument_int64.test
    test/function/suite/select/function/min/one_argument_int8.expected
    test/function/suite/select/function/min/one_argument_int8.test
    test/function/suite/select/function/min/one_argument_time.expected
    test/function/suite/select/function/min/one_argument_time.test
    test/function/suite/select/function/min/one_argument_uint16.expected
    test/function/suite/select/function/min/one_argument_uint16.test
    test/function/suite/select/function/min/one_argument_uint32.expected
    test/function/suite/select/function/min/one_argument_uint32.test
    test/function/suite/select/function/min/one_argument_uint64.expected
    test/function/suite/select/function/min/one_argument_uint64.test
    test/function/suite/select/function/min/one_argument_uint8.expected
    test/function/suite/select/function/min/one_argument_uint8.test
  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+101 -0)
===================================================================
--- lib/proc.c    2012-09-23 11:10:12 +0900 (7bce244)
+++ lib/proc.c    2012-09-23 18:03:27 +0900 (984106b)
@@ -2601,6 +2601,10 @@ is_comparable_number_type(grn_id type)
 static inline grn_id
 larger_number_type(grn_id type1, grn_id type2)
 {
+  if (type1 == type2) {
+    return type1;
+  }
+
   switch (type1) {
   case GRN_DB_TIME :
     return type1;
@@ -2619,6 +2623,46 @@ larger_number_type(grn_id type1, grn_id type2)
   }
 }
 
+static inline grn_id
+smaller_number_type(grn_id type1, grn_id type2)
+{
+  if (type1 == type2) {
+    return type1;
+  }
+
+  switch (type1) {
+  case GRN_DB_TIME :
+    return type1;
+  case GRN_DB_FLOAT :
+    if (type2 == GRN_DB_TIME) {
+      return type2;
+    } else {
+      return type1;
+    }
+  default :
+    {
+      grn_id smaller_number_type;
+      if (type2 > type1) {
+        smaller_number_type = type2;
+      } else {
+        smaller_number_type = type1;
+      }
+      switch (smaller_number_type) {
+      case GRN_DB_UINT8 :
+        return GRN_DB_INT8;
+      case GRN_DB_UINT16 :
+        return GRN_DB_INT16;
+      case GRN_DB_UINT32 :
+        return GRN_DB_INT32;
+      case GRN_DB_UINT64 :
+        return GRN_DB_INT64;
+      default :
+        return smaller_number_type;
+      }
+    }
+  }
+}
+
 static inline grn_bool
 is_negative_value(grn_obj *number)
 {
@@ -2795,6 +2839,61 @@ func_max(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
 }
 
 static grn_obj *
+func_min(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
+{
+  grn_obj *min;
+  grn_id cast_type = GRN_DB_INT8;
+  grn_obj casted_min, casted_number;
+  int i;
+
+  min = GRN_PROC_ALLOC(GRN_DB_VOID, 0);
+  if (!min) {
+    return min;
+  }
+
+  GRN_VOID_INIT(&casted_min);
+  GRN_VOID_INIT(&casted_number);
+  for (i = 0; i < nargs; i++) {
+    grn_obj *number = args[i];
+    grn_id domain = number->header.domain;
+    if (!is_comparable_number_type(domain)) {
+      continue;
+    }
+    cast_type = smaller_number_type(cast_type, domain);
+    if (!number_safe_cast(ctx, number, &casted_number, cast_type)) {
+      continue;
+    }
+    if (min->header.domain == GRN_DB_VOID) {
+      grn_obj_reinit(ctx, min, cast_type, 0);
+      GRN_TEXT_SET(ctx, min,
+                   GRN_TEXT_VALUE(&casted_number),
+                   GRN_TEXT_LEN(&casted_number));
+      continue;
+    }
+
+    if (min->header.domain != cast_type) {
+      if (!number_safe_cast(ctx, min, &casted_min, cast_type)) {
+        continue;
+      }
+      grn_obj_reinit(ctx, min, cast_type, 0);
+      GRN_TEXT_SET(ctx, min,
+                   GRN_TEXT_VALUE(&casted_min),
+                   GRN_TEXT_LEN(&casted_min));
+    }
+    if (compare_number(ctx, &casted_number, min, cast_type) < 0) {
+      grn_obj_reinit(ctx, min, cast_type, 0);
+      GRN_TEXT_SET(ctx, min,
+                   GRN_TEXT_VALUE(&casted_number),
+                   GRN_TEXT_LEN(&casted_number));
+    }
+  }
+  GRN_OBJ_FIN(ctx, &casted_min);
+  GRN_OBJ_FIN(ctx, &casted_number);
+
+  return min;
+}
+
+static grn_obj *
 func_geo_in_circle(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
 {
   grn_obj *obj;
@@ -3099,6 +3198,8 @@ grn_db_init_builtin_query(grn_ctx *ctx)
 
   grn_proc_create(ctx, "max", 3, GRN_PROC_FUNCTION, func_max,
                   NULL, NULL, 0, vars);
+  grn_proc_create(ctx, "min", 3, GRN_PROC_FUNCTION, func_min,
+                  NULL, NULL, 0, vars);
 
   {
     grn_obj *selector_proc;

  Added: test/function/suite/select/function/min/mix_float.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/mix_float.expected    2012-09-23 18:03:27 +0900 (ed2f92d)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values output COLUMN_SCALAR Float
+[[0,0.0,0.0],true]
+load --table Values
+[
+[]
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,output'   --scorer 'output = min(-29.29, -2929.29, 29.29)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["output","Float"]],[1,-2929.29]]]]

  Added: test/function/suite/select/function/min/mix_float.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/mix_float.test    2012-09-23 18:03:27 +0900 (1ac7193)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values output COLUMN_SCALAR Float
+
+load --table Values
+[
+[]
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,output' \
+  --scorer 'output = min(-29.29, -2929.29, 29.29)'

  Added: test/function/suite/select/function/min/mix_int.expected (+25 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/mix_int.expected    2012-09-23 18:03:27 +0900 (50280bd)
@@ -0,0 +1,25 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values int8_value COLUMN_SCALAR Int8
+[[0,0.0,0.0],true]
+column_create Values uint8_value COLUMN_SCALAR UInt8
+[[0,0.0,0.0],true]
+column_create Values int16_value COLUMN_SCALAR Int16
+[[0,0.0,0.0],true]
+column_create Values uint16_value COLUMN_SCALAR UInt16
+[[0,0.0,0.0],true]
+column_create Values int32_value COLUMN_SCALAR Int32
+[[0,0.0,0.0],true]
+column_create Values uint32_value COLUMN_SCALAR UInt32
+[[0,0.0,0.0],true]
+column_create Values int64_value COLUMN_SCALAR Int64
+[[0,0.0,0.0],true]
+column_create Values uint64_value COLUMN_SCALAR UInt64
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"int8_value":-8, "uint8_value": 8, "int16_value":-16, "uint16_value": 16, "int32_value":-32, "uint32_value": 32, "int64_value":-64, "uint64_value": 64}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(int8_value, uint8_value, int16_value, uint16_value, int32_value, uint32_value, int64_value, uint64_value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,-64]]]]

  Added: test/function/suite/select/function/min/mix_int.test (+19 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/mix_int.test    2012-09-23 18:03:27 +0900 (4013fac)
@@ -0,0 +1,19 @@
+table_create Values TABLE_NO_KEY
+column_create Values int8_value COLUMN_SCALAR Int8
+column_create Values uint8_value COLUMN_SCALAR UInt8
+column_create Values int16_value COLUMN_SCALAR Int16
+column_create Values uint16_value COLUMN_SCALAR UInt16
+column_create Values int32_value COLUMN_SCALAR Int32
+column_create Values uint32_value COLUMN_SCALAR UInt32
+column_create Values int64_value COLUMN_SCALAR Int64
+column_create Values uint64_value COLUMN_SCALAR UInt64
+
+load --table Values
+[
+{"int8_value":-8, "uint8_value": 8, "int16_value":-16, "uint16_value": 16, "int32_value":-32, "uint32_value": 32, "int64_value":-64, "uint64_value": 64}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(int8_value, uint8_value, int16_value, uint16_value, int32_value, uint32_value, int64_value, uint64_value)'

  Added: test/function/suite/select/function/min/mix_time.expected (+40 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/mix_time.expected    2012-09-23 18:03:27 +0900 (d3ebe61)
@@ -0,0 +1,40 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values time_value COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Values output COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"time_value":-1348322135.12666}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,output'   --scorer 'output = min(29, time_value, 29.29)'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "output",
+          "Time"
+        ]
+      ],
+      [
+        1,
+        -1348322135.12666
+      ]
+    ]
+  ]
+]

  Added: test/function/suite/select/function/min/mix_time.test (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/mix_time.test    2012-09-23 18:03:27 +0900 (87aa0ad)
@@ -0,0 +1,13 @@
+table_create Values TABLE_NO_KEY
+column_create Values time_value COLUMN_SCALAR Time
+column_create Values output COLUMN_SCALAR Time
+
+load --table Values
+[
+{"time_value":-1348322135.12666}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,output' \
+  --scorer 'output = min(29, time_value, 29.29)'

  Added: test/function/suite/select/function/min/no_argument.expected (+9 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/no_argument.expected    2012-09-23 18:03:27 +0900 (0611f67)
@@ -0,0 +1,9 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+load --table Values
+[
+[]
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min()'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,0]]]]

  Added: test/function/suite/select/function/min/no_argument.test (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/no_argument.test    2012-09-23 18:03:27 +0900 (15c53a9)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+
+load --table Values
+[
+[]
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min()'

  Added: test/function/suite/select/function/min/one_argument_float.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_float.expected    2012-09-23 18:03:27 +0900 (7cad04d)
@@ -0,0 +1,13 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR Float
+[[0,0.0,0.0],true]
+column_create Values output COLUMN_SCALAR Float
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":-1.1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,output'   --scorer 'output = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["output","Float"]],[1,-1.1]]]]

  Added: test/function/suite/select/function/min/one_argument_float.test (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_float.test    2012-09-23 18:03:27 +0900 (88f32ac)
@@ -0,0 +1,13 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR Float
+column_create Values output COLUMN_SCALAR Float
+
+load --table Values
+[
+{"value":-1.1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,output' \
+  --scorer 'output = min(value)'

  Added: test/function/suite/select/function/min/one_argument_int16.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int16.expected    2012-09-23 18:03:27 +0900 (b7830d5)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR Int16
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":-1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,-1]]]]

  Added: test/function/suite/select/function/min/one_argument_int16.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int16.test    2012-09-23 18:03:27 +0900 (e572ca9)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR Int16
+
+load --table Values
+[
+{"value":-1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_int32.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int32.expected    2012-09-23 18:03:27 +0900 (6377db5)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR Int32
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":-1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,-1]]]]

  Added: test/function/suite/select/function/min/one_argument_int32.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int32.test    2012-09-23 18:03:27 +0900 (b962846)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR Int32
+
+load --table Values
+[
+{"value":-1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_int64.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int64.expected    2012-09-23 18:03:27 +0900 (3a11092)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR Int64
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":-1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,-1]]]]

  Added: test/function/suite/select/function/min/one_argument_int64.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int64.test    2012-09-23 18:03:27 +0900 (6b3451e)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR Int64
+
+load --table Values
+[
+{"value":-1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_int8.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int8.expected    2012-09-23 18:03:27 +0900 (c171a5c)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR Int8
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":-1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,-1]]]]

  Added: test/function/suite/select/function/min/one_argument_int8.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_int8.test    2012-09-23 18:03:27 +0900 (af927b5)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR Int8
+
+load --table Values
+[
+{"value":-1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_time.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_time.expected    2012-09-23 18:03:27 +0900 (2068f1c)
@@ -0,0 +1,13 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Values output COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":1348322135.12666}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,output'   --scorer 'output = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["output","Time"]],[1,1348322135.12666]]]]

  Added: test/function/suite/select/function/min/one_argument_time.test (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_time.test    2012-09-23 18:03:27 +0900 (57baf1e)
@@ -0,0 +1,13 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR Time
+column_create Values output COLUMN_SCALAR Time
+
+load --table Values
+[
+{"value":1348322135.12666}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,output' \
+  --scorer 'output = min(value)'

  Added: test/function/suite/select/function/min/one_argument_uint16.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint16.expected    2012-09-23 18:03:27 +0900 (5176c56)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR UInt16
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,1]]]]

  Added: test/function/suite/select/function/min/one_argument_uint16.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint16.test    2012-09-23 18:03:27 +0900 (9e5b6c8)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR UInt16
+
+load --table Values
+[
+{"value":1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_uint32.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint32.expected    2012-09-23 18:03:27 +0900 (160d942)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR UInt32
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,1]]]]

  Added: test/function/suite/select/function/min/one_argument_uint32.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint32.test    2012-09-23 18:03:27 +0900 (ac189a7)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR UInt32
+
+load --table Values
+[
+{"value":1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_uint64.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint64.expected    2012-09-23 18:03:27 +0900 (2ec9ee8)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR UInt64
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,1]]]]

  Added: test/function/suite/select/function/min/one_argument_uint64.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint64.test    2012-09-23 18:03:27 +0900 (f66123e)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR UInt64
+
+load --table Values
+[
+{"value":1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'

  Added: test/function/suite/select/function/min/one_argument_uint8.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint8.expected    2012-09-23 18:03:27 +0900 (dca3cef)
@@ -0,0 +1,11 @@
+table_create Values TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Values value COLUMN_SCALAR UInt8
+[[0,0.0,0.0],true]
+load --table Values
+[
+{"value":1}
+]
+[[0,0.0,0.0],1]
+select Values   --filter true   --output_columns '_id,_score'   --scorer '_score = min(value)'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_score","Int32"]],[1,1]]]]

  Added: test/function/suite/select/function/min/one_argument_uint8.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/function/min/one_argument_uint8.test    2012-09-23 18:03:27 +0900 (84e7fa1)
@@ -0,0 +1,12 @@
+table_create Values TABLE_NO_KEY
+column_create Values value COLUMN_SCALAR UInt8
+
+load --table Values
+[
+{"value":1}
+]
+
+select Values \
+  --filter true \
+  --output_columns '_id,_score' \
+  --scorer '_score = min(value)'
-------------- next part --------------
HTML����������������������������...
Descargar 



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