Search code examples
hadoopapache-pig

Pig CLI getting stuck with ">>" symbol prompting for input


I'd like to understand what is wrong with below Pig code. The last time of below code cause Pig CLI getting stuck with ">>" prompting for input but regardless of what I enter, it continued to prompt.

 newServiceIdMapping  = load '/idn/home/data/new/ServiceIdMapping_test.csv' USING PigStorage(',') AS (market : chararray , serviceId : chararray , rm : chararray , serviceChannel : chararray , team : chararray , pm : chararray , tl : chararray , gh : chararray );

 newServiceIdMappingUpd = FOREACH newServiceIdMapping GENERATE (serviceId,rm , (pm == '' ? tl : pm) As pm1  ); 

Solution

  • Exclude the brackets after GENERATE.

    newServiceIdMapping  = load '/idn/home/data/new/ServiceIdMapping_test.csv' USING PigStorage(',') AS (market : chararray , serviceId : chararray , rm : chararray , serviceChannel : chararray , team : chararray , pm : chararray , tl : chararray , gh : chararray );
    
    newServiceIdMappingUpd = FOREACH newServiceIdMapping GENERATE serviceId,rm , (pm == '' ? tl : pm) as pm1 ;