I am connecting hadoop table to generate the report for the following query, it's working fine directly in hive but not working in tableau report query and am greeting the following error message.
"[Hortonworks][HiveODBC] (80) Syntax or semantic analysis error thrown in server while execurint query. Error message from server: Error while compiling statement: FAILED: ParseException line 3:7 cannot recognize input near 'WITH' 'Q1' 'AS' in from source"
WITH Q1 AS
select CONCAT(SUBSTR(invc_dt,1,4),SUBSTR(invc_dt,6,2)) as dist_month
group by CONCAT(SUBSTR(invc_dt,1,4),SUBSTR(invc_dt,6,2))
select t2.month as File_Creation_Month,t1.business_segment as Business_Segment,
t1.driver_license_state_cd as State_Code,t2.total_mvrs as Total_MVRs,
t1.drv_cnt as Driver_Count,
CASE WHEN SUM (t1.drv_cnt) IS NULL OR SUM (t1.drv_cnt) = 0 THEN 0
ELSE round((SUM(total_mvrs) / SUM(t1.drv_cnt))*100,2)
END as MVR_Order_Rate_PCT
(select concat(substr(plcy_exdt,1,4),substr(plcy_exdt,6,2)) as month,
driver_license_st_cd as driver_license_state_cd,
business_segment_org_id as business_segment,
count(distinct driver_license_nbr) as drv_cnt from
where driver_license_st_cd <> 'null'
AND concat(substr(plcy_exdt,1,4),substr(plcy_exdt,6,2)) >= '201701'
group by concat(substr(plcy_exdt,1,4),substr(plcy_exdt,6,2)) ,
select CONCAT(SUBSTR(TRANS_dt,1,4),SUBSTR(trans_dt,6,2)) as month,
segment AS bus_seg_org_id,
state_cd as state,count(first_nm) as total_mvrs from
where concat(substr(trans_dt,1,4),substr(trans_dt,6,2)) >= '201701'
and prod ='MVR'
and rpt_nm NOT IN ('MVR AZ12','MVR AZ12 CUS','MVR CA12','MVR MN MTHSTDB','MVR SC12')
group by CONCAT(SUBSTR(trans_dt,1,4),SUBSTR(trans_dt,6,2)),
ON t1.business_segment=t2.bus_seg_org_id and
and Q1.dist_month > 201801
group by t2.month,t1.business_segment,t1.driver_license_state_cd,