[ 
https://issues.apache.org/jira/browse/SPARK-16054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15338411#comment-15338411
 ] 

Apache Spark commented on SPARK-16054:
--------------------------------------

User 'gatorsmile' has created a pull request for this issue:
https://github.com/apache/spark/pull/13770

> 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)
> {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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to