'Hive subquery with Lateral View
I am trying to run the below code. I'm trying filtering on the jira_label
field. I'm getting the below error. I know this means I should add aliases and I have below, but I'm unsure why I'm still getting this? Any help will be appreciated.
DROP TABLE IF EXISTS datamart_wrk.dm_asoe_jira_project_health_temp;
CREATE TABLE datamart_wrk.dm_asoe_jira_project_health_temp STORED AS PARQUET AS
--Step 1 Create temp table containing all issue label combinations for the specific labels relevant to WSR project health
SELECT A.*, CASE WHEN a.impediment_priority='Critical' OR a.impediment_priority='Blocker'
THEN 10 WHEN a.jira_issue_due_date_utc < current_timestamp()
THEN 5 ELSE 0 END AS RAG_value, B.label
FROM datamart_core.dm_asoe_jira_impediments AS A
LEFT JOIN
( SELECT jira_issue_id, trim(jira_label) FROM (
SELECT jira_issue_id, jira_label FROM datamart_core.dm_asoe_jira_impediments AS W
LATERAL VIEW explode(split(w.jira_label, ',')) adTable AS jira_label
WHERE LOWER(w.jira_label) LIKE '%lt_help%' OR LOWER(w.jira_label) LIKE '%scope%' OR LOWER(w.jira_label) LIKE '%schedule%' OR LOWER(w.jira_label) LIKE '%resource%' OR LOWER(w.jira_label) LIKE '%budget%'
) AS Z
)
AS B ON a.jira_issue_id=b.issue_id
WHERE a.impediment_status NOT IN ('Cancel', 'Closed','Completed','Resolved');
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|