Skip to content

Commit e627caa

Browse files
committed
clean up build.gradle and fix weird javadoc issues with dependencies.
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
1 parent 60d03f7 commit e627caa

File tree

12 files changed

+424
-2454
lines changed

12 files changed

+424
-2454
lines changed

sandbox/libs/analytics-framework/build.gradle

Lines changed: 389 additions & 14 deletions
Large diffs are not rendered by default.

sandbox/plugins/analytics-backend-datafusion/build.gradle

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* compatible open source license.
77
*/
88

9-
def calciteVersion = '1.41.0'
10-
119
opensearchplugin {
1210
description = 'DataFusion native execution engine plugin for the query engine.'
1311
classname = 'org.opensearch.be.datafusion.DataFusionPlugin'
@@ -16,81 +14,9 @@ opensearchplugin {
1614

1715
dependencies {
1816
// Shared types and SPI interfaces (EngineBridge, EngineCapabilities, AnalyticsBackEndPlugin, etc.)
17+
// Also provides calcite-core transitively via api.
1918
api project(':sandbox:libs:analytics-framework')
20-
// Query executor plugin (provides transitive access to server interfaces including QueryBackEndPlugin)
21-
testImplementation project(':sandbox:plugins:analytics-engine')
22-
// Arrow Flight streaming transport (for BufferAllocator, VectorSchemaRoot)
23-
api project(':plugins:arrow-flight-rpc')
24-
25-
// Arrow memory implementation needed at test runtime for RootAllocator
26-
testRuntimeOnly "org.apache.arrow:arrow-memory-unsafe:${versions.arrow}"
27-
28-
// Isthmus: SQL -> Substrait conversion (test only — for building Substrait plans)
29-
testImplementation('io.substrait:isthmus:0.78.0') {
30-
exclude group: 'org.apache.calcite'
31-
exclude group: 'org.apache.calcite.avatica'
32-
}
33-
testImplementation('io.substrait:core:0.78.0') {
34-
exclude group: 'org.apache.calcite'
35-
exclude group: 'org.apache.calcite.avatica'
36-
}
37-
testImplementation "com.google.protobuf:protobuf-java:${versions.protobuf}"
38-
39-
// Calcite (needed by Isthmus for catalog/type resolution)
40-
testImplementation "org.apache.calcite:calcite-core:${calciteVersion}"
41-
testImplementation "org.apache.calcite:calcite-linq4j:${calciteVersion}"
42-
testImplementation "org.apache.calcite.avatica:avatica-core:1.27.0"
43-
testRuntimeOnly "org.apache.calcite:calcite-server:${calciteVersion}"
44-
45-
// Jackson (needed by Isthmus/Substrait for extension YAML parsing)
46-
testImplementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
47-
testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
48-
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${versions.jackson}"
49-
testImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
50-
51-
// Runtime dependencies for Calcite/Isthmus
52-
testRuntimeOnly "org.codehaus.janino:janino:3.1.12"
53-
testRuntimeOnly "org.codehaus.janino:commons-compiler:3.1.12"
54-
testRuntimeOnly 'org.jooq:joou-java-6:0.9.4'
55-
testRuntimeOnly "org.apache.commons:commons-math3:3.6.1"
56-
testRuntimeOnly "com.jayway.jsonpath:json-path:2.9.0"
57-
testRuntimeOnly "org.locationtech.jts:jts-core:${versions.jts}"
58-
testRuntimeOnly "org.yaml:snakeyaml:${versions.snakeyaml}"
59-
testRuntimeOnly "commons-codec:commons-codec:${versions.commonscodec}"
60-
testRuntimeOnly "org.apache.httpcomponents.core5:httpcore5:${versions.httpcore5}"
61-
testRuntimeOnly 'com.esri.geometry:esri-geometry-api:2.2.4'
6219
}
6320

21+
// TODO: Remove once back-end is built out with test suite
6422
testingConventions.enabled = false
65-
thirdPartyAudit.enabled = false
66-
67-
// Suppress -Werror and annotation warnings from Calcite/Arrow dependency jars
68-
tasks.withType(JavaCompile).configureEach {
69-
doFirst {
70-
options.compilerArgs.removeAll(['-Werror'])
71-
options.compilerArgs.removeIf { it.startsWith('-Xlint') || it.startsWith('-Xdoclint') }
72-
options.compilerArgs << '-Xlint:none'
73-
}
74-
}
75-
76-
configurations.all {
77-
resolutionStrategy {
78-
force 'com.google.guava:guava:33.4.0-jre'
79-
force 'com.google.guava:failureaccess:1.0.2'
80-
force 'com.google.errorprone:error_prone_annotations:2.36.0'
81-
force 'org.checkerframework:checker-qual:3.43.0'
82-
force "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
83-
force "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
84-
force "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson_annotations}"
85-
force "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
86-
force "org.slf4j:slf4j-api:${versions.slf4j}"
87-
force "org.locationtech.jts:jts-core:${versions.jts}"
88-
force "org.yaml:snakeyaml:${versions.snakeyaml}"
89-
force "commons-codec:commons-codec:${versions.commonscodec}"
90-
force "org.apache.httpcomponents.core5:httpcore5:${versions.httpcore5}"
91-
force "commons-logging:commons-logging:1.2"
92-
force "org.apache.commons:commons-lang3:3.13.0"
93-
force "org.apache.httpcomponents.client5:httpclient5:5.5"
94-
force "org.apache.httpcomponents.core5:httpcore5-h2:${versions.httpcore5}"
95-
}
96-
}

sandbox/plugins/analytics-engine/build.gradle

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
apply plugin: 'opensearch.internal-cluster-test'
1616

17-
def calciteVersion = '1.41.0'
18-
1917
// SQL Unified Query API version (aligned with OpenSearch build version)
2018
def sqlUnifiedQueryVersion = '3.6.0.0-SNAPSHOT'
2119

@@ -31,30 +29,23 @@ repositories {
3129
}
3230
}
3331

34-
// Custom configuration for guava — Calcite's API leaks guava types but OpenSearch
35-
// forbids guava on compile classpaths. This bypasses the check while keeping guava
36-
// available for compilation. At runtime it comes transitively from calcite-core.
32+
// Guava comes transitively from calcite-core and unified-query — forbidden on
33+
// compile classpaths by OpenSearch. Main sources don't need it; test sources do
34+
// (Calcite API exposes ImmutableList, Predicate). Bypass via custom config.
3735
configurations {
38-
calciteCompile
36+
calciteTestCompile
3937
compileClasspath { exclude group: 'com.google.guava' }
4038
testCompileClasspath { exclude group: 'com.google.guava' }
4139
}
42-
sourceSets.main.compileClasspath += configurations.calciteCompile
43-
sourceSets.test.compileClasspath += configurations.calciteCompile
40+
sourceSets.test.compileClasspath += configurations.calciteTestCompile
4441

4542
dependencies {
4643
// Shared types and SPI interfaces (QueryPlanExecutor, EngineBridge, EngineCapabilities, etc.)
44+
// Also provides calcite-core transitively via api.
4745
api project(':sandbox:libs:analytics-framework')
4846

49-
// Calcite for OpenSearchSchemaBuilder
50-
implementation "org.apache.calcite:calcite-core:${calciteVersion}"
51-
52-
// --- PPL test plugin dependencies ---
53-
54-
// Guava — Calcite's API exposes guava types (ImmutableList, Predicate).
55-
// Added via custom config to bypass the forbidden-dependency check on compile classpaths.
56-
// At runtime, guava is pulled transitively from calcite-core.
57-
calciteCompile "com.google.guava:guava:${versions.guava}"
47+
// Guava for test compilation — Calcite API exposes guava types
48+
calciteTestCompile "com.google.guava:guava:${versions.guava}"
5849

5950
// Calcite code generation (optional in calcite-core POM, needed at runtime for Enumerable pipeline)
6051
testRuntimeOnly "org.codehaus.janino:janino:3.1.12"
@@ -64,27 +55,22 @@ dependencies {
6455
testImplementation("org.opensearch.query:unified-query-api:${sqlUnifiedQueryVersion}") {
6556
exclude group: 'org.opensearch'
6657
}
67-
testImplementation("org.opensearch.query:unified-query-ppl:${sqlUnifiedQueryVersion}") {
68-
exclude group: 'org.opensearch'
69-
}
70-
testImplementation("org.opensearch.query:unified-query-common:${sqlUnifiedQueryVersion}") {
71-
exclude group: 'org.opensearch'
72-
exclude group: 'com.github.babbel'
73-
}
7458
testImplementation("org.opensearch.query:unified-query-core:${sqlUnifiedQueryVersion}") {
7559
exclude group: 'org.opensearch'
7660
}
77-
testImplementation("org.opensearch.query:unified-query-protocol:${sqlUnifiedQueryVersion}") {
61+
testImplementation("org.opensearch.query:unified-query-ppl:${sqlUnifiedQueryVersion}") {
7862
exclude group: 'org.opensearch'
79-
exclude group: 'com.github.babbel'
8063
}
8164

8265
// Arrow Flight streaming transport for ITs
8366
internalClusterTestImplementation project(':plugins:arrow-flight-rpc')
67+
68+
// Calcite bytecode references @Immutable from immutables — resolve at test compile time
69+
testCompileOnly 'org.immutables:value-annotations:2.8.8'
8470
}
8571

8672
configurations.all {
87-
// Globally exclude okhttp-aws-signer transitive from unified-query-common,
73+
// okhttp-aws-signer is a transitive dep of unified-query-common (via unified-query-core),
8874
// only published on JitPack, not needed for PPL parsing/planning
8975
exclude group: 'com.github.babbel', module: 'okhttp-aws-signer'
9076

@@ -118,18 +104,6 @@ configurations.all {
118104
}
119105
}
120106

121-
// Calcite pulls hundreds of optional transitive classes (guava, jackson, etc.)
122-
thirdPartyAudit.enabled = false
123-
124-
// Suppress -Werror and annotation warnings from Calcite/Arrow dependency jars
125-
tasks.withType(JavaCompile).configureEach {
126-
doFirst {
127-
options.compilerArgs.removeAll(['-Werror'])
128-
options.compilerArgs.removeIf { it.startsWith('-Xlint') || it.startsWith('-Xdoclint') }
129-
options.compilerArgs << '-Xlint:none'
130-
}
131-
}
132-
133107
// Arrow/Flight requires these JVM flags
134108
internalClusterTest {
135109
jvmArgs '--add-opens=java.base/java.nio=ALL-UNNAMED'
@@ -142,8 +116,3 @@ internalClusterTest {
142116
systemProperty 'io.netty.tryReflectionSetAccessible', 'true'
143117
jvmArgs += ["--add-opens", "java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"]
144118
}
145-
146-
tasks.named("dependencyLicenses").configure {
147-
mapping from: /calcite-.*/, to: 'calcite'
148-
mapping from: /jackson-.*/, to: 'jackson'
149-
}

0 commit comments

Comments
 (0)