Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

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:

Paste code macro
SELECT * FROM [table] WHERE [where clause] ORDER BY [ordering] LIMIT [limit] OFFSET [offset]


Expected upstream Snaps
: Snaps that will either input data into Cassandra Execute, merge information with Cassandra, or required to precede execution before Cassandra execution. If more powerful functionality is desired, then the Execute Snap should be used.

  • Expected downstream Snaps: Snaps that use information fetched from Cassandra or that is dependent on Cassandra having executed prior.
  • Expected input: Data, if any,  to be used to narrow the selection of data coming from Cassandra.
  • Expected output: Data of interest from Cassandra.
Prerequisites:

Validated Cassandra account, verified network connectivity to Cassandra server and port, and the Cassandra server running.

Support and limitations:
  • Works in Ultra Task Pipelines.
  • The Cassandra Snap Pack does not support the following data types introduced in Apache Cassandra V3.x, as the underlying SnapLogic JDBC driver is designed to work with Apache Cassandra V2.1:
    • DateRange
    • Duration
    • Geo-spatial data types such as Point, Polygon and LineString

Multiexcerpt include macro
nameCassKI1
pageCassandra Snap Pack

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:


InputThis Snap has at most one document input view. If the input view is defined, then the where clause can substitute incoming values for a given expression.
OutputThis Snap has at most two document output views.
ErrorThis Snap has at most one document error view and produces zero or more documents in the view.


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.

ExampleSYS

Default value:  [None]

Table Name

Required. The name of table to execute select query on.
Examplepeople

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

Without using expressions

Using expressions

  • "EMPNO=$EMPNO and ENAME=$EMPNAME"

  • email = $email 

  • emp=$emp

  • "emp='" + $emp + "'"

  • "EMPNO=" + $EMPNO + " and ENAME='" + $EMPNAME+ "'"


Warning
titleCaution

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]

Note

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
email 

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


Excerpt

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.
If you provide output fields, we recommend you to select Fetch Output Fields In Schema check box.

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

Info

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:

  • In memory: The query results are stored in the Snaplex memory. If the query is too large to fit in the memory space, it may cause the Snap to fail, choose the On disk option.
  • On disk: The query results are stored on the disk in a temporary (tmp) directory that is managed by the SnapLogic platform. This directory is deleted automatically when the Snap terminates.

Multiexcerpt include macro
nameSnap Execution
pageAnaplan Read

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

  

Note

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:


Insert excerpt
Cassandra Snap Pack
Cassandra Snap Pack
nopaneltrue