LIKE tweaks for performance - #2716
Conversation
|
馃摝 Opteryx build version: |
|
馃摝 Opteryx build version: |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors string-related operations for performance improvements by renaming the list_substring module to list_in_string and optimizing various algorithms. The changes focus on improving LIKE operations and substring search functionality.
- Renamed
list_substringfunctions tolist_in_stringacross multiple files - Optimized Boyer-Moore-Horspool algorithm with better variable handling and type improvements
- Updated output handling to use native JSON serialization instead of orjson
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| opteryx/managers/expression/ops.py | Updated function calls from list_substring to list_in_string |
| opteryx/functions/other_functions.py | Updated function calls from list_substring to list_in_string |
| opteryx/compiled/table_ops/hash_ops.pyx | Cleaned up comments and formatting |
| opteryx/compiled/list_ops/list_in_string.pyx | Renamed functions, optimized Boyer-Moore algorithm, improved type safety |
| opteryx/version.py | Updated build number |
| opteryx/main.py | Added redundant print statements and switched to native JSON |
|
|
||
| if needlelen == 0: | ||
| return -1 # No valid search possible | ||
| return 0 # No valid search possible |
There was a problem hiding this comment.
Changed return value from -1 to 0 for empty needle case. This changes the function's behavior - returning 0 means 'no match found' while the original -1 likely indicated an error condition. This could break calling code that expects -1 for invalid inputs.
| return 0 # No valid search possible | |
| return -1 # No valid search possible (invalid input) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
馃摝 Opteryx build version: |
|



Thank you for opening a Pull Request!
We appreciate your contribution to Opteryx. Your time and effort make a difference, and we鈥檙e excited to review your changes. To help ensure a smooth review process, please check the following:
Checklist for a Successful PR
Fixes: #
<issue_number_goes_here>Please replace
<issue_number_goes_here>with the corresponding issue number.Thank you for contributing to Opteryx! 馃帀