Skip to content

Comments

SQL: Properly handle indices with no/empty mapping#46775

Merged
costin merged 2 commits intoelastic:masterfrom
costin:fix/46757
Sep 17, 2019
Merged

SQL: Properly handle indices with no/empty mapping#46775
costin merged 2 commits intoelastic:masterfrom
costin:fix/46757

Conversation

@costin
Copy link
Member

@costin costin commented Sep 17, 2019

When encountering only indices with empty mapping, the IndexResolver
throws an exception as it expects to find at least one entry.
This commit fixes this case so that an empty mapping is returned.

Fix #46757

When encountering only indices with empty mapping, the IndexResolver
throws an exception as it expects to find at least one entry.
This commit fixes this case so that an empty mapping is returned.

Fix elastic#46757
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM. Left one comment.

Map<String, FieldCapabilities> types = entry.getValue();

// ignore size added by the mapper plugin
// ignore size added by the mapper plugin or indices with no mapping
Copy link
Contributor

Choose a reason for hiding this comment

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

Why "indices with no mapping" would be applicable to this condition? (the _size field, when enabled, will be added even if the mapping doesn't have any explicitly defined fields).

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right - the location of the comment is incorrect.

@costin costin merged commit 5f4f580 into elastic:master Sep 17, 2019
@costin costin deleted the fix/46757 branch September 17, 2019 13:09
costin added a commit that referenced this pull request Sep 17, 2019
When encountering only indices with empty mapping, the IndexResolver
throws an exception as it expects to find at least one entry.
This commit fixes this case so that an empty mapping is returned.

Fix #46757

(cherry picked from commit 5f4f580)
costin added a commit that referenced this pull request Sep 17, 2019
When encountering only indices with empty mapping, the IndexResolver
throws an exception as it expects to find at least one entry.
This commit fixes this case so that an empty mapping is returned.

Fix #46757

(cherry picked from commit 5f4f580)
costin added a commit that referenced this pull request Sep 17, 2019
When encountering only indices with empty mapping, the IndexResolver
throws an exception as it expects to find at least one entry.
This commit fixes this case so that an empty mapping is returned.

Fix #46757

(cherry picked from commit 5f4f580)
@colings86 colings86 added v7.4.0 and removed v7.4.1 labels Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL: empty index causes incorrect mapping error

5 participants