Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/15046#discussion_r79720526
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
---
@@ -293,6 +293,39 @@ class DataFrameReaderWriterSuite extends QueryTest
with SharedSQLContext with Be
Option(dir).map(spark.read.format("org.apache.spark.sql.test").load)
}
+ test("read a data source that does not extend SchemaRelationProvider") {
+ val dfReader = spark.read
+ .option("from", "1")
+ .option("TO", "10")
+ .format("org.apache.spark.sql.sources.SimpleScanSource")
+
+ // when users do not specify the schema
+ checkAnswer(dfReader.load(), spark.range(1, 11).toDF())
+
+ // when users specify the schema
+ val inputSchema = new StructType().add("s", IntegerType, nullable =
false)
+ val e = intercept[AnalysisException] {
dfReader.schema(inputSchema).load() }
--- End diff --
For `DataFrameReader` APIs, we do not have such a test case
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]