The behavior of a foreach operation (also called projection) has changed.
Unique Names Required in a Projection
Using a name multiple times in a projection throws an error.
In the previous release, this query produced only the last projected alias in the result set. In this release, the last line is invalid and throws an error:
l = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; r = load "0Fbyy000000002qCAA/0Fcyy000000002WCAQ"; l = foreach l generate 'value'/'divisor' as 'value' , category as category; r = foreach r generate 'value'/'divisor' as 'value' , category as category; cg = cogroup l by category right, r by category; cg = foreach cg generate r.category as 'category', sum(r.value) as sumrval, sum(l::value) as sumrval;
Consistent Projection of Constants
In this release, constant projection is consistent between preprojection and postprojection. A foreach operation returns rows based on filtered dataset size.
For example, this query returns all the rows in the loaded dataset:
In the previous release, it returned one row.
q = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; q = foreach q generate 1 as num;