Skip to content

Commit 4ab1b8a

Browse files
committed
add one more test case
1 parent 335e0d6 commit 4ab1b8a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,24 @@ class TableScanSuite extends DataSourceTest with SharedSQLContext {
395395
}
396396
}
397397

398+
test("read the data source tables that do not extend SchemaRelationProvider") {
399+
Seq("TEMPORARY VIEW", "TABLE").foreach { tableType =>
400+
val tableName = "relationProvierWithSchema"
401+
withTable (tableName) {
402+
sql(
403+
s"""
404+
|CREATE $tableType $tableName
405+
|USING org.apache.spark.sql.sources.SimpleScanSource
406+
|OPTIONS (
407+
| From '1',
408+
| To '10'
409+
|)
410+
""".stripMargin)
411+
checkAnswer(spark.table(tableName), spark.range(1, 11).toDF())
412+
}
413+
}
414+
}
415+
398416
test("SPARK-5196 schema field with comment") {
399417
sql(
400418
"""

0 commit comments

Comments
 (0)