prestodb / presto

The official home of the Presto distributed SQL query engine for big data
http://prestodb.io
Apache License 2.0
16.06k stars 5.38k forks source link

too long where clause cause error #10461

Closed thotwielder closed 4 years ago

thotwielder commented 6 years ago

I got this error in sql workbench running a query generated by tableau work sheet.

• [Simba][Presto] (1060) Presto Query Error: Compiler failed and interpreter is disabled (65543)

I found it's caused by too long where clause because if I shorten the where clause then it runs fine.

The query:

SELECT MONTH(CAST("custom_sql_query"."date" AS DATE)) AS "none_calculation_1",
YEAR(CAST("custom_sql_query"."date" AS DATE)) AS "none_calculation_2",
"custom_sql_query"."business_unit" AS "none_business_unit",
"custom_sql_query"."center_code" AS "none_center_code_n",
"custom_sql_query"."center_name" AS "none_center_name_n",
"custom_sql_query"."program_name" AS "none_program_name_"
FROM (
select distinct cast(year as varchar) ||'-'||
case when length(cast(month as varchar) )=1
then '0'|| cast( month as varchar)
else cast( month as varchar)
end ||
'-01' as date , center_name ,
business_unit ,
region_level1 ,
region_level2 ,
a.center_code ,
program_name ,
year ,
month ,
validleads ,
validleadtarget ,
opportunitynew ,
opportunitytarget ,
showupnew ,
showuptarget ,
newstudent ,
newstudenttarget ,
retainedstudent ,
refundstudent ,
achall,
grossamount ,
discountamount ,
refundnetsale ,
netsaleall ,
newnetsaleall ,
retainednetsaleall,
coalesce(b.user_name,c.user_name) as user_name
from dmt_sales.e1school_summary a
join dmt_security.user_center_mapping b
on a.center_code =b.center_code
join dmt_security.business_unit_mapping c
on a.business_unit=c.business_unit_name
) "custom_sql_query"
WHERE (((("custom_sql_query"."business_unit" = 'China Own') AND (((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (1, 2, 3, 4)) AND ("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2017) AND ("custom_sql_query"."center_code" = 'DCNFOC02') AND ("custom_sql_query"."center_name" = 'FZ1JA1')) 
OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'DCNFOC02') AND ("custom_sql_query"."center_name" = 'FZ1JA1')) OR (("custom_sql_query"."center_code" = 'DCNFOC03') AND ("custom_sql_query"."center_name" = 'FZ2CS1')))))) 
OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 5) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2017) AND ("custom_sql_query"."center_code" = 'DCNFOC02') AND ("custom_sql_query"."center_name" = 'FZ1JA1')) 
OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 6) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2016, 2017)) AND ("custom_sql_query"."center_code" = 'DCNFOC02') AND ("custom_sql_query"."center_name" = 'FZ1JA1')) 
OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (7, 8, 9, 10, 11, 12)) AND ("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2016) AND ("custom_sql_query"."center_code" = 'DCNFOC02') AND ("custom_sql_query"."center_name" = 'FZ1JA1')) 
OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2017) AND ((("custom_sql_query"."center_code" = 'DCNFOC02') AND ("custom_sql_query"."center_name" = 'FZ1JA1')) 
OR (("custom_sql_query"."center_code" = 'DCNFOC03') AND ("custom_sql_query"."center_name" = 'FZ2CS1')))))))) 
OR (("custom_sql_query"."business_unit" = 'Indonesia Franchise') AND (((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (1, 2)) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) 
OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))) 
OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 3) AND ((("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2011, 2012, 2014, 2015, 2016, 2017)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) 
OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))) 
OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2013) AND ("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) 
OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) 
OR (("custom_sql_query"."center_code" = 'BDB') AND ("custom_sql_query"."center_name" = 'Bdg Banda')) 
OR (("custom_sql_query"."center_code" = 'BDC') AND ("custom_sql_query"."center_name" = 'Bdg BKR')) 
OR (("custom_sql_query"."center_code" = 'BDD') AND ("custom_sql_query"."center_name" = 'Bandung Antapani')) 
OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) 
OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) 
OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) 
OR (("custom_sql_query"."center_code" = 'BEC') AND ("custom_sql_query"."center_name" = 'Bekasi Summarecon')) 
OR (("custom_sql_query"."center_code" = 'CBA') AND ("custom_sql_query"."center_name" = 'Cirebon')) 
OR (("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) 
OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')) 
OR (("custom_sql_query"."center_code" = 'DIDTES01') AND ("custom_sql_query"."center_name" = 'ID Omni Test')) 
OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) 
OR (("custom_sql_query"."center_code" = 'GWA') AND ("custom_sql_query"."center_name" = 'Grand Wisata')) 
OR (("custom_sql_query"."center_code" = 'JAK') AND ("custom_sql_query"."center_name" = 'Kalimalang')) 
OR (("custom_sql_query"."center_code" = 'JAO') AND ("custom_sql_query"."center_name" = 'Gunung Sahari')) 
OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) 
OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) 
OR (("custom_sql_query"."center_code" = 'KEA') AND ("custom_sql_query"."center_name" = 'Kediri')) 
OR (("custom_sql_query"."center_code" = 'KPG') AND ("custom_sql_query"."center_name" = 'Kupang')) 
OR (("custom_sql_query"."center_code" = 'LPA') AND ("custom_sql_query"."center_name" = 'Lampung')) 
OR (("custom_sql_query"."center_code" = 'MDC') AND ("custom_sql_query"."center_name" = 'Manado')) 
OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan'))
OR (("custom_sql_query"."center_code" = 'MKS') AND ("custom_sql_query"."center_name" = 'Makassar')) 
OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) 
OR (("custom_sql_query"."center_code" = 'MLB') AND ("custom_sql_query"."center_name" = 'Malang 2 Sawojajar')) 
OR (("custom_sql_query"."center_code" = 'MRA') AND ("custom_sql_query"."center_name" = 'Lombok')) 
OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) 
OR (("custom_sql_query"."center_code" = 'PAD') AND ("custom_sql_query"."center_name" = 'Padang')) 
OR (("custom_sql_query"."center_code" = 'PBA') AND ("custom_sql_query"."center_name" = 'Palembang')) 
OR (("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) 
OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) 
OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) 
OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) 
OR (("custom_sql_query"."center_code" = 'SMA') AND ("custom_sql_query"."center_name" = 'Semarang1 MT Haryono'))
OR (("custom_sql_query"."center_code" = 'SMB') AND ("custom_sql_query"."center_name" = 'Semarang2 Prof. Soedarto')) 
OR (("custom_sql_query"."center_code" = 'STR') AND ("custom_sql_query"."center_name" = 'Sunter')) 
OR (("custom_sql_query"."center_code" = 'SUA') AND ("custom_sql_query"."center_name" = 'Sby Kayun')) 
OR (("custom_sql_query"."center_code" = 'SUB') AND ("custom_sql_query"."center_name" = 'Sby Plaza')) 
OR (("custom_sql_query"."center_code" = 'SUC') AND ("custom_sql_query"."center_name" = 'Sby Bukit Mas')) 
OR (("custom_sql_query"."center_code" = 'SUD') AND ("custom_sql_query"."center_name" = 'Sby Klampis')) 
OR (("custom_sql_query"."center_code" = 'YYA') AND ("custom_sql_query"."center_name" = 'Yog YAPSquare')))))) 
OR (("custom_sql_query"."program_name" = 'Besiness English') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) 
OR (("custom_sql_query"."program_name" = 'Business English') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) 
OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')))) 
OR (("custom_sql_query"."program_name" = 'Frontrunner') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) 
OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) 
OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) 
OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) 
OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) 
OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) 
OR (("custom_sql_query"."center_code" = 'KPG') AND ("custom_sql_query"."center_name" = 'Kupang')) 
OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan')) 
OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) 
OR (("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) 
OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) 
OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) 
OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) 
OR (("custom_sql_query"."center_code" = 'SUA') AND ("custom_sql_query"."center_name" = 'Sby Kayun')) 
OR (("custom_sql_query"."center_code" = 'SUB') AND ("custom_sql_query"."center_name" = 'Sby Plaza')))) 
OR (("custom_sql_query"."program_name" = 'High Flyers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) 
OR (("custom_sql_query"."center_code" = 'BDC') AND ("custom_sql_query"."center_name" = 'Bdg BKR')) 
OR (("custom_sql_query"."center_code" = 'BDD') AND ("custom_sql_query"."center_name" = 'Bandung Antapani')) 
OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) 
OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) 
OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) 
OR (("custom_sql_query"."center_code" = 'BEC') AND ("custom_sql_query"."center_name" = 'Bekasi Summarecon')) 
OR (("custom_sql_query"."center_code" = 'CBA') AND ("custom_sql_query"."center_name" = 'Cirebon')) 
OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) 
OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) 
OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) 
OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) 
OR (("custom_sql_query"."center_code" = 'MLB') AND ("custom_sql_query"."center_name" = 'Malang 2 Sawojajar')) 
OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) 
OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) OR (("custom_sql_query"."center_code" = 'STR') AND ("custom_sql_query"."center_name" = 'Sunter')) OR (("custom_sql_query"."center_code" = 'SUB') AND ("custom_sql_query"."center_name" = 'Sby Plaza')))) OR (("custom_sql_query"."program_name" = 'IELTS') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')))) OR (("custom_sql_query"."program_name" = 'Small Stars') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) OR (("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) OR (("custom_sql_query"."center_code" = 'MLB') AND ("custom_sql_query"."center_name" = 'Malang 2 Sawojajar')) OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) OR (("custom_sql_query"."center_code" = 'STR') AND ("custom_sql_query"."center_name" = 'Sunter')) OR (("custom_sql_query"."center_code" = 'SUC') AND ("custom_sql_query"."center_name" = 'Sby Bukit Mas')) OR (("custom_sql_query"."center_code" = 'SUD') AND ("custom_sql_query"."center_name" = 'Sby Klampis')))) OR (("custom_sql_query"."program_name" = 'TOEFL') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'SUA') AND ("custom_sql_query"."center_name" = 'Sby Kayun')))) OR (("custom_sql_query"."program_name" = 'Trailblazers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) OR (("custom_sql_query"."center_code" = 'BDB') AND ("custom_sql_query"."center_name" = 'Bdg Banda')) OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) OR (("custom_sql_query"."center_code" = 'JAK') AND ("custom_sql_query"."center_name" = 'Kalimalang')) OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) OR (("custom_sql_query"."center_code" = 'LPA') AND ("custom_sql_query"."center_name" = 'Lampung')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) OR (("custom_sql_query"."center_code" = 'MLB') AND ("custom_sql_query"."center_name" = 'Malang 2 Sawojajar')) OR (("custom_sql_query"."center_code" = 'PBA') AND ("custom_sql_query"."center_name" = 'Palembang')) OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) OR (("custom_sql_query"."center_code" = 'STR') AND ("custom_sql_query"."center_name" = 'Sunter')) OR (("custom_sql_query"."center_code" = 'SUA') AND ("custom_sql_query"."center_name" = 'Sby Kayun')) OR (("custom_sql_query"."center_code" = 'SUB') AND ("custom_sql_query"."center_name" = 'Sby Plaza')) OR (("custom_sql_query"."center_code" = 'SUC') AND ("custom_sql_query"."center_name" = 'Sby Bukit Mas')))))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 4) AND ((("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2011, 2012, 2014, 2015, 2016, 2017)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2013) AND ("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BAA') AND ("custom_sql_query"."center_name" = 'Balikpapan')) OR (("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) OR (("custom_sql_query"."center_code" = 'BDB') AND ("custom_sql_query"."center_name" = 'Bdg Banda')) OR (("custom_sql_query"."center_code" = 'BDC') AND ("custom_sql_query"."center_name" = 'Bdg BKR')) OR (("custom_sql_query"."center_code" = 'BDD') AND ("custom_sql_query"."center_name" = 'Bandung Antapani')) OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'BEC') AND ("custom_sql_query"."center_name" = 'Bekasi Summarecon')) OR (("custom_sql_query"."center_code" = 'BGA') AND ("custom_sql_query"."center_name" = 'Bgr Padjajaran')) OR (("custom_sql_query"."center_code" = 'BGB') AND ("custom_sql_query"."center_name" = 'Bgr Yasmin')) OR (("custom_sql_query"."center_code" = 'BIA') AND ("custom_sql_query"."center_name" = 'Bintaro')) OR (("custom_sql_query"."center_code" = 'BMS') AND ("custom_sql_query"."center_name" = 'Banjarmasin')) OR (("custom_sql_query"."center_code" = 'CBA') AND ("custom_sql_query"."center_name" = 'Cirebon')) OR (("custom_sql_query"."center_code" = 'CLA') AND ("custom_sql_query"."center_name" = 'Cilegon')) OR (("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')) OR (("custom_sql_query"."center_code" = 'DPA') AND ("custom_sql_query"."center_name" = 'Depok')) OR (("custom_sql_query"."center_code" = 'GAD') AND ("custom_sql_query"."center_name" = 'Gading Serpong')) OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) OR (("custom_sql_query"."center_code" = 'GWA') AND ("custom_sql_query"."center_name" = 'Grand Wisata')) OR (("custom_sql_query"."center_code" = 'JAA') AND ("custom_sql_query"."center_name" = 'Gajah Mada')) OR (("custom_sql_query"."center_code" = 'JAC') AND ("custom_sql_query"."center_name" = 'Cipete')) OR (("custom_sql_query"."center_code" = 'JAE') AND ("custom_sql_query"."center_name" = 'Pondok Indah')) OR (("custom_sql_query"."center_code" = 'JAF') AND ("custom_sql_query"."center_name" = 'Kelapa Gading')) OR (("custom_sql_query"."center_code" = 'JAH') AND ("custom_sql_query"."center_name" = 'Pluit')) OR (("custom_sql_query"."center_code" = 'JAI') AND ("custom_sql_query"."center_name" = 'Tebet')) OR (("custom_sql_query"."center_code" = 'JAK') AND ("custom_sql_query"."center_name" = 'Kalimalang')) OR (("custom_sql_query"."center_code" = 'JAM') AND ("custom_sql_query"."center_name" = 'Cibubur')) OR (("custom_sql_query"."center_code" = 'JAN') AND ("custom_sql_query"."center_name" = 'Tanjung Duren')) OR (("custom_sql_query"."center_code" = 'JAO') AND ("custom_sql_query"."center_name" = 'Gunung Sahari')) OR (("custom_sql_query"."center_code" = 'JAP') AND ("custom_sql_query"."center_name" = 'Cinere')) OR (("custom_sql_query"."center_code" = 'JAR') AND ("custom_sql_query"."center_name" = 'Permata Hijau')) OR (("custom_sql_query"."center_code" = 'JAS') AND ("custom_sql_query"."center_name" = 'Cengkareng')) OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) OR (("custom_sql_query"."center_code" = 'KEA') AND ("custom_sql_query"."center_name" = 'Kediri')) OR (("custom_sql_query"."center_code" = 'KHI') AND ("custom_sql_query"."center_name" = 'Kota Harapan Indah')) OR (("custom_sql_query"."center_code" = 'KPG') AND ("custom_sql_query"."center_name" = 'Kupang')) OR (("custom_sql_query"."center_code" = 'KRW') AND ("custom_sql_query"."center_name" = 'Karawaci')) OR (("custom_sql_query"."center_code" = 'KWA') AND ("custom_sql_query"."center_name" = 'Kota Wisata')) OR (("custom_sql_query"."center_code" = 'LPA') AND ("custom_sql_query"."center_name" = 'Lampung')) OR (("custom_sql_query"."center_code" = 'MDC') AND ("custom_sql_query"."center_name" = 'Manado')) OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan')) OR (("custom_sql_query"."center_code" = 'MKS') AND ("custom_sql_query"."center_name" = 'Makassar')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) OR (("custom_sql_query"."center_code" = 'MLB') AND ("custom_sql_query"."center_name" = 'Malang 2 Sawojajar')) OR (("custom_sql_query"."center_code" = 'MRA') AND ("custom_sql_query"."center_name" = 'Lombok')) OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) OR (("custom_sql_query"."center_code" = 'PAD') AND ("custom_sql_query"."center_name" = 'Padang')) OR (("custom_sql_query"."center_code" = 'PBA') AND ("custom_sql_query"."center_name" = 'Palembang')) OR (("custom_sql_query"."center_code" = 'PDG') AND ("custom_sql_query"."center_name" = 'Taman Mini')) OR (("custom_sql_query"."center_code" = 'PJT') AND ("custom_sql_query"."center_name" = 'Pejaten')) OR (("custom_sql_query"."center_code" = 'PKA') AND ("custom_sql_query"."center_name" = 'Pekanbaru')) OR (("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) OR (("custom_sql_query"."center_code" = 'PUR') AND ("custom_sql_query"."center_name" = 'Puri Indah')) OR (("custom_sql_query"."center_code" = 'RMG') AND ("custom_sql_query"."center_name" = 'Rawamangun')) OR (("custom_sql_query"."center_code" = 'SAA') AND ("custom_sql_query"."center_name" = 'Samarinda')) OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) OR (("custom_sql_query"."center_code" = 'SMA') AND ("custom_sql_query"."center_name" = 'Semarang1 MT Haryono')) OR (("custom_sql_query"."center_code" = 'SMB') AND ("custom_sql_query"."center_name" = 'Semarang2 Prof. Soedarto')) OR (("custom_sql_query"."center_code" = 'STR') AND ("custom_sql_query"."center_name" = 'Sunter')) OR (("custom_sql_query"."center_code" = 'SUA') AND ("custom_sql_query"."center_name" = 'Sby Kayun')) OR (("custom_sql_query"."center_code" = 'SUB') AND ("custom_sql_query"."center_name" = 'Sby Plaza')) OR (("custom_sql_query"."center_code" = 'SUC') AND ("custom_sql_query"."center_name" = 'Sby Bukit Mas')) OR (("custom_sql_query"."center_code" = 'SUD') AND ("custom_sql_query"."center_name" = 'Sby Klampis')) OR (("custom_sql_query"."center_code" = 'TGB') AND ("custom_sql_query"."center_name" = 'BSD Tangerang')) OR (("custom_sql_query"."center_code" = 'TGC') AND ("custom_sql_query"."center_name" = 'Pamulang')) OR (("custom_sql_query"."center_code" = 'TGR') AND ("custom_sql_query"."center_name" = 'Tangerang City')) OR (("custom_sql_query"."center_code" = 'YYA') AND ("custom_sql_query"."center_name" = 'Yog YAPSquare')))))) OR (("custom_sql_query"."program_name" = 'Besiness English') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'LPA') AND ("custom_sql_query"."center_name" = 'Lampung')) OR (("custom_sql_query"."program_name" = 'Business English') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'JAR') AND ("custom_sql_query"."center_name" = 'Permata Hijau')) OR (("custom_sql_query"."center_code" = 'MKS') AND ("custom_sql_query"."center_name" = 'Makassar')) OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')))) OR (("custom_sql_query"."program_name" = 'Frontrunner') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BAA') AND ("custom_sql_query"."center_name" = 'Balikpapan')) OR (("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'BIA') AND ("custom_sql_query"."center_name" = 'Bintaro')) OR (("custom_sql_query"."center_code" = 'CLA') AND ("custom_sql_query"."center_name" = 'Cilegon')) OR (("custom_sql_query"."center_code" = 'DPA') AND ("custom_sql_query"."center_name" = 'Depok')) OR (("custom_sql_query"."center_code" = 'GWA') AND ("custom_sql_query"."center_name" = 'Grand Wisata')) OR (("custom_sql_query"."center_code" = 'JAC') AND ("custom_sql_query"."center_name" = 'Cipete')) OR (("custom_sql_query"."center_code" = 'JAF') AND ("custom_sql_query"."center_name" = 'Kelapa Gading')) OR (("custom_sql_query"."center_code" = 'JAH') AND ("custom_sql_query"."center_name" = 'Pluit')) OR (("custom_sql_query"."center_code" = 'JAO') AND ("custom_sql_query"."center_name" = 'Gunung Sahari')) OR (("custom_sql_query"."center_code" = 'JAP') AND ("custom_sql_query"."center_name" = 'Cinere')) OR (("custom_sql_query"."center_code" = 'JAR') AND ("custom_sql_query"."center_name" = 'Permata Hijau')) OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'KEA') AND ("custom_sql_query"."center_name" = 'Kediri')) OR (("custom_sql_query"."center_code" = 'KWA') AND ("custom_sql_query"."center_name" = 'Kota Wisata')) OR (("custom_sql_query"."center_code" = 'LPA') AND ("custom_sql_query"."center_name" = 'Lampung')) OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan')) OR (("custom_sql_query"."center_code" = 'MKS') AND ("custom_sql_query"."center_name" = 'Makassar')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) OR (("custom_sql_query"."center_code" = 'PKA') AND ("custom_sql_query"."center_name" = 'Pekanbaru')) OR (("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) OR (("custom_sql_query"."center_code" = 'RMG') AND ("custom_sql_query"."center_name" = 'Rawamangun')) OR (("custom_sql_query"."center_code" = 'SAA') AND ("custom_sql_query"."center_name" = 'Samarinda')) OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) OR (("custom_sql_query"."center_code" = 'SMA') AND ("custom_sql_query"."center_name" = 'Semarang1 MT Haryono')) OR (("custom_sql_query"."center_code" = 'TGR') AND ("custom_sql_query"."center_name" = 'Tangerang City')))) OR (("custom_sql_query"."program_name" = 'High Flyers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BAA') AND ("custom_sql_query"."center_name" = 'Balikpapan')) OR (("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'BIA') AND ("custom_sql_query"."center_name" = 'Bintaro')) OR (("custom_sql_query"."center_code" = 'BMS') AND ("custom_sql_query"."center_name" = 'Banjarmasin')) OR (("custom_sql_query"."center_code" = 'CBA') AND ("custom_sql_query"."center_name" = 'Cirebon')) OR (("custom_sql_query"."center_code" = 'CLA') AND ("custom_sql_query"."center_name" = 'Cilegon')) OR (("custom_sql_query"."center_code" = 'DPA') AND ("custom_sql_query"."center_name" = 'Depok')) OR (("custom_sql_query"."center_code" = 'GWA') AND ("custom_sql_query"."center_name" = 'Grand Wisata')) OR (("custom_sql_query"."center_code" = 'JAF') AND ("custom_sql_query"."center_name" = 'Kelapa Gading')) OR (("custom_sql_query"."center_code" = 'JAI') AND ("custom_sql_query"."center_name" = 'Tebet')) OR (("custom_sql_query"."center_code" = 'JAN') AND ("custom_sql_query"."center_name" = 'Tanjung Duren')) OR (("custom_sql_query"."center_code" = 'JAO') AND ("custom_sql_query"."center_name" = 'Gunung Sahari')) OR (("custom_sql_query"."center_code" = 'JAP') AND ("custom_sql_query"."center_name" = 'Cinere')) OR (("custom_sql_query"."center_code" = 'JAR') AND ("custom_sql_query"."center_name" = 'Permata Hijau')) OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'KEA') AND ("custom_sql_query"."center_name" = 'Kediri')) OR (("custom_sql_query"."center_code" = 'KWA') AND ("custom_sql_query"."center_name" = 'Kota Wisata')) OR (("custom_sql_query"."center_code" = 'MDC') AND ("custom_sql_query"."center_name" = 'Manado')) OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) OR (("custom_sql_query"."center_code" = 'PJT') AND ("custom_sql_query"."center_name" = 'Pejaten')) OR (("custom_sql_query"."center_code" = 'PKA') AND ("custom_sql_query"."center_name" = 'Pekanbaru')) OR (("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) OR (("custom_sql_query"."center_code" = 'RMG') AND ("custom_sql_query"."center_name" = 'Rawamangun')) OR (("custom_sql_query"."center_code" = 'SAA') AND ("custom_sql_query"."center_name" = 'Samarinda')) OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) OR (("custom_sql_query"."center_code" = 'SMA') AND ("custom_sql_query"."center_name" = 'Semarang1 MT Haryono')) OR (("custom_sql_query"."center_code" = 'STR') AND ("custom_sql_query"."center_name" = 'Sunter')) OR (("custom_sql_query"."center_code" = 'YYA') AND ("custom_sql_query"."center_name" = 'Yog YAPSquare')))) OR (("custom_sql_query"."program_name" = 'Life Club') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) OR (("custom_sql_query"."program_name" = 'Small Stars') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'BEC') AND ("custom_sql_query"."center_name" = 'Bekasi Summarecon')) OR (("custom_sql_query"."center_code" = 'BIA') AND ("custom_sql_query"."center_name" = 'Bintaro')) OR (("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) OR (("custom_sql_query"."center_code" = 'JAO') AND ("custom_sql_query"."center_name" = 'Gunung Sahari')) OR (("custom_sql_query"."center_code" = 'JAR') AND ("custom_sql_query"."center_name" = 'Permata Hijau')) OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'MDC') AND ("custom_sql_query"."center_name" = 'Manado')) OR (("custom_sql_query"."center_code" = 'MKS') AND ("custom_sql_query"."center_name" = 'Makassar')) OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) OR (("custom_sql_query"."center_code" = 'PJT') AND ("custom_sql_query"."center_name" = 'Pejaten')) OR (("custom_sql_query"."center_code" = 'RMG') AND ("custom_sql_query"."center_name" = 'Rawamangun')) OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) OR (("custom_sql_query"."center_code" = 'TGC') AND ("custom_sql_query"."center_name" = 'Pamulang')))) OR (("custom_sql_query"."program_name" = 'Trailblazers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'BAA') AND ("custom_sql_query"."center_name" = 'Balikpapan')) OR (("custom_sql_query"."center_code" = 'BDA') AND ("custom_sql_query"."center_name" = 'Bdg Ciwalk')) OR (("custom_sql_query"."center_code" = 'BDE') AND ("custom_sql_query"."center_name" = 'Cimahi')) OR (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) OR (("custom_sql_query"."center_code" = 'BGB') AND ("custom_sql_query"."center_name" = 'Bgr Yasmin')) OR (("custom_sql_query"."center_code" = 'BIA') AND ("custom_sql_query"."center_name" = 'Bintaro')) OR (("custom_sql_query"."center_code" = 'BMS') AND ("custom_sql_query"."center_name" = 'Banjarmasin')) OR (("custom_sql_query"."center_code" = 'CLA') AND ("custom_sql_query"."center_name" = 'Cilegon')) OR (("custom_sql_query"."center_code" = 'GAD') AND ("custom_sql_query"."center_name" = 'Gading Serpong')) OR (("custom_sql_query"."center_code" = 'GWA') AND ("custom_sql_query"."center_name" = 'Grand Wisata')) OR (("custom_sql_query"."center_code" = 'JAF') AND ("custom_sql_query"."center_name" = 'Kelapa Gading')) OR (("custom_sql_query"."center_code" = 'JAP') AND ("custom_sql_query"."center_name" = 'Cinere')) OR (("custom_sql_query"."center_code" = 'JAR') AND ("custom_sql_query"."center_name" = 'Permata Hijau')) OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) OR (("custom_sql_query"."center_code" = 'KEA') AND ("custom_sql_query"."center_name" = 'Kediri')) OR (("custom_sql_query"."center_code" = 'KWA') AND ("custom_sql_query"."center_name" = 'Kota Wisata')) OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan')) OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) OR (("custom_sql_query"."center_code" = 'MTR') AND ("custom_sql_query"."center_name" = 'Matraman')) OR (("custom_sql_query"."center_code" = 'PDG') AND ("custom_sql_query"."center_name" = 'Taman Mini')) OR (("custom_sql_query"."center_code" = 'PJT') AND ("custom_sql_query"."center_name" = 'Pejaten')) OR (("custom_sql_query"."center_code" = 'PKA') AND ("custom_sql_query"."center_name" = 'Pekanbaru')) OR (("custom_sql_query"."center_code" = 'RMG') AND ("custom_sql_query"."center_name" = 'Rawamangun')) OR (("custom_sql_query"."center_code" = 'SAA') AND ("custom_sql_query"."center_name" = 'Samarinda')) OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) OR (("custom_sql_query"."center_code" = 'SMB') AND ("custom_sql_query"."center_name" = 'Semarang2 Prof. Soedarto')) OR (("custom_sql_query"."center_code" = 'TGC') AND ("custom_sql_query"."center_name" = 'Pamulang')) OR (("custom_sql_query"."center_code" = 'YYA') AND ("custom_sql_query"."center_name" = 'Yog YAPSquare')))))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (5, 6)) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2011, 2012, 2013, 2014, 2015, 2016, 2017)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 7) AND ("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2011, 2013, 2014, 2015, 2016, 2017)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2012) AND ("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (8, 9, 11)) AND ("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2010) AND ("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2011, 2012, 2013, 2014, 2015, 2016, 2017)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (10, 12)) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) IN (2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017)) AND ((("custom_sql_query"."center_code" = 'DEA') AND ("custom_sql_query"."center_name" = 'Bali HW')) OR (("custom_sql_query"."center_code" = 'DEB') AND ("custom_sql_query"."center_name" = 'Bali Kuta')))))) OR (("custom_sql_query"."business_unit" = 'Russia Own') AND (((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 1) AND ((("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) NOT IN (1900, 2000, 2001, 2002, 2006, 2019)) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."program_name" = 'Frontrunner') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 2) AND ((("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) NOT IN (1900, 2000, 2001, 2002, 2006, 2007, 2018, 2019)) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'DRUTES01') AND ("custom_sql_query"."center_name" = 'RU Omni Test')) OR (("custom_sql_query"."center_code" = 'MOB') AND ("custom_sql_query"."center_name" = 'Novye Cheryemushki')) OR (("custom_sql_query"."center_code" = 'MOC') AND ("custom_sql_query"."center_name" = 'Yugo-Zapadnaya')) OR (("custom_sql_query"."center_code" = 'MOD') AND ("custom_sql_query"."center_name" = 'Alexeevskaya')) OR (("custom_sql_query"."center_code" = 'MOE') AND ("custom_sql_query"."center_name" = 'Marino')) OR (("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'MOK') AND ("custom_sql_query"."center_name" = 'Degunino')) OR (("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."center_code" = 'MOV') AND ("custom_sql_query"."center_name" = 'Universitet')) OR (("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."center_code" = 'SNA') AND ("custom_sql_query"."center_name" = 'Nevsky KnT')) OR (("custom_sql_query"."center_code" = 'SNB') AND ("custom_sql_query"."center_name" = 'Veteranov')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')) OR (("custom_sql_query"."center_code" = 'SNF') AND ("custom_sql_query"."center_name" = 'Bolshevikov')))))) OR (("custom_sql_query"."program_name" = 'EGE') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')) OR (("custom_sql_query"."program_name" = 'Frontrunner') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOB') AND ("custom_sql_query"."center_name" = 'Novye Cheryemushki')) OR (("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."center_code" = 'SNA') AND ("custom_sql_query"."center_name" = 'Nevsky KnT')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))) OR (("custom_sql_query"."program_name" = 'High Flyers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'SNA') AND ("custom_sql_query"."center_name" = 'Nevsky KnT')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))) OR (("custom_sql_query"."program_name" = 'Life Club') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."program_name" = 'Small Stars') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."center_code" = 'MOV') AND ("custom_sql_query"."center_name" = 'Universitet')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')) OR (("custom_sql_query"."center_code" = 'SNF') AND ("custom_sql_query"."center_name" = 'Bolshevikov')))) OR (("custom_sql_query"."program_name" = 'Trailblazers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOD') AND ("custom_sql_query"."center_name" = 'Alexeevskaya')) OR (("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'MOK') AND ("custom_sql_query"."center_name" = 'Degunino')) OR (("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 3) AND ((("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) NOT IN (1900, 2000, 2001, 2002, 2006, 2007, 2018, 2019)) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOB') AND ("custom_sql_query"."center_name" = 'Novye Cheryemushki')) OR (("custom_sql_query"."center_code" = 'MOC') AND ("custom_sql_query"."center_name" = 'Yugo-Zapadnaya')) OR (("custom_sql_query"."center_code" = 'MOD') AND ("custom_sql_query"."center_name" = 'Alexeevskaya')) OR (("custom_sql_query"."center_code" = 'MOE') AND ("custom_sql_query"."center_name" = 'Marino')) OR (("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'MOK') AND ("custom_sql_query"."center_name" = 'Degunino')) OR (("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."center_code" = 'MOV') AND ("custom_sql_query"."center_name" = 'Universitet')) OR (("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."center_code" = 'SNA') AND ("custom_sql_query"."center_name" = 'Nevsky KnT')) OR (("custom_sql_query"."center_code" = 'SNB') AND ("custom_sql_query"."center_name" = 'Veteranov')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')) OR (("custom_sql_query"."center_code" = 'SNF') AND ("custom_sql_query"."center_name" = 'Bolshevikov')))))) OR (("custom_sql_query"."program_name" = 'EF Extra') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."program_name" = 'Frontrunner') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))) OR (("custom_sql_query"."program_name" = 'High Flyers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'SNA') AND ("custom_sql_query"."center_name" = 'Nevsky KnT')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))) OR (("custom_sql_query"."program_name" = 'Small Stars') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))) OR (("custom_sql_query"."program_name" = 'Trailblazers') AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOC') AND ("custom_sql_query"."center_name" = 'Yugo-Zapadnaya')) OR (("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) = 4) AND ((("custom_sql_query"."program_name" IS NULL) AND (((YEAR(CAST("custom_sql_query"."date" AS DATE)) NOT IN (1900, 2000, 2001, 2002, 2006, 2018, 2019)) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR ((YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOB') AND ("custom_sql_query"."center_name" = 'Novye Cheryemushki')) OR (("custom_sql_query"."center_code" = 'MOC') AND ("custom_sql_query"."center_name" = 'Yugo-Zapadnaya')) OR (("custom_sql_query"."center_code" = 'MOD') AND ("custom_sql_query"."center_name" = 'Alexeevskaya')) OR (("custom_sql_query"."center_code" = 'MOE') AND ("custom_sql_query"."center_name" = 'Marino')) OR (("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'MOH') AND ("custom_sql_query"."center_name" = 'Sevastopolskaya')) OR (("custom_sql_query"."center_code" = 'MOI') AND ("custom_sql_query"."center_name" = 'Aeroport')) OR (("custom_sql_query"."center_code" = 'MOK') AND ("custom_sql_query"."center_name" = 'Degunino')) OR (("custom_sql_query"."center_code" = 'MOU') AND ("custom_sql_query"."center_name" = 'Preobrazhenka')) OR (("custom_sql_query"."center_code" = 'MOV') AND ("custom_sql_query"."center_name" = 'Universitet')) OR (("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR (("custom_sql_query"."center_code" = 'SNA') AND ("custom_sql_query"."center_name" = 'Nevsky KnT')) OR (("custom_sql_query"."center_code" = 'SNB') AND ("custom_sql_query"."center_name" = 'Veteranov')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')) OR (("custom_sql_query"."center_code" = 'SNF') AND ("custom_sql_query"."center_name" = 'Bolshevikov')))))) OR (("custom_sql_query"."program_name" IN ('Frontrunner', 'Trailblazers')) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')) OR (("custom_sql_query"."program_name" IN ('High Flyers', 'Small Stars')) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) = 2018) AND ((("custom_sql_query"."center_code" = 'MOF') AND ("custom_sql_query"."center_name" = 'Zhulebino')) OR (("custom_sql_query"."center_code" = 'SNC') AND ("custom_sql_query"."center_name" = 'Pionerskaya')))))) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (5, 7)) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) NOT IN (1900, 2000, 2001, 2002, 2018, 2019)) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk')) OR ((MONTH(CAST("custom_sql_query"."date" AS DATE)) IN (6, 8, 9, 10, 11, 12)) AND ("custom_sql_query"."program_name" IS NULL) AND (YEAR(CAST("custom_sql_query"."date" AS DATE)) NOT IN (1900, 2000, 2001, 2002, 2006, 2018, 2019)) AND ("custom_sql_query"."center_code" = 'NSA') AND ("custom_sql_query"."center_name" = 'Novosibirsk'))))) AND ("custom_sql_query"."user_name" = 'admin.e1'))
GROUP BY 1,
2,
3,
4,
5,
6
kokosing commented 6 years ago

