You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/04/06 01:09:00 UTC
[jira] [Commented] (PHOENIX-6683) Surround the OR filters with parentheses while converting spark filters to phoenix expessions
[ https://issues.apache.org/jira/browse/PHOENIX-6683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17517766#comment-17517766 ]
ASF GitHub Bot commented on PHOENIX-6683:
-----------------------------------------
chrajeshbabu opened a new pull request, #73:
URL: https://github.com/apache/phoenix-connectors/pull/73
…g spark filters to phoenix expessions
> Surround the OR filters with parentheses while converting spark filters to phoenix expessions
> ---------------------------------------------------------------------------------------------
>
> Key: PHOENIX-6683
> URL: https://issues.apache.org/jira/browse/PHOENIX-6683
> Project: Phoenix
> Issue Type: Bug
> Components: spark-connector
> Reporter: Rajeshbabu Chintaguntla
> Assignee: Rajeshbabu Chintaguntla
> Priority: Major
>
> 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
> {code}
> where ENTITY_INSTANCE_ID = 40 and (CANCELLATION_FLAG <> 'Y' OR CANCELLATION_FLAG IS NULL ) and CASE_MATCH_TYPE='M'
> {code}
> 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'
> {code}
> 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'
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)