Skip to content
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

Merged
merged 1 commit into from
Feb 14, 2016
Merged

Test and document nested objects #98

merged 1 commit into from
Feb 14, 2016

Conversation

davidvgalbraith
Copy link
Collaborator

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.

@@ -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`.

Copy link
Contributor

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.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right!

@dmehra
Copy link
Contributor

dmehra commented Feb 14, 2016

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
davidvgalbraith added a commit that referenced this pull request Feb 14, 2016
Test and document nested objects
@davidvgalbraith davidvgalbraith merged commit 24c62b7 into master Feb 14, 2016
@davidvgalbraith
Copy link
Collaborator Author

Great! I opened #100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants