tdSql.error('select distinct histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from stb;')
tdSql.error('select distinct histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from stb;')
...
@@ -2396,10 +2531,652 @@ class TDTestCase:
...
@@ -2396,10 +2531,652 @@ class TDTestCase:
tdSql.checkData(4,0,"(9:15]:2");
tdSql.checkData(4,0,"(9:15]:2");
#select session
#select session
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb session (col_timestamp, 1w);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb session (col_timestamp, 1d);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb session (col_timestamp, 1h);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb session (col_timestamp, 1m);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb session (col_timestamp, 1s);')
tdSql.checkRows(16)
tdSql.checkData(0,1,"(0:10]:0");
tdSql.checkData(1,1,"(0:10]:0");
tdSql.checkData(2,1,"(0:10]:1");
tdSql.checkData(3,1,"(0:10]:1");
tdSql.checkData(4,1,"(0:10]:1");
tdSql.checkData(5,1,"(0:10]:1");
tdSql.checkData(6,1,"(0:10]:1");
tdSql.checkData(7,1,"(0:10]:1");
tdSql.checkData(8,1,"(0:10]:1");
tdSql.checkData(9,1,"(0:10]:1");
tdSql.checkData(10,1,"(0:10]:1");
tdSql.checkData(11,1,"(0:10]:1");
tdSql.checkData(12,1,"(0:10]:0");
tdSql.checkData(13,1,"(0:10]:0");
tdSql.checkData(14,1,"(0:10]:0");
tdSql.checkData(15,1,"(0:10]:0");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb session (col_timestamp, 1a);')
tdSql.checkRows(16)
tdSql.checkData(0,1,"(0:10]:0");
tdSql.checkData(1,1,"(0:10]:0");
tdSql.checkData(2,1,"(0:10]:1");
tdSql.checkData(3,1,"(0:10]:1");
tdSql.checkData(4,1,"(0:10]:1");
tdSql.checkData(5,1,"(0:10]:1");
tdSql.checkData(6,1,"(0:10]:1");
tdSql.checkData(7,1,"(0:10]:1");
tdSql.checkData(8,1,"(0:10]:1");
tdSql.checkData(9,1,"(0:10]:1");
tdSql.checkData(10,1,"(0:10]:1");
tdSql.checkData(11,1,"(0:10]:1");
tdSql.checkData(12,1,"(0:10]:0");
tdSql.checkData(13,1,"(0:10]:0");
tdSql.checkData(14,1,"(0:10]:0");
tdSql.checkData(15,1,"(0:10]:0");
#select state_window
#select state_window
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_timestamp);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_tinyint);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_smallint);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_int);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_bigint);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_bool);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_float);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_double);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_binary);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb state_window(col_nchar);')
#select interval/sliding/fill
#select interval/sliding/fill
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1y);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1n);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1w);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1d);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1h);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1s);')
tdSql.checkRows(16)
tdSql.checkData(0,1,"(0:10]:0");
tdSql.checkData(1,1,"(0:10]:0");
tdSql.checkData(2,1,"(0:10]:1");
tdSql.checkData(3,1,"(0:10]:1");
tdSql.checkData(4,1,"(0:10]:1");
tdSql.checkData(5,1,"(0:10]:1");
tdSql.checkData(6,1,"(0:10]:1");
tdSql.checkData(7,1,"(0:10]:1");
tdSql.checkData(8,1,"(0:10]:1");
tdSql.checkData(9,1,"(0:10]:1");
tdSql.checkData(10,1,"(0:10]:1");
tdSql.checkData(11,1,"(0:10]:1");
tdSql.checkData(12,1,"(0:10]:0");
tdSql.checkData(13,1,"(0:10]:0");
tdSql.checkData(14,1,"(0:10]:0");
tdSql.checkData(15,1,"(0:10]:0");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1a);')
tdSql.checkRows(16)
tdSql.checkData(0,1,"(0:10]:0");
tdSql.checkData(1,1,"(0:10]:0");
tdSql.checkData(2,1,"(0:10]:1");
tdSql.checkData(3,1,"(0:10]:1");
tdSql.checkData(4,1,"(0:10]:1");
tdSql.checkData(5,1,"(0:10]:1");
tdSql.checkData(6,1,"(0:10]:1");
tdSql.checkData(7,1,"(0:10]:1");
tdSql.checkData(8,1,"(0:10]:1");
tdSql.checkData(9,1,"(0:10]:1");
tdSql.checkData(10,1,"(0:10]:1");
tdSql.checkData(11,1,"(0:10]:1");
tdSql.checkData(12,1,"(0:10]:0");
tdSql.checkData(13,1,"(0:10]:0");
tdSql.checkData(14,1,"(0:10]:0");
tdSql.checkData(15,1,"(0:10]:0");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1w) sliding(1w);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1d) sliding(1d);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1h) sliding(1h);')
tdSql.checkRows(1)
tdSql.checkData(0,1,"(0:10]:10");
tdSql.query('select histogram(col_int, "user_input", "[0,10]", 0) from tb interval(1s) sliding(1s);')
tdSql.checkRows(16)
tdSql.checkData(0,1,"(0:10]:0");
tdSql.checkData(1,1,"(0:10]:0");
tdSql.checkData(2,1,"(0:10]:1");
tdSql.checkData(3,1,"(0:10]:1");
tdSql.checkData(4,1,"(0:10]:1");
tdSql.checkData(5,1,"(0:10]:1");
tdSql.checkData(6,1,"(0:10]:1");
tdSql.checkData(7,1,"(0:10]:1");
tdSql.checkData(8,1,"(0:10]:1");
tdSql.checkData(9,1,"(0:10]:1");
tdSql.checkData(10,1,"(0:10]:1");
tdSql.checkData(11,1,"(0:10]:1");
tdSql.checkData(12,1,"(0:10]:0");
tdSql.checkData(13,1,"(0:10]:0");
tdSql.checkData(14,1,"(0:10]:0");
tdSql.checkData(15,1,"(0:10]:0");
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb where col_timestamp > now - 1w and col_timestamp < now + 1w interval(1w) fill(NULL);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb where col_timestamp > now - 1d and col_timestamp < now + 1d interval(1d) fill(None);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb where col_timestamp > now - 1h and col_timestamp < now + 1h interval(1h) fill(Prev);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb where col_timestamp > now - 1m and col_timestamp < now + 1m interval(1m) fill(Next);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb where col_timestamp > now - 1s and col_timestamp < now + 1s interval(1s) fill(Linear);')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from tb where col_timestamp > now - 1a and col_timestamp < now + 1a interval(1a) fill(Value, 1);')
#select group by
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_tinyint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_smallint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_int;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_bigint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_bool;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_float;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_binary;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by col_nchar;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_tinyint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_smallint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_int;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_bigint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_bool;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_float;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_binary;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_nchar;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tbname;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_tinyint,col_tinyint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_smallint,col_smallint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_int,col_int;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_bigint,col_bigint;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_bool,col_bool;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_float,col_float;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_double,col_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_binary,col_binary;')
tdSql.error('select histogram(col_int, "user_input", "[0,10]", 0) from stb group by tag_nchar,col_nchar;')
#select order by
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_timestamp;')
tdSql.checkRows(5)
tdSql.checkData(0,0,"(0:3]:3");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(5:7]:2");
tdSql.checkData(3,0,"(7:9]:2");
tdSql.checkData(4,0,"(9:15]:2");
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_timestamp desc;')
tdSql.checkRows(5)
tdSql.checkData(0,0,"(0:3]:3");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(5:7]:2");
tdSql.checkData(3,0,"(7:9]:2");
tdSql.checkData(4,0,"(9:15]:2");
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_tinyint;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_tinyint desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_smallint;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_smallint desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_int;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_int desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_bigint;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_bigint desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_bool;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_bool desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_float;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_float desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_double desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by col_double desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_tinyint;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_tinyint desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_smallint;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_smallint desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_int;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_int desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bigint;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bigint desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bool;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bool desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_float;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_float desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tbname;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tbname desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_timestamp,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_timestamp,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_tinyint,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_tinyint,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_smallint,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_smallint,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_int,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_int,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bigint,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bigint,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bool,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_bool,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_float,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_float,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double,col_timestamp desc;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double,col_timestamp;')
tdSql.error('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb order by tag_double,col_timestamp desc;')
#select limit/offset
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb limit 3;')
tdSql.checkRows(3)
tdSql.checkData(0,0,"(0:3]:3");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(5:7]:2");
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from ctb limit 3;')
tdSql.checkRows(3)
tdSql.checkData(0,0,"(0:3]:3");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(5:7]:2");
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from tb limit 3;')
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from tb1, tb2 where tb1.col_timestamp = tb2.col_timestamp;');
tdSql.checkRows(5)
tdSql.checkData(0,0,"(0:3]:3");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(5:7]:2");
tdSql.checkData(3,0,"(7:9]:2");
tdSql.checkData(4,0,"(9:15]:2");
tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from ctb1, ctb2 where ctb1.col_timestamp = ctb2.col_timestamp;');
tdSql.checkRows(5)
tdSql.checkData(0,0,"(0:3]:3");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(5:7]:2");
tdSql.checkData(3,0,"(7:9]:2");
tdSql.checkData(4,0,"(9:15]:2");
#stable join will cause crash
#tdSql.query('select histogram(col_int, "user_input", "[0,3,5,7,9,15]", 0) from stb1, stb2 where stb1.col_timestamp = stb2.col_timestamp and stb1.tag_int = stb2.tag_int;');
#tdSql.checkRows(5)
#tdSql.checkData(0, 0, "(0:3]:3");
#tdSql.checkData(1, 0, "(3:5]:2");
#tdSql.checkData(2, 0, "(5:7]:2");
#tdSql.checkData(3, 0, "(7:9]:2");
#tdSql.checkData(4, 0, "(9:15]:2");
#union all
tdSql.query('select histogram(col_int, \'user_input\', \'[1,3,5]\', 0) from tb1 union all select histogram(col_int, \'user_input\', \'[1,3,5]\', 0) from tb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:3]:2");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(1:3]:2");
tdSql.checkData(3,0,"(3:5]:2");
tdSql.query('select histogram(col_int, \'user_input\', \'[1,3,5]\', 0) from ctb1 union all select histogram(col_int, \'user_input\', \'[1,3,5]\', 0) from ctb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:3]:2");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(1:3]:2");
tdSql.checkData(3,0,"(3:5]:2");
tdSql.query('select histogram(col_int, \'user_input\', \'[1,3,5]\', 0) from stb1 union all select histogram(col_int, \'user_input\', \'[1,3,5]\', 0) from stb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:3]:2");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(1:3]:2");
tdSql.checkData(3,0,"(3:5]:2");
tdSql.query('select histogram(col_int, \'linear_bin\', \'{"start":1, "width":2, "count":2, "infinity":false}\', 0) from tb1 union all select histogram(col_int, \'linear_bin\', \'{"start":1, "width":2, "count":2, "infinity":false}\', 0) from tb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:3]:2");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(1:3]:2");
tdSql.checkData(3,0,"(3:5]:2");
tdSql.query('select histogram(col_int, \'linear_bin\', \'{"start":1, "width":2, "count":2, "infinity":false}\', 0) from ctb1 union all select histogram(col_int, \'linear_bin\', \'{"start":1, "width":2, "count":2, "infinity":false}\', 0) from ctb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:3]:2");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(1:3]:2");
tdSql.checkData(3,0,"(3:5]:2");
tdSql.query('select histogram(col_int, \'linear_bin\', \'{"start":1, "width":2, "count":2, "infinity":false}\', 0) from stb1 union all select histogram(col_int, \'linear_bin\', \'{"start":1, "width":2, "count":2, "infinity":false}\', 0) from stb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:3]:2");
tdSql.checkData(1,0,"(3:5]:2");
tdSql.checkData(2,0,"(1:3]:2");
tdSql.checkData(3,0,"(3:5]:2");
tdSql.query('select histogram(col_int, \'log_bin\', \'{"start":1, "factor":2, "count":2, "infinity":false}\', 0) from tb1 union all select histogram(col_int, \'log_bin\', \'{"start":1, "factor":2, "count":2, "infinity":false}\', 0) from tb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:2]:1");
tdSql.checkData(1,0,"(2:4]:2");
tdSql.checkData(2,0,"(1:2]:1");
tdSql.checkData(3,0,"(2:4]:2");
tdSql.query('select histogram(col_int, \'log_bin\', \'{"start":1, "factor":2, "count":2, "infinity":false}\', 0) from ctb1 union all select histogram(col_int, \'log_bin\', \'{"start":1, "factor":2, "count":2, "infinity":false}\', 0) from ctb2;')
tdSql.checkRows(4)
tdSql.checkData(0,0,"(1:2]:1");
tdSql.checkData(1,0,"(2:4]:2");
tdSql.checkData(2,0,"(1:2]:1");
tdSql.checkData(3,0,"(2:4]:2");
tdSql.query('select histogram(col_int, \'log_bin\', \'{"start":1, "factor":2, "count":2, "infinity":false}\', 0) from stb1 union all select histogram(col_int, \'log_bin\', \'{"start":1, "factor":2, "count":2, "infinity":false}\', 0) from stb2;')