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

RelMdUniqueKeys should not return empty when meeting Intersect and Minus if its input has unique keys

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.26.0
    • None

    Description

      Currently, we get an empty unique key for Intersect and Minus if its all is true. 

       

      // code placeholder
      public Set<ImmutableBitSet> getUniqueKeys(SetOp rel, RelMetadataQuery mq,
          boolean ignoreNulls) {
        if (!rel.all) {
          return ImmutableSet.of(
              ImmutableBitSet.range(rel.getRowType().getFieldCount()));
        }
        return ImmutableSet.of();
      }
      

      However, from the semantic of Intersect and Minus, we can get their unique keys from its input even if its all is true. 

      Attachments

        Issue Links

          Activity

            People

              Chunwei Lei Chunwei Lei
              Chunwei Lei Chunwei Lei
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m