From 9ae828437190eb37b20a49cfc9df9337256b9aac Mon Sep 17 00:00:00 2001 From: Vamsi Manohar Date: Thu, 5 Oct 2023 14:58:51 -0700 Subject: [PATCH] Add documentation Signed-off-by: Vamsi Manohar --- docs/user/interfaces/asyncqueryinterface.rst | 17 +++++++++------ .../ppl/admin/connectors/s3glue_connector.rst | 21 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/user/interfaces/asyncqueryinterface.rst b/docs/user/interfaces/asyncqueryinterface.rst index afcade2303..7a9ef33514 100644 --- a/docs/user/interfaces/asyncqueryinterface.rst +++ b/docs/user/interfaces/asyncqueryinterface.rst @@ -14,23 +14,28 @@ Async Query Interface Endpoints Introduction ============ -For supporting `S3Glue <../ppl/admin/connectors/s3glue_connector.rst>`_ and Cloudwatch datasources connectors, we have introduced a new execution engine on top of Spark. +For supporting `S3Glue <../ppl/admin/connectors/s3glue_connector.rst>`_ datasource connector, we have introduced a new execution engine on top of Spark. All the queries to be executed on spark execution engine can only be submitted via Async Query APIs. Below sections will list all the new APIs introduced. -Configuration required for Async Query APIs -====================================== +Required Spark Execution Engine Config for Async Query APIs +=========================================================== Currently, we only support AWS emr serverless as SPARK execution engine. The details of execution engine should be configured under -``plugins.query.executionengine.spark.config`` cluster setting. The value should be a stringified json comprising of ``applicationId``, ``executionRoleARN``,``region``. +``plugins.query.executionengine.spark.config`` cluster setting. The value should be a stringified json comprising of ``applicationId``, ``executionRoleARN``,``region``, ``sparkSubmitParameter``. Sample Setting Value :: - plugins.query.executionengine.spark.config: '{"applicationId":"xxxxx", "executionRoleARN":"arn:aws:iam::***********:role/emr-job-execution-role","region":"eu-west-1"}' - + plugins.query.executionengine.spark.config: '{"applicationId":"xxxxx", + "executionRoleARN":"arn:aws:iam::***********:role/emr-job-execution-role", + "region":"eu-west-1", + "sparkSubmitParameter": "--conf spark.dynamicAllocation.enabled=false" }' If this setting is not configured during bootstrap, Async Query APIs will be disabled and it requires a cluster restart to enable them back again. We make use of default aws credentials chain to make calls to the emr serverless application and also make sure the default credentials have pass role permissions for emr-job-execution-role mentioned in the engine configuration. +* ``applicationId``, ``executionRoleARN`` and ``region`` are required parameters. +* ``sparkSubmitParameter`` is an optional parameter. It can take the form ``--conf A=1 --conf B=2 ...``. + Async Query Creation API ====================================== diff --git a/docs/user/ppl/admin/connectors/s3glue_connector.rst b/docs/user/ppl/admin/connectors/s3glue_connector.rst index ef27cf572a..5cd2ed8033 100644 --- a/docs/user/ppl/admin/connectors/s3glue_connector.rst +++ b/docs/user/ppl/admin/connectors/s3glue_connector.rst @@ -20,10 +20,11 @@ This page covers s3Glue datasource configuration and also how to query and s3Glu Required resources for s3 Glue Connector =================================== -* S3: This is where the data lies. -* Spark Execution Engine: Query Execution happens on spark. -* Glue Metadata store: Glue takes care of table metadata. -* Opensearch: Index for s3 data lies in opensearch and also acts as temporary buffer for query results. +* ``EMRServerless Spark Execution Engine Config Setting``: Since we execute s3Glue queries on top of spark execution engine, we require this configuration. + More details: `ExecutionEngine Config <../../../interfaces/asyncqueryinterface.rst#id2>`_ +* ``S3``: This is where the data lies. +* ``Glue`` Metadata store: Glue takes care of table metadata. +* ``Opensearch IndexStore``: Index for s3 data lies in opensearch and also acts as temporary buffer for query results. We currently only support emr-serverless as spark execution engine and Glue as metadata store. we will add more support in future. @@ -74,8 +75,14 @@ Glue datasource configuration:: } }] -Sample s3Glue datasource queries -================================ - +Sample s3Glue datasource queries APIS +===================================== +Sample Async Query APIs +* Select Query : `select * from mys3.default.http_logs limit 1"` +* Create Covering Index Query: `create index clientip_year on my_glue.default.http_logs (clientip, year) WITH (auto_refresh=true)` +* Create Skipping Index: `create skipping index on mys3.default.http_logs (status VALUE_SET)` + +These queries would work only top of async queries. Documentation: `Async Query APIs <../../../interfaces/asyncqueryinterface.rst>`_ +Documentation on Indexing Queries: https://github.com/opensearch-project/opensearch-spark/blob/main/docs/index.md \ No newline at end of file