Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

convert below SQL 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

Students also viewed these Databases questions

Question

=+management system of the MNE?

Answered: 1 week ago