当前位置:  开发笔记 > 大数据 > 正文

Hive/DynamoDB错误"无法找到列的列映射"

如何解决《Hive/DynamoDB错误"无法找到列的列映射"》经验,为你挑选了1个好方法。

我在Amazon Elastic MapReduce EC2实例上运行以下Hive查询:

CREATE EXTERNAL TABLE myExport (access_key string, active bigint,
    api_id string, secret_key string)
STORED BY 'org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler'
TBLPROPERTIES ("dynamodb.table.name" = "Authentication",
    "dynamodb.column.mapping" = "access_key:access_key, active:active, api_id:api_id, secret_key:secret_key");

我试图抓取AuthenticationDynamoDB表的内容,但我看到以下错误:

FAILED: Error in metadata: MetaException(message:Could not find column mapping for column: active)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

Jens Roland.. 15

事实证明,Hive在分割逗号后不会修剪DynamoDB列映射,因此列映射列表不能包含空格.

修复:更改逗号加空格(",")分隔列表:

"dynamodb.column.mapping"
    = "access_key:access_key, active:active, api_id:api_id, secret_key:secret_key"

进入逗号(",")分隔列表:

"dynamodb.column.mapping"
    = "access_key:access_key,active:active,api_id:api_id,secret_key:secret_key"

现在它有效.



1> Jens Roland..:

事实证明,Hive在分割逗号后不会修剪DynamoDB列映射,因此列映射列表不能包含空格.

修复:更改逗号加空格(",")分隔列表:

"dynamodb.column.mapping"
    = "access_key:access_key, active:active, api_id:api_id, secret_key:secret_key"

进入逗号(",")分隔列表:

"dynamodb.column.mapping"
    = "access_key:access_key,active:active,api_id:api_id,secret_key:secret_key"

现在它有效.


这节省了我很多时间,谢谢!
难以置信的!你确定节省了我几个小时
推荐阅读
牛尾巴2010
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有