spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Cheung (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-22548) Incorrect nested AND expression pushed down to JDBC data source
Date Fri, 24 Nov 2017 20:55:00 GMT

     [ https://issues.apache.org/jira/browse/SPARK-22548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Felix Cheung updated SPARK-22548:
---------------------------------
    Target Version/s: 2.3.0, 2.2.2

> Incorrect nested AND expression pushed down to JDBC data source
> ---------------------------------------------------------------
>
>                 Key: SPARK-22548
>                 URL: https://issues.apache.org/jira/browse/SPARK-22548
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Jia Li
>            Assignee: Jia Li
>             Fix For: 2.1.3, 2.2.1, 2.3.0
>
>
> Let’s say I have a JDBC data source table ‘foobar’ with 3 rows:
> NAME		THEID
> ==================
> fred            	1
> mary          	2
> joe 'foo' "bar"    3
> This query returns incorrect result. 
> SELECT * FROM foobar WHERE (THEID > 0 AND TRIM(NAME) = 'mary') OR (NAME = 'fred')
> It’s supposed to return:
> fred             	1
> mary          	2
> But it returns
> fred            	1
> mary          	2
> joe 'foo' "bar"    3
> This is because one leg of the nested AND predicate, TRIM(NAME) = 'mary’, can not be
pushed down but is lost during JDBC push down filter translation. The same translation method
is also called by Data Source V2. I have a fix for this issue and will open a PR. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message