Set

Description

The SET command sets the value of a particular configuration variable (key). (Hive documentation)

SET <key>=<value>
!set <option>=<value>

Snowflake recommends not adding whitespace in the variable value assignment statement.

Sample Source Patterns

1. Set <option> with equivalence in Snowflake

The SET command is replaced by the !set command.

Hive

SET hive.output.file.extension='csv';

SnowSQL (CLI Client)

!set output_format=csv

2. Set <option> without equivalence in Snowflake

Many of the variable configurations supported in Hive do not have their equivalent in Snowflake, for those scenarios, an EWI is added.

Hive

SET hive.groupby.orderby.position.alias=true;

SnowSQL (CLI Client)

--EWI: SPRKHVSQLXXXX => SNOWFLAKE DOES NOT SUPPORT hive.groupby.orderby.position.alias COMMAND.
SET hive.groupby.orderby.position.alias=true;

Known Issues

1. Predefined variables

The SET command only works for system variables, which may differ in quantity, name, or domain between Hive and Snowflake, so a review should be done on the variable being used within the command to find its correct Snowflake equivalence. To see the list of system variables in Oracle you can use the command SHOW ALL whereas in Snowflake you can use !options.

  1. SPRKHVSQLXXXX: Snowflake does not support the COMMAND.

Last updated