Question: convert below Hive QL into spark program - select distinct a . branch _ number, b . post _ code, case when a . location

convert below Hive QL into spark program -
select distinct a
.
branch
_
number,
b
.
post
_
code,
case when a
.
location
_
format is NULL and a
.
location
_
type like "Petrol
-
Filling
-
Station" then "Petrol"
when a
.
location
_
format is NULL and a
.
legacy
_
format
_
code like
"
PH
"
then "Pharmacy"
else a
.
location
_
format end as store
_
format
_
description
from channels
_
reporting.vw
_
channels
_
locations a
inner join
(
select distinct location
_
id
,
post
_
code from location.location
LATERAL VIEW INLINE
(
array
(
address
)
)
post
_
code
where lifecycle
_
status like "Trading"
)
b
-
-
limit is for testing
on a
.
location
_
id
=
b
.
location
_
id
where
a
.
lifecycle
_
status like "Trading"
and a
.
country
_
code like
"
GB
"
;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!