Add quickwit-datafusion crate#6270
Draft
alexanderbianchi wants to merge 1 commit intoquickwit-oss:mainfrom
Draft
Add quickwit-datafusion crate#6270alexanderbianchi wants to merge 1 commit intoquickwit-oss:mainfrom
alexanderbianchi wants to merge 1 commit intoquickwit-oss:mainfrom
Conversation
a7618bc to
f8c18a9
Compare
f8c18a9 to
80da189
Compare
Contributor
|
Asked Claude to give me a strategy on how to review. PR #6270 Review Plan: Add quickwit-datafusion crateScopeThe local branch has the parent PR #6237 already merged to main. The actual PR changes are the uncommitted modifications (10 existing files) plus all untracked files (~5300 lines in the new crate, integration tests, proto definitions). Total: ~7100 additions. Review Order (dependency-driven, bottom-up)Phase 1: Protocol & Interface ContractReview the proto definition and generated code first — everything else depends on this API surface.
Phase 2: Core Abstractions (the generic execution layer)These files form the extension-point architecture. Review for soundness and future-proofing.
Phase 3: Distributed ExecutionCritical path — correctness bugs here affect query results.
Phase 4: Metrics Data Source (the concrete implementation)The bulk of domain logic lives here.
Phase 5: Service Layer & gRPC IntegrationWhere the crate meets the outside world.
Phase 6: Integration TestsValidate end-to-end correctness claims.
Phase 7: Cross-Cutting Concerns
Key Risk Areas to Prioritize
|
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.
Overview
Adds
quickwit-datafusion— a DataFusion-based query execution layer for parquet metrics splits, built on top of PR #6237 (wide-schema parquet pipeline).What's in this PR
quickwit-datafusioncrate — self-contained query layer with a pluggableQuickwitDataSourcetrait,DataFusionSessionBuilder,QuickwitSchemaProvider, andDataFusionService(streaming gRPC:ExecuteSql+ExecuteSubstrait)MetricsDataSource— parquet metrics source: metastore-backed split discovery, 30s object-store cache, filter pushdown with CAST-unwrapping fix, SubstraitReadRelconsumptionDistributedPhysicalOptimizerRuledecomposes queries into tasks (one per split) viaPartitionIsolatorExec. Tasks, not shuffles — parquet splits are self-contained so no cross-worker repartitioning is neededDataFusionServiceonly starts whenQW_ENABLE_DATAFUSION_ENDPOINT=trueis set; zero impact on existing deploymentsExecution Flow
flowchart TD Client -->|SQL or Substrait bytes| SVC[DataFusionService\nExecuteSql / ExecuteSubstrait] subgraph Coordinator SVC --> SB[DataFusionSessionBuilder\nbuild_session] SB --> CTX[SessionContext\n+ QuickwitSchemaProvider] CTX -->|Substrait| SC[QuickwitSubstraitConsumer\nconsume_read ReadRel] CTX -->|SQL| SP[QuickwitSchemaProvider\ntable lookup] SC --> MD[MetricsDataSource] SP --> MD MD --> IR[MetastoreIndexResolver\nresolve index_name] IR -->|split_provider · object_store · url\n30 s object-store cache| TP[MetricsTableProvider] TP --> OPT[DataFusion Optimizer] OPT -->|SearcherPool ≥ 2 nodes| DIST[DistributedPhysicalOptimizerRule] DIST --> EST[QuickwitTaskEstimator\nDesired N = num splits] EST --> PIE[PartitionIsolatorExec\nt0 gets splits 0,1 · t1 gets splits 2,3 …] PIE -->|WorkerService gRPC| WORKERS[(Workers)] end subgraph Worker [Worker — runs per task] WORKERS --> SCAN[MetricsTableProvider::scan\npushed-down filters] SCAN --> EXT[extract_split_filters\nMetricsSplitQuery\nCAST-unwrapping fix] EXT --> MSP[MetastoreSplitProvider\nlist_splits → metastore RPC] MSP -->|published splits matching\nmetric_names · time_range · tags| PS[ParquetSource\nbloom filter · page index · pushdown] PS --> OBS[QuickwitObjectStore\nquickwit_storage::Storage bridge] end OBS --> AGG[Partial aggregates] AGG --> NCE[NetworkCoalesceExec\ncoordinator merges] NCE -->|Arrow IPC stream| ClientNotes
SearcherPoolhas only one node the distributed rule is a no-op — the plan runs locally as a standardDataSourceExec.PartitionIsolatorExecassigns each split to a specific worker task; workers execute their local parquet scans and return partial aggregates. NoNetworkShuffleExec(no cross-worker repartitioning) because splits are already self-contained.QuickwitObjectStoreis a read-only adapter:get_opts,get_range,headare implemented; all write/list operations returnNotSupported.