Skip to content

Add internalSearch flag for native get-by-id (no Substrait) - #1

Open
alchemist51 wants to merge 2 commits into
thorkous:resolver-docfrom
alchemist51:internal-search-getbyid
Open

Add internalSearch flag for native get-by-id (no Substrait)#1
alchemist51 wants to merge 2 commits into
thorkous:resolver-docfrom
alchemist51:internal-search-getbyid

Conversation

@alchemist51

Copy link
Copy Markdown

Route the pluggable-dataformat get-by-id and seq-no-scan through the existing df_execute_query FFM call with an internalSearch flag instead of synthesizing SQL->Substrait in GetService. When the flag is set, the native side builds a DataFrame plan with a pushed-down filter (row_id = n for get-by-id, _seq_no

floor for the recovery scan), executes it, and returns a stream drained
through the same df_stream_next/df_stream_close path as a normal query.

  • ffm.rs: df_execute_query gains internal_search_mode + internal_search_bound
  • datafusion_query_config.rs: InternalSearch enum + from_wire + unit test
  • api.rs: execute_internal_search (DataFrame .filter, single-file assert, pushdown on); early dispatch from execute_query
  • helpers.rs (new): consolidate shared query setup used by both the Substrait and internal-search paths -- build_query_runtime_env (list-files cache + per-query memory pool overlay + object-store registration), build_session_context (with register_udfs flag), new_shard_query_context, register_listing_table, execute_plan_to_stream_ptr, run_cancellable_to_handle_ptr, wrap_stream_as_handle; repoint query_executor/indexed_executor/session_context
  • NativeBridge.java: executeQueryAsync gains internalSearchMode/Bound + INTERNAL_SEARCH_* constants; FFM descriptor updated
  • GetService.java: drop sqlToSubstrait + WireConfigSnapshot; call the flagged path

Description

[Describe what this change achieves]

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Add version map and integrated get-by-id for document lookup.

Signed-off-by: Koustubh Gupta <thorkous@amazon.com>
@alchemist51
alchemist51 force-pushed the internal-search-getbyid branch 2 times, most recently from 2dc404b to ad89c5b Compare June 19, 2026 13:18
Comment thread sandbox/plugins/analytics-backend-datafusion/rust/src/datafusion_query_config.rs Outdated
Comment thread sandbox/plugins/analytics-backend-datafusion/rust/src/query_executor.rs Outdated
@alchemist51
alchemist51 force-pushed the internal-search-getbyid branch from ad89c5b to e0b2767 Compare June 19, 2026 13:56
Route the pluggable-dataformat get-by-id and seq-no-scan through the existing
df_execute_query FFM call with an internalSearch flag instead of synthesizing
SQL->Substrait in GetService. When the flag is set, the native side builds a
DataFrame plan with a pushed-down filter (__row_id__ = n for get-by-id, _seq_no
> floor for the recovery scan), executes it, and returns a stream drained
through the same df_stream_next/df_stream_close path as a normal query.

- ffm.rs: df_execute_query gains internal_search_mode + internal_search_bound
- datafusion_query_config.rs: InternalSearch enum + from_wire + unit test
- api.rs: execute_internal_search (DataFrame .filter, single-file assert,
  pushdown on); early dispatch from execute_query
- helpers.rs (new): consolidate shared query setup used by both the Substrait
  and internal-search paths -- build_query_runtime_env (list-files cache +
  per-query memory pool overlay + object-store registration),
  build_session_context (with register_udfs flag), new_shard_query_context,
  register_listing_table, execute_plan_to_stream_ptr, run_cancellable_to_handle_ptr,
  wrap_stream_as_handle; repoint query_executor/indexed_executor/session_context
- NativeBridge.java: executeQueryAsync gains internalSearchMode/Bound +
  INTERNAL_SEARCH_* constants; FFM descriptor updated
- GetService.java: drop sqlToSubstrait + WireConfigSnapshot; call the flagged path
@alchemist51
alchemist51 force-pushed the internal-search-getbyid branch from e0b2767 to 8d70736 Compare June 19, 2026 14:06
@thorkous
thorkous force-pushed the resolver-doc branch 8 times, most recently from ff48bfc to 0f0daf4 Compare June 20, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants