Suppose i have below Structured data file
1298712012061228765236542123049824234209374 1203972012073042198531203948203498023498023 1203712012092329385612350924395798456892345 1234812012101223423498230482034893204820398
Here in above file first 6 digit are UserId from (1-6) next 8 digit are year_date from (7-12) column next 6 column is Count field from (13-18) , then similarly I have product_id from (19-30) and Character_values column from (31-42) for the above flat file, So I want my data in below format. I mean to say is that I want to load my data using this mentioned field. Is there any option available in PIG or HIVE for this?
You can use it both in pig and hive. Two solutions are below
PIG:
When you dump :
dump strsplit; (29871,29871,29871,29871,29871)
(20397,20397,20397,20397,20397)
(20371,20371,20371,20371,20371)
(23481,23481,23481,23481,23481)
HIVE:
Step1:create a temp table and load the original data;
Step2:create a table which will fit your data.
Step3:Inster you temp table into actula table