无法在 HIVE 中创建 table
unable able to create table in HIVE
当我尝试使用以下命令在 HIVE 中创建 table 时,
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 目录的完全权限。
感谢您的回复。
我找到了解决办法。
我正在使用 HIVE 2.1.0.
必须使用 SCHEMA TOOL 初始化模式
命令:
$HIVE_HOME/bin/schematool -dbType mysql -initSchema
注意:在我的例子中,-dbType 是 mysql,因为我使用 mysql 作为 rdbms。
请参考以下内容link:
https://cwiki.apache.org/confluence/display/Hive/Hive+Schema+Tool
我已经在 mysql 中删除了 Metastore 数据库,并通过 运行 上述命令创建了 Metastore 模式。
现在我可以在配置单元中创建 table。
当我尝试使用以下命令在 HIVE 中创建 table 时,
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 目录的完全权限。
感谢您的回复。
我找到了解决办法。 我正在使用 HIVE 2.1.0.
必须使用 SCHEMA TOOL 初始化模式
命令: $HIVE_HOME/bin/schematool -dbType mysql -initSchema
注意:在我的例子中,-dbType 是 mysql,因为我使用 mysql 作为 rdbms。
请参考以下内容link: https://cwiki.apache.org/confluence/display/Hive/Hive+Schema+Tool
我已经在 mysql 中删除了 Metastore 数据库,并通过 运行 上述命令创建了 Metastore 模式。
现在我可以在配置单元中创建 table。