Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
RelMdColumnUniqueness.areColumnsUnique gets the following stack:
ava.lang.NullPointerException at org.apache.calcite.util.ImmutableBitSet.countBits(ImmutableBitSet.java:280) at org.apache.calcite.util.ImmutableBitSet.access$600(ImmutableBitSet.java:36) at org.apache.calcite.util.ImmutableBitSet$Builder.cardinality(ImmutableBitSet.java:799) at org.apache.calcite.rel.metadata.RelMdColumnUniqueness.areColumnsUnique(RelMdColumnUniqueness.java:178)
The cause is that it populates an ImmutableBitSet.Builder, calls build on it, then calls cardinality. That is not allowed – once build has been called the builder cannot be re-used, even for cardinality.