-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-12941][SQL][BRANCH-1.4] Spark-SQL JDBC Oracle dialect fails to map string datatypes to Oracle VARCHAR datatype #10912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding a getJDBCType() method to the JdbcDialects.scala which would create a VARCHAR type for Oracle create table operations.Currently the type TEXT is throwing exceptions which is incompatible to Oracle
|
@yhuai fyr |
|
Can you also create a pr for master? Can you add a docker integration test (like MySQLIntegrationSuite)? |
|
test this please |
|
Test build #50107 has finished for PR 10912 at commit
|
|
please fix the style error |
Updated the style error-remove whitespace
|
@yhuai The style check error has been fixed and committed. |
|
Can you add a test? Also, can you create a pr for master? |
Adding test case for the getJDBCType() method for the datatype-StringType as a part of OracleDialect
|
@yhuai Added the testcase for 1.4. For the master PR, would it be good to raise another bug in reference to this and upload the fix as a new PR for that bug.? In that case, we could close this quickly (once tests passed) , and release this fix for Jose who raised this bug, for his purpose. |
There was a problem hiding this comment.
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.
|
Please create a PR against master. You do not need to create a new jira. In the title of the new PR, you just use the same JIRA number. For this PR, it is better to add |
|
btw, just want to double check. Have you tested your fix with Oracle? |
|
Also, I'd like to get the change in master first. Thanks. |
|
@yhuai Yes;tested. So, as you mentioned, will create a new PR against master with the OracleIntegrationSuite. |
|
test this please |
|
Test build #50199 has finished for PR 10912 at commit
|
|
@yhuai Can the below line wrap pass the style check? |
|
Read it as 2 spaces before .map |
|
If you look at the link, you will see (https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/50199/consoleFull) Also, I do not think the test in this PR will work. Please put that in the OracleIntegrationSuite in the PR for master. |
|
@yhuai working on the OracleIntegrationSuite (In the process of docker creation using Oracle linux) |
|
@yhuai and @JoshRosen But there was no corresponding ojdbc jar in the maven repository. So we had to manually download it to the local and build it. |
|
@yhuai |
Updated for the style fix.
|
@yhuai The style check error for this PR has been fixed in the last commit. This is for branch 1.4. You may request a retest please. |
| assert(oracleDialect.getJDBCType(StringType). | ||
| map(_.databaseTypeDefinition).get == "VARCHAR2(255)") | ||
| } | ||
|
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
test this please |
| val oracleDialect = JdbcDialects.get("jdbc:oracle://127.0.0.1/db") | ||
| assert(oracleDialect.getJDBCType(StringType). | ||
| map(_.databaseTypeDefinition).get == "VARCHAR2(255)") | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
Test build #52189 has finished for PR 10912 at commit
|
| assert(agg.getCatalystType(1, "", 1, null) == Some(StringType)) | ||
| } | ||
|
|
||
| test("OracleDialect type mapping") { |
There was a problem hiding this comment.
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.
|
Merging to 1.4 and 1.5 |
… map string datatypes to Oracle VARCHAR datatype Adding a getJDBCType() method to the JdbcDialects.scala which would create a VARCHAR type for Oracle create table operations.Currently the type TEXT is throwing exceptions which is incompatible to Oracle Author: thomastechs <[email protected]> Closes #10912 from thomastechs/thomastechs-12941-branch.
… map string datatypes to Oracle VARCHAR datatype Adding a getJDBCType() method to the JdbcDialects.scala which would create a VARCHAR type for Oracle create table operations.Currently the type TEXT is throwing exceptions which is incompatible to Oracle Author: thomastechs <[email protected]> Closes #10912 from thomastechs/thomastechs-12941-branch. (cherry picked from commit 9d8404b) Signed-off-by: Yin Huai <[email protected]> Conflicts: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
|
ok I have merged it into branch 1.4 and branch 1.5. Can you close this PR? Thanks! |
Adding a getJDBCType() method to the JdbcDialects.scala which would create a VARCHAR type for Oracle create table operations.Currently the type TEXT is throwing exceptions which is incompatible to Oracle