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.

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/b1d22c7e .
        Hide
        julianhyde Julian Hyde added a comment -

        Closing now that 1.0.0-incubating has been released.

        Show
        julianhyde Julian Hyde added a comment - Closing now that 1.0.0-incubating has been released.

          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:

              Development