What does “Correlated scalar subqueries must be Aggregated” mean?
问题 I use Spark 2.0. I'd like to execute the following SQL query: val sqlText = """ select f.ID as TID, f.BldgID as TBldgID, f.LeaseID as TLeaseID, f.Period as TPeriod, coalesce( (select f ChargeAmt from Fact_CMCharges f where f.BldgID = Fact_CMCharges.BldgID limit 1), 0) as TChargeAmt1, f.ChargeAmt as TChargeAmt2, l.EFFDATE as TBreakDate from Fact_CMCharges f join CMRECC l on l.BLDGID = f.BldgID and l.LEASID = f.LeaseID and l.INCCAT = f.IncomeCat and date_format(l.EFFDATE,'D')<>1 and f.Period