Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions

Question

1. How can world language curricula tell the story of cultures?

Answered: 1 week ago

Question

What is the orientation toward time?

Answered: 1 week ago

Question

4. How is culture a contested site?

Answered: 1 week ago