feat: Add Apache TsFile format support #7933
Open
+440
−0
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.
Add Apache TsFile format support
Adds support for loading
.tsfiledatasets. Closes #7922.What's TsFile?
Apache TsFile is a columnar time-series format popular in IoT. The TsFile community requested this integration and offered to help maintain it.
What I did
Created a new
TsFilebuilder inpackaged_modules/tsfile/following the same pattern as HDF5. Registered the module and added.tsfileextension mapping. Also addedtsfile>=2.0.0as an optional dependency.The builder uses
tsfile.to_dataframe()with iterator mode for memory-efficient reading, then converts to PyArrow tables. Schema is inferred automatically from file metadata.Config options
batch_size- rows per batch (default 10000)table_name- which table to read (for multi-table files)columns- filter specific columnsstart_time/end_time- time-range filteringUsage
Tests
Added 11 tests covering config validation, basic loading, data integrity, feature inference, and error handling. All passing.