Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started