Uh oh!
There was an error while loading. Please reload this page.
[SPARK-26499] [SQL] JdbcUtils.makeGetter does not handle ByteType - #23400
[SPARK-26499] [SQL] JdbcUtils.makeGetter does not handle ByteType#23400twdsilva wants to merge 5 commits into
Conversation
twdsilva
commented
Dec 29, 2018
Uh oh!
There was an error while loading. Please reload this page.
HyukjinKwon
commented
Dec 29, 2018
I think we should also update migration guide. |
HyukjinKwon
commented
Dec 29, 2018
ok to test |
HyukjinKwon
commented
Dec 29, 2018
SparkQA
commented
Dec 29, 2018
Test build #100534 has finished for PR 23400 at commit
|
twdsilva
commented
Dec 30, 2018
In order to update the migration guide, would I have to create a separate PR for https://github.com/apache/spark-website ? |
twdsilva
commented
Dec 30, 2018
I will investigate why the PySpark unit tests are failing. |
HyukjinKwon
commented
Dec 30, 2018
Migration guide is located in https://github.com/apache/spark/blob/master/docs/sql-migration-guide-upgrade.md |
HyukjinKwon
commented
Dec 30, 2018
PySpark test failure looks orthogonal with this change. |
… test that uses custom JdbcDialect that maps TINYINT to ByteType
SparkQA
commented
Dec 30, 2018
Test build #100547 has finished for PR 23400 at commit
|
Looks good. For completeness, the integration test should be a good to do. |
twdsilva
commented
Dec 30, 2018
@HyukjinKwon I ran the docker integration tests and they all passed |
SparkQA
commented
Dec 30, 2018
Test build #100548 has finished for PR 23400 at commit
|
HyukjinKwon
commented
Dec 30, 2018
retest this please |
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Dec 30, 2018
Test build #100552 has finished for PR 23400 at commit
|
HyukjinKwon
commented
Dec 31, 2018
Let me leave this open for few more days before getting it merged. |
SparkQA
commented
Dec 31, 2018
Test build #100582 has finished for PR 23400 at commit
|
kiszk
commented
Dec 31, 2018
retest this please |
SparkQA
commented
Dec 31, 2018
Test build #100586 has finished for PR 23400 at commit
|
HyukjinKwon
commented
Dec 31, 2018
retest this please |
SparkQA
commented
Dec 31, 2018
Test build #100591 has finished for PR 23400 at commit
|
HyukjinKwon
commented
Dec 31, 2018
retest this please |
srowen
left a comment
There was a problem hiding this comment.
OK by me; I don't see any harm in supporting it
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Dec 31, 2018
Test build #100593 has finished for PR 23400 at commit
|
SparkQA
commented
Jan 1, 2019
Test build #100599 has finished for PR 23400 at commit
|
HyukjinKwon
commented
Jan 1, 2019
retest this please |
1 similar comment
HyukjinKwon
commented
Jan 1, 2019
retest this please |
SparkQA
commented
Jan 1, 2019
Test build #100601 has finished for PR 23400 at commit
|
SparkQA
commented
Jan 1, 2019
Test build #4491 has finished for PR 23400 at commit
|
SparkQA
commented
Jan 1, 2019
Test build #100602 has finished for PR 23400 at commit
|
HyukjinKwon
commented
Jan 1, 2019
Merged to master. |
…Type ## What changes were proposed in this pull request? Modifed JdbcUtils.makeGetter to handle ByteType. ## How was this patch tested? Added a new test to JDBCSuite that maps ```TINYINT``` to ```ByteType```. Closesapache#23400 from twdsilva/tiny_int_support. Authored-by: Thomas D'Silva <tdsilva@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
…Type ## What changes were proposed in this pull request? Modifed JdbcUtils.makeGetter to handle ByteType. ## How was this patch tested? Added a new test to JDBCSuite that maps ```TINYINT``` to ```ByteType```. Closesapache#23400 from twdsilva/tiny_int_support. Authored-by: Thomas D'Silva <tdsilva@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
## What changes were proposed in this pull request? This is a port of SPARK-26499 to 2.4 Modifed JdbcUtils.makeGetter to handle ByteType. ## How was this patch tested? Added a new test to JDBCSuite that maps ```TINYINT``` to ```ByteType```. Closes#23400 from twdsilva/tiny_int_support. Authored-by: Thomas D'Silva <tdsilvaapache.org> Signed-off-by: Hyukjin Kwon <gurwls223apache.org> ### Why are the changes needed? Changes are required to port pr #26301 (SPARK-29644) to 2.4 ### Does this PR introduce any user-facing change? No ### How was this patch tested? Yes, tested on 2.4 with using docker integration test for MySQL, MsSQLServer, Postgres ``sh /build/mvn test -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.11 -Dtest=none -DwildcardSuites=org.apache.spark.sql.jdbc.MySQLIntegrationSuite ./build/mvn test -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.11 -Dtest=none -DwildcardSuites=org.apache.spark.sql.jdbc.MsSqlServerIntegrationSuite ./build/mvn test -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.11 -Dtest=none -DwildcardSuites=org.apache.spark.sql.jdbc.PostgresIntegrationSuite `` Closes#26531 from shivsood/pr_26499_2.4_port. Lead-authored-by: shivsood <shivsood@microsoft.com> Co-authored-by: Thomas D'Silva <tdsilva@apache.org> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
…eType in JdbcUtils.makeGetter ### What changes were proposed in this pull request? This is a follow-up pr to fix the code coming from #23400; it replaces `update` with `setByte` for ByteType in `JdbcUtils.makeGetter`. ### Why are the changes needed? For better code. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Existing tests. Closes#26532 from maropu/SPARK-26499-FOLLOWUP. Authored-by: Takeshi Yamamuro <yamamuro@apache.org> Signed-off-by: Sean Owen <sean.owen@databricks.com>
| size: Int, | ||
| md: MetadataBuilder): Option[DataType] = { | ||
| sqlType match { | ||
| case java.sql.Types.TINYINT => Some(ByteType) |
There was a problem hiding this comment.
I'm wondering if this is okay in this H2 dialect context.
We made testH2DialectTinyInt like this, but theoretically, TINYINT is still unsigned and Spark ByteType is signed.
There was a problem hiding this comment.
Yeah, I think we found similar issue in another PR. @twdsilva can you check and fix it if needed?
| } | ||
| test("Map TINYINT to ByteType via JdbcDialects") { | ||
| JdbcDialects.registerDialect(testH2DialectTinyInt) |
There was a problem hiding this comment.
Oh, @dongjoon-hyun, actually this test seems fine. The test dialect seems only scoped for this specific case.
There was a problem hiding this comment.
although it's a bit odd given #23400 (comment), at least this test is scoped and won't affect other tests about unsigned TINYINT cases.
There was a problem hiding this comment.
Originally, I suspected this dialect is valid for H2 database's type.
Luckily, TINYINT of H2 database seems to be also -128 to 127.
In this case, I'm okay~
…Type
What changes were proposed in this pull request?
Modifed JdbcUtils.makeGetter to handle ByteType.
How was this patch tested?
Added a new test to JDBCSuite that maps
TINYINTtoByteType.