-
Notifications
You must be signed in to change notification settings - Fork 0
Commits of plugin engine-datafusion #271
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
Changes from all commits
0140eff
b7c5cfb
e700056
90d5676
073afec
2284dcd
1eaca09
a1e4ae6
a739841
e17bce1
f2dc283
3508b17
72e75f1
17c2a2c
7a935b2
7698cf3
947291d
a146b3e
546ef45
fffbc30
51eef8f
3accadb
86da8d6
a8ddfcb
9f1eed6
802b335
ca6283c
33fb888
3e074dd
d80272f
c00d031
0541444
c61849d
5b6569c
0fc133f
bd20858
129122d
69a73a4
9ede8b8
7642179
86b2b76
e02c8eb
9e05822
ce5e475
c87fa23
c49cfa7
e6b66e0
45d6b75
8fbbc41
9989ff2
656ec5b
a1d3868
347d0ca
02fc4f6
e2cf8b7
4b61351
75ccc05
1b6d5d9
c009515
f43a7d6
f691ca5
53f76ef
869892b
c1fd20d
f76c5da
c6a42c2
6cf2c40
5b626f5
4987cb8
4ed75f4
31308ab
ac4466d
d0bade5
2250240
73975ab
f3bc3bd
459ead6
2ee604f
c1a285f
17d274f
9b49abb
3816113
7b3234d
f439f7a
a311a1b
564dcde
ede94a0
2ca0f80
46b7228
a844c24
42b1fe4
9fdfb35
1960e07
9ce258a
9f94eef
fba04d6
a85f603
b1a1d30
f5a7030
e980a19
bda4e93
863ac1d
20fe987
cf5fad4
09569ef
6d744bf
c3a8415
23e4717
a786542
ad3dd8b
3e0daa3
481409d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,5 +11,6 @@ | |
| *.crt binary | ||
| *.p12 binary | ||
| *.ttf binary | ||
| *.parquet binary | ||
| *.txt text=auto | ||
| CHANGELOG.md merge=union | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: DataFusion E2E Integration Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - feature/datafusion | ||
| push: | ||
| branches: | ||
| - feature/datafusion | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| RUSTFLAGS: "-A unused_variables -A unused_mut" | ||
|
|
||
| steps: | ||
| - name: Checkout OpenSearch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: OpenSearch | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
|
|
||
| - name: Setup Rust | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| components: rustfmt | ||
|
|
||
| - name: Install Protocol Buffers | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y protobuf-compiler | ||
|
|
||
| - name: Install Protocol Buffers | ||
| if: runner.os == 'macOS' | ||
| run: brew install protobuf | ||
|
|
||
| - name: Install Protocol Buffers | ||
| if: runner.os == 'Windows' | ||
| run: choco install protoc | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v3 | ||
|
|
||
| - name: Publish OpenSearch to Maven Local | ||
| working-directory: OpenSearch | ||
| run: ./gradlew publishToMavenLocal -x test -PrustDebug=true | ||
|
|
||
| - name: Checkout SQL Plugin | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: vinaykpud/sql | ||
| ref: feature/substrait-plan | ||
| path: opensearch-sql | ||
|
|
||
| - name: Publish SQL Plugin to Maven Local | ||
| working-directory: opensearch-sql | ||
| run: ./gradlew publishToMavenLocal -x test | ||
|
|
||
| - name: Run DataFusionReaderManager Tests | ||
| working-directory: OpenSearch | ||
| run: ./gradlew :plugins:engine-datafusion:test --tests "org.opensearch.datafusion.DataFusionReaderManagerTests" | ||
|
|
||
| - name: Run IndexFileDeleter Tests | ||
| working-directory: OpenSearch | ||
| run: ./gradlew :server:test --tests "org.opensearch.index.engine.exec.coord.IndexFileDeleterTests" | ||
|
|
||
| - name: Run OpenSearch with DataFusion Plugin | ||
| working-directory: OpenSearch | ||
| run: | | ||
| ./gradlew run \ | ||
| --preserve-data \ | ||
| -PremotePlugins="['org.opensearch.plugin:opensearch-job-scheduler:3.3.0.0-SNAPSHOT', 'org.opensearch.plugin:opensearch-sql-plugin:3.3.0.0-SNAPSHOT']" \ | ||
| -PinstalledPlugins="['engine-datafusion']" & | ||
|
|
||
| # Wait for OpenSearch to start | ||
| timeout 300 bash -c 'until curl -s http://localhost:9200; do sleep 5; done' | ||
|
|
||
| - name: Run SQL CalcitePPLClickBenchIT | ||
| working-directory: opensearch-sql | ||
| run: ./gradlew :integ-test:integTest --tests "org.opensearch.sql.calcite.clickbench.CalcitePPLClickBenchIT" -Dtests.method="testDataFusion" -Dtests.cluster=localhost:9200 -Dtests.rest.cluster=localhost:9200 -DignorePrometheus=true -Dtests.clustername=opensearch -Dtests.output=true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -168,6 +168,8 @@ public void beforeStart() { | |||||||||
| firstNode.setting("discovery.seed_hosts", LOCALHOST_ADDRESS_PREFIX + DEFAULT_TRANSPORT_PORT); | ||||||||||
| cluster.setPreserveDataDir(preserveData); | ||||||||||
| for (OpenSearchNode node : cluster.getNodes()) { | ||||||||||
| // TODO : remove this - this disables assertions | ||||||||||
| node.jvmArgs(" -da "); | ||||||||||
|
Comment on lines
+171
to
+172
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code adds
Suggested change
|
||||||||||
| if (node != firstNode) { | ||||||||||
| node.setHttpPort(String.valueOf(httpPort)); | ||||||||||
| httpPort++; | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,19 @@ ${error.file} | |
| 21-:-javaagent:agent/opensearch-agent.jar | ||
| 21-:--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED | ||
|
|
||
| # Heap size settings | ||
| # -Xms32g | ||
| # -Xmx32g | ||
|
|
||
| # Enable native memory tracking | ||
| -XX:NativeMemoryTracking=summary | ||
|
|
||
| # Allow jcmd to attach to the process (required for 'jcmd VM.native_memory' commands) | ||
| -XX:+UnlockDiagnosticVMOptions | ||
|
|
||
| # Enabling debug logs for Allocators in Arrow | ||
| -Darrow.memory.debug.allocator=true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| # For cases with high memory-mapped file counts, a lower value can improve stability and | ||
| # prevent issues like "leaked" maps or performance degradation. A value of 1 effectively | ||
| # disables the shared Arena pooling and uses a confined Arena for each MMapDirectory | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,7 +160,12 @@ configure([ | |
| project(":test:fixtures:hdfs-fixture"), | ||
| project(":test:fixtures:s3-fixture"), | ||
| project(":test:framework"), | ||
| project(":test:logger-usage") | ||
| project(":test:logger-usage"), | ||
| project(":libs:opensearch-vectorized-exec-spi"), // TODO | ||
| project(":plugins:engine-datafusion"), //TODO | ||
| project(":server"), | ||
| project(":modules:parquet-data-format"), | ||
| project(":modules:parquet-data-format:benchmarks") | ||
|
Comment on lines
+164
to
+168
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Several new projects are being excluded from Javadoc checks. While this might be acceptable during initial development, it's important to add Javadocs for public APIs before the feature is finalized to ensure maintainability. The |
||
| ]) { | ||
| project.tasks.withType(MissingJavadocTask) { | ||
| isExcluded = true | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -85,20 +85,20 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set.of(PublicApi.class, ExperimentalApi.class, DeprecatedApi.class) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (var element : elements) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validate(element); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!checkPackage(element)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Skip all not-public elements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checkPublicVisibility(null, element); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (element instanceof TypeElement) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process((TypeElement) element); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // for (var element : elements) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // validate(element); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // if (!checkPackage(element)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // continue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // // Skip all not-public elements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // checkPublicVisibility(null, element); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // if (element instanceof TypeElement) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // process((TypeElement) element); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+88
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The entire processing loop for API annotations (
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| apply plugin: 'opensearch.build' | ||
|
|
||
| description = 'Vectorized engine common interfaces for OpenSearch' | ||
|
|
||
| dependencies { | ||
| api project(':libs:opensearch-core') | ||
| api project(':libs:opensearch-common') | ||
|
|
||
| testImplementation(project(":test:framework")) { | ||
| exclude group: 'org.opensearch', module: 'vectorized-exec-spi' | ||
| } | ||
| } | ||
|
|
||
| tasks.named('forbiddenApisMain').configure { | ||
| replaceSignatureFiles 'jdk-signatures' | ||
| } | ||
|
|
||
| jarHell.enabled = false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| test { | ||
| systemProperty 'tests.security.manager', 'false' | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,94 @@ | ||||||
| /* | ||||||
| * SPDX-License-Identifier: Apache-2.0 | ||||||
| * | ||||||
| * The OpenSearch Contributors require contributions made to | ||||||
| * this file be licensed under the Apache-2.0 license or a | ||||||
| * compatible open source license. | ||||||
| */ | ||||||
|
|
||||||
| package org.opensearch.vectorized.execution.jni; | ||||||
|
|
||||||
| import java.lang.ref.Cleaner; | ||||||
| import java.util.concurrent.atomic.AtomicBoolean; | ||||||
|
|
||||||
| /** | ||||||
| * Base class for type-safe native pointer wrappers. | ||||||
| * Provides automatic resource management and prevents use-after-close errors. | ||||||
| * Subclasses must implement {@link #doClose()} to release native resources. | ||||||
| * Cleaner is used to ensure resources are cleaned up even if the object is not explicitly closed. | ||||||
| */ | ||||||
| public abstract class NativeHandle implements AutoCloseable { | ||||||
|
|
||||||
| protected final long ptr; | ||||||
| private final AtomicBoolean closed = new AtomicBoolean(false); | ||||||
| protected static final long NULL_POINTER = 0L; | ||||||
| private final Cleaner.Cleanable cleanable; | ||||||
|
|
||||||
| private static final Cleaner CLEANER = Cleaner.create(); | ||||||
|
|
||||||
| /** | ||||||
| * Creates a new native handle. | ||||||
| * @param ptr the native pointer (must not be 0) | ||||||
| * @throws IllegalArgumentException if ptr is 0 | ||||||
| */ | ||||||
| protected NativeHandle(long ptr) { | ||||||
| if (ptr == NULL_POINTER) { | ||||||
| throw new IllegalArgumentException("Null native pointer"); | ||||||
| } | ||||||
| this.ptr = ptr; | ||||||
| this.cleanable = CLEANER.register(this, new CleanupAction(ptr, this::doClose)); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Ensures the handle is still open. | ||||||
| * @throws IllegalStateException if the handle has been closed | ||||||
| */ | ||||||
| public void ensureOpen() { | ||||||
| if (closed.get()) { | ||||||
| throw new IllegalStateException("Handle already closed"); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Gets the native pointer value. | ||||||
| * @return the native pointer | ||||||
| * @throws IllegalStateException if the handle has been closed | ||||||
| */ | ||||||
| public long getPointer() { | ||||||
| ensureOpen(); | ||||||
| return ptr; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public void close() { | ||||||
| if (closed.compareAndSet(false, true)) { | ||||||
| cleanable.clean(); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Releases the native resource. | ||||||
| * Called once when the handle is closed. | ||||||
| * Subclasses must implement this to free native memory. | ||||||
| */ | ||||||
| protected abstract void doClose(); | ||||||
|
|
||||||
| /** | ||||||
| * Cleans up the native resource. | ||||||
| * Called by the cleaner when the handle is garbage collected. | ||||||
| */ | ||||||
| private static final class CleanupAction implements Runnable { | ||||||
| private final long ptr; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| private final Runnable doClose; | ||||||
|
|
||||||
| CleanupAction(long ptr, Runnable doClose) { | ||||||
| this.ptr = ptr; | ||||||
| this.doClose = doClose; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public void run() { | ||||||
| doClose.run(); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern
**/Cargo.lockwill ignore allCargo.lockfiles.Cargo.lockfiles are crucial for ensuring reproducible builds by locking dependency versions. They should typically be checked into version control for applications and binaries. Ignoring them can lead to different developers or CI environments using different dependency versions, which can introduce subtle bugs.