Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15579

SQL WHERE filter with 20 or more values in the IN clause results in no filtering on that field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0, 8.10
    • Parallel SQL

    Description

      Calcite has a default threshold of 20 for the number of values in an IN clause. If this threshold is reached, then Calcite transforms the IN clause into an inline table + sub-query which is not handled by SolrFilter, so that filter clause gets dropped from the resulting query to Solr, see:

      https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L1143

      The easiest solution is to update the config.withInSubQueryThreshold(Integer.MAX_VALUE)

      I think we should also explore how to work with the sub-query against the inline table if possible.

      Attachments

        Activity

          People

            thelabdude Timothy Potter
            thelabdude Timothy Potter
            Votes:
            0 Vote for this issue
            Watchers:
            2 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