in pig获取错误为'error compiling operator polocalreareat'

kq0g1dla  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(306)

我在cloudera上练习(非商业用途)。我在《Pig》里的剧本是, a1 = load '/user/training/my_hdfs/id' using PigStorage('\t') as(id:int,name:chararray,desig:chararray); a2 = load '/user/training/my_hdfs/trips' using PigStorage('\t') as(id:int,place:chararray,no_trips:int); a3 = join a1 by id,a2 by id; a4 = group a3 by a1::id; illustrate a4; 在显示消息为之后, 2017-08-21 07:52:11,926 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Encountered IOException. Exception : Error compiling operator POLocalRearrange 数据集是,
Table id 101 aaa executive 102 bbb manager 104 hhh manager 106 ccc trainee 109 hhh trainee Table trips 101 pune 1 101 hyd 2 102 pune 2 102 hyd 3 102 bang 4

tzdcorbm

tzdcorbm1#

当我试着用提供的数据运行你的程序时,我也得到了一些错误,因为你文件中的分隔符不一致。有些地方是它的空间,有些地方是它的标签(可能是它的复制粘贴)。我使定界符通用(使用制表符),一切都很好。
尝试使用dumpa1或dumpa2,看看是否可以在正确的列中看到数据。对我来说,在定界符通用化之后,它工作得非常完美,并给出了以下输出:

------------------------------------------------------------------
| a1     | id:int     | name:chararray     | desig:chararray     |
------------------------------------------------------------------
|        | 101        | aaa                | executive           |
|        | 101        | aaa                | executive           |
------------------------------------------------------------------
----------------------------------------------------------------
| a2     | id:int     | place:chararray     | no_trips:int     |
----------------------------------------------------------------
|        | 101        | pune                | 1                |
|        | 101        | hyd                 | 2                |
----------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
| a3     | a1::id:int     | a1::name:chararray     | a1::desig:chararray     | a2::id:int     | a2::place:chararray     | a2::no_trips:int     |
------------------------------------------------------------------------------------------------------------------------------------------------
|        | 101            | aaa                    | executive               | 101            | pune                    | 1                    |
|        | 101            | aaa                    | executive               | 101            | hyd                     | 2                    |
|        | 101            | aaa                    | executive               | 101            | pune                    | 1                    |
|        | 101            | aaa                    | executive               | 101            | hyd                     | 2                    |
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| a4     | group:int     | a3:bag{:tuple(a1::id:int,a1::name:chararray,a1::desig:chararray,a2::id:int,a2::place:chararray,a2::no_trips:int)}                                 |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|        | 101           | {(101, ..., 1), ..., (101, ..., 2)}                                                                                                               |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

相关问题