Xiao Li created SPARK-16054:
-------------------------------

             Summary: 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}




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