-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter Expression support #440
base: develop-3.4
Are you sure you want to change the base?
Conversation
This is v6 of the perf_SUITE tests. The test adds a complex index entry to every object, and then adds a new test phase to test regex queries. There are three profiles added so the full, mini and profiling versions of perf_SUITE can be run without having to edit the file itself: e.g. ./rebar3 as perf_mini do ct --suite=test/end_to_end/perf_SUITE When testing as `perf_prof` summarised versions of the eprof results are now printed to screen. The volume of keys within the full test suite has been dropped ... just to make life easier so that test run times are not excessively increase by the new features.
The re2 library, though not offering the complete functionality of pcre, is known to be much faster in many scenarios. Switch to re2 in preparation for the OTP switch to re2 in OTP28
Assume to make the job of gs easier - name makes a massive difference to load time in OTP 24.
alos try and improve test stability by increasing pause
Identify and log out memory usage by test phase
Allow for a capturing regular expression to be passed with a filter function that will filter based on the captured output. Also allows a specific captured term to be returned as the returned term (rather than the whole index term)
First draft of allowing an externally provided comparison expression to be validated, parsed and evaluated
Required as re2 can only output binary not string in captures.
Allow for capture with either delimited index terms, or with regex capture, and then filtering of captured attributes using a logical expression. The xref check `locals_not_used` is now ignored due to issues with auto-generated module.
Allow for the generation of projected attributes from an index term
Allow for additional functions in eval. Change the leveled query API to generalise application of eval/filter expressions.
Remove `capture` option - as all can be achieved via eval/filter.
The Filter should expect to compare BETWEEN low AND high ... supporting high AND low may be confusing. The filter should allow for identifier to be in any location in a comparator i.e. string BETWEEN identifier AND identifier integer > identifier This make check some validity constraints harder at parse time (i.e. that High >= Low), but makes tse result more compatible. For ease, of implementation IN can only be used for a comparison between a string and a list of strings (with the identifier representing either part).
now passes 10k tests
Differentiate between positive/negative integers and non-negative integers. Stop parsing of unusable split/index values.
Works on index terms of type unicode_binary()
" | map($birthday, <=, ((\"0430\", 2024)), 2023, $yoc)" | ||
" | subtract($yoc, $yob, $age)" | ||
" | add($age, 1, $age_next)" | ||
" | to_string($age, $age)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize one can overload variables to have different types... probably not the nicest thing to use in an example.
%% Lexer for eval expressions | ||
|
||
Definitions. | ||
WhiteSpace = ([\t\f\v\r\n\s]+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When reading the documentation, I would say \s
subsumes the others.
Co-authored-by: Thomas Arts <thomas.arts@quviq.com>
Co-authored-by: Thomas Arts <thomas.arts@quviq.com>
…n' into mas-d31-mas.i1433-filterexpression
This reverts commit 1b320c6.
Update tot he lexers, to require strings to be non-empty, which rules out a raft of potential failure scenarios during evaluation. Handle unexpected types in eval functions by not creating the attribute rather than throwing an exception. Add a new ends_with function, that behaves as begins_with in reverse.
Allow for return_keys of logical combinations of queries
Avoid confusion over meaning of NOT
Don't rely on ordering of inputs, use a numeric identifier as a key
Allow indexes to be evaluated into a Key/Value map using an eval pipeline, and then filtered using a filter expression