How can correct data types on Apache Pig be enforced?

前端 未结 1 1560
遥遥无期
遥遥无期 2021-01-06 11:20

I am having trouble SUMming a bag of values, due to a Data type error.

When I load a csv file whose lines look like this:

6   574 false   10.1.72.23          


        
相关标签:
1条回答
  • 2021-01-06 11:46

    Have you tried to cast the data retrieved from the 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, ...);
    
    0 讨论(0)
提交回复
热议问题