gpt4 book ai didi

hadoop - SemanticException 10072:数据库不存在(Sqoop)

转载 作者:行者123 更新时间:2023-12-02 20:29:37 25 4
gpt4 key购买 nike

我使用sqoop命令创建了一个配置单元内部表。

sqoop import -Dmapreduce.map.memory.mb=4096 
--driver com.mysql.jdbc.Driver
--connect 'jdbc:mysql://{mysql_url}'
--username 'xxxx'
--password 'xxxx'
--input-fields-terminated-by '\t'
--split-by id
--target-dir {hdfs_path}
--verbose -m 1
--hive-drop-import-delims
--fields-terminated-by '\t'
--hive-import
--hive-table '{table_name}'
--query "select id from temp WHERE \$CONDITIONS LIMIT 10"

我在其中创建了一个表,它在正常工作。
19/01/06 19:33:44 DEBUG hive.TableDefWriter: Load statement: LOAD DATA INPATH 'hdfs://hadoop/{hdfs_path}' INTO TABLE `tmp.temp`
19/01/06 19:33:44 INFO hive.HiveImport: Loading uploaded data into Hive
19/01/06 19:33:44 DEBUG hive.HiveImport: Using in-process Hive instance.
19/01/06 19:33:44 DEBUG util.SubprocessSecurityManager: Installing subprocess security manager

Logging initialized using configuration in jar:file:${HADOOP_HOME}/hive-1.1.0-cdh5.14.2/lib/hive-common-1.1.0-cdh5.14.2.jar!/hive-log4j.properties

它在hdfs仓库中创建。
$ hadoop dfs -ls {hdfs_path}
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

19/01/06 19:43:23 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 2 items
0 2019-01-06 19:33 {hdfs_path}/_SUCCESS
65 2019-01-06 19:33 {hdfs_path}/part-m-00000.gz

但是这是一个错误:
FAILED: SemanticException [Error 10072]: Database does not exist: tmp

我已经将hive-site.xml放入sqoop conf目录中。
cp ${HIVE_HOME}/conf/hive-site.xml ${SQOOP_HOME}/conf/hive-site.xml

“hive.metastore.uris”设置为本地和远程节俭。

我该怎么办?帮我。谢谢

最佳答案

请使用此sqoop命令根据您的要求使用现有表和change子句将数据从sqoop导入到配置单元中。我刚刚根据命令中的要求修改了一些子句并添加了一些子句

ubuntu@localhost:/usr/local/hive$ sqoop import -Dmapreduce.map.memory.mb=4096  --connect 'jdbc:mysql://localhost/test' --username 'root' -P --input-fields-terminated-by ',' --split-by id  --target-dir /user/hive/warehouse/test_hive --hive-drop-import-delims --fields-terminated-by ',' --hive-import --hive-database default --hive-table test_hive --query "select id from test WHERE \$CONDITIONS LIMIT 10"  --driver com.mysql.jdbc.Driver --delete-target-dir

快乐Hadooppppppppp

关于hadoop - SemanticException 10072:数据库不存在(Sqoop),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54060771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com