Schema Mapping
The CData Python Connector for Elasticsearch models the Elasticsearch REST APIs as relational tables and stored procedures that can be accessed with standard SQL. This enables access from standards-based tools.
The table definitions are dynamically retrieved. When you connect, the connector connects to Elasticsearch and retrieves the schemas, list of tables, and the metadata for the tables by querying the Elasticsearch REST server. Any changes to the remote data are immediately reflected in your queries.
The following table maps Elasticsearch concepts to relational ones:
Elasticsearch Versions 6 and Above:
Elasticsearch Concept | SQL Concept |
Index | Table |
Alias | View |
Document | Row (each document is a row and the document's JSON structure is represented as columns) |
Field | Column |
Note: Starting in Elasticsearch 6, indices are limited to a single type. Therefore the type is no longer treated as a table, since an index and type have a one-to-one relation. Types are hidden and used internally where necessary to issue the proper request to Elasticsearch.
Elasticsearch Versions Prior to Version 6:
Elasticsearch Concept | SQL Concept |
Index | Schema |
Type | Table |
Alias | View |
Document | Row (each document is a row and the document's JSON structure is represented as columns) |
Field | Column |