From 4bb872e8d261ea37bcc06f9243da9869de399c86 Mon Sep 17 00:00:00 2001 From: extricatrianz <153259391+extricatrianz@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:53:15 +0530 Subject: [PATCH 1/5] Create extrica-setup.md --- .../connect-data-platform/extrica-setup.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 website/docs/docs/core/connect-data-platform/extrica-setup.md diff --git a/website/docs/docs/core/connect-data-platform/extrica-setup.md b/website/docs/docs/core/connect-data-platform/extrica-setup.md new file mode 100644 index 00000000000..ea3e2dee010 --- /dev/null +++ b/website/docs/docs/core/connect-data-platform/extrica-setup.md @@ -0,0 +1,48 @@ +### Connecting to Extrica + +#### Example profiles.yml +Here is a example of a dbt-extrica profile parameters. At a minimum, you need to specify `type`, `method`, `username`, `password` `host`, `port`, `schema`, `catalog` and `threads`. + + +```yaml +: + outputs: + dev: + type: extrica + method: jwt + username: [username for jwt auth] + password: [password for jwt auth] + host: [extrica hostname] + port: [port number] + schema: [dev_schema] + catalog: [catalog_name] + threads: [1 or more] + + prod: + type: extrica + method: jwt + username: [username for jwt auth] + password: [password for jwt auth] + host: [extrica hostname] + port: [port number] + schema: [dev_schema] + catalog: [catalog_name] + threads: [1 or more] + target: dev + +``` + + +#### Description of Profile Fields + +| Parameter | Type | Description | +|------------|----------|------------------------------------------| +| type | string | Specifies the type of dbt adapter (Extrica). | +| method | jwt | Authentication method for JWT authentication. | +| username | string | Username for JWT authentication. The obtained JWT token is used to initialize a trino.auth.JWTAuthentication object. | +| password | string | Password for JWT authentication. The obtained JWT token is used to initialize a trino.auth.JWTAuthentication object. | +| host | string | The host parameter specifies the hostname or IP address of the Trino server. | +| port | integer | The port parameter specifies the port number on which the Trino server is listening. | +| schema | string | Schema or database name for the connection. | +| catalog | string | Name of the catalog representing the data source. | +| threads | integer | Number of threads for parallel execution of queries. (1 or more | From e9b7b3ebff8a58fa2debd7401df34a958f3f246e Mon Sep 17 00:00:00 2001 From: extricatrianz <153259391+extricatrianz@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:34:45 +0530 Subject: [PATCH 2/5] Added extrica adapter in community-adapters.md --- website/docs/docs/community-adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/community-adapters.md b/website/docs/docs/community-adapters.md index d1e63f03128..1faf2fd9e25 100644 --- a/website/docs/docs/community-adapters.md +++ b/website/docs/docs/community-adapters.md @@ -17,4 +17,4 @@ Community adapters are adapter plugins contributed and maintained by members of | [TiDB](/docs/core/connect-data-platform/tidb-setup) | [Firebolt](/docs/core/connect-data-platform/firebolt-setup) | [MindsDB](/docs/core/connect-data-platform/mindsdb-setup) | [Vertica](/docs/core/connect-data-platform/vertica-setup) | [AWS Glue](/docs/core/connect-data-platform/glue-setup) | [MySQL](/docs/core/connect-data-platform/mysql-setup) | | [Upsolver](/docs/core/connect-data-platform/upsolver-setup) | [Databend Cloud](/docs/core/connect-data-platform/databend-setup) | [fal - Python models](/docs/core/connect-data-platform/fal-setup) | -| [TimescaleDB](https://dbt-timescaledb.debruyn.dev/) | | | +| [TimescaleDB](https://dbt-timescaledb.debruyn.dev/) | [Extrica](/docs/core/connect-data-platform/extrica-setup) | | From 5008f0231d85756da15660dd09c7c5468258cc03 Mon Sep 17 00:00:00 2001 From: extricatrianz <153259391+extricatrianz@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:28:46 +0530 Subject: [PATCH 3/5] added setup and config urls in sidebars.js --- website/sidebars.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/sidebars.js b/website/sidebars.js index 598fffc7f0d..81605490e01 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -213,6 +213,7 @@ const sidebarSettings = { "docs/core/connect-data-platform/decodable-setup", "docs/core/connect-data-platform/upsolver-setup", "docs/core/connect-data-platform/starrocks-setup", + "docs/core/connect-data-platform/extrica-setup", ], }, ], @@ -723,6 +724,7 @@ const sidebarSettings = { "reference/resource-configs/oracle-configs", "reference/resource-configs/upsolver-configs", "reference/resource-configs/starrocks-configs", + "reference/resource-configs/extrica-configs", ], }, { From a6ebef3e681610e0599befe2be3674785ddc444b Mon Sep 17 00:00:00 2001 From: extricatrianz <153259391+extricatrianz@users.noreply.github.com> Date: Fri, 8 Dec 2023 21:30:10 +0530 Subject: [PATCH 4/5] Update extrica-setup.md --- .../connect-data-platform/extrica-setup.md | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/website/docs/docs/core/connect-data-platform/extrica-setup.md b/website/docs/docs/core/connect-data-platform/extrica-setup.md index ea3e2dee010..3060aaa7369 100644 --- a/website/docs/docs/core/connect-data-platform/extrica-setup.md +++ b/website/docs/docs/core/connect-data-platform/extrica-setup.md @@ -1,4 +1,41 @@ -### Connecting to Extrica +--- +title: "Extrica Setup" +description: "Read this guide to learn about the Extrica Trino Query Engine setup in dbt." +id: "extrica-setup" +meta: + maintained_by: Extrica, Trianz + authors: Gaurav Mittal, Viney Kumar, Mohammed Feroz, and Mrinal Mayank + github_repo: 'extricatrianz/dbt-extrica' + pypi_package: 'dbt-extrica' + min_core_version: 'v1.7.2' + cloud_support: 'Not Supported' + min_supported_version: 'n/a' + platform_name: 'Extrica' + config_page: '/reference/resource-configs/extrica-configs' +--- +

