self.check_result_auto("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select ceil(c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) ,ceil(c6) from sub1_bound")
self.check_result_auto("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select ceil(c1), ceil(c2) ,ceil(c3), ceil(c3), ceil(c2) ,ceil(c1) from sub1_bound")
self.check_result_auto("select ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(c1)))))))))) nest_col_func from sub1_bound;","select ceil(c1) from sub1_bound")
self.check_result_auto_cos("select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ","select cos(abs(c1)), cos(abs(c2)) ,cos(abs(c3)), cos(abs(c4)), cos(abs(c5)) from sub1_bound")
self.check_result_auto_cos("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select cos(c1), cos(c2) ,cos(c3), cos(c3), cos(c2) ,cos(c1) from sub1_bound")
self.check_result_auto_cos("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound","select cos(abs(c1)) from sub1_bound")
self.check_result_auto("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select floor(c1), floor(c2) ,floor(c3), floor(c4), floor(c5) ,floor(c6) from sub1_bound")
self.check_result_auto("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select floor(c1), floor(c2) ,floor(c3), floor(c3), floor(c2) ,floor(c1) from sub1_bound")
self.check_result_auto("select floor(floor(floor(floor(floor(floor(floor(floor(floor(floor(c1)))))))))) nest_col_func from sub1_bound;","select floor(c1) from sub1_bound")
q_where=['ts < now +1s','q_bigint >= -9223372036854775807 and q_bigint <= 9223372036854775807','q_int <= 2147483647 and q_int >= -2147483647',
'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308',
'q_double >= -1.7E308 and q_double <= 1.7E308','q_binary like \'binary%\' or q_binary = \'0\' ','q_nchar like \'nchar%\' or q_nchar = \'0\' ',
'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308',
'q_double >= -1.7E308 and q_double <= 1.7E308','q_binary like \'binary%\' or q_binary = \'0\' ','q_nchar like \'nchar%\' or q_nchar = \'0\' ',
'q_bool = true or q_bool = false','q_bool in (0 , 1)','q_bool in ( true , false)','q_bool = 0 or q_bool = 1',
'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767',
'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767',
'q_tinyint between -127 and 127 ','q_float >= -3.4E38 ','q_float <= 3.4E38 ','q_double >= -1.7E308 ',
'q_double <= 1.7E308 ','q_float between -3.4E38 and 3.4E38 ','q_double between -1.7E308 and 1.7E308 ',
'q_float is not null ','q_double is not null ',]
...
...
@@ -284,33 +284,33 @@ class TDTestCase:
't1.q_smallint >= -32767 and t1.q_smallint <= 32767 and t2.q_smallint >= -32767 and t2.q_smallint <= 32767',
't1.q_tinyint >= -127 and t1.q_tinyint <= 127 and t2.q_tinyint >= -127 and t2.q_tinyint <= 127',
't1.q_float >= - 1.7E308 and t1.q_float <= 1.7E308 and t2.q_float >= - 1.7E308 and t2.q_float <= 1.7E308',
't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308',
't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ',
't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ',
't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)','t1.q_bool in ( true , false) and t2.q_bool in ( true , false)',
't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308',
't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ',
't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ',
't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)','t1.q_bool in ( true , false) and t2.q_bool in ( true , false)',
't1.q_bigint between -9223372036854775807 and 9223372036854775807 and t2.q_bigint between -9223372036854775807 and 9223372036854775807',
't1.q_int between -2147483647 and 2147483647 and t2.q_int between -2147483647 and 2147483647',
't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
't1.q_tinyint between -127 and 127 and t2.q_tinyint between -127 and 127 ','t1.q_float between -1.7E308 and 1.7E308 and t2.q_float between -1.7E308 and 1.7E308',
't1.q_double between -1.7E308 and 1.7E308 and t2.q_double between -1.7E308 and 1.7E308']
#TD-6201 ,'t1.q_bool between 0 and 1 or t2.q_bool between 0 and 1']
#'t1.q_bool = true and t1.q_bool = false and t2.q_bool = true and t2.q_bool = false' , 't1.q_bool = 0 and t1.q_bool = 1 and t2.q_bool = 0 and t2.q_bool = 1' ,
q_u_or_where=['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )',
'(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )','(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)',
q_u_or_where=['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )',
'(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )','(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)',
'(t1.q_bool in (0 , 1) or t2.q_bool in (0 , 1))','(t1.q_bool in ( true , false) or t2.q_bool in ( true , false))','(t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1)',
'(t1.q_bigint between -9223372036854775807 and 9223372036854775807 or t2.q_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.q_int between -2147483647 and 2147483647 or t2.q_int between -2147483647 and 2147483647)',
'(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
'(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
'(t1.q_tinyint between -127 and 127 or t2.q_tinyint between -127 and 127 )','(t1.q_float between -1.7E308 and 1.7E308 or t2.q_float between -1.7E308 and 1.7E308)',
'(t1.q_double between -1.7E308 and 1.7E308 or t2.q_double between -1.7E308 and 1.7E308)']
# tag column where
t_where=['ts < now +1s','t_bigint >= -9223372036854775807 and t_bigint <= 9223372036854775807','t_int <= 2147483647 and t_int >= -2147483647',
't_smallint >= -32767 and t_smallint <= 32767','q_tinyint >= -127 and t_tinyint <= 127','t_float >= -1.7E308 and t_float <= 1.7E308',
't_double >= -1.7E308 and t_double <= 1.7E308','t_binary like \'binary%\' or t_binary = \'0\' ','t_nchar like \'nchar%\' or t_nchar = \'0\'',
't_double >= -1.7E308 and t_double <= 1.7E308','t_binary like \'binary%\' or t_binary = \'0\' ','t_nchar like \'nchar%\' or t_nchar = \'0\'',
't_bool = true or t_bool = false','t_bool in (0 , 1)','t_bool in ( true , false)','t_bool = 0 or t_bool = 1',
't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767',
't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767',
't_tinyint between -127 and 127 ','t_float between -1.7E308 and 1.7E308','t_double between -1.7E308 and 1.7E308']
#TD-6201,'t_bool between 0 and 1'
...
...
@@ -320,27 +320,27 @@ class TDTestCase:
't1.t_smallint >= -32767 and t1.t_smallint <= 32767 and t2.t_smallint >= -32767 and t2.t_smallint <= 32767',
't1.t_tinyint >= -127 and t1.t_tinyint <= 127 and t2.t_tinyint >= -127 and t2.t_tinyint <= 127',
't1.t_float >= -1.7E308 and t1.t_float <= 1.7E308 and t2.t_float >= -1.7E308 and t2.t_float <= 1.7E308',
't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308',
'(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ',
'(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )','(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)',
't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308',
'(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ',
'(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )','(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)',
't1.t_bool in (0 , 1) and t2.t_bool in (0 , 1)','t1.t_bool in ( true , false) and t2.t_bool in ( true , false)','(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)',
't1.t_bigint between -9223372036854775807 and 9223372036854775807 and t2.t_bigint between -9223372036854775807 and 9223372036854775807',
't1.t_int between -2147483647 and 2147483647 and t2.t_int between -2147483647 and 2147483647',
't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
'(t1.t_tinyint between -127 and 127 and t2.t_tinyint between -127 and 127) ','t1.t_float between -1.7E308 and 1.7E308 and t2.t_float between -1.7E308 and 1.7E308',
'(t1.t_double between -1.7E308 and 1.7E308 and t2.t_double between -1.7E308 and 1.7E308)']
#TD-6201,'t1.t_bool between 0 and 1 or t2.q_bool between 0 and 1']
t_u_or_where=['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )',
'(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )','(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)',
t_u_or_where=['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )',
'(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )','(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)',
'(t1.t_bool in (0 , 1) or t2.t_bool in (0 , 1))','(t1.t_bool in ( true , false) or t2.t_bool in ( true , false))','(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)',
'(t1.t_bigint between -9223372036854775807 and 9223372036854775807 or t2.t_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.t_int between -2147483647 and 2147483647 or t2.t_int between -2147483647 and 2147483647)',
'(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)',
'(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)',
'(t1.t_tinyint between -127 and 127 or t2.t_tinyint between -127 and 127 )','(t1.t_float between -1.7E308 and 1.7E308 or t2.t_float between -1.7E308 and 1.7E308)',
'(t1.t_double between -1.7E308 and 1.7E308 or t2.t_double between -1.7E308 and 1.7E308)']
order_u_where=['order by t1.ts','order by t1.ts asc','order by t2.ts','order by t2.ts asc']
order_desc_where=['order by ts','order by ts asc','order by ts desc']
orders_desc_where=['order by ts','order by ts asc','order by ts desc','order by loc','order by loc asc','order by loc desc']
group_where=['group by tbname , loc','group by tbname','group by tbname, t_bigint','group by tbname,t_int','group by tbname, t_smallint','group by tbname,t_tinyint',
group_where=['group by tbname , loc','group by tbname','group by tbname, t_bigint','group by tbname,t_int','group by tbname, t_smallint','group by tbname,t_tinyint',
'group by tbname,t_float','group by tbname,t_double','group by tbname,t_binary','group by tbname,t_nchar','group by tbname,t_bool','group by tbname ,loc ,t_bigint',
'group by tbname,t_binary ,t_nchar ,t_bool','group by tbname,t_int ,t_smallint ,t_tinyint','group by tbname,t_float ,t_double ',
'PARTITION BY tbname , loc','PARTITION BY tbname','PARTITION BY tbname, t_bigint','PARTITION BY tbname,t_int','PARTITION BY tbname, t_smallint','PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname , loc','PARTITION BY tbname','PARTITION BY tbname, t_bigint','PARTITION BY tbname,t_int','PARTITION BY tbname, t_smallint','PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float','PARTITION BY tbname,t_double','PARTITION BY tbname,t_binary','PARTITION BY tbname,t_nchar','PARTITION BY tbname,t_bool','PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool','PARTITION BY tbname,t_int ,t_smallint ,t_tinyint','PARTITION BY tbname,t_float ,t_double ']
group_where_j=['group by t1.loc','group by t1.t_bigint','group by t1.t_int','group by t1.t_smallint','group by t1.t_tinyint',
group_where_j=['group by t1.loc','group by t1.t_bigint','group by t1.t_int','group by t1.t_smallint','group by t1.t_tinyint',
'group by t1.t_float','group by t1.t_double','group by t1.t_binary','group by t1.t_nchar','group by t1.t_bool','group by t1.loc ,t1.t_bigint',
'group by t1.t_binary ,t1.t_nchar ,t1.t_bool','group by t1.t_int ,t1.t_smallint ,t1.t_tinyint','group by t1.t_float ,t1.t_double ',
'PARTITION BY t1.loc','PARTITION by t1.t_bigint','PARTITION by t1.t_int','PARTITION by t1.t_smallint','PARTITION by t1.t_tinyint',
'PARTITION BY t1.loc','PARTITION by t1.t_bigint','PARTITION by t1.t_int','PARTITION by t1.t_smallint','PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float','PARTITION by t1.t_double','PARTITION by t1.t_binary','PARTITION by t1.t_nchar','PARTITION by t1.t_bool','PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool','PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint','PARTITION by t1.t_float ,t1.t_double ',
'group by t2.loc','group by t2.t_bigint','group by t2.t_int','group by t2.t_smallint','group by t2.t_tinyint',
'group by t2.loc','group by t2.t_bigint','group by t2.t_int','group by t2.t_smallint','group by t2.t_tinyint',
'group by t2.t_float','group by t2.t_double','group by t2.t_binary','group by t2.t_nchar','group by t2.t_bool','group by t2.loc ,t2.t_bigint',
'group by t2.t_binary ,t2.t_nchar ,t2.t_bool','group by t2.t_int ,t2.t_smallint ,t2.t_tinyint','group by t2.t_float ,t2.t_double ',
'PARTITION BY t2.loc','PARTITION by t2.t_bigint','PARTITION by t2.t_int','PARTITION by t2.t_smallint','PARTITION by t2.t_tinyint',
'PARTITION BY t2.loc','PARTITION by t2.t_bigint','PARTITION by t2.t_int','PARTITION by t2.t_smallint','PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float','PARTITION by t2.t_double','PARTITION by t2.t_binary','PARTITION by t2.t_nchar','PARTITION by t2.t_bool','PARTITION BY t2.loc ,t2.t_bigint',
'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool','PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint','PARTITION by t2.t_float ,t2.t_double ']
partiton_where=['PARTITION BY tbname , loc','PARTITION BY tbname','PARTITION BY tbname, t_bigint','PARTITION BY tbname,t_int','PARTITION BY tbname, t_smallint','PARTITION BY tbname,t_tinyint',
'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool','PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint','PARTITION by t2.t_float ,t2.t_double ']
partiton_where=['PARTITION BY tbname , loc','PARTITION BY tbname','PARTITION BY tbname, t_bigint','PARTITION BY tbname,t_int','PARTITION BY tbname, t_smallint','PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float','PARTITION BY tbname,t_double','PARTITION BY tbname,t_binary','PARTITION BY tbname,t_nchar','PARTITION BY tbname,t_bool','PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool','PARTITION BY tbname,t_int ,t_smallint ,t_tinyint','PARTITION BY tbname,t_float ,t_double ']
partiton_where_j=['PARTITION BY t1.loc','PARTITION by t1.t_bigint','PARTITION by t1.t_int','PARTITION by t1.t_smallint','PARTITION by t1.t_tinyint',
partiton_where_j=['PARTITION BY t1.loc','PARTITION by t1.t_bigint','PARTITION by t1.t_int','PARTITION by t1.t_smallint','PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float','PARTITION by t1.t_double','PARTITION by t1.t_binary','PARTITION by t1.t_nchar','PARTITION by t1.t_bool','PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool','PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint','PARTITION by t1.t_float ,t1.t_double ',
'PARTITION BY t2.loc','PARTITION by t2.t_bigint','PARTITION by t2.t_int','PARTITION by t2.t_smallint','PARTITION by t2.t_tinyint',
'PARTITION BY t2.loc','PARTITION by t2.t_bigint','PARTITION by t2.t_int','PARTITION by t2.t_smallint','PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float','PARTITION by t2.t_double','PARTITION by t2.t_binary','PARTITION by t2.t_nchar','PARTITION by t2.t_bool','PARTITION BY t2.loc ,t2.t_bigint',
'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool','PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint','PARTITION by t2.t_float ,t2.t_double ']
'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool','PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint','PARTITION by t2.t_float ,t2.t_double ']
group_where_regular=['group by tbname ','group by tbname','group by tbname, q_bigint','group by tbname,q_int','group by tbname, q_smallint','group by tbname,q_tinyint',
group_where_regular=['group by tbname ','group by tbname','group by tbname, q_bigint','group by tbname,q_int','group by tbname, q_smallint','group by tbname,q_tinyint',
'group by tbname,q_float','group by tbname,q_double','group by tbname,q_binary','group by tbname,q_nchar','group by tbname,q_bool','group by tbname ,q_bigint',
'group by tbname,q_binary ,q_nchar ,q_bool','group by tbname,q_int ,q_smallint ,q_tinyint','group by tbname,q_float ,q_double ',
'PARTITION BY tbname ','PARTITION BY tbname','PARTITION BY tbname, q_bigint','PARTITION BY tbname,q_int','PARTITION BY tbname, q_smallint','PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname ','PARTITION BY tbname','PARTITION BY tbname, q_bigint','PARTITION BY tbname,q_int','PARTITION BY tbname, q_smallint','PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float','PARTITION BY tbname,q_double','PARTITION BY tbname,q_binary','PARTITION BY tbname,q_nchar','PARTITION BY tbname,q_bool','PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool','PARTITION BY tbname,q_int ,q_smallint ,q_tinyint','PARTITION BY tbname,q_float ,q_double ']
group_where_regular_j=['group by t1.q_bigint','group by t1.q_int','group by t1.q_smallint','group by t1.q_tinyint',
group_where_regular_j=['group by t1.q_bigint','group by t1.q_int','group by t1.q_smallint','group by t1.q_tinyint',
'group by t1.q_float','group by t1.q_double','group by t1.q_binary','group by t1.q_nchar','group by t1.q_bool','group by t1.q_bigint',
'group by t1.q_binary ,t1.q_nchar ,t1.q_bool','group by t1.q_int ,t1.q_smallint ,t1.q_tinyint','group by t1.q_float ,t1.q_double ',
'PARTITION by t1.q_bigint','PARTITION by t1.q_int','PARTITION by t1.q_smallint','PARTITION by t1.q_tinyint',
'PARTITION by t1.q_bigint','PARTITION by t1.q_int','PARTITION by t1.q_smallint','PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float','PARTITION by t1.q_double','PARTITION by t1.q_binary','PARTITION by t1.q_nchar','PARTITION by t1.q_bool','PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool','PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint','PARTITION by t1.q_float ,t1.q_double ',
'group by t2.q_bigint','group by t2.q_int','group by t2.q_smallint','group by t2.q_tinyint',
'group by t2.q_bigint','group by t2.q_int','group by t2.q_smallint','group by t2.q_tinyint',
'group by t2.q_float','group by t2.q_double','group by t2.q_binary','group by t2.q_nchar','group by t2.q_bool','group by t2.q_bigint',
'group by t2.q_binary ,t2.q_nchar ,t2.q_bool','group by t2.q_int ,t2.q_smallint ,t2.q_tinyint','group by t2.q_float ,t2.q_double ',
'PARTITION by t2.q_bigint','PARTITION by t2.q_int','PARTITION by t2.q_smallint','PARTITION by t2.q_tinyint',
'PARTITION by t2.q_bigint','PARTITION by t2.q_int','PARTITION by t2.q_smallint','PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float','PARTITION by t2.q_double','PARTITION by t2.q_binary','PARTITION by t2.q_nchar','PARTITION by t2.q_bool','PARTITION BY t2.q_bigint',
'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool','PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint','PARTITION by t2.q_float ,t2.q_double ']
partiton_where_regular=['PARTITION BY tbname ','PARTITION BY tbname','PARTITION BY tbname, q_bigint','PARTITION BY tbname,q_int','PARTITION BY tbname, q_smallint','PARTITION BY tbname,q_tinyint',
'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool','PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint','PARTITION by t2.q_float ,t2.q_double ']
partiton_where_regular=['PARTITION BY tbname ','PARTITION BY tbname','PARTITION BY tbname, q_bigint','PARTITION BY tbname,q_int','PARTITION BY tbname, q_smallint','PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float','PARTITION BY tbname,q_double','PARTITION BY tbname,q_binary','PARTITION BY tbname,q_nchar','PARTITION BY tbname,q_bool','PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool','PARTITION BY tbname,q_int ,q_smallint ,q_tinyint','PARTITION BY tbname,q_float ,q_double ']
partiton_where_regular_j=['PARTITION by t1.q_bigint','PARTITION by t1.q_int','PARTITION by t1.q_smallint','PARTITION by t1.q_tinyint',
partiton_where_regular_j=['PARTITION by t1.q_bigint','PARTITION by t1.q_int','PARTITION by t1.q_smallint','PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float','PARTITION by t1.q_double','PARTITION by t1.q_binary','PARTITION by t1.q_nchar','PARTITION by t1.q_bool','PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool','PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint','PARTITION by t1.q_float ,t1.q_double ',
'PARTITION by t2.q_bigint','PARTITION by t2.q_int','PARTITION by t2.q_smallint','PARTITION by t2.q_tinyint',
'PARTITION by t2.q_bigint','PARTITION by t2.q_int','PARTITION by t2.q_smallint','PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float','PARTITION by t2.q_double','PARTITION by t2.q_binary','PARTITION by t2.q_nchar','PARTITION by t2.q_bool','PARTITION BY t2.q_bigint',
'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool','PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint','PARTITION by t2.q_float ,t2.q_double ']
'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool','PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint','PARTITION by t2.q_float ,t2.q_double ']
interp_where=['ts = now','ts = \'2020-09-13 20:26:40.000\'','ts = \'2020-09-13 20:26:40.009\'','tbname in (\'table_1\') and ts = now','tbname in (\'table_0\' ,\'table_1\',\'table_2\',\'table_3\',\'table_4\',\'table_5\') and ts = \'2020-09-13 20:26:40.000\'','tbname like \'table%\' and ts = \'2020-09-13 20:26:40.002\'']
sql+="%s as calc16_0 "%random.choice(calc_calculate_all_j)
sql+=", %s as calc16_1 "%random.choice(calc_aggregate_all_j)
#sql += ", %s as calc16_2 " % random.choice(calc_select_in_j)
sql+=", %s as calc16_1 "%random.choice(calc_aggregate_all_j)
#sql += ", %s as calc16_2 " % random.choice(calc_select_in_j)
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(t_join_where)
sql+=") "
sql+="order by calc16_0 "
sql+="order by calc16_0 "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 16-2.2 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql="select * from ( select "
sql+="%s as calc16_0 "%random.choice(calc_calculate_all_j)
sql+=", %s as calc16_1 "%random.choice(calc_aggregate_all_j)
sql+=", %s as calc16_1 "%random.choice(calc_aggregate_all_j)
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(qt_u_or_where)
sql+=") "
sql+="order by calc16_0 "
sql+="order by calc16_0 "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 16-3 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular)
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular)
sql+=" from regular_table_1 where "
sql+="%s "%random.choice(q_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-4 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular_j)
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular_j)
sql+=" from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(q_u_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-4.2 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular_j)
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular_j)
sql+=" from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(q_u_or_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-5 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql="select * from ( select "
sql+="%s as calc16_1 , "%random.choice(calc_calculate_all)
sql+="%s as calc16_1 , "%random.choice(calc_calculate_regular)
sql+="%s as calc16_2 "%random.choice(calc_select_all)
sql+="%s as calc16_1 , "%random.choice(calc_calculate_regular)
sql+="%s as calc16_2 "%random.choice(calc_select_all)
sql+=" from stable_1 where "
sql+="%s "%random.choice(q_where)
sql+="%s "%random.choice(group_where)
#sql += "%s " % random.choice(having_support)
sql+=") "
sql+="order by calc16_1 "
sql+="order by calc16_1 "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
tdSql.query("select 16-6 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname)
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname)
sql+=" from stable_1 where "
sql+="%s "%random.choice(q_where)
sql+="%s "%random.choice(group_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
tdSql.query("select 16-7 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname_j)
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname_j)
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(t_join_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
tdSql.query("select 16-8 from stable_1;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname_j)
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname_j)
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(qt_u_or_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdLog.info(sql)
tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
#17 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or interval_sliding group by having order by limit offset )interval_sliding
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 17-1 from stable_1;")
foriinrange(self.fornum):
#this is having_support , but tag-select cannot mix with last_row,other select can
#this is having_support , but tag-select cannot mix with last_row,other select can
self.check_result_auto("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select round(c1), round(c2) ,round(c3), round(c4), round(c5) ,round(c6) from sub1_bound")
self.check_result_auto("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select round(c1), round(c2) ,round(c3), round(c3), round(c2) ,round(c1) from sub1_bound")
self.check_result_auto("select round(round(round(round(round(round(round(round(round(round(c1)))))))))) nest_col_func from sub1_bound;","select round(c1) from sub1_bound")
self.check_result_auto_sqrt("select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ","select sqrt(abs(c1)), sqrt(abs(c2)) ,sqrt(abs(c3)), sqrt(abs(c4)), sqrt(abs(c5)) from sub1_bound")
self.check_result_auto_sqrt("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select sqrt(c1), sqrt(c2) ,sqrt(c3), sqrt(c3), sqrt(c2) ,sqrt(c1) from sub1_bound")
self.check_result_auto_sqrt("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound","select sqrt(abs(c1)) from sub1_bound")