Add M4 table function implementation and integrate with statement ana…#17656
Merged
Conversation
JackieTien97
reviewed
Jun 9, 2026
JackieTien97
left a comment
Contributor
There was a problem hiding this comment.
根据 M4 需求文档和讨论里的语义,我标了几个需要对齐的点:输出列顺序、SIZE/SLIDE 模式一致性、ORIGIN 不应过滤早于原点的数据,以及实现复杂度需要满足每行 O(1) 分组处理。
MileaRobertStefan
pushed a commit
to MileaRobertStefan/iotdb
that referenced
this pull request
Jun 26, 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.
This pull request introduces support for the M4 table function in the query engine, enabling advanced time-series windowing operations (such as time-based and count-based window modes) and adds comprehensive integration and unit tests for this functionality. The changes ensure that the query planner can correctly recognize and process the M4 function, infer its window mode, and handle argument validation robustly.
The most important changes are:
M4 Table Function Integration:
M4TableFunctionas a built-in table function inTableBuiltinTableFunction, enabling its use in SQL queries and ensuring it is instantiated correctly in the query engine. [1] [2] [3] [4]Query Planner Enhancements:
StatementAnalyzerto automatically infer and append the window mode (time-based or count-based) for the M4 table function, based on the type of theSIZEargument, and to validate required arguments.Testing Improvements:
IoTDBM4TableFunctionIT.java) that covers various use cases, including time and count window modes, argument validation, and error handling for the M4 table function.TableFunctionTest.javato verify correct plan generation for both time and count window modes of the M4 function, as well as proper error handling for missing required arguments. [1] [2]…lyzer