Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6683

Surround the OR filters with parentheses while converting spark filters to phoenix expressions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • connectors-6.0.0
    • spark-connector
    • None

    Description

      If there are mix of AND and OR filters in the query while converting the to phoenix filter from spark filters no parentheses got added to OR filters which is leading to wrong filter and finally getting wrong data.

      For example if the filter is used is below

       where ENTITY_INSTANCE_ID = 40 and  (CANCELLATION_FLAG <> 'Y' OR CANCELLATION_FLAG IS NULL ) and CASE_MATCH_TYPE='M'
      

      which is getting converted to an expression and leading to wrong result because result is always giving most of the records matching CANCELLATION_FLAG is not 'Y'

      NOT  "CANCELLATION_FLAG" = 'Y' OR  "CANCELLATION_FLAG" IS NULL AND "CASE_MATCH_TYPE" IS NOT NULL AND "ENTITY_INSTANCE_ID" = 40 AND "ENTITY_INSTANCE_ID" IS NOT NULL AND "CASE_MATCH_TYPE" = 'M'
      

      Attachments

        Issue Links

          Activity

            People

              rajeshbabu Rajeshbabu Chintaguntla
              rajeshbabu Rajeshbabu Chintaguntla
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: