-
Notifications
You must be signed in to change notification settings - Fork 489
Add MySQL as a supported database for the relational JDBC persistence backend #4281
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
Open
Y-Wakuta
wants to merge
1
commit into
apache:main
Choose a base branch
from
Y-Wakuta:feat/mysql-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
persistence/relational-jdbc-mysql/tests/build.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.quarkus) | ||
| id("org.kordamp.gradle.jandex") | ||
| id("polaris-runtime") | ||
| } | ||
|
|
||
| // Mirror `runtime/test-common`'s antlr/Scala exclusions and additionally drop | ||
| // jackson-module-scala: Jackson's ServiceLoader otherwise tries to instantiate | ||
| // DefaultScalaModule during RESTEasy provider init and fails. | ||
| configurations.all { | ||
| if (name != "checkstyle") { | ||
| exclude(group = "org.antlr", module = "antlr4-runtime") | ||
| exclude(group = "org.scala-lang", module = "scala-library") | ||
| exclude(group = "org.scala-lang", module = "scala-reflect") | ||
| exclude(group = "com.fasterxml.jackson.module", module = "jackson-module-scala_2.12") | ||
| exclude(group = "com.fasterxml.jackson.module", module = "jackson-module-scala_2.13") | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(platform(libs.quarkus.bom)) | ||
| implementation("io.quarkus:quarkus-rest-jackson") | ||
| // The MySQL JDBC driver lives only in this test module so it stays off the | ||
| // production-facing `runtime/service` classpath. | ||
| implementation("io.quarkus:quarkus-jdbc-mysql") | ||
| implementation(project(":polaris-relational-jdbc")) | ||
| implementation(project(":polaris-runtime-service")) | ||
|
|
||
| testImplementation(project(":polaris-runtime-test-common")) | ||
|
|
||
| intTestImplementation("io.quarkus:quarkus-junit") | ||
| intTestImplementation("io.rest-assured:rest-assured") | ||
| intTestImplementation(project(":polaris-api-management-model")) | ||
| intTestImplementation(project(":polaris-tests")) | ||
| // Reuse the existing `ServerManager` (the PolarisServerManager SPI impl) from | ||
| // runtime-service test fixtures instead of duplicating it in this module. | ||
| intTestImplementation(testFixtures(project(":polaris-runtime-service"))) | ||
| intTestImplementation(platform(libs.iceberg.bom)) | ||
| intTestImplementation("org.apache.iceberg:iceberg-api") | ||
| intTestImplementation("org.apache.iceberg:iceberg-core") | ||
| // CatalogTests / ViewCatalogTests test fixtures used by Mysql*IT base classes. | ||
| intTestImplementation("org.apache.iceberg:iceberg-api:${libs.versions.iceberg.get()}:tests") | ||
| intTestImplementation("org.apache.iceberg:iceberg-core:${libs.versions.iceberg.get()}:tests") | ||
|
|
||
| intTestImplementation(platform(libs.testcontainers.bom)) | ||
| intTestImplementation("org.testcontainers:testcontainers-junit-jupiter") | ||
| intTestImplementation("org.testcontainers:testcontainers-mysql") | ||
| intTestImplementation(project(":polaris-container-spec-helper")) | ||
|
|
||
| // RESTEasy Classic (via keycloak-admin-client) provides the jakarta.ws.rs.client.ClientBuilder | ||
| // SPI used by `PolarisClient`. Must remain `intTestRuntimeOnly` so it does not participate | ||
| // in Quarkus augmentation (which uses RESTEasy Reactive). | ||
| intTestRuntimeOnly(libs.keycloak.admin.client) | ||
| } | ||
|
|
||
| // `runtime/defaults` keeps the MySQL named datasource off by default; flip it on at Quarkus | ||
| // build time for this test module only. The matching `active=true` runtime override is set | ||
| // by `MysqlRelationalJdbcLifeCycleManagement`. | ||
| quarkus { quarkusBuildProperties.put("quarkus.datasource.mysql.jdbc", "true") } | ||
|
|
||
| tasks.named("javadoc") { dependsOn("jandex") } | ||
|
|
||
| tasks.withType<Test> { | ||
| if (System.getenv("AWS_REGION") == null) { | ||
| environment("AWS_REGION", "us-west-2") | ||
| } | ||
| environment("POLARIS_BOOTSTRAP_CREDENTIALS", "POLARIS,test-admin,test-secret") | ||
| val apiVersion = System.getenv("DOCKER_API_VERSION") ?: "1.44" | ||
| systemProperty("api.version", apiVersion) | ||
| jvmArgs("--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED") | ||
| systemProperty("java.security.manager", "allow") | ||
| maxParallelForks = 1 | ||
|
|
||
| val logsDir = project.layout.buildDirectory.get().asFile.resolve("logs") | ||
| jvmArgumentProviders.add( | ||
| CommandLineArgumentProvider { | ||
| listOf("-Dquarkus.log.file.path=${logsDir.resolve("polaris.log").absolutePath}") | ||
| } | ||
| ) | ||
| doFirst { | ||
| logsDir.deleteRecursively() | ||
| project.layout.buildDirectory.get().asFile.resolve("quarkus.log").delete() | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
...t/java/org/apache/polaris/persistence/relational/jdbc/mysql/tests/MysqlApplicationIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.polaris.persistence.relational.jdbc.mysql.tests; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import org.apache.polaris.service.it.test.PolarisApplicationIntegrationTest; | ||
|
|
||
| @TestProfile(MysqlRelationalJdbcProfile.class) | ||
| @QuarkusIntegrationTest | ||
| public class MysqlApplicationIT extends PolarisApplicationIntegrationTest {} | ||
27 changes: 27 additions & 0 deletions
27
.../org/apache/polaris/persistence/relational/jdbc/mysql/tests/MysqlManagementServiceIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.polaris.persistence.relational.jdbc.mysql.tests; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import org.apache.polaris.service.it.test.PolarisManagementServiceIntegrationTest; | ||
|
|
||
| @TestProfile(MysqlRelationalJdbcProfile.class) | ||
| @QuarkusIntegrationTest | ||
| public class MysqlManagementServiceIT extends PolarisManagementServiceIntegrationTest {} |
27 changes: 27 additions & 0 deletions
27
...java/org/apache/polaris/persistence/relational/jdbc/mysql/tests/MysqlPolicyServiceIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.polaris.persistence.relational.jdbc.mysql.tests; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import org.apache.polaris.service.it.test.PolarisPolicyServiceIntegrationTest; | ||
|
|
||
| @TestProfile(MysqlRelationalJdbcProfile.class) | ||
| @QuarkusIntegrationTest | ||
| public class MysqlPolicyServiceIT extends PolarisPolicyServiceIntegrationTest {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.