Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Oct 23, 2019

What changes were proposed in this pull request?

This PR updates JDBC Integration Test DBMS Docker Images.

DBMS Docker Image Tag Release
MySQL mysql:5.7.28 Oct 13, 2019
PostgreSQL postgres:12.0-alpine Oct 3, 2019
  • For MySQL, SET GLOBAL sql_mode = '' is added to disable all strict modes because test("Basic write test") creates a table like the following. The latest MySQL rejects 0000-00-00 00:00:00 as TIMESTAMP and causes the test case failure.
mysql> desc datescopy;
+-------+-----------+------+-----+---------------------+-----------------------------+
| Field | Type      | Null | Key | Default             | Extra                       |
+-------+-----------+------+-----+---------------------+-----------------------------+
| d     | date      | YES  |     | NULL                |                             |
| t     | timestamp | NO   |     | CURRENT_TIMESTAMP   | on update CURRENT_TIMESTAMP |
| dt    | timestamp | NO   |     | 0000-00-00 00:00:00 |                             |
| ts    | timestamp | NO   |     | 0000-00-00 00:00:00 |                             |
| yr    | date      | YES  |     | NULL                |                             |
+-------+-----------+------+-----+---------------------+-----------------------------+
  • For PostgreSQL, I chose the smallest image in 12 releases. It reduces the image size a lot, 312MB -> 72.8MB. This is good for CI/CI testing environment.
$ docker images | grep postgres
postgres      12.0-alpine          5b681acb1cfc        2 days ago          72.8MB
postgres      11.4                 53912975086f        3 months ago        312MB

Note that

  • For MsSqlServer, we are using 2017-GA-ubuntu and the next version 2019-CTP3.2-ubuntu is still Community Technology Preview status.
  • For DB2 and Oracle, the official images are not available.

Why are the changes needed?

This is to make it sure we are testing with the latest DBMS images during preparing 3.0.0.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Since this is the integration test, we need to run this manually.

build/mvn install -DskipTests
build/mvn -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.12 test

@dongjoon-hyun
Copy link
Member Author

There is some suspicious part. I'll reopen this later.

@SparkQA
Copy link

SparkQA commented Oct 23, 2019

Test build #112527 has finished for PR 26224 at commit 324c8d6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 23, 2019

Test build #112528 has finished for PR 26224 at commit c31d669.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun dongjoon-hyun reopened this Oct 23, 2019
Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

seems fine.

@dongjoon-hyun
Copy link
Member Author

Thank you for review, @viirya !

@SparkQA
Copy link

SparkQA commented Oct 23, 2019

Test build #112562 has finished for PR 26224 at commit c31d669.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member

maropu commented Oct 23, 2019

retest this please

}

override def dataPreparation(conn: Connection): Unit = {
// Since MySQL 5.7.14+, we need to disable strict mode
Copy link
Member

Choose a reason for hiding this comment

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

just out of curiosity; why we need to disable the mode in this mysql?

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Oct 23, 2019

Choose a reason for hiding this comment

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

As I mentioned in the PR description, MySQL baned 0000-00-00 00:00:00. There is a SQL mode for that. I enumerated and tested all versions. It starts to ban on 5.7.14.

Copy link
Member

Choose a reason for hiding this comment

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

oh, I missed that. thanks.

class PostgresIntegrationSuite extends DockerJDBCIntegrationSuite {
override val db = new DatabaseOnDocker {
override val imageName = "postgres:11.4"
override val imageName = "postgres:12.0-alpine"
Copy link
Member

Choose a reason for hiding this comment

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

12.0-alpine instead of 12.0?

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Oct 23, 2019

Choose a reason for hiding this comment

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

Yes. This is another improvement. It reduces the image size a lot, 312MB -> 72.8MB. This is good for CI/CI testing environment.

$ docker images | grep postgres
postgres                         12.0-alpine          5b681acb1cfc        2 days ago          72.8MB
postgres                         11.4                 53912975086f        3 months ago        312MB

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add this to the PR description.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! Yea, it looks nice.

@dongjoon-hyun
Copy link
Member Author

Thank you for review, @maropu !

@maropu
Copy link
Member

maropu commented Oct 23, 2019

Anyway, I checked this pr worked correctly on my local env.

@dongjoon-hyun
Copy link
Member Author

Thank you again, @maropu !

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented Oct 23, 2019

Thank you, @viirya and @maropu .
Since this is the integration test suite and the integration test itself is verified manually, I'll merge this. (Also, the last commit passed the test twice last night) Merged to master!

@dongjoon-hyun dongjoon-hyun deleted the SPARK-29567 branch October 23, 2019 23:45
@SparkQA
Copy link

SparkQA commented Oct 24, 2019

Test build #112567 has finished for PR 26224 at commit c31d669.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants