0
我正在使用Redshift數據庫的複製命令並將json文件從s3存儲區存儲到數據庫。但我得到這個錯誤「溢出,列類型:整數」和錯誤代碼是1216和JSON文件行號是33。Redshift複製命令錯誤「溢出,列類型:整數」
這裏是我的JSON文件:
{
"id": 119548805147,
"title": "Shoes",
"vendor": "xyz",
"product_type": "",
"handle": "shoes",
"options": [
{
"id": 171716739099,
"product_id": 119548805147,
"name": "Size",
"position": 1,
"values": [
"9",
"10",
"11"
]
},
{
"id": 171716771867,
"product_id": 119548805147,
"name": "Color",
"position": 2,
"values": [
"Red",
"white",
"Black"
]
}
],
"images": [],
"image": null
} //line number 33
{
"id": 119548805147,
"title": "Shoes",
"vendor": "xyz",
"product_type": "",
"handle": "shoes",
"options": [
{
"id": 171716739099,
"product_id": 119548805147,
"name": "Size",
"position": 1,
"values": [
"9",
"10",
"11"
]
},
{
"id": 171716771867,
"product_id": 119548805147,
"name": "Color",
"position": 2,
"values": [
"Red",
"white",
"Black"
]
}
],
"images": [],
"image": null
}
我的紅移表如下面
CREATE TABLE products (
"_id" int4 DEFAULT "identity"(297224, 0, '1,1'::text),
"id" int4,
title varchar(50),
product_type varchar(200),
vendor varchar(200),
handle varchar(200),
variants_id int4,
"options" varchar(65535),
images varchar(65535),
image varchar(65535)
);
而在紅移我的複製命令是在這裏:
copy products
from 's3://kloudio-data-files'
access_key_id 'my access key'
secret_access_key 'my secret key'
json 'auto'
我覺得這是列和json文件數據類型不匹配,但我沒有得到它。