Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this problem we will be using Hive from Hadoop to write a python function which will transform a customer table and create a new

In this problem we will be using Hive from Hadoop to write a python function which will transform a customer table and create a new table. The new target table should have only three columns, c_custkey (no changes), c_address, and c_city.

Write python code that will

1)take in the c_address column, shorten it to 6 characters (i.e., if the value is longer, remove extra characters, but otherwise keep it as-is).

2)For c_city, add a space and a # to indicate the digit at the end (e.g., UNITED KI2 => UNITED KI #2, or INDONESIA4 => INDONESIA #4).

Tip: don't forget to add

#!/usr/bin/python

import sys

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

Which form of proof do you find most persuasive? Why?

Answered: 1 week ago