本文介绍了Hive使用参数化的LOCATION创建外部表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这符合预期:

This works as expected:

 DROP TABLE mytable;
 CREATE EXTERNAL TABLE mytable (
     Dim1 STRING,
     Dim2 STRING,
     Dim3 STRING )
 LOCATION 'hdfs:///user/myuser/data';

但这不是:

but this doesn't:

 set rootpath = 'hdfs:///user/myuser/data';
 DROP TABLE mytable;
 CREATE EXTERNAL TABLE mytable (
     Dim1 STRING,
     Dim2 STRING,
     Dim3 STRING )
 LOCATION '${hiveconf:rootpath}';

失败时出现以下错误(Hive 0.9.0):

It fails with the following error (Hive 0.9.0):

我做错了什么,或者这是一个已知的问题/限制吗?是否有解决方法的建议?

Am I doing something wrong, or is this a known issue/limitation? Are there any suggestions for workarounds?

推荐答案

我认为它应该读取 LOCATION $ {hiveconf:rootpath}

这篇关于Hive使用参数化的LOCATION创建外部表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 15:47
查看更多