Skip to content

Commit eba3575

Browse files
Working changes (#44)
* Changes in dataformat for CSVEngine Signed-off-by: Arpit Bandejiya <[email protected]> * Changes for Reader to work Signed-off-by: Arpit Bandejiya <[email protected]> --------- Signed-off-by: Arpit Bandejiya <[email protected]> Co-authored-by: Bharathwaj G <[email protected]> Signed-off-by: bharath-techie <[email protected]>
1 parent 00dd39a commit eba3575

File tree

11 files changed

+259
-28
lines changed

11 files changed

+259
-28
lines changed

gradle/missing-javadoc.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ configure([
160160
project(":test:fixtures:hdfs-fixture"),
161161
project(":test:fixtures:s3-fixture"),
162162
project(":test:framework"),
163-
project(":test:logger-usage")
163+
project(":test:logger-usage"),
164+
project(":libs:opensearch-vectorized-exec-spi"), // TODO
165+
project(":plugins:engine-datafusion"), //TODO
164166
]) {
165167
project.tasks.withType(MissingJavadocTask) {
166168
isExcluded = true

plugins/engine-datafusion/jni/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ pub extern "system" fn Java_org_opensearch_datafusion_DataFusionQueryJNI_execute
209209
let table_path = shard_view.table_path();
210210
let files_meta = shard_view.files_meta();
211211

212+
println!("Table path: {}", table_path);
213+
println!("Files: {:?}", files_meta);
212214

213215
let list_file_cache = Arc::new(DefaultListFilesCache::default());
214216
list_file_cache.put(table_path.prefix(), files_meta);
@@ -252,7 +254,7 @@ pub extern "system" fn Java_org_opensearch_datafusion_DataFusionQueryJNI_execute
252254
// Create a new TableProvider
253255
let provider = Arc::new(ListingTable::try_new(config).unwrap());
254256
let shard_id = table_path.prefix().filename().expect("error in fetching Path");
255-
ctx.register_table("logs", provider)
257+
ctx.register_table("hits", provider)
256258
.expect("Failed to attach the Table");
257259

258260
});

plugins/engine-datafusion/src/main/java/org/opensearch/datafusion/DatafusionEngine.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.opensearch.index.engine.EngineSearcherSupplier;
3131
import org.opensearch.index.engine.SearchExecEngine;
3232
import org.opensearch.index.engine.exec.FileMetadata;
33+
import org.opensearch.search.SearchShardTarget;
3334
import org.opensearch.search.aggregations.SearchResultsCollector;
3435
import org.opensearch.search.internal.ReaderContext;
3536
import org.opensearch.search.internal.ShardSearchRequest;
@@ -56,7 +57,7 @@ public class DatafusionEngine extends SearchExecEngine<DatafusionContext, Datafu
5657

5758
public DatafusionEngine(DataFormat dataFormat, Collection<FileMetadata> formatCatalogSnapshot, DataFusionService dataFusionService) throws IOException {
5859
this.dataFormat = dataFormat;
59-
this.datafusionReaderManager = new DatafusionReaderManager("TODO://FigureOutPath", formatCatalogSnapshot);
60+
this.datafusionReaderManager = new DatafusionReaderManager("/Users/gbh/Downloads/res", formatCatalogSnapshot);
6061
this.datafusionService = dataFusionService;
6162
}
6263

@@ -71,8 +72,8 @@ public QueryPhaseExecutor<DatafusionContext> getQueryPhaseExecutor() {
7172
}
7273

7374
@Override
74-
public DatafusionContext createContext(ReaderContext readerContext, ShardSearchRequest request, SearchShardTask task) throws IOException {
75-
DatafusionContext datafusionContext = new DatafusionContext(readerContext, request, task, this);
75+
public DatafusionContext createContext(ReaderContext readerContext, ShardSearchRequest request, SearchShardTarget searchShardTarget, SearchShardTask task) throws IOException {
76+
DatafusionContext datafusionContext = new DatafusionContext(readerContext, request, searchShardTarget, task, this);
7677
// Parse source
7778
datafusionContext.datafusionQuery(new DatafusionQuery(request.source().queryPlanIR(), new ArrayList<>()));
7879
return datafusionContext;

0 commit comments

Comments
 (0)