Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,9 @@ case object OracleDialect extends JdbcDialect {
None
}
}

override def getJDBCType(dt: DataType): Option[JdbcType] = dt match {
case StringType => Some(JdbcType("VARCHAR2(255)", java.sql.Types.VARCHAR))
case _ => None
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -445,4 +445,9 @@ class JDBCSuite extends SparkFunSuite with BeforeAndAfter {
assert(agg.getCatalystType(1, "", 1, null) == Some(StringType))
}

test("OracleDialect type mapping") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it will be good to make the test name more specific on what it will test.

val oracleDialect = JdbcDialects.get("jdbc:oracle://127.0.0.1/db")
assert(oracleDialect.getJDBCType(StringType).map(_.databaseTypeDefinition).get == "VARCHAR2(255)")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this test works. Let me be clear. We need to add a docker integration test like MySQLIntegrationSuite. Since spark 1.4 branch does not have the testing infrastructure. I think the the right way to do it is for your new PR (using the same JIRA id in the title) created for master, you add the test. Then, for this PR, we just keep the fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I see. Originally, I thought it requires a oracle db. Thank you for the explanation.

Then, we should also add this test in the master. Can you submit a PR? We can reuse the jira number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okei @yhuai So I shall submit another PR, for the same JIRA with the updates in the JDBCSuite.scala in the master branch. I shall also close this PR


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test does not work, right? If so, can we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to testcase written for MySQL,for branch 1.4; which is not actually spinning up any MySQL or Oracle instance; but for the test suite purpose, as I believe. So far, builds for this PR for branch 1.4, failed due to style checks.

}