ElasticsearchSQLHook

通过 elasticsearch-dbapi 与 Elasticsearch 交互的 Elasticsearch Hook

使用示例

tests/system/elasticsearch/example_elasticsearch_query.py

    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

此条目有帮助吗?