You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2015/11/10 09:09:10 UTC

[jira] [Resolved] (SPARK-10664) JDBC DataFrameWriter does not save data to Oracle 11 Database

     [ 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