Versions Compared

Key

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

...

You can use the Hive - Execute Snap to execute arbitrary SQL. This Snap enables you to execute simple DML (SELECT, INSERT, UPDATE, DELETE) type statements. For the comprehensive scripting functionality offered by the various databases, you should use the stored procedure functionality offered by their chosen database in the Stored Procedure Snap.

  • This Snap works only with single queries.

Note

You can drop your database when working with queries, so be cautious.

...

Field Name

Field Type

Description

Label*

 

Default ValueHive - Execute
Example: Hive - Execute

String

Specify a unique 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.

Hive Configuration Properties 

Use this field set to configure property-value pairs to set for the SQL statement. The values are used in 'set x=y' statements executed immediately before the SQL.

Property

Default Value: N/A
Example: name

String

Specify the name of the configuration property.

Value

Default Value: N/A
Example: jack

String

Specify the value of the configuration property.

SQL Statement*

Default Value: N/A
Exampleselect * from people LIMIT 10 or select * from people where name = $people.name

String/Expression

Specify the SQL statement to execute on the server. Document value substitution will be performed on literals starting with $ (such as $people.name will be substituted with its value in the incoming document).

The Snap does not allow to inject SQL, such as select * from people where $columName = 'abc'. Only values can be substituted since prepared statements are used for execution, which result, for example, in select * from people where address = ?

  • We recommend you to add a single query in the SQL Statement field.

  • The '$' sign and identifier characters, such as double quotes (“), single quotes ('), or back quotes (`), are reserved characters and should not be used in comments or for purposes other than their originally intended purpose.

  • If a select query is executed, the query's results are merged into the incoming document and any existing keys will have their values overwritten. On the other hand, the original document is written if there are no results from the query.

Query type

 

Default Value: Auto
Example: Read

Dropdown list/Expression

Select the type of query for your SQL statement (Read or Write).

When Auto is selected, the Snap tries to determine the query type automatically.
If the execution result of the query is not as expected, you can change the query type to Read or Write.

Pass through

Default Value: Selected

Checkbox

Select this checkbox if you want the input document to be passed through to the output view under the key 'original'. This property applies only to the Execute Snaps with a SELECT statement.

Ignore empty result

Default Value: Deselected

Checkbox

Select if you want no document written to the output view when the SELECT operation does not produce any result. If this property is not selected and the Pass through property is selected, the input document will be passed through to the output view.

Number of Retries*

 

Default Value0
Example5

Integer

Specify the maximum number of reconnections in case of a connection failure or timeout.

Retry Interval (seconds)*

 

Default Value1
Example11

Integer

Specify the time interval in seconds between connection attempts.

Multiexcerpt include macro
nameSnap Execution
pageSOAP Execute

 

Default ValueExecute only
ExampleValidate & Execute

Dropdown list

Multiexcerpt include macro
nameExecution_Detail_Write
pageSOAP Execute

...