diff options
author | thomastechs <thomas.sebastian@tcs.com> | 2016-03-03 20:35:40 -0800 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-03-03 20:35:40 -0800 |
commit | f6ac7c30d48e666618466e825578fa457e2a0ed4 (patch) | |
tree | 8d83c36389f68387537e6f842664909bc52566b2 /sql | |
parent | 15d57f9c23145ace37d1631d8f9c19675c142214 (diff) | |
download | spark-f6ac7c30d48e666618466e825578fa457e2a0ed4.tar.gz spark-f6ac7c30d48e666618466e825578fa457e2a0ed4.tar.bz2 spark-f6ac7c30d48e666618466e825578fa457e2a0ed4.zip |
[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 <thomas.sebastian@tcs.com>
Author: THOMAS SEBASTIAN <thomas.sebastian@tcs.com>
Closes #11489 from thomastechs/thomastechs-12941-master-new.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala index b0d64aa7bf..dfffa58212 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala @@ -645,4 +645,10 @@ class JDBCSuite extends SparkFunSuite r => assert(!List("testPass", "testUser").exists(r.toString.contains)) } } + + test("SPARK 12941: The data type mapping for StringType to Oracle") { + val oracleDialect = JdbcDialects.get("jdbc:oracle://127.0.0.1/db") + assert(oracleDialect.getJDBCType(StringType). + map(_.databaseTypeDefinition).get == "VARCHAR2(255)") + } } |