我在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");
我试图抓取Authentication
DynamoDB表的内容,但我看到以下错误:
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"
现在它有效.
事实证明,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"
现在它有效.