Fix several bugs in tsfile-cli and add tag filter commands#837
Merged
Conversation
# Conflicts: # cpp/tools/cli/run_cli.cc # cpp/tools/skills/tsfile-cli/SKILL.md
jt2594838
approved these changes
Jun 11, 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.
Summary
The PR is a plugin for #836.
CLI install behavior.
cpp/build.shno longer runsmake installby default, which previously installed into CMake's default/usr/localprefix when users only intended to build. The script now builds only by default and runs install only when explicitly invoked withinstall/--install.--helpand README docs were updated accordingly.Case-insensitive table filters. Metadata commands now normalize table filter names before comparing against stored table schema names. This fixes
schema -t TABLE1,stats -t TABLE1, andcount -t TABLE1returning empty results for table-model files whose internal table names are lower-cased.Row-window pushdown.
head/catnow useTsFileReader::queryByRow(...)when--offset/-ncan be pushed down, avoiding the previous behavior of scanning rows first and applying offset/limit in the formatter. Time-range queries (--start/--end) keep the existing path so offset/limit semantics remain "after time filtering" untilqueryByRowgrows a time-range API.Tag filter predicates. Added a simple table TAG predicate interface for row commands:
--tag-filter <column> <op> <value>--tag-between <column> <lower> <upper>--tag-not-between <column> <lower> <upper>Supported operators match the existing C++ tag filter builder:
eq,neq,lt,lteq,gt,gteq,regexp, andnot-regexp. The CLI constructs the underlyingTagFilterBuilderfilter and passes it through the reader'stag_filterpath forhead,cat, andsample.Docs and agent skill. Updated
cpp/tools/README.mdand the in-repotsfile-cliskill so users and agents can discover the explicit install mode, row-window behavior, and tag predicate options.Test plan
cmake --build cpp/build/Debug --target tsfile_clicmake -S cpp -B cpp/build/Debug -DCMAKE_BUILD_TYPE=Debug -DBUILD_TEST=ON -DENABLE_ANTLR4=OFFcmake --build cpp/build/Debug --target TsFile_Testcpp/build/Debug/test/lib/TsFile_Test --gtest_filter='ParseArgsTest.*'cpp/build/Debug/test/lib/TsFile_Test --gtest_filter='CliE2E.*'schema,stats,counthead/cat --offset/-nrow-window behavior, including time-range fallback semanticscat,head, andsample, including invalid field-column rejectionlarge_data.tsfileforcat/head --offset -nlarge_data.tsfile, includingeq,between, andregexppredicatesbash -n build.shbash build.sh --helpbash build.sh -t=Debug --disable-antlr4confirms default build skips install