SELECT orginfo.court_uuid,orginfo.uuid buildId,orginfo.memo buildmemo,orginfo. NAME AS buildname,T.userid,T.birth,T.sex,now() AS analysis_date,now() AS create_time,now() AS update_time FROM (SELECT base_house.org_uuid,base_user.birth,base_user.sex,base_user.uuid as userid,base_user.court_uuid as courtid1,base_house_user_rel.house_uuid,substring(base_org.sort_by,0,9) as orgsort_by FROM mdc.base_user base_user INNER JOIN mdc.base_house_user_rel base_house_user_rel ON base_user.uuid = base_house_user_rel.user_uuid INNER JOIN mdc.base_house base_house ON base_house_user_rel.house_uuid = base_house.uuid LEFT JOIN mdc.base_org base_org ON base_house.org_uuid = base_org.uuid WHERE base_user.user_type = 1) AS T LEFT JOIN mdc.base_org orginfo ON orginfo.sort_by = T.orgsort_by AND orginfo.court_uuid = T.courtid1 WHERE orginfo.org_type = 3 AND length (orginfo.sort_by) = 9 AND orginfo.uuid IS NOT NULL;
sql能在spark-sql中运行,但是我在java中使用sparkSession.sql就报错java.io.FileNotFoundException: File does not exist: /opt\mdc\base_org。
其中mdc是表空间,base_org是上面关联查询中的其中一个表。
是否不能把多重关联的sql放入到sparksession.sql中?必须使用Dataset<Row>中的join函数进行关联操作?
第一次使用sparksql~~~~请大神指点