From 5233eb54c820e58c0c87bd8f9384265dcbf71f7c Mon Sep 17 00:00:00 2001 From: Gordon Guthrie Date: Fri, 30 Oct 2015 18:38:38 +0000 Subject: [PATCH] rejig of DDL to use double/sint64 and conform to key order --- tests/timeseries_util.erl | 35 ++++++++++------------------ tests/ts_A_put_pass_2.erl | 4 ++-- tests/ts_B_random_query_pass_eqc.erl | 6 ++--- tests/ts_api_util.erl | 4 ++-- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/tests/timeseries_util.erl b/tests/timeseries_util.erl index d41a6973..af34cdb0 100644 --- a/tests/timeseries_util.erl +++ b/tests/timeseries_util.erl @@ -197,9 +197,9 @@ get_ddl(docs) -> "myseries varchar not null, " ++ "time timestamp not null, " ++ "weather varchar not null, " ++ - "temperature float, " ++ - "PRIMARY KEY ((quantum(time, 15, 'm'), myfamily, myseries), " ++ - "time, myfamily, myseries))"; + "temperature double, " ++ + "PRIMARY KEY ((myfamily, myseries, quantum(time, 15, 'm')), " ++ + "myfamily, myseries, time))"; %% another valid DDL - one with all the good stuff like %% different types and optional blah-blah get_ddl(variety) -> @@ -207,14 +207,14 @@ get_ddl(variety) -> "myfamily varchar not null, " ++ "myseries varchar not null, " ++ "time timestamp not null, " ++ - "myint integer not null, " ++ - "myfloat float not null, " ++ + "myint sint64 not null, " ++ + "myfloat double not null, " ++ "mybool boolean not null, " ++ "mytimestamp timestamp not null, " ++ "myany any not null, " ++ - "myoptional integer, " ++ - "PRIMARY KEY ((quantum(time, 15, 'm'), myfamily, myseries), " ++ - "time, myfamily, myseries))"; + "myoptional sint64, " ++ + "PRIMARY KEY ((myfamily, myseries, quantum(time, 15, 'm')), " ++ + "myfamily, myseries, time))"; %% an invalid TS DDL becuz family and series not both in key get_ddl(shortkey_fail) -> _SQL = "CREATE TABLE GeoCheckin (" ++ @@ -222,7 +222,7 @@ get_ddl(shortkey_fail) -> "myseries varchar not null, " ++ "time timestamp not null, " ++ "weather varchar not null, " ++ - "temperature float, " ++ + "temperature double, " ++ "PRIMARY KEY ((quantum(time, 15, 'm'), myfamily), " ++ "time, myfamily))"; %% an invalid TS DDL becuz partition and local keys dont cover the same space @@ -232,20 +232,9 @@ get_ddl(splitkey_fail) -> "myseries varchar not null, " ++ "time timestamp not null, " ++ "weather varchar not null, " ++ - "temperature float, " ++ - "PRIMARY KEY ((quantum(time, 15, 'm'), myfamily, myseries), " ++ - "time, myfamily, myseries, temperature))"; -%% another invalid TS DDL because family/series must be varchar -%% or is this total bollox??? -get_ddl(keytype_fail_mebbies_or_not_eh_check_it_properly_muppet_boy) -> - _SQL = "CREATE TABLE GeoCheckin (" ++ - "myfamily integer not null, " ++ - "myseries varchar not null, " ++ - "time timestamp not null, " ++ - "weather varchar not null, " ++ - "temperature float, " ++ - "PRIMARY KEY ((quantum(time, 15, 'm'), myfamily, myseries), " ++ - "time, myfamily, myseries))". + "temperature double, " ++ + "PRIMARY KEY ((myfamily, myseries, quantum(time, 15, 'm')), " ++ + "time, myfamily, myseries, temperature))". get_valid_obj() -> [get_varchar(), diff --git a/tests/ts_A_put_pass_2.erl b/tests/ts_A_put_pass_2.erl index a72d5533..9b7a1dfa 100644 --- a/tests/ts_A_put_pass_2.erl +++ b/tests/ts_A_put_pass_2.erl @@ -17,8 +17,8 @@ confirm() -> "myfamily varchar not null, " ++ "myseries varchar not null, " ++ "time timestamp not null, " ++ - "myint integer not null, " ++ - "myfloat float not null, " ++ + "myint sint64 not null, " ++ + "myfloat double not null, " ++ "mybool boolean not null, " ++ "mytimestamp timestamp not null, " ++ "myany any not null, " ++ diff --git a/tests/ts_B_random_query_pass_eqc.erl b/tests/ts_B_random_query_pass_eqc.erl index b982c5ab..fd9c120e 100644 --- a/tests/ts_B_random_query_pass_eqc.erl +++ b/tests/ts_B_random_query_pass_eqc.erl @@ -100,9 +100,9 @@ get_ddl(Bucket, {No, Q}) -> "time timestamp not null, " ++ "weather varchar not null, " ++ "temperature float, " ++ - "PRIMARY KEY ((quantum(time, " ++ integer_to_list(No) ++ ", '" ++ - atom_to_list(Q) ++ "'), myfamily, myseries), " ++ - "time, myfamily, myseries))". + "PRIMARY KEY ((myfamily, myseries, quantum(time, " ++ integer_to_list(No) ++ ", '" ++ + atom_to_list(Q) ++ "')), " ++ + "myfamily, myseries, time))". make_data(NPuts, Q, NSpans) -> Multi = get_multi(Q) * NSpans, diff --git a/tests/ts_api_util.erl b/tests/ts_api_util.erl index a8c296a0..76b9d182 100644 --- a/tests/ts_api_util.erl +++ b/tests/ts_api_util.erl @@ -90,8 +90,8 @@ get_ddl(api) -> "mybin varchar not null, " ++ "myfloat float not null, " ++ "mybool boolean not null, " ++ - "PRIMARY KEY ((quantum(time, 15, 'm'), myfamily, myseries), " ++ - "time, myfamily, myseries))". + "PRIMARY KEY ((myfamily, myseries, quantum(time, 15, 'm')), " ++ + "myfamily, myseries, temperature, time))". get_map(api) -> [{<<"myfamily">>, 1},