From d8330afbd0d9f09569a28ec241a9c9039bcbd8b3 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Wed, 26 Jun 2024 13:17:34 -0700 Subject: [PATCH] Add pit for join queries (#2703) * Add search after for join Signed-off-by: Rupal Mahajan * Enable search after by default Signed-off-by: Rupal Mahajan * Add pit Signed-off-by: Rupal Mahajan * nit Signed-off-by: Rupal Mahajan * Fix tests Signed-off-by: Rupal Mahajan * ignore joinWithGeoIntersectNL Signed-off-by: Rupal Mahajan * Rerun CI with scroll Signed-off-by: Rupal Mahajan * Remove unused code and retrigger CI with search_after true Signed-off-by: Rupal Mahajan * Address comments Signed-off-by: Rupal Mahajan * Remove unused code change Signed-off-by: Rupal Mahajan * Update pit keep alive time with SQL_CURSOR_KEEP_ALIVE Signed-off-by: Rupal Mahajan * Fix scroll condition Signed-off-by: Rupal Mahajan * nit Signed-off-by: Rupal Mahajan * Add pit before query execution Signed-off-by: Rupal Mahajan * nit Signed-off-by: Rupal Mahajan * Move pit from join request builder to executor Signed-off-by: Rupal Mahajan * Remove unused methods Signed-off-by: Rupal Mahajan * Add pit in parent class's run() Signed-off-by: Rupal Mahajan * Add comment for fetching subsequent result in NestedLoopsElasticExecutor Signed-off-by: Rupal Mahajan * Update comment Signed-off-by: Rupal Mahajan * Add javadoc for pit handler Signed-off-by: Rupal Mahajan * Add pit interface Signed-off-by: Rupal Mahajan * Add pit handler unit test Signed-off-by: Rupal Mahajan * Fix failed unit test CI Signed-off-by: Rupal Mahajan * Fix spotless error Signed-off-by: Rupal Mahajan * Rename pit class and add logs Signed-off-by: Rupal Mahajan * Fix pit delete unit test Signed-off-by: Rupal Mahajan --------- Signed-off-by: Rupal Mahajan --- .../sql/legacy/executor/join/ElasticJoinExecutor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java b/legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java index 061868c9b5..83b8ef42cc 100644 --- a/legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java +++ b/legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java @@ -31,6 +31,7 @@ import org.opensearch.sql.legacy.esdomain.LocalClusterState; import org.opensearch.sql.legacy.exception.SqlParseException; import org.opensearch.sql.legacy.executor.ElasticHitsExecutor; +import org.opensearch.sql.legacy.pit.PointInTimeHandler; import org.opensearch.sql.legacy.pit.PointInTimeHandlerImpl; import org.opensearch.sql.legacy.query.SqlElasticRequestBuilder; import org.opensearch.sql.legacy.query.join.HashJoinElasticRequestBuilder; @@ -47,7 +48,9 @@ public abstract class ElasticJoinExecutor extends ElasticHitsExecutor { protected final int MAX_RESULTS_ON_ONE_FETCH = 10000; private Set aliasesOnReturn; private boolean allFieldsReturn; + protected Client client; protected String[] indices; + protected PointInTimeHandler pit; protected ElasticJoinExecutor(Client client, JoinRequestBuilder requestBuilder) { metaResults = new MetaSearchResult();