Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.16.0, 0.17.0
-
None
-
None
-
Reviewed
Description
Ran into a failure with a script of the form:
u = union onschema x, y; -- schema: (a, b: {(m:int, n: chararray)})
z = foreach u {
i = foreach b generate m + 5;
generate a, i;
}
The issue ended up being that LOUnion is not setting uids on inner schemas. This means that uids on inner schema fields are all -1, so when ProjectExpression.getFieldSchema() tries to look up the fields in the inner select from the inner schema, all the fields match, and the last field's schema ends up being returned. In the example above this causes TypeCheckingExpVisitor.addCastsToNumericBinExpression() to fail for the addition operator (since the returned field schema is a chararray).
This only seems to affect the schema, so I don't think this should cause bad data to be produced.