无法在配置单元中创建表

6kkfgxo0  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(283)

当我尝试使用下面的命令在配置单元中创建表时,

CREATE TABLE IF NOT EXISTS employee ( eid int, name String,
salary String, destination String)
COMMENT 'Employee details'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;

我得到下面的错误。

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:For direct MetaStore DB connections, we don't support retries at the client level.)

我已授予hdfs中/user/hive/warehouse目录的完全权限。

lymnna71

lymnna711#

谢谢你的回复。
我找到了解决办法。我正在使用Hive2.1.0。
必须使用schema工具初始化schema
comand:$hive\u home/bin/schematool-dbtype mysql-initschema
注意:在我的例子中-dbtype是mysql,因为我使用mysql作为rdbms。
请参考以下链接:https://cwiki.apache.org/confluence/display/hive/hive+schema+tool
我在mysql中删除了metastoredb,并通过运行上述命令创建了metastore模式。
现在我可以在hive中创建表了。

相关问题