Replacing space with underscore is a good option. Alias is like variable
declaration in any language which are guided by certain rules and syntax.
http://pig.apache.org/docs/r0.9.1/basic.html#Data+Types+and+More

On Tue, Feb 21, 2012 at 8:43 PM, Austin Chungath <[email protected]> wrote:

> Consider
> describe A;
> A: {New York: chararray, Delhi: chararray}
>
> B = foreach a generate New York;
>
> error:
> mismatched input 'York' expecting SEMI_COLON
>
> Is there an escape sequence for space in pig scripts?
> I understand that it is not possible to create a column name with a space
> in pig using scripts.
> The column name with a space was created when my UDF created a schema
> taking values from a tuple and that tuple had this string "New York".
> Ideally I should have checked for spaces in the string and replaced it with
> an underscore, but just out of curiosity is there a way to address a column
> named "New York"?
>
> Any help is much appreciated.
> Thanks,
>
> Austin
>

Reply via email to