-
Notifications
You must be signed in to change notification settings - Fork 3
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
Test and document nested objects #98
Conversation
@@ -162,6 +162,9 @@ In this case, Juttle will issue a query against ES that matches documents whose | |||
* `reduce by fieldname` (other than reduce by document type) | |||
* `reduce -every :interval:` | |||
|
|||
##### Optimization and nested objects | |||
There are a few fundamental incompatibilities between [Elasticsearch's model](https://www.elastic.co/guide/en/elasticsearch/guide/current/complex-core-fields.html) for nested object and array fields and [Juttle's](http://juttle.github.io/juttle/concepts/fields/#fields-with-object-or-array-values). This can lead to some odd results for optimized programs. For objects, an optimized `reduce by some_object_field` will return `null` as the only value for `some_object_field`. For arrays, an optimized `reduce by some_array_field` will return a separate value for `some_array_field` for every element in every array stored in `some_array_field`. | |||
|
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.
Advice for how to get better behavior would be fitting here. Perhaps:
For results conforming to Juttle's `reduce` behavior, if reducing by an object or array field, make the reduce follow unoptimized path by adding `put unoptimized = true` before the `reduce by some_object_or_array_field`.
(My read of the situation is that we don't have a way to force the program to do that, because by the time we discover that was an object field, it's too late; hence, the user has to do that.)
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.
Right!
Fwiw I don't have a problem with merging in skipped tests because they are waiting on a dependency. Additionally we can (should) file an issue for that work so it doesn't get forgotten. |
also warn if you reduce by an object field
063708b
to
007df47
Compare
Test and document nested objects
Great! I opened #100. |
Also warn if you reduce by an object field. Most of the tests are skipped because of juttle/juttle#320. I'll open this PR so I don't forget about it, but probably not ready for merge unless we want a bunch of skipped tests in there.