ElasticsearchSQLHook

Elasticsearch Hook that interact with Elasticsearch through the elasticsearch-dbapi

Usage Example

tests/system/providers/elasticsearch/example_elasticsearch_query.py[source]

    es = ElasticsearchSQLHook(elasticsearch_conn_id=CONN_ID)

    es_connection = es.get_conn()
    response = es_connection.execute_sql("SHOW TABLES")
    for row in response["rows"]:
        print(f"row: {row}")
    return True

Was this entry helpful?