Skip to content

Add lossless error bound enum variant - #350

Merged
CGodiksen merged 16 commits into
mainfrom
dev/lossless-error-bound
Sep 10, 2025
Merged

Add lossless error bound enum variant #350
CGodiksen merged 16 commits into
mainfrom
dev/lossless-error-bound

Conversation

@CGodiksen

Copy link
Copy Markdown
Collaborator

Closes #345 by adding a Lossless variant to the ErrorBound enum. The absolute and relative error bounds have also been changed both in the Rust API and in the Python bindings to no longer allow a value of 0.

When fixing some unit tests, a bug was found that allowed TimeSeriesTableMetadata to be created with unsupported types for specifically tag columns. This bug has been fixed and the test that checked for the issue has been fixed.

@CGodiksen CGodiksen self-assigned this Sep 9, 2025
@CGodiksen
CGodiksen requested a review from Copilot September 9, 2025 18:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a Lossless variant to the ErrorBound enum to represent lossless storage of time series values. The absolute and relative error bounds have been updated to no longer allow zero values (only positive values are now permitted), as lossless storage is now explicitly represented by the new Lossless variant.

  • Added Lossless variant to ErrorBound enum for explicit lossless compression
  • Changed absolute and relative error bounds to require positive values (no longer allow zero)
  • Fixed a bug that allowed unsupported data types in time series table tag columns

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/modelardb_types/src/types.rs Added Lossless variant to ErrorBound enum and updated validation logic
crates/modelardb_types/src/flight/protocol.proto Added LOSSLESS enum value to protobuf error bound type
crates/modelardb_types/src/flight/mod.rs Updated encoding/decoding logic to handle lossless error bounds
crates/modelardb_storage/src/parser.rs Updated SQL parser to use lossless error bounds as default
crates/modelardb_storage/src/metadata/table_metadata_manager.rs Updated metadata handling for lossless error bounds
crates/modelardb_embedded/src/operations/mod.rs Updated operations to use lossless error bounds as default
crates/modelardb_embedded/src/operations/data_folder.rs Updated data folder operations for lossless error bounds
crates/modelardb_embedded/src/capi.rs Updated C API documentation for lossless error bounds
crates/modelardb_embedded/bindings/python/tests/test_error_bound.py Updated Python tests to reflect new validation rules
crates/modelardb_embedded/bindings/python/modelardb/table.py Updated Python table documentation
crates/modelardb_embedded/bindings/python/modelardb/error_bound.py Updated Python error bound validation
crates/modelardb_compression/src/types.rs Updated compression tests to use lossless error bounds
crates/modelardb_compression/src/models/swing.rs Updated Swing model tests to use lossless error bounds
crates/modelardb_compression/src/models/pmc_mean.rs Updated PMC-Mean model tests to use lossless error bounds
crates/modelardb_compression/src/models/mod.rs Updated model logic to handle lossless error bounds
crates/modelardb_compression/src/models/macaque_v.rs Updated MacaqueV model tests to use lossless error bounds
crates/modelardb_compression/src/compression.rs Updated compression tests to use lossless error bounds
crates/modelardb_test/src/table.rs Updated test utilities to use lossless error bounds
Comments suppressed due to low confidence (1)

crates/modelardb_types/src/types.rs:1

  • The documentation comment lists conditions that return ModelarDbTypesError, but the newly added validation for unsupported data types (line 106) is too generic. It should specify which data types are supported: timestamp columns must be i64 microseconds, field columns must be f32, and tag columns must be Utf8 strings.
/* Copyright 2022 The ModelarDB Contributors

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread crates/modelardb_types/src/types.rs
Comment thread crates/modelardb_storage/src/parser.rs
Comment thread crates/modelardb_embedded/src/capi.rs Outdated
Comment thread crates/modelardb_types/src/types.rs
@CGodiksen
CGodiksen merged commit c07fd61 into main Sep 10, 2025
4 of 7 checks passed
@CGodiksen
CGodiksen deleted the dev/lossless-error-bound branch September 10, 2025 18:30
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.

Add lossless ErrorBound enum instance

4 participants