Uh oh!
There was an error while loading. Please reload this page.
[SPARK-10655][SQL] Adding additional data type mappings to jdbc DB2dialect. - #9162
[SPARK-10655][SQL] Adding additional data type mappings to jdbc DB2dialect.#9162sureshthalamati wants to merge 3 commits into
Conversation
rxin
commented
Oct 20, 2015
Jenkins, test this please. |
SparkQA
commented
Oct 20, 2015
Test build #1930 has finished for PR 9162 at commit
|
There was a problem hiding this comment.
isn't this mapping it to normal decimal with precision 31?
There was a problem hiding this comment.
Using this mapping DB2 will throw error if the precision of the value being written is > 31 during insert execution. But if the value scale is higher than 2 , value will rounded to scale of 2.
Other alternative was to let it fail with error when create table is executed (current behavior). I was not sure how common the decimal type system default (38, 18) is used to create the data frame. I thought it is better to map to DB2 max precision, instead of failing with error ,considering there is no way to write decimals of precision > 31 to DB2.
If you think it is better to fail on create , instead of surprises during execution. I will update the patch.
I am also working on creating pull request (SPARK-10849) to allow users to specify the target database column type. This will allow user to specify the decimal precision, and scale of their choice in these kind of scenarios.
sureshthalamati
commented
Oct 28, 2015
Thank you for reviewing patch , Reynold. Please let me know if it needs any more changes. |
rick-ibm
commented
Nov 4, 2015
I think these are fine defaults. The work on SPARK-10849 gives fine-grained control to power users. LGTM. Thanks. |
sureshthalamati
commented
Nov 10, 2015
@rxin Wondering if I need any additional work on this patch ? Thanks. |
JoshRosen
commented
Nov 11, 2015
Hey @sureshthalamati, take a look at #9503, which we just merged to re-enable the Docker JDBC integration tests; you should be able to build on that patch to write integration tests that run against a real DB2 instance that's running in Docker. |
sureshthalamati
commented
Nov 16, 2015
Thank you for the information , Josh. Luciano seems to working on creating PR for DB2 docker test setup. I will check with him , and incorporate the type mapping tests into the docker test case. |
ec8e546 to
729fb85Comparelresende
commented
Nov 30, 2015
I have a wip pr #9893, and an open question that I think @JoshRosen could help about the JDBC drivers for the other docker tests. Anyway, these two PRs are independent of each other, no ? |
27eeba0 to
5d022beComparesureshthalamati
commented
May 21, 2016
Updated the PR with the DB2 docker test case for the DB2 specific type mappings added in this PR. TIME STAMP WITH TIME ZONE is DB2Z specific , I could not add the docker test case for this data type. Can you please review the updated PR. |
sureshthalamati
commented
May 24, 2016
ping @JoshRosen@rxin This issue was blocked due to docker relates issues for a while. If you can review the updated PR , that will be great. |
There was a problem hiding this comment.
Is there a duplication of BooleanType line here ? probably copy + paste issue.
lresende
commented
May 24, 2016
Other then the minor comment around BooleanType, it LGTM. |
sureshthalamati
commented
May 25, 2016
Thanks, Luciano. Addressed your comment. |
sureshthalamati
commented
Jun 1, 2016
@JoshRosen@rxin Any suggestions to improve this fix to get it merged ? |
lresende
commented
Jun 3, 2016
Jenkins retest this please |
There was a problem hiding this comment.
How about DECFLOAT(16) and DECFLOAT(34)?
There was a problem hiding this comment.
Thanks for reviewing @gatorsmile . Added test cases for those two variations of the DECFLOAT types.
SparkQA
commented
Sep 26, 2016
Test build #65932 has finished for PR 9162 at commit
|
gatorsmile
commented
Jun 16, 2017
@sureshthalamati Could you please retest it using DB2? |
gatorsmile
commented
Jun 16, 2017
retest this please |
SparkQA
commented
Jun 17, 2017
Test build #78198 has finished for PR 9162 at commit
|
sureshthalamati
commented
Jun 20, 2017
sure @gatorsmile . Thanks. |
f85c3d9 to
8b8bc9aComparesureshthalamati
commented
Jun 21, 2017
@gatorsmile I rebased and ran the DB2 docker test on my machine, it ran fine. |
SparkQA
commented
Jun 21, 2017
Test build #78337 has finished for PR 9162 at commit
|
gatorsmile
commented
Jun 21, 2017
The scope of this PR is just to the DB2 dialect. The risk is pretty small even if the fix might not cover all the scenarios. Thanks! @sureshthalamati LGTM |
gatorsmile
commented
Jun 21, 2017
Thanks! Merging to master. |
sureshthalamati
commented
Jun 21, 2017
Thank you @gatorsmile |
…alect. This patch adds DB2 specific data type mappings for decfloat, real, xml , and timestamp with time zone (DB2Z specific type) types on read and for byte, short data types on write to the to jdbc data source DB2 dialect. Default mapping does not work for these types when reading/writing from DB2 database. Added docker test, and a JDBC unit test case. Author: sureshthalamati <suresh.thalamati@gmail.com> Closesapache#9162 from sureshthalamati/db2dialect_enhancements-spark-10655.
This patch adds DB2 specific data type mappings for decfloat, real, xml , and timestamp with time zone (DB2Z specific type) types on read and for byte, short data types on write to the to jdbc data source DB2 dialect. Default mapping does not work for these types when reading/writing from DB2 database.
Added docker test, and a JDBC unit test case.