Skip to content

Add M4 table function implementation and integrate with statement ana…#17656

Merged
JackieTien97 merged 3 commits into
apache:masterfrom
CoollZzz:feat/M4-Table-Function
Jun 10, 2026
Merged

Add M4 table function implementation and integrate with statement ana…#17656
JackieTien97 merged 3 commits into
apache:masterfrom
CoollZzz:feat/M4-Table-Function

Conversation

@CoollZzz

@CoollZzz CoollZzz commented May 13, 2026

Copy link
Copy Markdown
Contributor

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:

  • Registered the M4TableFunction as a built-in table function in TableBuiltinTableFunction, enabling its use in SQL queries and ensuring it is instantiated correctly in the query engine. [1] [2] [3] [4]

Query Planner Enhancements:

  • Updated the StatementAnalyzer to automatically infer and append the window mode (time-based or count-based) for the M4 table function, based on the type of the SIZE argument, and to validate required arguments.

Testing Improvements:

  • Added a comprehensive integration test suite (IoTDBM4TableFunctionIT.java) that covers various use cases, including time and count window modes, argument validation, and error handling for the M4 table function.
  • Expanded unit tests in TableFunctionTest.java to 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

@JackieTien97 JackieTien97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

根据 M4 需求文档和讨论里的语义,我标了几个需要对齐的点:输出列顺序、SIZE/SLIDE 模式一致性、ORIGIN 不应过滤早于原点的数据,以及实现复杂度需要满足每行 O(1) 分组处理。

@JackieTien97 JackieTien97 merged commit 983e927 into apache:master Jun 10, 2026
41 checks passed
MileaRobertStefan pushed a commit to MileaRobertStefan/iotdb that referenced this pull request Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants