JackieTien97 opened a new pull request, #18983: URL: https://github.com/apache/iotdb/pull/18983
## Description Patterns such as `1,+,2` and `1,*,2` silently discard the misplaced repetition signs and are interpreted as `1,2`. Extra signs after a group, including `}++`, `}+*`, `}*+`, and `}**`, are also silently accepted. Reject unconsumed `+` and `*` in `QetchAlgorithm`'s shared pattern parser. A repetition sign must immediately follow `}`, where the parser consumes the pair. Invalid patterns now fail during table-function analysis with semantic error **701** and an English or Chinese explanation, including when the input table is empty: ```text 701: Invalid pattern: '1,+,2'. Repetition signs '+' and '*' must immediately follow '}'. ``` Add coverage for 16 malformed patterns, valid grouped and nested repetitions, and both populated and empty SQL inputs. Related: #18961. ## Validation - Spotless, `git diff --check`, and English/Chinese message-key and placeholder parity checks passed. - Clean reactor verification with `TableSimpleIT`: `PatternMatchTableFunctionTest` passed all 9 tests; `IoTDBWindowTVFIT#testPatternMatch*` passed all 5 integration tests. - Full-reactor `mvn test-compile -DskipTests` and `mvn clean test-compile -DskipTests -P with-zh-locale` passed. The tests and compilation checks ran in an isolated checkout of `16cf45d1c0` plus this patch. This PR is based on `212214e6ae`; after moving to that base, the patch and all five modified files were verified byte-for-byte identical to the tested sources. The tests have not been rerun on the newer base. This PR has: - [x] been self-reviewed. - [x] added a comment explaining the parser invariant. - [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]
