Save table with global variable in the name of the table

Solved!
Florent1
Level 1
Save table with global variable in the name of the table

Hello,

I would like to know if it's possible to save a table in Hive with a global variable in the name of the table ?

Thank you very much in advance.

Florent

0 Kudos
1 Solution
HarizoR
Developer Advocate

Hi Florent,

In your HDFS connection settings, you can leverage variable expansion in the "Hive table name prefix" and "Hive table name suffix" fields. This allows you to dynamically prefix or suffix the names of all generated Hive tables using variables. For example, if you have 2 global variables defined as such:

{
  "prefix": "MYPROJ",
  "suffix": "DESIGN"
}

Then, if you put ${prefix} in "Hive table name prefix" and ${suffix} in "Hive table name suffix", then any new table name will be of the form MYPROJ_TABLENAME_DESIGN.

 

Hope this helps!

Best,

Harizo

View solution in original post

2 Replies
HarizoR
Developer Advocate

Hi Florent,

In your HDFS connection settings, you can leverage variable expansion in the "Hive table name prefix" and "Hive table name suffix" fields. This allows you to dynamically prefix or suffix the names of all generated Hive tables using variables. For example, if you have 2 global variables defined as such:

{
  "prefix": "MYPROJ",
  "suffix": "DESIGN"
}

Then, if you put ${prefix} in "Hive table name prefix" and ${suffix} in "Hive table name suffix", then any new table name will be of the form MYPROJ_TABLENAME_DESIGN.

 

Hope this helps!

Best,

Harizo

Florent1
Level 1
Author

Hi Harizo,

Thank you very much, this was exactly what I wanted.

Florent

0 Kudos