Commits data fusion - #273
Conversation
Signed-off-by: Marc Handalian <marc.handalian@gmail.com> (cherry picked from commit cb75910)
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> (cherry picked from commit eb01905)
…project#19399) Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> (cherry picked from commit c9d5b17)
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> (cherry picked from commit 98de93e)
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> (cherry picked from commit 5fef617)
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> (cherry picked from commit e4ebf59)
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Co-authored-by: Arpit Bandejiya <abandeji@amazon.com> Signed-off-by: bharath-techie <bharath78910@gmail.com>
Co-authored-by: Arpit Bandejiya <abandeji@amazon.com> Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
* Abstracting lucene away: part 1 * initial abstractions to reduce indexing engine coupling * Text backed engine testing --------- Co-authored-by: Mohit Godwani <mgodwan@amazon.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
…roject#19441) Signed-off-by: expani <anijainc@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
* Changes in dataformat for CSVEngine Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> * Changes for Reader to work Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> --------- Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> Co-authored-by: Bharathwaj G <bharath78910@gmail.com> Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
* Integrate aggregators to convert result from datafusion Signed-off-by: expani <anijainc@amazon.com> * Initialised bigArrays and queryCollManagers for DatafusionContext Signed-off-by: expani <anijainc@amazon.com> * Refactored to set agg result within utility Signed-off-by: expani <anijainc@amazon.com> --------- Signed-off-by: expani <anijainc@amazon.com>
Co-authored-by: Arpit Bandejiya <abandeji@amazon.com> Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: expani <anijainc@amazon.com>
* Feature/datafusion 4 (#46) * Composite document writer pool initial implementation * Committer interface and lucene based commit engine implementation * Catalog snapshot changes to create segment view during commit --------- Co-authored-by: Shashank Gowri <shnkgo@amazon.com> * fix build for commit integration Signed-off-by: bharath-techie <bharath78910@gmail.com> --------- Signed-off-by: bharath-techie <bharath78910@gmail.com> Co-authored-by: Shashank Gowri <shnkgo@amazon.com>
* Add parquet benchmarks in missing javadoc Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> * add flag to disable java doc check --------- Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
* Single commit with all changes * Update the e2e test workflow * Ignore lint * Add missing doc flag * fix newline * remove extra missingdoc flag in action * Add changes to have all queries * Run only DatafusionReaderManager test Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> * Fix 200 status code Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> --------- Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
* Add CacheManager # Conflicts: # plugins/engine-datafusion/jni/src/lib.rs # plugins/engine-datafusion/jni/src/listing_table.rs # plugins/engine-datafusion/jni/src/row_id_optimizer.rs # plugins/engine-datafusion/jni/src/util.rs # Conflicts: # plugins/engine-datafusion/jni/src/lib.rs # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/DataFusionQueryJNI.java # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/DataFusionService.java # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/core/GlobalRuntimeEnv.java # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/search/DatafusionSearcher.java # plugins/engine-datafusion/src/test/java/org/opensearch/datafusion/DataFusionReaderManagerTests.java # Conflicts: # plugins/engine-datafusion/jni/src/lib.rs # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/DataFusionPlugin.java # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/DataFusionService.java # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/core/GlobalRuntimeEnv.java # plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/search/DatafusionSearcher.java # plugins/engine-datafusion/src/test/java/org/opensearch/datafusion/DataFusionReaderManagerTests.java # plugins/engine-datafusion/src/test/java/org/opensearch/datafusion/DataFusionServiceTests.java # plugins/engine-datafusion/src/test/java/org/opensearch/datafusion/TestDataFusionServiceTests.java * create CacheManager struct * rebase * add file2 * fix references * cleanup commented code * remove unused references * rebase1 * Add Native Handles * moving cacheOperations to use runtimeEnv * fix references * runtimeHandle reference * rename configPtr reference
…#20048) * add stream and allocator closure post fetch phase Signed-off-by: Marc Handalian <marc.handalian@gmail.com> * Move stream and allocator for executeQueryPhase into correct scope Signed-off-by: Marc Handalian <marc.handalian@gmail.com> --------- Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
…nsearch-project#20032) * Injecting count sub agg if absent to ensure doc_count is correct Signed-off-by: expani <anijainc@amazon.com> * Sorting keys for merge sort to work Signed-off-by: expani <anijainc@amazon.com> * Went into zen mode and made code simpler Signed-off-by: expani <anijainc@amazon.com> --------- Signed-off-by: expani <anijainc@amazon.com>
…ject#20041) * Single commit with all changes * Update the e2e test workflow * Clean unused functions Signed-off-by: Arpit Bandejiya <abandeji@amazon.com> * remove imports --------- Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
* fixing path reference while adding to cache * remove unnecessary logs
…roject#20070) Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…s with Searcher (opensearch-project#20063) * CatalogSnapshot Manager + postDelete hooks * Fix tests * Minor fixes to post delete hooks * Fix IndexFileDeleterTests * Add IndexFileDeleter tests in E2E * Empty commit to re-run E2E tests
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
…project#20079) These tests run 42 or 43 queries right now and match results for correctness. all queries flagged as supported are expected to succeed for this check to pass Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
…sync changes (opensearch-project#20071) * Changes for tokio io/cpu runtime + search flow async changes Signed-off-by: bharath-techie <bharath78910@gmail.com> * minor fixes and todos Signed-off-by: bharath-techie <bharath78910@gmail.com> * Addressing comment to move to ActionListener Signed-off-by: bharath-techie <bharath78910@gmail.com> * addressing comments Signed-off-by: bharath-techie <bharath78910@gmail.com> * fix to sort numeric aggs Signed-off-by: bharath-techie <bharath78910@gmail.com> --------- Signed-off-by: bharath-techie <bharath78910@gmail.com>
…ect#20110) Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
…pensearch-project#20119) Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…pensearch-project#19978) * Adding JNI abstractions for logging in rust through RustLoggerBridge Signed-off-by: Raghuvansh Raj <raghraaj@amazon.com> * Adding logging for java in parquet-data-format module and cleaning up stale files Signed-off-by: Raghuvansh Raj <raghraaj@amazon.com> --------- Signed-off-by: Raghuvansh Raj <raghraaj@amazon.com>
* Refactor stream handling for DF execution * Change to Buffer Allocator for DF execution * Introduce RecordBatchIterator and integrate with collector * Minor fixup * Update VSRManager to update field vector atomically * Fixup * Fixup * Fixup * Test fixup * Integrate with AsyncRecordBatchIterator * Fix up
* Update MetadataCache Warm-up to include page-indexes * disable dynamic metadtaa cache limit updates
* Add tests for NativeParquetWriter * Run Rust UTs in E2E tests
* No-op load writer files implementation * Implemented flush conditions and improved engine failure handling --------- Co-authored-by: Shashank Gowri <shnkgo@amazon.com>
Summary of ChangesHello @sandeshkr419, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant architectural enhancements to OpenSearch by integrating the DataFusion query engine and enabling native Parquet data format support. The changes involve creating new plugins for Parquet data handling and DataFusion integration, along with a dedicated module for vectorized execution interfaces. This foundational work sets the stage for high-performance, columnar data processing within OpenSearch, leveraging Rust for native code execution and Apache Arrow for efficient in-memory data representation. The build system has been updated to seamlessly manage these new multi-language components, and JVM configurations are adjusted to optimize memory usage for vectorized operations. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant amount of new code for Data Fusion integration, including new modules for Parquet data format and a DataFusion engine plugin. The changes span across Java, Gradle, and Rust. While this is a substantial feature addition, the review has identified several critical and high-severity issues that must be addressed. These include a security vulnerability related to arbitrary code execution in a Gradle script, incorrect logic in core components, disabled API validation checks, and the use of temporary debugging flags that disable assertions. There are also a number of medium-severity issues concerning code quality, maintainability, and potential bugs. The pull request appears to be in an early stage of development and requires thorough review and fixes before it can be considered for merging.
| cluster.setPreserveDataDir(preserveData); | ||
| for (OpenSearchNode node : cluster.getNodes()) { | ||
| // TODO : remove this - this disables assertions | ||
| node.jvmArgs(" -da "); |
There was a problem hiding this comment.
| } | ||
|
|
||
| public DataFormat getDataFormat() { | ||
| return DataFormat.CSV; |
| public boolean equals(Object obj) { | ||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
The equals() method always returns true, and hashCode() always returns 0. This violates the Java object contract and can lead to incorrect behavior in collections like HashMap or HashSet. Since this class appears to be stateless, it could be implemented as a singleton, or equals() should perform a proper type check.
| public boolean equals(Object obj) { | |
| return true; | |
| } | |
| @Override | |
| public int hashCode() { | |
| return 0; | |
| } | |
| public boolean equals(Object obj) { | |
| return obj instanceof ParquetDataFormat; | |
| } | |
| @Override | |
| public int hashCode() { | |
| return getClass().hashCode(); | |
| } |
| } | ||
|
|
||
| if (findProperty("remotePlugins")) { | ||
| remotePlugins = Eval.me(remotePlugins) |
There was a problem hiding this comment.
The use of Eval.me(remotePlugins) introduces a critical security vulnerability. It allows for arbitrary code execution, as a malicious user could provide a crafted string to the remotePlugins property. This should be replaced with a safer parsing mechanism, such as splitting the string by a delimiter.
def remotePluginsList = remotePlugins.split(',').collect { it.trim() }
| // 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); | ||
| // } | ||
| // } |
There was a problem hiding this comment.
| // Note: MutexFileMetadataCache wrapper has been removed as DefaultFilesMetadataCache | ||
| // is already thread-safe with its own internal Mutex. | ||
| // The double-locking was causing race conditions and crashes. |
|
|
||
| TOKIO_RUNTIME_MANAGER.get_or_init(|| { | ||
| println!("Runtime manager initialized with {} CPU threads", cpu_threads); | ||
| Arc::new(RuntimeManager::new(cpu_threads as usize)) |
There was a problem hiding this comment.
Using println! for logging is not ideal. It's better to use the log crate, which is already a dependency. This allows for structured logging with configurable levels and can be routed to the Java logging framework.
| Arc::new(RuntimeManager::new(cpu_threads as usize)) | |
| info!("Runtime manager initialized with {} CPU threads", cpu_threads); |
| if cache_guard.contains_key(object_meta) { | ||
| Ok(true) | ||
| } else { | ||
| println!("[CACHE ERROR] Failed to cache metadata for: {}", file_path); |
There was a problem hiding this comment.
Using println! for error logging is not ideal. It's better to use the log crate (e.g., log::error!) for structured logging, which will provide better visibility and control over log output.
| println!("[CACHE ERROR] Failed to cache metadata for: {}", file_path); | |
| log::error!("[CACHE ERROR] Failed to cache metadata for: {}", file_path); |
|
|
||
| return settingList; | ||
| } | ||
|
|
There was a problem hiding this comment.
The use of streams to collect settings here is unnecessarily complex. This can be simplified by directly adding the setting lists to settingList, which would improve readability.
| return settingList; | |
| } | |
| settingList.addAll(CacheSettings.CACHE_SETTINGS); | |
| settingList.addAll(CacheSettings.CACHE_ENABLED); |
| type.getEvictionType(clusterSettings)); | ||
|
|
||
| NativeBridge.createCache(cacheManagerPtr, type.cacheTypeName, type.getSizeLimit(clusterSettings).getBytes(), type.getEvictionType(clusterSettings)); | ||
| // clusterSettings.addSettingsUpdateConsumer(type.sizeLimitSetting,(v) -> NativeBridge.cacheManagerUpdateSizeLimitForCacheType(cacheManagerPtr, CacheType.METADATA.getCacheTypeName(),v.getBytes())); |
Description
[Describe what this change achieves]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.