spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheng Lian (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-15916) JDBC AND/OR operator push down does not respect lower OR operator precedence
Date Sat, 18 Jun 2016 00:13:05 GMT

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

Cheng Lian updated SPARK-15916:
-------------------------------
    Assignee: Hyukjin Kwon

> JDBC AND/OR operator push down does not respect lower OR operator precedence
> ----------------------------------------------------------------------------
>
>                 Key: SPARK-15916
>                 URL: https://issues.apache.org/jira/browse/SPARK-15916
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Piotr Czarnas
>            Assignee: Hyukjin Kwon
>             Fix For: 2.0.0
>
>
> A table from sql server Northwind database was registered as a JDBC dataframe.
> A query was executed on Spark SQL, the "northwind_dbo_Categories" table is a temporary
table which is a JDBC dataframe to "[northwind].[dbo].[Categories]" sql server table:
> SQL executed on Spark sql context:
> SELECT CategoryID FROM northwind_dbo_Categories
> WHERE (CategoryID = 1 OR CategoryID = 2) AND CategoryName = 'Beverages'
> Spark has done a proper predicate pushdown to JDBC, however parenthesis around two OR
conditions was removed. Instead the following query was sent over JDBC to SQL Server:
> SELECT "CategoryID" FROM [northwind].[dbo].[Categories] WHERE (CategoryID = 1) OR (CategoryID
= 2) AND CategoryName = 'Beverages'
> As a result, the last two conditions (around the AND operator) were considered as the
highest precedence: (CategoryID = 2) AND CategoryName = 'Beverages'
> Finally SQL Server has executed a query like this:
> SELECT "CategoryID" FROM [northwind].[dbo].[Categories] WHERE CategoryID = 1 OR (CategoryID
= 2 AND CategoryName = 'Beverages')



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message