ELT Cast Function
In this article
Overview
You can use this Snap to convert a data type of a column in the input SQL string into other supported data types.
Snap Type
ELT Cast Function Snap is a Transform-type Snap that transforms the column data type.
Prerequisites
Valid accounts and access permissions to connect to the following targets:
Snowflake, Redshift, Azure Synapse, Databricks Lakehouse Platform, or BigQuery
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitation
ELT Snap Pack does not support the Legacy SQL dialect of Google BigQuery. We recommend that you use only the BigQuery's Standard SQL dialect in this Snap.
Known Issues
None.
Snap Input and Output
Input/Output | Type of View | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| The SQL query which you want to transform. |
Output | Document |
|
| The outgoing SQL query with the specified transformation. |
Error | Error handling is to have a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that might arise while running the Pipeline by choosing one of the options from the When errors occur section under the Views tab. The options available are:
See Error View in Pipeline in examples to understand the Snap error view settings and error output. For more information on the error view and handling error output in a Pipeline, see Error handling in Pipelines. |
Snap Settings
Click the = (Expression) button in the Snap's configuration, if available, to define the corresponding field value using expression language and Pipeline parameters.
You can use the SQL Expressions and Functions supported for ELT for this purpose. This list is common to all target CDWs supported. You can also use other expressions/functions that your target CDW supports.
Field names marked with an asterisk ( * ) in the table below are mandatory.
Field Name | Type | Description |
---|---|---|
Label* | String | 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. Default Value: ELT Cast Function |
Get preview data | Checkbox | Select this checkbox to include a preview of the query's output. The Snap performs limited execution and generates a data preview during Pipeline validation. In case of ELT Pipelines, only the SQL query flows through the Snaps but not the actual source data. Hence, the preview data for a Snap is the result of executing the SQL query that the Snap has generated in the Pipeline. The number of records displayed in the preview (upon validation) is the smaller of the following:
Rendering Complex Data Types in Databricks Lakehouse Platform Based on the data types of the fields in the input schema, the Snap renders the complex data types like map and struct as object data type and array as an array data type. It renders all other incoming data types as-is except for the values in binary fields are displayed as a base64 encoded string and as string data type. |
Pass through | Checkbox | Select this checkbox to specify that the Snap must include the incoming document (SQL query) in its output document. Default Value: Not selected |
Cast functions | Specify your SQL expressions, data type and the relevant alias using this fieldset. Click to add a new row. Ensure that you specify each expression in a separate row. | |
Function* | String/Expression | Specify your function/operation to be performed in the specified columns. Ensure that you specify each function in a separate row. |
Data Type* | String/Expression | Specify the data type for the selected expression/function. Clickto retrieve the list of the supported aggregate functions. This is typically a column name in your source table. Each of the function needs only one value. |
Alias* | String | Specify the column in which the result of the binary function has to be displayed. You can also reference this name in downstream Snaps to process the data further. Default Value: None. |
Troubleshooting
Error | Reason | Resolution |
---|---|---|
Missing property value | You have not specified a value for the mandatory field where this message is displayed. | Ensure that you specify appropriate values for all mandatory fields in the Snap configuration. |
Invalid placement of ELT Cast Function snap | ELT Cast Function Snap cannot be used at the start of a Pipeline. | Move the ELT Cast Function Snap to either the middle or the end of the Pipeline. |
CAST (DEPT AS BINARY) is not a natural function for Snowflake. It displays the following error message. | In the SQL query, | Instead of (DEPT AS BINARY), you can use:
Examples:
|
Snap Pack History
See Also
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439233/Glossary
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438341/Getting+Started
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439233/Glossary
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.