3

我在 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
4

1 回答 1

16

事实证明,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"

现在它可以工作了。

于 2013-09-05T14:34:18.787 回答