Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-509

RelMdColumnUniqueness uses ImmutableBitSet.Builder twice, gets NullPointerException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-incubating
    • Component/s: None
    • Labels:

      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.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: