Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19259#discussion_r139333048
--- Diff:
external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/OracleIntegrationSuite.scala
---
@@ -63,15 +63,40 @@ class OracleIntegrationSuite extends
DockerJDBCIntegrationSuite with SharedSQLCo
}
override def dataPreparation(conn: Connection): Unit = {
- conn.prepareStatement("CREATE TABLE numerics (b DECIMAL(1), f
DECIMAL(3, 2), i DECIMAL(10))").executeUpdate();
+ conn.prepareStatement("CREATE TABLE datetime (id NUMBER(10), d DATE, t
TIMESTAMP)")
+ .executeUpdate()
conn.prepareStatement(
- "INSERT INTO numerics VALUES (4, 1.23, 9999999999)").executeUpdate();
- conn.commit();
+ """INSERT INTO datetime VALUES
+ |(1, {d '1991-11-09'}, {ts '1996-01-01 01:23:45'})
+ """.stripMargin.replaceAll("\n", " ")).executeUpdate()
+ conn.commit()
+
+ sql(
+ s"""
+ |CREATE TEMPORARY VIEW datetime
+ |USING org.apache.spark.sql.jdbc
+ |OPTIONS (url '$jdbcUrl', dbTable 'datetime',
oracle.jdbc.mapDateToTimestamp 'false')
+ """.stripMargin.replaceAll("\n", " "))
+
+ conn.prepareStatement("CREATE TABLE datetime1 (id NUMBER(10), d DATE,
t TIMESTAMP)")
+ .executeUpdate()
+ conn.commit()
+
+ sql(
+ s"""
+ |CREATE TEMPORARY VIEW datetime1
+ |USING org.apache.spark.sql.jdbc
+ |OPTIONS (url '$jdbcUrl', dbTable 'datetime1',
oracle.jdbc.mapDateToTimestamp 'false')
+ """.stripMargin.replaceAll("\n", " "))
+
+ conn.prepareStatement("CREATE TABLE numerics (b DECIMAL(1), f
DECIMAL(3, 2), i DECIMAL(10))").executeUpdate()
+ conn.prepareStatement(
+ "INSERT INTO numerics VALUES (4, 1.23, 9999999999)").executeUpdate()
+ conn.commit()
}
-
- test("SPARK-16625 : Importing Oracle numeric types") {
- val df = sqlContext.read.jdbc(jdbcUrl, "numerics", new Properties);
+ test("SPARK-16625 : Importing Oracle numeric types") {
+ val df = sqlContext.read.jdbc(jdbcUrl, "numerics", new Properties)
--- End diff --
revert this back
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]