数据类型转换问题

时间:2019-02-11 14:16:50

标签: apache hadoop apache-pig

在我的Pig代码中对NULLS执行SUM操作时遇到了问题。但是,我无法理解我的代码在哪里错误地工作。另一个奇怪的事情是,当我在grunt shell命令中逐个命令运行相同的代码时,它就像一个魅力。但是,当我将其放在脚本中时,它给了我下面的错误。

ERROR 0: Exception while executing (Name: grp_import_on_order: Local Rearrange[tuple]{tuple}(false) - scope-1105 Operator Key: scope-1105): 

org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: work__idrp_import_on_order: New For Each(false,false)[bag] - scope-1088 Operator Key: scope-1088):
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: Pre Combiner Local Rearrange[tuple]{Unknown} - scope-1107 Operator Key: scope-1107):  
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POCast (Name: Cast[int] - scope-981 Operator Key: scope-981) 
children: [[POProject (Name: Project [chararray][3] - scope-980 Operator Key: scope-980) children: null at []]] at []]: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: grp_import_on_order: Local Rearrange[tuple]{tuple}(false) - scope-1105 Operator Key: scope-1105):
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: work__idrp_import_on_order: New For Each(false,false)[bag] - scope-1088 Operator Key: scope-1088):
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: Pre Combiner Local Rearrange[tuple]{Unknown} - scope-1107 Operator Key: scope-1107):
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POCast (Name: Cast[int] - scope-981 Operator Key: scope-981) 
children: [[POProject (Name: Project[chararray][3] - scope-980 Operator Key: scope-980) children: null at []]] at []]: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:289)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLocalRearrange.getNextTuple(POLocalRearrange.java:263)
        at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.runPipeline(PigGenericMapBase.java:282)
        at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:277)
        at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:64)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: work__idrp_import_on_order: New For Each(false,false)[bag] - scope-1088 Operator Key: scope-1088):
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: Pre Combiner Local Rearrange[tuple]{Unknown} - scope-1107 Operator Key: scope-1107):
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POCast (Name: Cast[int] - scope-981 Operator Key: scope-981) 
children: [[POProject (Name: Project[chararray][3] - scope-980 Operator Key: scope-980) children: null at []]] at []]: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:289)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.getNextTuple(POForEach.java:242)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:281)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing (Name: Pre Combiner Local Rearrange[tuple]{Unknown} - scope-1107 Operator Key: scope-1107): 

org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POCast (Name: Cast[int] - scope-981 Operator Key: scope-981) 
children: [[POProject (Name: Project [chararray][3] - scope-980 Operator Key: scope-980) children: null at []]] at []]: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:289)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POPreCombinerLocalRearrange.getNextTuple(POPreCombinerLocalRearrange.java:126)
        ... 1 more
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POCast (Name: Cast[int] - scope-981 Operator Key: scope-981) children: [[POProject (Name: 

Project[chararray][3] - scope-980 Operator Key: scope-980) children: null at []]] at []]: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:338)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.processPlan(POForEach.java:378)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.getNextTuple(POForEach.java:298)
        ... 1 more
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POCast.getNextInteger(POCast.java:577)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:321)

0 个答案:

没有答案