我正在尝试使用以下命令创建配置单元表,但由于出现错误


USE ${hiveconf:DBNAME} ;
CREATE  TABLE IF NOT EXISTS ${hiveconf:TBNAME} (${hiveconf:ts}) PARTITIONED BY(timest string) ROW
FORMAT DELIMITED FIELDS TERMINATED BY ",";

上面的脚本使用
hive -hiveconf ts=$layout1 -hiveconf TBNAME=$TABLENAME -hiveconf DBNAME=$DATABASE -hiveconf env=$environment -f sqlqueryfile

任何想法,为什么它会失败。

两个配置文件变量是
TABLENAME=testingmultiple
layout1="TP string, KEY_NM string, KEY_CD string, YR_MO double, POS double"

最佳答案

传递ts时使用包装:请参阅以下命令:-

  hive -hiveconf "ts=$layout1" -hiveconf TBNAME=$TABLENAME -hiveconf DBNAME=$DATABASE -hiveconf env=$environment -f sqlqueryfile

09-11 11:39