[Solved-1 Solution] How can correct data types on Apache Pig be enforced ?



Problem:

How can correct data types on Apache Pig be enforced ?

Solution 1:

We can use cast to retrieve the data from UDF. Applying the schema here does not perform any casting.
E.g

logs_base = 
   FOREACH raw_logs
   GENERATE
       FLATTEN(
           (tuple(LONG,LONG,CHARARRAY,....)) EXTRACT(line, '^...')
       )
       AS (account_id: INT, ...);

Related Searches to How can correct data types on Apache Pig be enforced?