== Physical Plan == * HashAggregate (4) +- Exchange (3) +- * HashAggregate (2) +- * Scan JDBCRelation(( SELECT DISTINCT t1.F0000080, case when t4.ye<>'' THEN t4.ye ELSE DATE_FORMAT(NOW(),'%Y') end ye , '01-02-03-04-05-06-07-08-09-10-11-12' dataTime from (SELECT F0000080 from `立项审批` WHERE `Status`='1' ) t1 LEFT JOIN `井位信息` t2 on t2.ObjectId=t1.F0000080 and t2.`Status`='1' LEFT JOIN `井位运行情况表` t3 on t2.ObjectId=t3.F0000026 and t3.`Status`='1' LEFT JOIN( SELECT DISTINCT F0000031, CASE WHEN date_format(F0000030, '%d')>25 and date_format(F0000030, '%c')=12 THEN date_format(F0000030, '%Y')+1 ELSE date_format(F0000030, '%Y') END ye FROM `日报填报` where Status='1' )t4 on t4.F0000031=t3.ObjectId ) as T) [numPartitions=1] (1) (1) Scan JDBCRelation(( SELECT DISTINCT t1.F0000080, case when t4.ye<>'' THEN t4.ye ELSE DATE_FORMAT(NOW(),'%Y') end ye , '01-02-03-04-05-06-07-08-09-10-11-12' dataTime from (SELECT F0000080 from `立项审批` WHERE `Status`='1' ) t1 LEFT JOIN `井位信息` t2 on t2.ObjectId=t1.F0000080 and t2.`Status`='1' LEFT JOIN `井位运行情况表` t3 on t2.ObjectId=t3.F0000026 and t3.`Status`='1' LEFT JOIN( SELECT DISTINCT F0000031, CASE WHEN date_format(F0000030, '%d')>25 and date_format(F0000030, '%c')=12 THEN date_format(F0000030, '%Y')+1 ELSE date_format(F0000030, '%Y') END ye FROM `日报填报` where Status='1' )t4 on t4.F0000031=t3.ObjectId ) as T) [numPartitions=1] [codegen id : 1] Output: [] ReadSchema: struct<> (2) HashAggregate [codegen id : 1] Input: [] Keys: [] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#40104L] Results [1]: [count#40105L] (3) Exchange Input [1]: [count#40105L] Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#12024] (4) HashAggregate [codegen id : 2] Input [1]: [count#40105L] Keys: [] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#40101L] Results [1]: [count(1)#40101L AS count#40102L]