Versions Compared

Key

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

In this article

...

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input 

Document

  • Min: 0
  • Max: No limit
  • ELT Transform
  • ELT Copy
The database, schema, table names in which the query must be executed. You can also pass this information using an upstream ELT Snap. Additionally, you can also pass such information for several tables to the Snap using a separate input view for each table.
Output

Document

  • Min: 1
  • Max: 1
  • ELT Copy
  • ELT Intersect

A SELECT SQL query for the table specified in the Snap. If you use the SQL editor, then an SQL query built based on your inputs in the editor. Optionally, the output also includes a preview of the query's output if the Get preview data check box checkbox is selected.

Snap Settings

Info
titleSQL Functions and Expressions for ELT

You can use the SQL Expressions and Functions supported for ELT to define your Snap or Account settings with the Expression symbol = enabled, where available. This list is common to all target CDWs supported. You can also use other expressions/functions that your target CDW supports.

...

Parameter NameData TypeDescriptionDefault ValueExample 
LabelString
Insert excerpt
File Writer
File Writer
nopaneltrue
ELT SelectFetch Sales Data
Get preview dataCheck boxCheckbox

Multiexcerpt include macro
namegetpreviewdata
pageELT Intersect

Note

If you have selected this field, then you must ensure that the database name is also provided, either in the Snap's Database Name field or in the Account. Otherwise, the Snap's output contains only the SQL built using the Snap. This does not indicate that the SQL is correct. 


Not selectedSelected
Database NameString

The name of the database in which the target/source tables are located. Leave it blank to use the database name specified in the account settings.

Note

You must ensure that the database name is correct. Otherwise, even though the Snap builds an SQL query, you will receive an error when executing the Snap since the query executes only in the target database.  

If your target database is Databricks Lakehouse Platform (DLP), you can, alternatively, mention the file format type for your table path in this field. For example, DELTA, CSV, JSON, ORC, AVRO. See Table Path Management for DLP section below to understand the Snap's behavior towards table paths.

N/A

TESTDB

DELTA

ORC

Schema Name (Not applicable to Databricks Lakehouse Platform)String

The name of the database schema. In case it is not defined, then the suggestion for the table name retrieves all tables names of all schema in the specified database (except for DLP) when you click Image Modified.

Note
  • Ensure that you include the exactly same schema name including the double quotes, if used, when you repeat the schema name in the Table Name field.
  • Leave this field blank if your target database is Databricks Lakehouse Platform.


N/APUBLIC
Table NameString

The name of the table for which you want to build the SQL queries. In case it is not defined, then the Snap retrieves all table names associated with the specified schema when you click Image Modified 

Multiexcerpt include macro
nameME_Schema_And_Table_Names
pageELT Insert-Select

If your target database is Databricks Lakehouse Platform (DLP), you can, alternatively, mention the table path in this field. For example, `/mnt/elt/mytabletarget`. See Table Path Management for DLP section to understand the Snap's behavior towards table paths.

Note

When your target database is BigQuery, this Snap supports wildcard search in this field. For more information on wildcard search, see BigQuery: Querying wildcard tables.


N/A

PUBLIC.EMPLOYEES

`/mnt/elt/emp`

Enable SQL query editorCheck boxCheckbox

Select this to enable the SQL query editor. You can use this editor to build all types of SQL queries that will execute on multiple tables. Enabling the SQL query editor activates the fieldset Input View to Virtual Table Map in the Snap.

Note
  • To perform operations upon multiple tables, you must pass the table names through upstream Snaps. Specify each table name in a separate input view.
  • You must be careful when phrasing the query to prevent SQL injection. See Preventing SQL Injection for details. 


Not selectedSelected
Input View to Virtual Table Map

Activates when you select the Enable SQL query editor checkbox. This is useful when you enable multiple input views in the ELT Select Snap. Use this field set to map each input view to a dummy table. You will reference the table name specified in each input view with this dummy/virtual table name. 

Note
  • Each input view corresponds to the SQL coming from the upstream Snap and that SQL is referenced by the dummy table name.
  • Virtual table name columns must not have duplicates.
  • One input view must not be associated with different table names. 

Click + to add rows. Each input view must be specified in a separate row.

This field set consists of the following fields:

  • Input View
  • Virtual Table Name
Input ViewStringSelect the input view whose table reference is to be mapped.N/Ainput2
Virtual Table NameStringSpecify the dummy/virtual table name that will be assigned to the table reference in the selected input view. N/Atbl1
SQL Query EditorQuery editor

Enter the SQL queries that you want to build using this Snap. Even though the Snap's name is ELT Select, you can use this SQL query editor to build any SQL query.

Info
titleSQL Comments are allowed

You can include inline comments and multi-line comments before, inside, or after your statement in this editor. It supports all standard SQL comment syntaxes as listed below:

-- comment text# comment text/* multi-line
comment text */
// comment text



N/ASELECT DISTINCT  FROM MYTABLE

...

Method-2: Dynamic Substitutions

You must enable expressions when referencing table names using Pipeline parameters. Format the query, except the Pipeline parameter's reference, as a string. 

For example, if you you want to write a SELECT query to fetch records from a table and you are passing the table's name in the Pipeline parameter table:

Code Block
"SELECT * FROM" + _table

In the example above, you must still use JSON-paths if you want to use another Pipeline parameter for substituting values in the SQL:

Code Block
"SELECT * FROM " + _table + " WHERE colname = _name"

...