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

Improve how ReduceExpressionsRule handles duplicate constraints

    Details

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

      Description

      We need to improve ReduceExpressionRule to deal with multiple "equals to literal" in predicate. In ReduceExpressionRule.java, L396-397:

      final ImmutableMap<RexNode, RexLiteral> constants =
             predicateConstants(predicates);

      The query is

      select * from src where (key='12' and key is null);

      Here 'key' is a string type and it is one of the columns of 'src' table.

      Then we will have predicates

      [=($0, '12'), isnull($0)]

      which is the input of the
      predicateConstants, and the function will return "{$0='12'}"

        Attachments

          Activity

            People

            • Assignee:
              pxiong Pengcheng Xiong
              Reporter:
              pxiong Pengcheng Xiong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: