Cassandra - Select
On this Page
Snap type: | Transform | |||||||
---|---|---|---|---|---|---|---|---|
Description: | This Snap allows you to fetch data from a Cassandra database by providing a table name and configuring the connection. The Snap produces the records from the database on its output view which can then be processed by a downstream Snap. Limit and offset are not supported by Cassandra JDBC driver. Queries produced by the Snap have an equivalent format:
| |||||||
Prerequisites: | Validated Cassandra account, verified network connectivity to Cassandra server and port, and the Cassandra server running. | |||||||
Support and limitations: |
Snaps in this Snap Pack display an exception (raised by the JDBC driver) when you query a map column that has a timestamp as the key. Example
| |||||||
Known Issues: | The Cassandra Select Snap supports inet Data Type that stores the IP address values. Upon validation, the Snap must display a blank space followed by the corresponding IP address value in its output view, which is the expected behavior. But, in the 4.24 Release, this Snap incorrectly displays empty string as null for inet Data Type followed by the IP address value in its output view. | |||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring Cassandra Accounts for information on setting up this type of account. | |||||||
Views: |
| |||||||
Settings | ||||||||
Label | Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | |||||||
Schema name | The database schema name. In case it is not defined, then the suggestion for the table name will retrieve all tables names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values. Example: SYS Default value: [None] | |||||||
Table Name | Required. The name of table to execute select query on. Default value: [None] | |||||||
Where clause | WHERE clause of SELECT statement. The value to be used in the WHERE clause will be used here. Document value substitutions (such as $person.firstname with the value found in the incoming document at the path) can also be used as needed. The "=" will not need to be checked when using document value substitutions unless using expression language. Examples:
Caution Using expressions that join strings together to create SQL queries or conditions has a potential SQL injection risk and is hence unsafe. Ensure that you understand all implications and risks involved before using concatenation of strings with '=' Expression enabled. Default value: [None] The Where clause property does not support passing Pipeline parameters or passing upstream parameters. | |||||||
Order by: Column names | Enter in the columns in the order in which you want to order by. The default database sort order will be used. Example: name Default value: [None] | |||||||
Output fields | Enter or select output field names for SQL SELECT statement. To select all fields, leave it at default. Example: email, address, first, last, etc. Default value: [None] | |||||||
Fetch Output Fields In Schema | Select this check box to include only the selected fields or columns in the Output Schema (second output view). If you do not provide any Output fields, all the columns are visible in the output. Default value: Not selected | |||||||
Pass through | If checked, the input document will be passed through to the output view under the key 'original'. Default value: Selected | |||||||
Number of retries | Specifies the maximum number of attempts to be made to receive a response. The request is terminated if the attempts do not result in a response. Example: 3 Default value: 0 If the value is larger than 0, the Snap first downloads the target file into a temporary local file. If any error occurs during the download, the Snap waits for the time specified in the Retry interval and attempts to download the file again from the beginning. When the download is successful, the Snap streams the data from the temporary file to the downstream Pipeline. All temporary local files are deleted when they are no longer needed. Ensure that the local drive has sufficient free disk space to store the temporary local file. | |||||||
Retry interval (seconds) | Specifies the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception. Example: 10 Default value: 1 | |||||||
Staging mode | Required when the value in the Number of retries field is greater than 0. Specify the location from the following options to store input documents between retries:
| |||||||
Snap Execution | Select one of the following three modes in which the Snap executes:
Default Value: Execute only |
For the 'Suggest' in the Order by columns and the Output fields properties, the value of the Table name property should be an actual table name instead of an expression. If it is an expression, it will display an error message "Could not evaluate accessor: ..." when the 'Suggest' button is clicked. This is because, at the time the "Suggest" button is clicked, the input document is not available for the Snap to evaluate the expression in the Table name property. The input document is available to the Snap only during the preview or execution time.
Troubleshooting
- Run Cassandra JDBC driver using another JDBC tool to verify syntax and results.
Examples
Passing values in Where clause property with Expressions:
Passing values in Where clause property without Expressions:
Snap Pack History
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.