spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-10664) JDBC DataFrameWriter does not save data to Oracle 11 Database
Date Tue, 10 Nov 2015 08:09:10 GMT

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

Sean Owen resolved SPARK-10664.
-------------------------------
    Resolution: Duplicate

> JDBC DataFrameWriter does not save data to Oracle 11 Database
> -------------------------------------------------------------
>
>                 Key: SPARK-10664
>                 URL: https://issues.apache.org/jira/browse/SPARK-10664
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.0
>            Reporter: Dmitriy Atorin
>            Priority: Critical
>
> The issue is that Oracle 11 and less does not support LIMIT function.
> The issue is here:
> 1 . Go in org.apache.spark.sql.execution.datasources.jdbc
> 2. object JdbcUtils 
> 3.
> def tableExists(conn: Connection, table: String): Boolean = {
>     // Somewhat hacky, but there isn't a good way to identify whether a table exists
for all
>     // SQL database systems, considering "table" could also include the database name.
>     Try(conn.prepareStatement(s"SELECT 1 FROM $table LIMIT 1").executeQuery().next()).isSuccess
>   }
> I think it is better to write in this way 
> s"SELECT count(*) FROM $table WHERE 1=0"



--
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