JackieTien97 opened a new pull request, #18961:
URL: https://github.com/apache/iotdb/pull/18961
## Description
An empty repetition group such as `pattern => '1,{,}+,1'` causes
`pattern_match` to pop an empty stack while building its state machine and
return `301: null`.
Validate patterns during table-function analysis so invalid input returns
semantic error **701** with a localized explanation. Reuse the validation at
the parser entry point to reject empty and nested empty groups, unmatched
braces, malformed numeric points, and patterns without enough data points
before state-machine construction.
For the reported pattern, the error is now:
```text
701: Invalid pattern: '1,{,}+,1'. Repetition groups must contain at least
one numeric data point.
```
## Validation
- Spotless formatting and English/Chinese message-key and placeholder parity
checks passed.
- `PatternMatchTableFunctionTest`: 8 tests passed, including valid nested
patterns and existing partition-isolation cases.
- `IoTDBWindowTVFIT#testPatternMatch*` with `TableSimpleIT`: 4 tests passed.
The new regression test checks both error code 701 and the message for 7
invalid patterns against populated and empty inputs.
- Full-reactor English `mvn test-compile -DskipTests` and clean Chinese `mvn
clean test-compile -DskipTests -P with-zh-locale` passed.
Validation used an isolated checkout of `2fc87bd8d8` plus this patch; all
six changed files were verified identical to this PR. The initial clean
verification hit an existing compilation failure in `SystemInfoTest`, which
calls removed `DataRegionInfo` methods. That test file was excluded only in the
verification checkout; the exclusion is not included in this PR.
This PR has:
- [x] been self-reviewed.
- [x] added or updated unit tests.
- [x] added integration tests.
- [x] been tested in a test IoTDB cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]