res_s3select=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,"select min(int(_1)),max(int(_2)),min(int(_3))+1 from stdin;")).replace("\n","")
# assert is according to radom-csv function
assertres_s3select=="0,1000,1,"
# purpose of test that all where conditions create the same group of values, thus same result
res_s3select_substr=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select min(int(_2)),max(int(_2)) from stdin where substr(_2,1,1) == "1"')).replace("\n","")
res_s3select_between_numbers=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select min(int(_2)),max(int(_2)) from stdin where int(_2)>=100 and int(_2)<200')).replace("\n","")
res_s3select_eq_modolu=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select min(int(_2)),max(int(_2)) from stdin where int(_2)/100 == 1 or int(_2)/10 == 1 or int(_2) == 1')).replace("\n","")
res_s3select_alias=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,"select int(_1) as a1, int(_2) as a2 , (a1+a2) as a3 from stdin where a3>100 and a3<300;")).replace(",","")
res_s3select_no_alias=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,"select int(_1),int(_2),int(_1)+int(_2) from stdin where (int(_1)+int(_2))>100 and (int(_1)+int(_2))<300;")).replace(",","")
res_s3select_alias=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,"select int(_1) as a1,int(_2) as a2, a1+a4 as a3, a5+a1 as a4, int(_3)+a3 as a5 from stdin;"))
find_res=res_s3select_alias.find("number of calls exceed maximum size, probably a cyclic reference to alias");
res_s3select_date_time=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select count(0) from stdin where extract("year",timestamp(_1)) > 1950 and extract("year",timestamp(_1)) < 1960;'))
res_s3select_substr=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select count(0) from stdin where int(substr(_1,1,4))>1950 and int(substr(_1,1,4))<1960;'))
assertres_s3select_date_time==res_s3select_substr
res_s3select_date_time=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select count(0) from stdin where datediff("month",timestamp(_1),dateadd("month",2,timestamp(_1)) ) == 2;'))
res_s3select_count=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select count(0) from stdin;'))
assertres_s3select_date_time==res_s3select_count
res_s3select_date_time=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select count(0) from stdin where datediff("year",timestamp(_1),dateadd("day", 366 ,timestamp(_1))) == 1 ;'))
# validate that utcnow is integrate correctly with other date-time functions
res_s3select_date_time_utcnow=remove_xml_tags_from_result(run_s3select(bucket_name,csv_obj_name,'select count(0) from stdin where datediff("hours",utcnow(),dateadd("day",1,utcnow())) == 24 ;'))