Skip to content

Commit b3d572b

Browse files
committed
move front-end test plugin to a separate plugin package.
add sandbox/qa with a rest test that will test full wiring & execution Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
1 parent d8df6c9 commit b3d572b

File tree

98 files changed

+2274
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2274
-206
lines changed

.gitignore

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,3 @@ testfixtures_shared/
7676

7777
# build files generated
7878
doc-tools/missing-doclet/bin/
79-
/plugins/dataformat-csv/jni/target
80-
/plugins/dataformat-csv/jni/Cargo.lock
81-
82-
/modules/parquet-data-format/src/main/rust/target
83-
/modules/parquet-data-format/src/main/rust/debug
84-
/modules/parquet-data-format/src/main/resources/native/
85-
/modules/parquet-data-format/jni/target/debug
86-
/modules/parquet-data-format/jni/target/.rustc_info.json
87-
88-
/modules/parquet-data-format/jni/target/release
89-
**/Cargo.lock
90-
/modules/parquet-data-format/jni/

gradle/run.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ testClusters {
8888
for (String p : installedPlugins) {
8989
// check if its a local plugin first
9090
if (project.findProject(':plugins:' + p) != null) {
91-
plugin('plugins:' + p)
91+
plugin(':plugins:' + p)
92+
} else if (project.findProject(':sandbox:plugins:' + p) != null) {
93+
plugin(':sandbox:plugins:' + p)
9294
} else {
9395
// attempt to fetch it from maven
9496
project.repositories.mavenLocal()

modules/parquet-data-format/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ dependencies {
114114
implementation 'org.apache.arrow:arrow-c-data:18.3.0'
115115

116116
// Checker Framework annotations (required by Arrow)
117-
implementation 'org.checkerframework:checker-qual:3.42.0'
117+
implementation 'org.checkerframework:checker-qual:3.43.0'
118118

119119
// Jackson dependencies required by Arrow
120120
implementation 'com.fasterxml.jackson.core:jackson-core:2.18.2'

modules/parquet-data-format/src/main/java/com/parquet/parquetdataformat/engine/read/ParquetDataSourceCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ public class ParquetDataSourceCodec implements DataSourceCodec {
3232
}
3333

3434
public DataFormat getDataFormat() {
35-
return DataFormat.CSV;
35+
return DataFormat.PARQUET;
3636
}
3737
}

plugins/engine-datafusion/build.gradle

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ opensearchplugin {
2323
name = pluginName
2424
description = pluginDescription
2525
classname = "${projectPath}.${pathToPlugin}"
26+
extendedPlugins = ['analytics-engine']
2627
licenseFile = rootProject.file('LICENSE.txt')
2728
noticeFile = rootProject.file('NOTICE.txt')
2829
}
2930

3031

3132
dependencies {
3233
api project(':libs:opensearch-vectorized-exec-spi')
34+
api project(':sandbox:libs:analytics-framework')
3335
implementation "org.apache.logging.log4j:log4j-api:${versions.log4j}"
3436
implementation "org.apache.logging.log4j:log4j-core:${versions.log4j}"
3537

@@ -47,10 +49,32 @@ dependencies {
4749
// SLF4J API for Arrow logging compatibility
4850
implementation "org.slf4j:slf4j-api:${versions.slf4j}"
4951
// CheckerFramework annotations required by Arrow 17.0.0
50-
implementation "org.checkerframework:checker-qual:3.42.0"
52+
implementation "org.checkerframework:checker-qual:3.43.0"
5153
// FlatBuffers dependency required by Arrow 17.0.0
5254
implementation "com.google.flatbuffers:flatbuffers-java:${versions.flatbuffers}"
5355

56+
// Substrait: RelNode → Substrait plan conversion via Calcite Isthmus
57+
implementation('io.substrait:core:0.67.0') {
58+
exclude group: 'ch.qos.logback', module: 'logback-classic'
59+
exclude group: 'ch.qos.logback', module: 'logback-core'
60+
exclude group: 'org.apache.calcite', module: 'calcite-core'
61+
exclude group: 'org.apache.calcite', module: 'calcite-linq4j'
62+
exclude group: 'com.google.code.gson', module: 'gson'
63+
exclude group: 'org.antlr', module: 'antlr4-runtime'
64+
exclude group: 'org.antlr', module: 'antlr4'
65+
}
66+
implementation('io.substrait:isthmus:0.67.0') {
67+
exclude group: 'ch.qos.logback', module: 'logback-classic'
68+
exclude group: 'ch.qos.logback', module: 'logback-core'
69+
exclude group: 'org.apache.calcite', module: 'calcite-core'
70+
exclude group: 'org.apache.calcite', module: 'calcite-linq4j'
71+
exclude group: 'com.google.code.gson', module: 'gson'
72+
exclude group: 'org.antlr', module: 'antlr4-runtime'
73+
exclude group: 'org.antlr', module: 'antlr4'
74+
}
75+
implementation "com.google.protobuf:protobuf-java:${versions.protobuf}"
76+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${versions.jackson}"
77+
5478
testImplementation "junit:junit:${versions.junit}"
5579
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
5680
testImplementation "org.mockito:mockito-core:${versions.mockito}"
@@ -131,6 +155,47 @@ task copyNativeLibrary(type: Copy, dependsOn: buildRustLibrary) {
131155
}
132156
}
133157

158+
// Exclude jars provided by analytics-engine plugin (shared via extendedPlugins classloader)
159+
// Exclude jars already in the analytics-engine parent plugin ZIP (via analytics-framework)
160+
bundlePlugin {
161+
exclude 'analytics-framework-*.jar'
162+
exclude 'calcite-core-*.jar'
163+
exclude 'calcite-linq4j-*.jar'
164+
exclude 'avatica-core-*.jar'
165+
exclude 'avatica-metrics-*.jar'
166+
exclude 'guava-*.jar'
167+
exclude 'failureaccess-*.jar'
168+
exclude 'slf4j-api-*.jar'
169+
exclude 'checker-qual-*.jar'
170+
exclude 'jackson-annotations-*.jar'
171+
exclude 'jackson-databind-*.jar'
172+
exclude 'jackson-core-*.jar'
173+
exclude 'commons-codec-*.jar'
174+
exclude 'janino-*.jar'
175+
exclude 'commons-compiler-*.jar'
176+
exclude 'joou-java-6-*.jar'
177+
exclude 'commons-lang3-*.jar'
178+
exclude 'commons-text-*.jar'
179+
exclude 'commons-math3-*.jar'
180+
exclude 'value-annotations-*.jar'
181+
exclude 'json-path-*.jar'
182+
exclude 'json-smart-*.jar'
183+
exclude 'accessors-smart-*.jar'
184+
exclude 'asm-*.jar'
185+
exclude 'jts-core-*.jar'
186+
exclude 'jts-io-common-*.jar'
187+
exclude 'proj4j-*.jar'
188+
exclude 'uzaygezen-core-*.jar'
189+
exclude 'sketches-core-*.jar'
190+
exclude 'memory-*.jar'
191+
exclude 'httpcore5-*.jar'
192+
exclude 'httpcore5-h2-*.jar'
193+
exclude 'httpclient5-*.jar'
194+
exclude 'jts-core-*.jar'
195+
exclude 'jackson-core-*.jar'
196+
exclude 'error_prone_annotations-*.jar'
197+
}
198+
134199
// Ensure native library is built before Java compilation
135200
compileJava.dependsOn copyNativeLibrary
136201

@@ -194,13 +259,37 @@ tasks.named("dependencyLicenses").configure {
194259
mapping from: /slf4j-.*/, to: 'slf4j-api'
195260
mapping from: /checker-qual.*/, to: 'checker-qual'
196261
mapping from: /flatbuffers-.*/, to: 'flatbuffers-java'
262+
mapping from: /substrait-.*/, to: 'substrait'
263+
mapping from: /protobuf-.*/, to: 'protobuf-java'
197264
}
198265

199266
// Configure third party audit to handle Apache Arrow dependencies
200267
tasks.named('thirdPartyAudit').configure {
201268
ignoreMissingClasses(
202269
// Apache Commons Codec (missing dependency)
203-
'org.apache.commons.codec.binary.Hex'
270+
'org.apache.commons.codec.binary.Hex',
271+
// Immutables annotations (used by Substrait generated code, annotation-only)
272+
'org.immutables.value.Value',
273+
'org.immutables.value.Value$Check',
274+
'org.immutables.value.Value$Default',
275+
'org.immutables.value.Value$Derived',
276+
'org.immutables.value.Value$Enclosing',
277+
'org.immutables.value.Value$Immutable',
278+
'org.immutables.value.Value$Lazy',
279+
'org.immutables.value.Value$Parameter',
280+
'org.immutables.value.Value$Style',
281+
// Error Prone annotations (used by Substrait/Protobuf, annotation-only)
282+
'com.google.errorprone.annotations.CanIgnoreReturnValue',
283+
'com.google.errorprone.annotations.CheckReturnValue',
284+
'com.google.errorprone.annotations.Immutable',
285+
'com.google.errorprone.annotations.InlineMe',
286+
'com.google.errorprone.annotations.InlineMeValidationDisabled',
287+
'com.google.errorprone.annotations.concurrent.LazyInit',
288+
// JSR-305 annotations (used by Substrait, annotation-only)
289+
'javax.annotation.Nonnull',
290+
'javax.annotation.Nullable',
291+
'javax.annotation.concurrent.Immutable',
292+
'javax.annotation.concurrent.NotThreadSafe'
204293
)
205294
ignoreViolations(
206295
// Apache Arrow internal classes that use Unsafe operations
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
package org.opensearch.datafusion;
10+
11+
import org.apache.calcite.sql.SqlOperatorTable;
12+
import org.opensearch.analytics.backend.EngineBridge;
13+
import org.opensearch.analytics.spi.AnalyticsBackEndPlugin;
14+
import org.opensearch.index.engine.exec.coord.CatalogSnapshot;
15+
16+
/**
17+
* SPI adapter that delegates to the real {@link DataFusionPlugin} instance.
18+
*
19+
* <p>{@code PluginsService} extension discovery requires either a no-arg constructor
20+
* or a constructor taking the enclosing plugin. Since {@code DataFusionPlugin}
21+
* itself needs a {@code Settings} constructor for plugin loading, this thin
22+
* adapter bridges the two requirements.
23+
*/
24+
public class DataFusionAnalyticsBackend implements AnalyticsBackEndPlugin {
25+
26+
private final DataFusionPlugin plugin;
27+
28+
public DataFusionAnalyticsBackend(DataFusionPlugin plugin) {
29+
this.plugin = plugin;
30+
}
31+
32+
@Override
33+
public String name() {
34+
return plugin.name();
35+
}
36+
37+
@Override
38+
public EngineBridge<?, ?, ?> bridge(CatalogSnapshot snapshot) {
39+
return plugin.bridge(snapshot);
40+
}
41+
42+
@Override
43+
public SqlOperatorTable operatorTable() {
44+
return plugin.operatorTable();
45+
}
46+
}

0 commit comments

Comments
 (0)