Overview of {frontMatter.meta.pypi_package}

+ + +

Installing {frontMatter.meta.pypi_package}

+ +Use `pip` to install the adapter, which automatically installs `dbt-core` and any additional dependencies. Use the following command for installation: + +python -m pip install {frontMatter.meta.pypi_package} + +

Configuring {frontMatter.meta.pypi_package}

+ +

For {frontMatter.meta.platform_name}-specifc configuration please refer to {frontMatter.meta.platform_name} Configuration

+ + +

Connecting to {frontMatter.meta.platform_name}

#### Example profiles.yml Here is a example of a dbt-extrica profile parameters. At a minimum, you need to specify `type`, `method`, `username`, `password` `host`, `port`, `schema`, `catalog` and `threads`. @@ -33,7 +70,7 @@ Here is a example of a dbt-extrica profile parameters. At a minimum, you need t ``` -#### Description of Profile Fields +#### Description of Extrica Profile Fields | Parameter | Type | Description | |------------|----------|------------------------------------------| @@ -41,8 +78,10 @@ Here is a example of a dbt-extrica profile parameters. At a minimum, you need t | method | jwt | Authentication method for JWT authentication. | | username | string | Username for JWT authentication. The obtained JWT token is used to initialize a trino.auth.JWTAuthentication object. | | password | string | Password for JWT authentication. The obtained JWT token is used to initialize a trino.auth.JWTAuthentication object. | -| host | string | The host parameter specifies the hostname or IP address of the Trino server. | -| port | integer | The port parameter specifies the port number on which the Trino server is listening. | +| host | string | The host parameter specifies the hostname or IP address of the Extrica's Trino server. | +| port | integer | The port parameter specifies the port number on which the Extrica's Trino server is listening. | | schema | string | Schema or database name for the connection. | | catalog | string | Name of the catalog representing the data source. | | threads | integer | Number of threads for parallel execution of queries. (1 or more | + +

For further info, refer to the GitHub repository: {frontMatter.meta.github_repo}

From 8a56870cb9b18984066e039e5f365821fa1665fa Mon Sep 17 00:00:00 2001 From: extricatrianz <153259391+extricatrianz@users.noreply.github.com> Date: Fri, 8 Dec 2023 22:27:53 +0530 Subject: [PATCH 5/5] Create extrica-configs.md --- .../resource-configs/extrica-configs.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 website/docs/reference/resource-configs/extrica-configs.md diff --git a/website/docs/reference/resource-configs/extrica-configs.md b/website/docs/reference/resource-configs/extrica-configs.md new file mode 100644 index 00000000000..b2fd0a368f2 --- /dev/null +++ b/website/docs/reference/resource-configs/extrica-configs.md @@ -0,0 +1,98 @@ +--- +title: "Extrica configurations" +id: "extrica-configs" +--- +## Configuring Extrica + +#### Install dbt-extrica adapter + +```sh + pip install dbt-extrica +``` +#### Initialize dbt project +```sh +dbt init +``` +* Select Adapters : After running the `dbt init` command, you'll be prompted to select adapters from a list of available adapters. Choose the appropriate adapter for your project. +* Modify Profiles.yml : The dbt init command will create a project structure in current dir and a .dbt folder inside users of your system. Inside .dbt folder, you'll find a profiles.yml file. + +#### Configure Profiles.yml +* Open the profiles.yml file in a text editor. +* Locate the section for your selected adapter and project (e.g., extrica). +* Add the necessary connection details such as host, port, user, password, etc. +* Save and close the profiles.yml file. + +#### Example profiles.yml +Here is a example of a dbt-extrica profile parameters. At a minimum, you need to specify `type`, `method`, `username`, `password` `host`, `port`, `schema`, `catalog` and `threads`. + + +```yaml +: + outputs: + dev: + type: extrica + method: jwt + username: [username for jwt auth] + password: [password for jwt auth] + host: [extrica hostname] + port: [port number] + schema: [dev_schema] + catalog: [catalog_name] + threads: [1 or more] + + prod: + type: extrica + method: jwt + username: [username for jwt auth] + password: [password for jwt auth] + host: [extrica hostname] + port: [port number] + schema: [dev_schema] + catalog: [catalog_name] + threads: [1 or more] + target: dev + +``` + + +#### Check connection is successful +```sh +dbt debug +``` +#### To run all models use below command +```sh +dbt run +``` +## Model Example: +This dbt model demonstrates a basic transformation workflow, starting with the selection of relevant columns from +the table. The SELECT statement combines the results to present the final transformed data. + + +```sql +{{ config(materialized='table') }} + +with customer_insurance_data as ( + +SELECT + hospital_sales.sale_id_en, + hospital_sales.sales_date, + hospital_sales.hospital_id_en, + hospital_sales.product_id_en, + customer_insurance.customerid, + customer_insurance.gender, + customer_insurance.annual_premium_cost +FROM + orarcle112.annuity.hospital_product_sales_encrypt_csv hospital_sales +INNER JOIN + orarcle112.annuity.insurance_customer_encrypt_csv customer_insurance +ON + hospital_sales.hospital_id_en = customer_insurance.hospital_id_en +) + +select * +from customer_insurance_data +``` + + + +