Skip to content

Commit

Permalink
[apache#4520] Imporvement(jdbc-catalogs): Shrink JDBC catalog binary …
Browse files Browse the repository at this point in the history
…package size to about 3MB. (apache#4521)

### What changes were proposed in this pull request?

Remove some unnecessary jar dependencies in the runtime classpath for
JDBC catalogs.

### Why are the changes needed?

Shrink JDBC catalog package.

Fix: apache#4520 

### Does this PR introduce _any_ user-facing change?

N/A.
### How was this patch tested?

Test locally and CI.

MySQL catalog:

![image](https://github.com/user-attachments/assets/ddd24475-e7c7-4900-9ec8-6b2dba25882e)

PostgreSQL catalog:

<img width="1315" alt="image"
src="https://github.com/user-attachments/assets/548121c6-a940-455a-83dc-e14f3f7788ee">
Doris catalog:


![image](https://github.com/user-attachments/assets/c952f112-c4f1-404e-8709-56be8b8e7214)

---------

Co-authored-by: Jerry Shao <jerryshao@datastrato.com>
  • Loading branch information
yuqi1129 and jerryshao authored Aug 26, 2024
1 parent 3795285 commit 0af3353
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 30 deletions.
26 changes: 17 additions & 9 deletions catalogs/catalog-jdbc-doris/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@ plugins {
}

dependencies {
implementation(project(":api"))
implementation(project(":catalogs:catalog-jdbc-common"))
implementation(project(":common"))
implementation(project(":core"))
implementation(project(":api")) {
exclude(group = "*")
}
implementation(project(":catalogs:catalog-jdbc-common")) {
exclude(group = "*")
}
implementation(project(":common")) {
exclude(group = "*")
}
implementation(project(":core")) {
exclude(group = "*")
}

implementation(libs.bundles.log4j)
implementation(libs.commons.collections4)
implementation(libs.commons.lang3)
implementation(libs.guava)
implementation(libs.jsqlparser)
implementation(libs.slf4j.api)

testImplementation(project(":catalogs:catalog-jdbc-common", "testArtifacts"))
testImplementation(project(":clients:client-java"))
testImplementation(project(":integration-test-common", "testArtifacts"))
testImplementation(project(":server"))
testImplementation(project(":server-common"))

testImplementation(libs.commons.lang3)
testImplementation(libs.guava)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.mysql.driver)
Expand All @@ -61,7 +65,11 @@ tasks {
}
val copyCatalogLibs by registering(Copy::class) {
dependsOn("jar", "runtimeJars")
from("build/libs")
from("build/libs") {
exclude("guava-*.jar")
exclude("log4j-*.jar")
exclude("slf4j-*.jar")
}
into("$rootDir/distribution/package/catalogs/jdbc-doris/libs")
}

Expand Down
32 changes: 21 additions & 11 deletions catalogs/catalog-jdbc-mysql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,36 @@ plugins {
}

dependencies {
implementation(project(":api"))
implementation(project(":catalogs:catalog-common"))
implementation(project(":catalogs:catalog-jdbc-common"))
implementation(project(":common"))
implementation(project(":core"))
implementation(project(":api")) {
exclude(group = "*")
}
implementation(project(":catalogs:catalog-common")) {
exclude(group = "*")
}
implementation(project(":catalogs:catalog-jdbc-common")) {
exclude(group = "*")
}
implementation(project(":common")) {
exclude(group = "*")
}
implementation(project(":core")) {
exclude(group = "*")
}

implementation(libs.bundles.log4j)
implementation(libs.commons.collections4)
implementation(libs.commons.lang3)
implementation(libs.guava)
implementation(libs.jsqlparser)
implementation(libs.slf4j.api)

testImplementation(project(":catalogs:catalog-jdbc-common", "testArtifacts"))
testImplementation(project(":clients:client-java"))
testImplementation(project(":integration-test-common", "testArtifacts"))
testImplementation(project(":server"))
testImplementation(project(":server-common"))

testImplementation(libs.commons.lang3)
testImplementation(libs.guava)
testImplementation(libs.mysql.driver)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.mysql.driver)
testImplementation(libs.testcontainers)
testImplementation(libs.testcontainers.mysql)

Expand All @@ -63,7 +69,11 @@ tasks {

val copyCatalogLibs by registering(Copy::class) {
dependsOn("jar", "runtimeJars")
from("build/libs")
from("build/libs") {
exclude("guava-*.jar")
exclude("log4j-*.jar")
exclude("slf4j-*.jar")
}
into("$rootDir/distribution/package/catalogs/jdbc-mysql/libs")
}

Expand Down
27 changes: 17 additions & 10 deletions catalogs/catalog-jdbc-postgresql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,34 @@ plugins {

dependencies {

implementation(project(":api"))
implementation(project(":catalogs:catalog-jdbc-common"))
implementation(project(":common"))
implementation(project(":core"))
implementation(project(":api")) {
exclude(group = "*")
}
implementation(project(":catalogs:catalog-jdbc-common")) {
exclude(group = "*")
}
implementation(project(":common")) {
exclude(group = "*")
}
implementation(project(":core")) {
exclude(group = "*")
}

implementation(libs.bundles.log4j)
implementation(libs.commons.collections4)
implementation(libs.commons.lang3)
implementation(libs.guava)
implementation(libs.jsqlparser)

testImplementation(project(":catalogs:catalog-jdbc-common", "testArtifacts"))
testImplementation(project(":clients:client-java"))
testImplementation(project(":integration-test-common", "testArtifacts"))
testImplementation(project(":server"))
testImplementation(project(":server-common"))

testImplementation(libs.bundles.log4j)
testImplementation(libs.commons.lang3)
testImplementation(libs.guava)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.mysql.driver)
testImplementation(libs.postgresql.driver)
testImplementation(libs.slf4j.api)
testImplementation(libs.testcontainers)
testImplementation(libs.testcontainers.mysql)
testImplementation(libs.testcontainers.postgresql)
Expand All @@ -66,7 +69,11 @@ tasks {

val copyCatalogLibs by registering(Copy::class) {
dependsOn("jar", "runtimeJars")
from("build/libs")
from("build/libs") {
exclude("guava-*.jar")
exclude("log4j-*.jar")
exclude("slf4j-*.jar")
}
into("$rootDir/distribution/package/catalogs/jdbc-postgresql/libs")
}

Expand Down

0 comments on commit 0af3353

Please sign in to comment.