1

In apache Hive CLI or Beeline CLI, I need to concatenate value of a variable with a string. Is it possible to do so?

Example: set path_on_hdfs="/apps/hive/warehouse/my_db.db";

how to get something like '${hivevar:path_on_hdfs}/myTableName'?

MehrdadAP
  • 417
  • 4
  • 11
  • @Taegost tried built-in concat function and bash style concatenation, but non of them worked. – MehrdadAP Jun 21 '16 at 19:11
  • Please include that information in your question, along with specifics as to what exactly you tried, and how those attempts failed – Taegost Jun 21 '16 at 19:18

1 Answers1

2

You can try something like this:

set path_on_hdfs= /test1/test2

create external table test(id int) location '${hiveconf:path_on_hdfs}/myTable';

is should work...

Giri
  • 91
  • 2