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

Encountered Warning IMPLICIT_CAST_TO_CHARARRAY 5 time(s)

Highlighted

Encountered Warning IMPLICIT_CAST_TO_CHARARRAY 5 time(s)

New Contributor
 
1 REPLY 1

Re: Encountered Warning IMPLICIT_CAST_TO_CHARARRAY 5 time(s)

Hi Gayathri

Default data type in Pig is byteArray. That means if you do not mention any data type for a column, it will by default assign byteArray data type to it.

So, when you said

raw_nmon_DS = LOAD '$input' using PigStorage(','); 

every column in your schema is byteArray by default.

So whenever you perform any operation on your columns, they are first casted to appropriate data types from byteArray. Refer Pig Documentation to learn more about casting.

For starters, you can start with assigning data types to your columns when reading the file. Something like below.

raw_nmon_DS = LOAD '/user/edureka_268377/data/sample.txt' using PigStorage(',') as (col1:chararray,col2:chararray,col3:chararray,............,coln:chararray);

Hope that helps!


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