Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AmazonServiceException: Supplied AttributeValue is empty, must contain exactly one of the supported datatypes

I am trying to import data from dynamodb console interface, but unable to get success.

Data is

{"_id":{"s":"d9922db0-83ac-11e6-9263-cd3ebf92dec3"},"applicationId":{"S":"2"},"applicationName":{"S":"Paperclip"},"ip":{"S":"127.0.0.1"},"objectInfo":{"S":"elearning_2699"},"referalUrl":{"S":"backported data"},"url":{"S":""},"userAgent":{"S":""},"userEmail":{"S":"[email protected]"},"userId":{"S":"508521"},"userName":{"S":"Karthik"},"created":{"S":"1486983137000"},"verb":{"S":"submitproject"},"dataVals":{"S":"{\"projectid\":5,\"name\":\"Test 1\",\"domain\":\"apparel\",\"submittype\":[\"Writeup\",\"Screenshots\"],\"passcriteria\":\"Percentage\",\"taemail\":\"[email protected]\",\"attemptNo\":1,\"submitDate\":1467784988}"},"eventTime":{"S":"1467784988000"}}

I am getting below error

Error: java.lang.RuntimeException: com.amazonaws.AmazonServiceException: Supplied AttributeValue is empty, must contain exactly one of the supported datatypes (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: GECS2L57CG9ANLKCSJSB8EIKVRVV4KQNSO5AEMVJF66Q9ASUAAJG) at org.apache.hadoop.dynamodb.DynamoDBFibonacciRetryer.handleException(DynamoDBFibonacciRetryer.java:107) at org.apache.hadoop.dynamodb.DynamoDBFibonacciRetryer.runWithRetry(DynamoDBFibonacciRetryer.java:83) at org.apache.hadoop.dynamodb.DynamoDBClient.writeBatch(DynamoDBClient.java:220) at org.apache.hadoop.dynamodb.DynamoDBClient.putBatch(DynamoDBClient.java:170) at org.apache.hadoop.dynamodb.write.AbstractDynamoDBRecordWriter.write(AbstractDynamoDBRecordWriter.java:91) at org.apache.hadoop.mapred.MapTask$DirectMapOutputCollector.collect(MapTask.java:844) at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:596) at org.apache.hadoop.dynamodb.tools.ImportMapper.map(ImportMapper.j errorStackTrace amazonaws.datapipeline.taskrunner.TaskExecutionException: Failed to complete EMR transform. at amazonaws.datapipeline.activity.EmrActivity.runActivity(EmrActivity.java:67) at amazonaws.datapipeline.objects.AbstractActivity.run(AbstractActivity.java:16) at amazonaws.datapipeline.taskrunner.TaskPoller.executeRemoteRunner(TaskPoller.java:136) at amazonaws.datapipeline.taskrunner.TaskPoller.executeTask(TaskPoller.java:105) at amazonaws.datapipeline.taskrunner.TaskPoller$1.run(TaskPoller.java:81) at private.com.amazonaws.services.datapipeline.poller.PollWorker.executeWork(PollWorker.java:76) at private.com.amazonaws.services.datapipeline.poller.PollWorker.run(PollWorker.java:53) at java.lang.Thread.run(Thread.java:745) Caused by: amazonaws.datapipeline.taskrunner.TaskExecutionException: Error: java.lang.RuntimeException: com.amazonaws.AmazonServiceException: Supplied AttributeValue is empty, must contain exactly one of the supported datatypes (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: GECS2L57CG9ANLKCSJSB8EIKVRVV4KQNSO5AEMVJF66Q9ASUAAJG) at org.apache.hadoop.dynamodb.DynamoDBFibonacciRetryer.handleException(DynamoDBFibonacciRetryer.java:107) at org.apache.hadoop.dynamodb.DynamoDBFibonacciRetryer.runWithRetry(DynamoDBFibonacciRetryer.java:83) at org.apache.hadoop.dynamodb.DynamoDBClient.writeBatch(DynamoDBClient.java:220) at org.apache.hadoop.dynamodb.DynamoDBClient.putBatch(DynamoDBClient.java:170) at org.apache.hadoop.dynamodb.write.AbstractDynamoDBRecordWriter.write(AbstractDynamoDBRecordWriter.java:91) at org.apache.hadoop.mapred.MapTask$DirectMapOutputCollector.collect(MapTask.java:844) at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:596) at org.apache.hadoop.dynamodb.tools.ImportMapper.map(ImportMapper.java:26) at org.apache.hadoop.dynamodb.tools.ImportMapper.map(ImportMapper.java:13) at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:65) at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:432) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:175) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:170) Caused by: com.amazonaws.AmazonServiceException: Supplied AttributeValue is empty, must contain exactly one of the supported datatypes (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: GECS2L57CG9ANLKCSJSB8EIKVRVV4KQNSO5AEMVJF66Q9ASUAAJG) at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:1772) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.batchWriteItem(AmazonDynamoDBClient.java:730) at amazonaws.datapipeline.cluster.EmrUtil.runSteps(EmrUtil.java:286) at amazonaws.datapipeline.activity.EmrActivity.runActivity(EmrActivity.java:63)

Am I doing anything wrong?

like image 428
rahulb Avatar asked Feb 13 '17 12:02

rahulb


1 Answers

Error: java.lang.RuntimeException: com.amazonaws.AmazonServiceException: Supplied AttributeValue is empty, must contain exactly one of the supported datatypes (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException This is the error you are getting.

Below are the possible reasons

  1. DynamoDB does not support empty value, so you should remove those fields (agree with @notionquest)
  2. Field's value should have proper data type as per table
like image 137
Priyabrata Avatar answered Sep 17 '22 13:09

Priyabrata