File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,11 @@ spark.sql("CREATE EXTERNAL TABLE foo (id int, name varchar(100)) location 's3a:/
112112spark.sql(" INSERT INTO foo (id, name) VALUES(1, 'Foo')" )
113113```
114114
115+ ## Querying an S3 Table
116+
115117A REST call to the OpenSearch container can be used to query the table using the Async API.
118+
119+ [ Async Query Creation API] ( https://github.com/opensearch-project/sql/blob/main/docs/user/interfaces/asyncqueryinterface.rst#async-query-creation-api )
116120``` shell
117121curl \
118122 -u ' admin:C0rrecthorsebatterystaple.' \
@@ -122,14 +126,22 @@ curl \
122126 http://localhost:9200/_plugins/_async_query
123127```
124128
129+ Sample response:
130+ ``` json
131+ {
132+ "queryId" : " HlbM61kX6MDkAktO" ,
133+ "sessionId" : " 1Giy65ZnzNlmsPAm"
134+ }
135+ ```
136+
125137When the query is finished, the results can be retrieved with a REST call to the OpenSearch container.
138+
139+ [ Async Query Result API] ( https://github.com/opensearch-project/sql/blob/main/docs/user/interfaces/asyncqueryinterface.rst#async-query-result-api )
126140``` shell
127141curl \
128142 -u ' admin:C0rrecthorsebatterystaple.' \
129- -X POST \
130- -H ' Content-Type: application/json' \
131- -d ' {}' \
132- ' http://localhost:9200/query_execution_result_mys3/_search?pretty'
143+ -X GET \
144+ ' http://localhost:9200/_plugins/_async_query/HlbM61kX6MDkAktO'
133145```
134146
135147## Configuration of the Cluster
You can’t perform that action at this time.
0 commit comments