Hive - Variable (hivevar)

About

Hive variables are variables that can be set at the session level and referenced in Hive commands or queries.

Management

Set

Substitution

${VAR}

Example

Example with SQL - SQLLine (SQL at the command line) and a URL

sqlline -u "jdbc:hive2://HiveServer/db;#foo=bar" 
  • Select with substituion
select '${foo}';
+-----+
| bar |
+-----+
| bar |
+-----+
1 row selected (0.368 seconds)

Powered by ComboStrap