Support Questions
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Highlighted

## why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

Explorer

why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

5 REPLIES 5
Highlighted

## Re: why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

Guru

maybe some small example data along with the code in question being show (w/results and/or errors) would be helpful

Highlighted

## Re: why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

Explorer

@Vishal , here is an example.

a = load '/tmp/test.csv' using PigStorage(',') as (name:chararray,city:chararray,state:chararray,country:chararray);

b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A

You will get a (>>) when the statement is not closed with a semicolon (;) or when the quotes are not properly opened and closed ('').

Correct code:

a = load '/tmp/test.csv' using PigStorage(',') as (name:chararray,city:chararray,state:chararray,country:chararray);

b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A';

## Re: why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

Explorer

Thank you for your answer but these 2 things i checked time and again but still couldn't get through it.could data it is processing like type or sonething be a problem?

Highlighted

## Re: why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

Explorer

@Vishal , please share your code here. I will take a look and recommend the solution.

Highlighted

## Re: why filter by statement on pig Grunt going to next line(>>), e.g. b = filter a by (chararray) \$2 != 'N/A' and (chararray)\$3 != 'N/A'; after Enter next line appears with >>

Explorer

Unfortunately dont have code as it happened during attempt to some question and trying to understand the concept what all things could cause it to go to next line.

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