Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
The Correlate expression has among others a field (requiredColumns for representing the set of columns that are used by the correlation.
public abstract class Correlate extends BiRel { protected final CorrelationId correlationId; protected final ImmutableBitSet requiredColumns; protected final JoinRelType joinType; /** * Returns the required columns in left relation required for the correlation * in the right. * * @return columns in left relation required for the correlation in the right */ public ImmutableBitSet getRequiredColumns() { return requiredColumns; }
As the javadoc indicates (implicitly) these columns must be a subset of the columns of the left relation. This is currently not enforced when creating a correlation which can lead to invalid plans and runtime failures which are hard to investigate.
I propose to introduce an additional check inside Correlate#isValid method for enforcing that required columns are valid.
Attachments
Issue Links
- links to