You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by da...@ya.ru on 2008/12/29 07:25:34 UTC
Error while concatenating two bags
Got a error when tried to concatenate two pieces of data which contain
bags. A simple example:
a = load 'a' as (list: bag{t: tuple(item: chararray)});
b = load 'b' as (list: bag{t: tuple(item: chararray)});
c = union a, b;
describe c
Gives this:
==cut==
2008-12-29 09:17:47,851 [main] ERROR org.apache.pig.PigServer - Cannot
cast bag with schema list: bag({t: (item: chararray)}) to tuple with
schema tuple
2008-12-29 09:17:47,852 [main] ERROR org.apache.pig.PigServer -
Problem resolving LOForEach schema Cannot cast bag with schema list:
bag({t: (item: chararray)}) to tuple with schema tuple
2008-12-29 09:17:47,852 [main] ERROR org.apache.pig.PigServer -
Problem while casting inputs of UNION
2008-12-29 09:17:47,852 [main] ERROR org.apache.pig.PigServer - Severe
problem found during validation
org.apache.pig.impl.plan.PlanValidationException: An unexpected
exception caused the validation to stop
2008-12-29 09:17:47,852 [main] ERROR
org.apache.pig.tools.grunt.GruntParser - java.io.IOException: Unable
to describe schema for alias c [Cannot cast bag with schema list:
bag({t: (item: chararray)}) to tuple with schema tupleProblem
resolving LOForEach schema Cannot cast bag with schema list: bag({t:
(item: chararray)}) to tuple with schema tupleProblem while casting
inputs of UNIONSevere problem found during validation
org.apache.pig.impl.plan.PlanValidationException: An unexpected
exception caused the validation to stop]
at org.apache.pig.PigServer.dumpSchema(PigServer.java:358)
at org.apache.pig.tools.grunt.GruntParser.processDescribe(GruntParser.java:151)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:188)
at org.apache.pig.tools.grunt.GruntParser.parseContOnError(GruntParser.java:94)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:58)
at org.apache.pig.Main.main(Main.java:282)
Caused by: org.apache.pig.impl.logicalLayer.FrontendException: Cannot
cast bag with schema list: bag({t: (item: chararray)}) to tuple with
schema tupleProblem resolving LOForEach schema Cannot cast bag with
schema list: bag({t: (item: chararray)}) to tuple with schema
tupleProblem while casting inputs of UNIONSevere problem found during
validation org.apache.pig.impl.plan.PlanValidationException: An
unexpected exception caused the validation to stop
... 6 more
2008-12-29 09:17:47,852 [main] ERROR
org.apache.pig.tools.grunt.GruntParser - Unable to describe schema for
alias c [Cannot cast bag with schema list: bag({t: (item: chararray)})
to tuple with schema tupleProblem resolving LOForEach schema Cannot
cast bag with schema list: bag({t: (item: chararray)}) to tuple with
schema tupleProblem while casting inputs of UNIONSevere problem found
during validation org.apache.pig.impl.plan.PlanValidationException: An
unexpected exception caused the validation to stop]
2008-12-29 09:17:47,852 [main] ERROR
org.apache.pig.tools.grunt.GruntParser - java.io.IOException: Unable
to describe schema for alias c [Cannot cast bag with schema list:
bag({t: (item: chararray)}) to tuple with schema tupleProblem
resolving LOForEach schema Cannot cast bag with schema list: bag({t:
(item: chararray)}) to tuple with schema tupleProblem while casting
inputs of UNIONSevere problem found during validation
org.apache.pig.impl.plan.PlanValidationException: An unexpected
exception caused the validation to stop]
==cut==
How can I merge two bags using Pig (without direct file operations)
and avoid this error?
Thanks!