You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "linxt20 (via GitHub)" <gi...@apache.org> on 2026/04/18 04:59:41 UTC

[PR] fix(tvf): validate non-negative width and height in pattern_match [iotdb]

linxt20 opened a new pull request, #17515:
URL: https://github.com/apache/iotdb/pull/17515

   ## Description
   
   Add validation for negative `width` and `height` parameters in the `pattern_match` table-valued function. Previously, passing a negative value for either parameter was silently accepted and produced an empty result set with no indication of misuse, which is inconsistent with how `smooth` and `threshold` are already validated.
   
   ## Changes
   
   - **`PatternMatchTableFunction.analyze()`**: Add non-negative checks for `WIDTH_PARAM` and `HEIGHT_PARAM`. A negative value now throws `UDFException` with a clear message, matching the existing behavior of `smooth` / `threshold`.
   - **`IoTDBWindowTVFIT`**: Add two integration test cases asserting that `width => -1.0` and `height => -10.0` are rejected with the expected error messages.
   
   ## Before
   
   ```sql
   IoTDB:test_db> select * from pattern_match(
     ..., width => -1.0, height => 500.0, ...);
   Empty set.    -- silently returns nothing
   ```
   
   ## After
   
   ```sql
   IoTDB:test_db> select * from pattern_match(
     ..., width => -1.0, ...);
   Error: width must be a non-negative number, but got: -1.0
   ```
   
   ## Type of change
   
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [x] Test case
   
   ## Compatibility
   
   No behavioral change for valid (non-negative) inputs. Only previously-undefined behavior with negative inputs is now rejected at analysis time.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(tvf): validate non-negative width and height in pattern_match [iotdb]

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #17515:
URL: https://github.com/apache/iotdb/pull/17515


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org