Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the SQL filtering fix.
No open issues 🎉
What changed in this PR
Fixes SQL filtering when treatIntegersAsDoubles is disabled, preventing integer bit patterns from being misinterpreted as doubles.
Changes:
- Temporarily enables integer-as-double handling during SQL evaluation and restores the caller’s setting afterward.
- Documents filtering behavior and adds regression tests for both setting modes.
| File | Description |
|---|---|
| tests/api/read.cc | Tests SQL filtering results and setting preservation in both modes. |
| src/odc/api/Odb.h | Documents how filtering interacts with integer representation settings. |
| src/odc/api/Odb.cc | Adds a scoped setting override for SQL evaluation. |
Review effort: Balanced
mcocdawc
approved these changes
Dec 4, 2026
| eckit::PathName path = "sql-filter-test-1"; | ||
|
|
||
| { | ||
| odc::api::Settings::treatIntegersAsDoubles(false); |
Collaborator
There was a problem hiding this comment.
here you set a global setting?
| EXPECT(s.getIntegerValues("values") == query.expected); | ||
| } | ||
|
|
||
| EXPECT(!reader.next()); |
| // The data crossing this function (in and out) is encoded ODB-2, where the in-memory representation does not | ||
| // matter, so we always run the query with integers-as-doubles. The (32-bit) integers are exactly representable | ||
| // as doubles, so nothing is lost. Frames read from the output are decoded according to the caller's setting. | ||
| const IntegersAsDoublesGuard guard(true); |
Collaborator
There was a problem hiding this comment.
Would this also apply to other places?
Seems like a general problem of the SQL interface?
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.
Description
fix treatIntegersAsDouble:
value 1 is interpreted as denormal 4.9e-324 and, which is flushed to zero
Contributor Declaration
By opening this pull request, I affirm the following:
📖 Documentation 📖
https://sites.ecmwf.int/docs/dev-section/odc/pull-requests/PR-75