-
Notifications
You must be signed in to change notification settings - Fork 1
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
Review jsonpath_rs (2) #11
base: master
Are you sure you want to change the base?
Conversation
Yes, but lets leave it to a separate PR
Agree, will add it on this PR.
The json path rules was not clear to me, But I believe I understand now, if the filter is applied on simple value (string, number, boolean, ...) then it is applied on that value. But if it is applied on array or object, it is applies on each element. I will change the code, we might not need the
Saw that, will fix them. |
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.
👍🏼 Few comments
@@ -913,32 +922,33 @@ impl<'i, UPTG: UserPathTrackerGenerator> PathCalculator<'i, UPTG> { | |||
self.calc_range(pairs, curr, json, path_tracker, calc_data); | |||
} | |||
Rule::filter => { | |||
if flat_arrays_on_filter && json.get_type() == SelectValueType::Array { | |||
if json.get_type() == SelectValueType::Array |
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.
Is there any impact on performance from this change? (always flattening also without filter)
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.
Not that I can think of...
Co-authored-by: Omer Shadmi <[email protected]>
@oshadmi fixed. |
Replace #10
Few comments up til now:
full_scan
orall
? (currently it seems to be allowed by the grammar)flat_arrays_on_filter
- you mean we should not iterate all array entries, but only the relevant ones (e.g., if using a union, no need to iterate all?)And not sure I understand, for example, in
calc_internal
inRule::filter
in theelse
clause we passtrue
and not the param we gotflat_arrays_on_filter
filter_inner
,filter_nested
) so they are commented out to be reviewed later