-
Notifications
You must be signed in to change notification settings - Fork 98
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
filtering flattened projection does not seem to follow projection rules #68
Comments
I think without the pipe the second filter is being applied to each of the results, rather than the whole result set. |
I'm still confused on why the interpreter sees a difference between filtering a array property and a flattened array? They are both projections are they not? If so, what am I missing in the documentation on vs this implementation? The implementation reads like the |
NB: Sorry, I know this doesn't answer your question but I found it interesting, so I thought I would share. I sometimes find it useful to look at the parsed AST to see what's going on: If you compare expr3 and expr4 where I've used an index expression, you can see how it nests differently. |
@daniefer I think this detailed explanation of the concept of projection may help you. @darrenmothersele is correct, you need a |
Scenario
If we have an object like so:
and the query:
I get the result
This seems to line up just fine with the documentation of what a "projection" is in JMES.
It is my understanding that Filter and Flatten are both types of projections. So if I then filter the flattened projection like so
I would expect this
but instead I have to pipe the result to a filter projection in order to get this to work:
Question / Issue
I would not expect that I have to first use the pipe operator in order to achieve that.
Why is it that the filter is not applied as a projection of each result of the flatten operation? Am I misunderstanding something about what is/is not a projection and how the projection algorithm is supposed to work?
The text was updated successfully, but these errors were encountered: