我们在 AWS 中启动了两个 EMR,并在一个 EMR 中安装了 hadoop 和 hive-0.11.0,在另一个 EMR 中安装了 hive-0.13.1。
一切似乎都工作正常,但在尝试将数据加载到 TABLE 时,它给出了以下错误,并且它发生在两个 Hive 服务器中。
错误信息:
An error occurred when executing the SQL command: load data inpath 's3://buckername/export/employee_1/' into table employee_2 Query returned non-zero code: 10028, cause: FAILED: SemanticException [Error 10028]: Line 1:17 Path is not legal ''s3://buckername/export/employee_1/'': Move from: s3://buckername/export/employee_1 to: hdfs://XXX.XX.XXX.XX:X000/mnt/hive_0110/warehouse/employee_2 is not valid. Please check that values for params "default.fs.name" and "hive.metastore.warehouse.dir" do not conflict. [SQL State=42000, DB Errorcode=10028]
我搜索了这个消息的原因和意思,我找到了这个 link但是当尝试执行给定 link 中建议的命令时它还会出现以下错误。
命令:
--service metatool -updateLocation hdfs://XXX.XX.XXX.XX:X000 hdfs://XXX.XX.XXX.XX:X000
Initializing HiveMetaTool.. HiveMetaTool:Parsing failed. Reason: Unrecognized option: -hiveconf
在此方面的任何帮助将不胜感激。
最佳答案
LOAD 不支持 S3。最佳做法是将数据保留在 S3 中,仅将其用作 Hive 外部表,而不是将数据复制到 HDFS。一些引用 http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-hive-additional-features.html和 When you create an external table in Hive with an S3 location is the data transfered?
关于hadoop - 将数据加载到 HIVE 中的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30801690/