Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

SPLIT in pig


SPLIT in pig

New Contributor

I am trying to split reviews_per_month into their respective category.


My error is : 
2019-11-30 06:06:58,036 [main] ERROR - ERROR 1200: Pig script failed to parse:
<line 145, column 20> Invalid scalar projection: b0
Details at logfile: /home/cloudera/Downloads/pig_1575121155335.log


NY_Airbnb_data = LOAD 'AB_NYC_2019.csv' using PigStorage (',') as (id:int, name:chararray, host_id:int, host_name:chararray, neighbourhood_group:chararray, neighbourhood:chararray, lattitude:double, longitude:double, room_type:chararray, price:int, minimum_night:int, number_of_review:int, last_review:datetime, reviews_per_month:chararray, calculated_host_listing_count:int, availability_365:int);

b0 = FOREACH NY_Airbnb_data GENERATE name, neighbourhood_group, neighbourhood, room_type, reviews_per_month;

SPLIT b0 into b2 if(b0.price > 200), b3 if (b0.price < 100);

dump b2;




Don't have an account?
Coming from Hortonworks? Activate your account here