I think this query would benefit from having this implemented https://github.com/prestodb/presto/issues/6385 and automatic rewrite the below to IN operator:

...
R (("custom_sql_query"."center_code" = 'BEA') AND ("custom_sql_query"."center_name" = 'Bekasi')) 
OR (("custom_sql_query"."center_code" = 'BEB') AND ("custom_sql_query"."center_name" = 'Cikarang')) 
OR (("custom_sql_query"."center_code" = 'GRA') AND ("custom_sql_query"."center_name" = 'Gresik')) 
OR (("custom_sql_query"."center_code" = 'JMR') AND ("custom_sql_query"."center_name" = 'Sby Jemursari')) 
OR (("custom_sql_query"."center_code" = 'JRA') AND ("custom_sql_query"."center_name" = 'Jember')) 
OR (("custom_sql_query"."center_code" = 'KPG') AND ("custom_sql_query"."center_name" = 'Kupang')) 
OR (("custom_sql_query"."center_code" = 'MED') AND ("custom_sql_query"."center_name" = 'Medan')) 
OR (("custom_sql_query"."center_code" = 'MLA') AND ("custom_sql_query"."center_name" = 'Malang 1 Ijen')) 
OR (("custom_sql_query"."center_code" = 'PTA') AND ("custom_sql_query"."center_name" = 'Pontianak')) 
OR (("custom_sql_query"."center_code" = 'SBY') AND ("custom_sql_query"."center_name" = 'Sby PTC')) 
OR (("custom_sql_query"."center_code" = 'SDA') AND ("custom_sql_query"."center_name" = 'Sidoarjo')) 
OR (("custom_sql_query"."center_code" = 'SLA') AND ("custom_sql_query"."center_name" = 'Solo')) 
OR (("custom_sql_query"."center_code" = 'SUA') AND ("custom_sql_query"."center_name" = 'Sby Kayun')) 
...
thotwielder commented 6 years ago

It's automatically generated by tableau workbook.

rschlussel commented 6 years ago

This looks the same as #2568

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any activity in the last 2 years. If you feel that this issue is important, just comment and the stale tag will be removed; otherwise it will be closed in 7 days. This is an attempt to ensure that our open issues remain valuable and relevant so that we can keep track of what needs to be done and prioritize the right things.