#amazon-web-services #hive #amazon-dynamodb #amazon-emr
#amazon-веб-сервисы #улей #amazon-dynamodb #amazon-emr
Вопрос:
Я пытаюсь импортировать данные из s3 в свою таблицу dynamodb через datapipeline, используя стеки cloudformation AWS. Во-первых, передача данных занимает слишком много времени (~4,5 часа), возможно, из-за наличия огромных данных. В любом случае, после долгих часов ожидания я получаю следующую ошибку:
Hive Runtime Error while processing row {"id":123456,"user":"user.mock@email.com","userpasswordhash":"xxxx","email":"user.mock@email.com","created":"2021-10-18 19:53:12.74","termsEDate":"","updated":"2021-10-26 12:56:09.223","termsGDate":"","regresource1":"api","regsource2":"apikey","primaryId":"","inreview":""} Caused by: java.lang.RuntimeException: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: The provided key element does not match the schema
Схема выглядит следующим образом
create table USER ( ID int unsigned auto_increment comment 'Primary key id identifing this user entry' primary key, USER varchar(150) collate utf8_bin not null, USERPWDHASH varchar(255) null comment 'Hash of the user pwd', EMAIL varchar(150) not null, CREATED timestamp(3) default CURRENT_TIMESTAMP(3) not null, UPDATED timestamp(3) null, TERMS_EDATE datetime null comment 'The latest created time in terms for sync', TERMS_GDATE datetime null comment 'The latest updated time in terms for sync', REG_SOURCE_1 varchar(50) null comment 'Primary user registration source', REG_SOURCE_2 varchar(255) null PRIMARY_ID int unsigned null comment 'Id of primary account associated with this user', IN_REVIEW tinyint(1) null, constraint IDX_USERNAME unique (USERNAME), constraint PRIMARY_SSO_ID_fk foreign key (PRIMARY_SSO_ID) references USER (SSOID) on delete cascade )
Мое определение и сопоставления столбцов dynamodb выглядят следующим образом
S3ColumnDefinition: id bigint,user string,userpasswordhash string,email string,created string,termsEDatum string,updated string,termsGDatum string,regSource1 string,regSource2 string,primaryId string,inReview string DynamoDBColumnDefinition: id bigint,user string,userpasswordhash string,email string,created string,termsEDatum string,updated string,termsGDatum string,regSource1 string,regSource2 string,primaryId string,inReview string S3ToDynamoDBColumnMapping: id:id,user:user,userpasswordhash:userpasswordhash,email:email,created:created,termsEDate:termsEDate,updated:updated,termsGDate:termsGDate,regSource1:regSource1,regSource2:regSource2,primarySsoId:primaryId,inReview:inReview
И DynamoDB выглядит так, как показано ниже
Type: "AWS::DynamoDB::Table" Properties: AttributeDefinitions: - AttributeName: "id" AttributeType: "N" KeySchema: - AttributeName: "id" KeyType: "HASH" BillingMode: "PAY_PER_REQUEST"
Не уверен, что я здесь делаю не так. Ваши ответы будут оценены по достоинству. Спасибо!