Repository navigation
Conversation
Carry table intent through catalog lookups, SQL planning, and asynchronous provider caches so applications can authorize writes before schema use. Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
…ntent Make access handling explicit across catalogs and planner contexts, keep remote snapshots separated by operation, and document authorization boundaries. Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
Remove legacy lookup and snapshot adapters, migrate all callers, and document the single-method interfaces. Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
Carry create, replace, drop, and index intent through prefetch, direct SQL planning, and built-in DDL execution. Preserve authorized absence in the canonical planner API and in remote snapshots; reject unrequested lookups. Remove dynamic file and object-store catalog wrappers. Keep file access explicit through registration, external tables, COPY, and DataFrame APIs. Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
Name the operation contract TableIntent and use Describe for named-object metadata inspection. Preserve intent through lookup, prefetch, and snapshot APIs, and clarify application-owned visibility and privilege mapping. Document breaking signatures, authorized absence, snapshot isolation, removed implicit file lookup, and foreign FFI limits in release and migration notes. Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
Restore implicit file queries while keeping catalog denial and storage failures distinct from absence. Environment: Datadog workspace Co-Authored-By: Codex GPT-6 <noreply@localhost>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Targets this fork's
den-55branch. No upstream issue has been opened.Rationale for this change
Authorizing catalogs need to distinguish operations to make fine-grained permission decisions. A caller may be allowed to insert into a table without selecting from it, but DataFusion still needs the destination schema to plan the insert. A name-only lookup cannot express that distinction.
Table lookup now requires an operation intent. SQL planning, asynchronous prefetch, and catalog snapshots carry it to the catalog and preserve it in cached lookups. Applications retain control of identity and the mapping from operations to privileges.
What changes are included in this PR?
TableIntenton existing lookup methods.SchemaProvider::table,AsyncSchemaProvider::table,ContextProvider::get_table_source, andSessionContext::table_provideraccept an explicit intent. There are no compatibility overloads or implicit defaults. Wrappers must forward intent; catalogs without authorization can explicitly ignore it.Describe,Read, insert modes, update/delete/truncate, MERGE clause actions, and specific create/drop/index operations. Creation carriesor_replaceand authorizes the name even when it does not exist. Metadata needed to plan a mutation uses that mutation's intent; DataFusion adds no separate Describe lookup or privilege hierarchy.INSERT INTO t SELECT * FROM tchecks both insert and read intent. Providers and authorized absence are cached by resolved name and intent. Ordinary SELECT lookup counts are unchanged; there is no per-row execution work.ContextProvider::get_table_sourcenow returns an optional source:Ok(None)means authorized absence, while denial and lookup failures remain errors. DDL does not suppress those errors underIF EXISTSorIF NOT EXISTS.resolve_table_references_with_intentsupplies(TableReference, TableIntent)pairs toAsync*::resolve. Unrequested pairs fail, including names not previously resolved. Snapshots are scoped to one caller and query. Metadata may still be cached independently beneath authorization checks; separate intent lookups need not duplicate metadata fetches.enable_url_table()and CLI file queries remain supported.UrlTableFactory::try_new(url, intent)receives the original intent only after a successful catalog miss. DDL misses do not infer files. The CLI configures stores inside the file factory before inference; catalog denial never enters that path. Missing files and empty listings remain absent, while inference failures propagate. Automatic store registration requires the typedObjectStoreNotFoundregistry error; other registry failures stop resolution.Guided code walk · Catalog integration guide
Resolution paths and integration boundaries
SqlToRelContextProvidermethod, including for DDL destinations.SessionContext::tablesuppliesRead;DataFrame::write_tablepreserves the insert mode.Describe. Information-schema columns/views and defaulttable_typerequest it for underlying objects. DESCRIBE of a query retains its normal read checks.Async*::resolvehelpers preserve exact intents. Built-in session prefetch does not call these helpers.Readand rejects other intents. Same-library round trips retain the original provider.Applications must still enforce the following boundaries:
Describedoes not automatically filter enumeration. Names, existence checks, andtable_typeoverrides need an application visibility policy; denial during information-schema traversal fails the query. The built-in information-schema provider does not authorize access to the system tables themselves.Are these changes tested?
Regression coverage includes write-only inserts, denied sources before schema inspection, self-inserts, forwarding wrappers, MERGE actions, Describe, DDL on absent names, DDL revocation, exact-intent snapshots, and implicit-file resolution boundaries. New regressions cover terminal catalog/factory denial, DDL without storage side effects, missing files versus inference failures, registry denial without automatic registration, and implicit Describe/INSERT.
Current revision: workspace Clippy with all targets and features and
-D warnings, Rust formatting, and documentation formatting passed. Clippy compiled the regression test code; test execution was skipped as requested.Historical focused validation passed 684 SQL/catalog tests and 19 core authorization tests. Those are historical results, not a test run of the current revision. Dynamic-file SQL logic, CLI execution, and cross-library FFI checks remain outstanding. Full CI and downstream consumer migration have not been validated.
Are there any user-facing changes?
Yes: breaking Rust APIs and stricter fallback error handling. Existing catalog implementations, planner contexts, callers, and remote snapshot integrations must migrate.
ContextProvider::get_table_sourceadditionally changes from a required source toResult<Option<Arc<dyn TableSource>>>.UrlTableFactory::try_newalso requires intent. Implicit SQL file queries remain available, while denied catalog lookups and inference failures propagate; DDL targets no longer trigger file inference. Foreign FFI adapters reject non-read intents until the ABI can carry them.The release notes and migration guide document signature changes, wrapper migration, absence/error semantics, snapshot behavior, factory migration, the typed missing-store error, and error propagation. The PR carries the
api changelabel.