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 2016/11/07 20:28:58 UTC

[jira] [Resolved] (SPARK-16054) Verification of DataFrameReader API Usage

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

Sean Owen resolved SPARK-16054.
-------------------------------
    Resolution: Won't Fix

> Verification of DataFrameReader API Usage
> -----------------------------------------
>
>                 Key: SPARK-16054
>                 URL: https://issues.apache.org/jira/browse/SPARK-16054
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Xiao Li
>
> Below are potential user errors when using DataFrameReader APIs
> {noformat}
> // not allowed to specify format when reading tables from catalog
> spark.read.format("parquet").table(tableName)
> // not allowed to specify schema when reading tables from catalog
> val schema = StructType(StructField("c1", IntegerType) :: Nil)
> spark.read.schema(schema).table(tableName)
> // not allowed to specify options when reading tables from catalog
> spark.read.options(Map("header" -> "true", "mode" -> "dropmalformed")).table(tableName)
> // not allowed to specify the format more than once
> spark.read.format(format).json(path.getCanonicalPath)
> // not allowed to specify schema more than once.
> spark.read.schema(schema1).schema(schema2).json(path.getCanonicalPath)
> // not allowed to specify the schema when reading tables from JDBC
> val schema = StructType(StructField("c1", IntegerType) :: Nil)
> spark.read.schema(schema).jdbc(urlWithUserAndPass, "TEST.PEOPLE", new Properties)
> {noformat}
> We should issue errors when detecting these user errors.



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