Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Workaround for fieldnames with dots in elasticsearch #243

Merged

Conversation

arjansh
Copy link
Contributor

@arjansh arjansh commented Jul 6, 2020

MetaModel is unable to work with a document indexed by Elasticsearch which contains dots in its field names. Note that this is actually caused by Elasticsearch, because the mapping returned for such a document by Elasticsearch doesn't match the source returned by Elasticsearch when getting the source of a search hit. (see elastic/elasticsearch-hadoop#853 and related issues for more info on this).

Note that the branch for this PR is branch off of the branch for #242, because it extends the Integration Test which is introduced in that PR.

Arjan Seijkens added 2 commits July 3, 2020 15:29
… indexed by Elasticsearch which contains dots in its fieldnames. Note that this is actually caused by Elasticsearch, because the mapping returned for such a document by Elasticsearch doesn't match the source returned by Elasticsearch when getting the source of a search hit. (see elastic/elasticsearch-hadoop#853 and related issues for more info on this).
…based on indexed documents with dots in the field names in an inconsistent manner. I.e the mapping it returns for such documents indicate those kind of fields are treated as nested objects. But if you get the source map of such a document from Elasticsearch, it still contains the original fieldnames (with dots in them).
} else if (column.getType() == ColumnType.MAP && value == null) {
// Because of a bug in Elasticsearch, when field names contain dots, it's possible that the
// mapping of the index described a column to be of the type "MAP", while it's based on a number
// of fields contains dots in their name. In this case we may have to work around that
Copy link
Contributor

Choose a reason for hiding this comment

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

"contains dots..." => "containing dots..."

@asfgit asfgit merged commit e3aecb9 into apache:master Jul 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants