Skip to content

Commit f6ac7c3

Browse files
thomastechsyhuai
authored andcommitted
[SPARK-12941][SQL][MASTER] Spark-SQL JDBC Oracle dialect fails to map string datatypes to Oracle VARCHAR datatype mapping
## What changes were proposed in this pull request? A test suite added for the bug fix -SPARK 12941; for the mapping of the StringType to corresponding in Oracle ## How was this patch tested? manual tests done (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests) (If this patch involves UI changes, please attach a screenshot; otherwise, remove this) Author: thomastechs <[email protected]> Author: THOMAS SEBASTIAN <[email protected]> Closes #11489 from thomastechs/thomastechs-12941-master-new.
1 parent 15d57f9 commit f6ac7c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,4 +645,10 @@ class JDBCSuite extends SparkFunSuite
645645
r => assert(!List("testPass", "testUser").exists(r.toString.contains))
646646
}
647647
}
648+
649+
test("SPARK 12941: The data type mapping for StringType to Oracle") {
650+
val oracleDialect = JdbcDialects.get("jdbc:oracle://127.0.0.1/db")
651+
assert(oracleDialect.getJDBCType(StringType).
652+
map(_.databaseTypeDefinition).get == "VARCHAR2(255)")
653+
}
648654
}

0 commit comments

Comments
 (0)