1414
1515apply plugin : ' opensearch.internal-cluster-test'
1616
17- def calciteVersion = ' 1.41.0'
18-
1917// SQL Unified Query API version (aligned with OpenSearch build version)
2018def 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 .
3735configurations {
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
4542dependencies {
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
8672configurations. 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
134108internalClusterTest {
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