在我的 S3 中,我有一个如下所示的 csv 文件:
id created_at description priority status
现在,描述列的行如下所示:
but they did not explain why the following request is not working. We get an Unauthorized error. Is it because of the API key, advertisementId or wrong data? Can we please receive what is needed for this request including the test data?
{
"errors": [
"Unauthorized"
],
"result": null,
"status": 401
}
curl -X POST "https://xx/v1/prefill/eWR1iNBnG8Wj" -H "accept: application/json" -H "Authorization: Bearer 2e05581e8b" -H "Content-Type: application/json" -d "{\"data\":{\"externalId\":\"string\",\"subId\":\"string\",\"common\":{\"amount\":20000,\"term\":84,\"purpose\":\"REFINANCING\",\"payoutAccount\":{\"iban\":\"string\"},\"payoutAccountHolder\":\"PRIMARY\",
它有普通文本,但也有一些特殊字符。现在我用这样的命令加载到MYSQL中:
LOAD DATA FROM S3 's3://{s3_bucket_name}/{s3_key}'
REPLACE
INTO TABLE {schema_name}.stg_tickets
CHARACTER SET utf8mb4
FIELDS
TERMINATED BY ','
ENCLOSED BY '"'
IGNORE 1 LINES
(id, url, @created_at, @updated_at, @external_id, @type, subject,
description, priority, status, recipient, requester_id,
submitter_id, assignee_id, @organization_id, @group_id,
collaborator_ids, follower_ids, @forum_topic_id, @problem_id,
@has_incidents)
但这会弄乱列,因为它无法正确区分描述。例如,它将其添加到优先级列
"""subId"":""string""
这不是真的,因为这仍然是描述栏的一部分。
我想使用MySQL命令本身来处理它。目前无法选择预处理 S3 文件。
如果您还没有这样做,也许可以解决问题? (只是一个疯狂的猜测)
ALTER DATABASE YourDatabaseName CHARACTER SET UTF8MB4 COLLATE UTF8MB4_UNICODE_CI;
ALTER TABLE {schema_name}.stg_tickets CONVERT TO CHARACTER SET UTF8MB4 COLLATE UTF8MB4_UNICODE_CI;