stringapache-hive

Concatenation of variable value and string in apache hive


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'?


Solution

  • 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...