Skip to content

Commit dae1c71

Browse files
Merge pull request mendix#8872 from mendix/kk-snow-dataingestion
Kk snow dataingestion
2 parents 50a34d8 + 64ab2d8 commit dae1c71

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

content/en/docs/appstore/use-content/platform-supported-content/modules/snowflake/mendix-data-loader.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Once the Mendix Data Loader is deployed, follow these steps to configure and use
4949
6. To view the configuration status, click the **Authentication Configuration** tab.
5050
7. To set up authentication, click **Edit**, and then provide the required information based on the selected authentication type:
5151

52-
[//]: # (<!-- markdownlint-disable no-space-in-emphasis -->)
53-
5452
* For basic authentication, enter the following information:
5553
* **Username** – A username for basic authentication into the OData resource in your Mendix application
5654
* **Password** – A password for basic authentication into the OData resource in your Mendix application
@@ -61,8 +59,6 @@ Once the Mendix Data Loader is deployed, follow these steps to configure and use
6159
* **Allowed Scopes** – Allowed and custom scopes configured on the client from your OAuth provider
6260
* **Access Token Validity** – Duration (in seconds) for which the access token is valid
6361

64-
[//]: # (<!-- markdownlint-enable no-space-in-emphasis -->)
65-
6662
8. Click **Generate Script**.
6763
9. Click **Back** to return to the **Details** page.
6864
10. Click the **Ingestion Configuration** tab to set up your ingestion destination table.
@@ -102,6 +98,47 @@ To view all ingestion jobs associated with a specific data source in Snowflake,
10298
SELECT * FROM core.ingestion_job WHERE DATASOURCE_ID = '1234abcd' ORDER BY CREATED_DATE_TIME DESC;
10399
```
104100

101+
## Programmatically Triggering an Ingestion Job From a Mendix App {#trigering-jobs}
102+
103+
Programmatically triggering an ingestion job can meet data ingestion requirements where a scheduled task may not, for example in the following use cases:
104+
105+
* Waiting for a last submission to be submitted to a Mendix app before data ingestion occurs.
106+
* Starting data ingestion when the load on the Mendix app is the lowest.
107+
108+
### Prerequisites
109+
110+
* A fully configured data source in the Mendix Data Loader
111+
* A Mendix app equipped with the Snowflake REST SQL connector
112+
* An authenticated user that is allowed to trigger stored procedures
113+
114+
### Triggering the Ingestion
115+
116+
To trigger an ingestion job programmatically, use the `ExecuteStatement` operation available in the [Snowflake REST SQL connector](/appstore/connectors/snowflake/snowflake-rest-sql/).
117+
118+
1. Obtain the Snowflake data source ID by performing the following steps:
119+
120+
1. In the Snowflake environment, open the Mendix Data Loader by clicking **Data Products** > **Apps** > **Mendix Data Loader**.
121+
2. Open the application by clicking the `MENDIX_DATA_LOADER` tab.
122+
3. Click **View** by the configured data source.
123+
4. Copy the value for the `ID` key.
124+
125+
2. In the Snowflake REST SQL connector, use the `ExecuteStatement` operation to execute the following statement:
126+
127+
```sql
128+
CALL {NAME_OF_THE_MENDIX_DATA_LOADER}.MX_FUNCTIONS.RUN_INGESTION_JOB('{DATASOURCE_ID}','');
129+
```
130+
131+
where you must specify the following variables:
132+
133+
* `{NAME_OF_THE_MENDIX_DATA_LOADER}` - The default name for the Mendix Data Loader is `MENDIX_DATA_LOADER`
134+
* `{DATASOURCE_ID}` - Required; the data source ID that you obtained in step 1
135+
136+
For example, for a data source with the ID *40FJYP9D*, the resulting statement would be:
137+
138+
```sql
139+
CALL MENDIX_DATA_LOADER.MX_FUNCTIONS.RUN_INGESTION_JOB('40FJYP9D','');
140+
```
141+
105142
## Verifying the Access Token
106143

107144
When using OAuth authentication with the Mendix Data Loader, it is crucial to verify the access token received by your Mendix application. This verification process ensures the token's authenticity and integrity, protecting your application from unauthorized access attempts.

content/en/docs/appstore/use-content/platform-supported-content/modules/snowflake/snowflake-rest-sql.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ Your custom microflows should consist of the following:
117117

118118
This approach allows you to achieve asynchronous behavior while leveraging the Snowflake REST SQL Connector.
119119

120+
#### Programmatic Triggering of Ingestion Jobs
121+
122+
The Snowflake REST SQL connector can be used to trigger data ingestion jobs with an SQL statement. For more information, see [Mendix Data Loader: Programmatically Triggering an Ingestion Job From a Mendix App](/appstore/modules/snowflake/mendix-data-loader/#trigering-jobs).
123+
120124
## Technical Reference
121125

122126
To help you work with the Snowflake REST SQL connector, the following sections of this document list the available entities, enumerations, and activities that you can use in your application.

0 commit comments

Comments
 (0)