'How to convert Oracle SQL query into datalake(Impala)?

I have one Oracle SQL query in the below format how I can proceed to convert this into Impala:-

SELECT
Some_Columns

FROM
(
SELECT * FROM
(
SELECT 
Some_more_columns

FROM
Main_table
LEFT JOIN t1 on codn_1 = cond_2
....
....
Some more left joins
.....

WHERE
some_filters

)
PIVOT(
count(*) for column_x in (some_column)
)
) T
ORDER BY 2,3


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source