Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #767 +/- ##
===========================================
- Coverage 62.73% 62.68% -0.06%
===========================================
Files 705 705
Lines 42165 42393 +228
Branches 6223 6268 +45
===========================================
+ Hits 26453 26574 +121
- Misses 14781 14863 +82
- Partials 931 956 +25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Adds device enumeration and per-device timeseries metadata to the C wrapper, with matching Python bindings on
TsFileReader. A follow-up extendsTimeseriesStatistic(numeric min/max/first/last, boolean first/last, string stats)C API (
tsfile_cwrapper.h)Types:
DeviceID,TimeseriesStatistic,TimeseriesMetadata,DeviceTimeseriesMetadataEntry,DeviceTimeseriesMetadataMap.Sentinel:
tsfile_c_metadata_empty_device_list_marker— use withlength == 0when you need a non-nulldevice_idspointer for an empty query.Functions
tsfile_reader_get_all_devices→out_devices/out_length; free withtsfile_free_device_id_array.tsfile_reader_get_timeseries_metadata→out_map; free withtsfile_free_device_timeseries_metadata_map.Query semantics (
tsfile_reader_get_timeseries_metadata)device_idslengthNULLNULL0E_OK(IDs not read)NULL> 0Errors: If
length > 0and anydevice_ids[i].path == NULL→E_INVALID_ARG/RET_INVALID_ARG.Memory: All heap data in
out_map(includingTimeseriesStatistic.str_*) is owned by the API; only release viatsfile_free_device_timeseries_metadata_map. Do not freestr_*individually.TimeseriesStatistic(which flags matter)int_range_valid+*int64—INT32,DATE,INT64,TIMESTAMPfloat_range_valid+*float64—FLOAT,DOUBLEbool_ext_valid+first_bool/last_bool—BOOLEAN(plus existingsum_valid/sum)str_ext_valid+str_*—STRING(lexicographic min/max, time-ordered first/last);TEXT— first/last only; do not rely on min/max forTEXTPython API
Schema:
DeviceID,TimeseriesStatistic(extended; string fieldsOptional[str]),TimeseriesMetadata.TsFileReaderget_all_devices() -> list[DeviceID]get_timeseries_metadata(device_ids=None) -> dict[str, list[TimeseriesMetadata]]None→ all devices;[]→{}; non-empty list → filter (DeviceIDorstrpaths).Native memory is freed inside the extension; use the returned dict/objects only.
Example
Tests
cpp/test/cwrapper/cwrapper_metadata_test.ccpython/tests/test_reader_metadata.pyNote: Order of devices/series follows the native C++ map/container iteration unless you document a stronger guarantee later.