You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Greg Michalopoulos (JIRA)" <ji...@apache.org> on 2016/01/25 16:19:40 UTC

[jira] [Updated] (SPARK-12928) Oracle FLOAT datatype is not properly handled when reading via JDBC

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

Greg Michalopoulos updated SPARK-12928:
---------------------------------------
    Description: 
When trying to read in a table from Oracle and saveAsParquet, an IllegalArgumentException is thrown when a column of FLOAT datatype is encountered.

Below is the code being run:
{code}val jdbcDF = sqlContext.read.format("jdbc").options(
  Map("url" -> jdbcConnectionString,
          "dbtable" -> "(select someFloat from someTable)",
          "fetchSize" -> fetchSize)).load()

  jdbcDF.saveAsParquetFile(destinationDirectory + table)
{code}

Here is the exception:
{code}java.lang.IllegalArgumentException: Unsupported dataType: {"type":"struct","fields":[{"name":"someFloat","type":"decimal(38,-127)","nullable":true,"metadata":{"name":"someFloat"}}]}, [1.1] failure: `TimestampType' expected but `{' found
{code}

>From the exception it was clear that the FLOAT datatype was presenting itself as scale -127 which appears to be the problem. 


  was:
When trying to read in a table from Oracle and saveAsParquet, an IllegalArgumentException is thrown when a column of FLOAT datatype is encountered.

Below is the code being run:
{code}val jdbcDF = sqlContext.read.format("jdbc").options(
  Map("url" -> jdbcConnectionString,
          "dbtable" -> "(select someFloat from someTable"),
          "fetchSize" -> fetchSize)).load()

  jdbcDF.saveAsParquetFile(destinationDirectory + table)
{code}

Here is the exception:
{code}java.lang.IllegalArgumentException: Unsupported dataType: {"type":"struct","fields":[{"name":"someFloat","type":"decimal(38,-127)","nullable":true,"metadata":{"name":"someFloat"}}]}, [1.1] failure: `TimestampType' expected but `{' found
{code}

>From the exception it was clear that the FLOAT datatype was presenting itself as scale -127 which appears to be the problem. 



> Oracle FLOAT datatype is not properly handled when reading via JDBC
> -------------------------------------------------------------------
>
>                 Key: SPARK-12928
>                 URL: https://issues.apache.org/jira/browse/SPARK-12928
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.6.0
>         Environment: Oracle Database 11g Enterprise Edition   11.2.0.3.0      64bit Production
>            Reporter: Greg Michalopoulos
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When trying to read in a table from Oracle and saveAsParquet, an IllegalArgumentException is thrown when a column of FLOAT datatype is encountered.
> Below is the code being run:
> {code}val jdbcDF = sqlContext.read.format("jdbc").options(
>   Map("url" -> jdbcConnectionString,
>           "dbtable" -> "(select someFloat from someTable)",
>           "fetchSize" -> fetchSize)).load()
>   jdbcDF.saveAsParquetFile(destinationDirectory + table)
> {code}
> Here is the exception:
> {code}java.lang.IllegalArgumentException: Unsupported dataType: {"type":"struct","fields":[{"name":"someFloat","type":"decimal(38,-127)","nullable":true,"metadata":{"name":"someFloat"}}]}, [1.1] failure: `TimestampType' expected but `{' found
> {code}
> From the exception it was clear that the FLOAT datatype was presenting itself as scale -127 which appears to be the problem. 



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