Repository navigation
[Subscription] Make column filters follow schema changes by default - #18925
Merged
jt2594838 merged 1 commit intoOct 20, 2026
Merged
Conversation
jt2594838
approved these changes
Oct 20, 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.
Description
Table subscription column filters currently bind to a schema snapshot when the topic matcher is initialized. A filter such as
column_name = "s2"retains the original TAGs but omits TAGs added while the consumer is running. New matching FIELDs and tables also require rebinding.Make column filters follow schema changes by default. Selecting part of a table's FIELDs automatically retains all its TAGs, including later additions, without ALTER TOPIC or a consumer restart. Matching FIELDs and tables are discovered dynamically, and datatype predicates use the current committed table schema. Preserve view aliases, ATTRIBUTE exclusion, per-table TIME selection, and filters that match no columns.
The expression is parsed once. Each Tablet resolves a cached table plan through the local committed schema cache; the plan is rebuilt only when that table's schema instance changes. Retain runtime TAGs in the existing pruning loop and replace per-column table lookups with direct set membership. The local schema accessor preserves metadata lease fencing and does not contact ConfigNode.
Document the behavior in
iotdb-client/subscription/README.md. There is no fixed column-schema snapshot option. The topic'smode = snapshotcontinues to control the historical data cutoff independently of column filtering.Validation
ColumnFilterBinderTest,ColumnFilterParserTest,TabletColumnPrunerTest,SubscriptionTopicAgentTest,DataNodeTableCacheTest, andDataNodeTableCacheLeaseTest.IoTDBSubscriptionColumnFilterITpassed: new tables, new FIELDs, new TAGs with selected FIELDs, new TAG values in TsFile payloads, and live datatype changes. Each case warms the matcher before the schema change.IoTDBConsensusSubscriptionColumnFilterClusterIT#testStreamingColumnFilterIncludesNewTagsAndFieldsOnThreeDataNodespassed with 1 ConfigNode, 3 DataNodes, and data replication factor 2.git diff --checkpassed.Integration-test condition: master currently compiles
CommonConfig.SUBSCRIPTION_ENABLEDasfalse, so stock test artifacts reject topic creation. The six integration tests ran with that flag enabled only in temporary generated test artifacts, recompilingDataNodeMemoryConfigto account for the inlined constant. The original generated jars were restored afterward; the production feature gate is unchanged by this PR.Performance
A local pruning microbenchmark compared the original snapshot matcher/pruner from the base commit with the streaming implementation and a real
DataNodeTableCache. After warmup, nine alternating samples were measured per case; the table reports medians in ns/Tablet.The narrow single-row case adds about 39 ns (3.5%); the other measured cases spend less time pruning. These results cover pruning with unchanged schema, not end-to-end throughput. Given the small local lookup cost and reuse of table plans, no legacy schema-snapshot configuration is retained.
This PR has: