-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-16625][SQL] General data types to be mapped to Oracle #14377
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
|
Jenkins test this please |
|
Test build #62919 has finished for PR 14377 at commit
|
|
@poolis @thomastechs do you have an opinion on this? I see you suggested changes to the Oracle dialect previously so might be good reviewers |
| // this to NUMERIC with -127 scale | ||
| // Not sure if there is a more robust way to identify the field as a float (or other | ||
| // numeric types that do not specify a scale. | ||
| case Types.NUMERIC if md.build().getLong("scale") == -127 => |
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.
@wangyum I can merge this, since it looks reasonable, even though I'm not an Oracle expert. Can we streamline this a bit by only computing md.build().getLong("scale") once? The repeated matching of Types.NUMERIC could be done once in an if statement and be clearer.
|
Jenkins test this please |
|
Test build #63170 has finished for PR 14377 at commit
|
|
Jenkins retest this please |
|
Jenkins add to whitelist |
|
Test build #63263 has finished for PR 14377 at commit
|
|
Merged to master |
|
This change has broken number with size to be converted to boolean. I have one table which has number column with size 1, in spark 2.1 its get converted to boolean, instead of integer. If this is expected, from the code is there a way to avoid this conversion? |
|
@vivekdixit05 Which direction? Reading or writing? |
|
@gatorsmile While reading. |
|
@vivekdixit05 Does this PR #17830 resolve your issue? |
| case 1 => Option(BooleanType) | ||
| case 3 | 5 | 10 => Option(IntegerType) | ||
| case 19 if scale == 0L => Option(LongType) | ||
| case 19 if scale == 4L => Option(FloatType) |
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.
We should not change the read path. The bug we need to resolve is just the write path.
… in read path ## What changes were proposed in this pull request? This PR is to revert some code changes in the read path of #14377. The original fix is #17830 When merging this PR, please give the credit to gaborfeher ## How was this patch tested? Added a test case to OracleIntegrationSuite.scala Author: Gabor Feher <[email protected]> Author: gatorsmile <[email protected]> Closes #18408 from gatorsmile/OracleType. (cherry picked from commit b837bf9) Signed-off-by: gatorsmile <[email protected]>
… in read path ## What changes were proposed in this pull request? This PR is to revert some code changes in the read path of apache#14377. The original fix is apache#17830 When merging this PR, please give the credit to gaborfeher ## How was this patch tested? Added a test case to OracleIntegrationSuite.scala Author: Gabor Feher <[email protected]> Author: gatorsmile <[email protected]> Closes apache#18408 from gatorsmile/OracleType.
… in read path This PR is to revert some code changes in the read path of #14377. The original fix is #17830 When merging this PR, please give the credit to gaborfeher Added a test case to OracleIntegrationSuite.scala Author: Gabor Feher <[email protected]> Author: gatorsmile <[email protected]> Closes #18408 from gatorsmile/OracleType.
… in read path ## What changes were proposed in this pull request? This PR is to revert some code changes in the read path of apache#14377. The original fix is apache#17830 When merging this PR, please give the credit to gaborfeher ## How was this patch tested? Added a test case to OracleIntegrationSuite.scala Author: Gabor Feher <[email protected]> Author: gatorsmile <[email protected]> Closes apache#18408 from gatorsmile/OracleType.
|
|
|
@gatorsmile We can consider merging this PR: #18266. |
What changes were proposed in this pull request?
Spark will convert BooleanType to BIT(1), LongType to BIGINT, ByteType to BYTE when saving DataFrame to Oracle, but Oracle does not support BIT, BIGINT and BYTE types.
This PR is convert following Spark Types to Oracle types refer to Oracle Developer's Guide
How was this patch tested?
Add new tests in JDBCSuite.scala and OracleDialect.scala