Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors DataFolder to unify handling of normal vs metadata tables, introduces a shared write path, and expands test coverage across DataFolder and DeltaTableWriter, aligning with issue #357.
Changes:
- Unifies metadata-table querying by removing
MetadataTableand reusingNormalTablewith optionalDataSink(INSERT disabled for metadata tables). - Introduces a standalone
DeltaTableWritermodule and updatesDataFolderto expose a singlewrite_record_batches()API for both normal and time series tables. - Expands and reorganizes tests to cover public APIs and rollback/commit behavior for
DeltaTableWriter.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/modelardb_test/src/table.rs | Adds shared NoOpDataSink test utility (currently panics via unimplemented!()). |
| crates/modelardb_test/Cargo.toml | Adds async-trait and datafusion dependencies to support test sink. |
| crates/modelardb_storage/src/query/normal_table.rs | Extends NormalTable to support metadata tables by making DataSink optional and rejecting INSERT when absent. |
| crates/modelardb_storage/src/query/mod.rs | Removes metadata_table module from the query layer. |
| crates/modelardb_storage/src/query/metadata_table.rs | Deletes dedicated metadata table provider implementation. |
| crates/modelardb_storage/src/optimizer/model_simple_aggregates.rs | Switches tests to use shared NoOpDataSink from modelardb_test. |
| crates/modelardb_storage/src/lib.rs | Updates normal table registration to pass Some(data_sink) to NormalTable. |
| crates/modelardb_storage/src/data_folder/mod.rs | Cleans up constructors, adds table_writer() + unified write_record_batches(), and significantly expands tests. |
| crates/modelardb_storage/src/data_folder/delta_table_writer.rs | New module for transactional Delta writes, including commit/rollback tests. |
| crates/modelardb_server/src/storage/data_transfer.rs | Simplifies remote writes to use write_record_batches() regardless of table type. |
| crates/modelardb_server/src/storage/compressed_data_manager.rs | Switches both normal and time-series writes to write_record_batches(). |
| crates/modelardb_server/src/context.rs | Updates tests to use unified write API. |
| crates/modelardb_embedded/src/operations/data_folder.rs | Updates embedded operations to use unified write API. |
| crates/modelardb_bulkloader/src/main.rs | Updates DeltaTableWriter import path to new module location. |
| Cargo.lock | Records new transitive dependencies for modelardb_test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chrthomsen
approved these changes
Mar 23, 2026
skejserjensen
approved these changes
Mar 24, 2026
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.
This PR closes #357 by cleaning up the API of
DataFolderand extending the tests to cover all functionality.The main changes in the PR are:
DataFolderDataFolderDeltaTableWriter