Important Nexla Help Center Update:
Nexla's Zendesk Help Center pages are being deprecated and will soon no longer be available.
Nexla Documentation is now the home for Nexla's User Guides, with improved formatting and categories that are easier to navigate, providing a better overall user experience.
Please update any bookmarks to the new Nexla Documentation site (docs.nexla.com/user-guides).
_______________________________________________
Nexla's database connectors provide self-serve capabilities to serve any use case ranging from simple to complex. One feature supporting these varied use cases is the ability to set up a database source—for example, a Google BigQuery or Databricks source—using Table Mode or Query Mode.
This article explains the features available in Table Mode and Query Mode and how to use each when setting up a data source with a database connector.
Contents:
1. Table Mode
1.1 Table Selection
1.2 Data-Filtering Options
2. Query Mode
2.1 Write the Custom Query
2.2 Database Commit Options
1. Table Mode
Table Mode allows users to specify the database source through a simple selection method. This mode is equivalent to running a simple, optimized SELECT operation on any database table, but it also provides additional customization options to filter which rows will be read by Nexla.
When setting up a database source, after selecting the source type and credentials, follow the below instructions to configure the database source using Table Mode. Section 1.1 provides instructions for selecting the database table that will serve as the data source, and Section 1.2 covers data-filtering options.
1.1 Table Selection
- In the screen, ensure that the Table Mode tab is selected.
- The Table Mode tab displays a directory of all available tables in the source database. In this directory, find the table from which Nexla should read data.
To expand a location in the database directory, click the icon next to it.
- Optional: To preview the columns that a table contains, click next to the table name.
- Optional: To preview the columns that a table contains, click next to the table name.
- Select the table from which Nexla should read data by hovering over it and clicking the button that appears to the right.
Once the table is selected, the button will display , and the path of the selected table will be shown above the directory list.
- Optional: Click the button in the upper right corner of the Table Mode tab to generate a preview sample of data from the selected table at the bottom of the screen.
- To create a filter specifying which data Nexla should read from this source, continue to Section 1.2. To finish creating this source without a filter, configure any desired scheduling options, and click in the top right corner of the screen.
For more information about configuring source scan scheduling options, see the documentation for the specific source connector type in the Create a Data Source section.
1.2 Data-Filtering Options
For a database source, the default configuration instructs Nexla to read all data in the selected table during each ingestion cycle—this is equivalent to running a SELECT clause on the table. However, if the source contains historical data that should not be scanned, Nexla provides the option to select different table scan modes that specify which data should be ingested.
To apply a data filter, select an option from the Table Scan Mode pulldown menu in the Advanced Settings panel on the right. Each available table scan mode is explained below.
- Read the whole table: This is the default configuration for a database source; it instructs Nexla to scan the entire table.
- This option is selected by default when creating a new database source, and no additional action or information is required to use this mode.
- This option is selected by default when creating a new database source, and no additional action or information is required to use this mode.
- Start reading from a specific ID: This option configures Nexla to begin scanning the table at a specific ID stored in a numeric column in the table.
- Select "Start reading from a specific ID" from the Table Scan Mode pulldown menu.
- Select the table column containing the IDs that will be used to specify the ID from which Nexla should begin reading data.
The selected column must be a numeric column.
- Enter the ID at which Nexla should start ingesting data from the table in the Starting ID field.
- Configure any desired scheduling options, and then click in the top right corner of the screen to finish creating this source with the applied filter.
- Select "Start reading from a specific ID" from the Table Scan Mode pulldown menu.
- Start reading from a specific ID and timestamp: This option configures Nexla to begin scanning the table at a location specified by both an ID and a timestamp.
- Select "Start reading from a specific ID and timestamp" from the Table Scan Mode pulldown menu.
- Select the table column containing the IDs that will be used to specify the ID from which Nexla should begin reading data.
The selected column must be a numeric column.
- Enter the ID at which Nexla should start ingesting data from the table in the Starting ID field.
- Select the column containing the timestamp information that will be used to specify the timestamp from which Nexla should begin reading data.
The selected column must be a datetime column.
- Enter the timestamp at which Nexla should start ingesting data from the table in the Starting Timestamp field.
The timestamp entered in this field must be a value in UNIX epoch or ISO format.
- Configure any desired scheduling options, and then click in the top right corner of the screen to finish creating this source with the applied filter.
- Select "Start reading from a specific ID and timestamp" from the Table Scan Mode pulldown menu.
- Start reading from a specific timestamp: This option configures Nexla to begin scanning the table at a specific timestamp stored in a datetime column in the table.
- Select "Start reading from a specific timestamp" from the Table Scan Mode pulldown menu.
- Select the column containing the timestamp information that will be used to specify the timestamp from which Nexla should begin reading data.
The selected column must be a datetime column.
- Enter the timestamp at which Nexla should start ingesting data from the table in the Starting Timestamp field.
The timestamp entered in this field must be a value in UNIX epoch or ISO format.
- Configure any desired scheduling options, and then click in the top right corner of the screen to finish creating this source with the applied filter.
- Select "Start reading from a specific timestamp" from the Table Scan Mode pulldown menu.
2. Query Mode
Query Mode is a allows users to perform a query of any complexity level to specify the database source. This mode provides a free-form query editor that can be used to perform any query written using the syntax and convention supported by the underlying database and/or warehouse.
When setting up a database source, after selecting the source type and credentials, follow the below instructions to configure the database source using Query Mode. Section 2.1 provides instructions for constructing a database query to configure data ingestion from the source, and Section 2.2 covers database commit options.
2.1 Write the Custom Query
- In the screen, ensure that the Query Mode tab is selected.
- Using the syntax and convention supported by the underlying database, construct the query specifying which data Nexla should ingest in the Custom Query to Fetch Data field.
Nexla supports any query that can be written following the syntax and convention of the underlying database, regardless of complexity.
- Information about the appropriate query syntax and convention can be found in the documentation published by the underlying database (Databricks, Google BigQuery, Snowflake, etc.).
- For assistance with constructing a custom query, contact support@nexla.com.
- Information about the appropriate query syntax and convention can be found in the documentation published by the underlying database (Databricks, Google BigQuery, Snowflake, etc.).
- Optional: Click the button in the upper right corner of the Query Mode tab to generate a preview sample of the data that will be retrieved according to the constructed query. This data preview will appear at the bottom of the screen.
- To configure Nexla to perform a database commit after reading data from this source, continue to Section 2.2. To finish creating this source without a database commit, configure any desired scheduling options, and click in the top right corner of the screen.
For more information about configuring source scan scheduling options, see the documentation for the specific source connector type in the Create a Data Source section.
2.2 Database Commit Options
Some custom queries can contain statements that should be committed to the database source after data ingestion. For example, when a query includes data manipulation operations such as INSERT, DELETE, or UPDATE transactions, a COMMIT operation must be performed to save the associated changes in the source database and make them visible to other database users. In these cases, Nexla can easily be configured to execute a database COMMIT at the end of data ingestion.
Typically, queries created in Nexla using Query Mode do not require a COMMIT. Database changes made by executing a COMMIT are permanent; thus, this option should be utilized with care to avoid database record and/or relationship losses.
- To configure Nexla to execute a database COMMIT at the end of the query, select "True" from the Perform Database Commit After Read? pulldown menu in the Advanced Settings panel on the right side of the screen.
- Since changes made to the data, table structure, etc. using a COMMIT operation are permanent, please ensure that the constructed query is sequentially and logically correct when Nexla is configured to perform a database COMMIT after reading data from the source.
- Since changes made to the data, table structure, etc. using a COMMIT operation are permanent, please ensure that the constructed query is sequentially and logically correct when Nexla is configured to perform a database COMMIT after reading data from the source.
- Configure any desired scheduling options, and then click in the top right corner of the screen to finish creating this source with the selected database COMMIT option.
Comments
0 comments
Please sign in to leave a comment.