JSON Пример данных
{"location": {"city": "Lexington","zip": "40503"},"dimensions": {"sq_ft": "1000"},"type": "Residential","sale_date": "2016-02-6","price": "75836"},
{"location": {"city": "Belmont","zip": "02478"},"dimensions": {"sq_ft": "1103"},"type": "Residential","sale_date": "2016-10-16","price": "92567"},
{"location": {"city": "Winchester","zip": "01890"},"dimensions": {"sq_ft": "1122"},"type": "Condo","sale_date": "2016-11-26","price": "89921"},
{"location": {"city": "Winchester","zip": "01890"},"dimensions": {"sq_ft": "1122"},"type": "Condo","sale_date": "","price": "89921"}
ddl
create or replace table sales_json_details(
dimensions varchar(1000),
location varchar(1000),
price number,
sale_date timestamp,
type varchar(100)
)
запрос для загрузки данных
copy into sales_json_details from @internal_stage_json_demo
file_format = (type = json NULL_IF='' )
MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE;
Исключение:
**Failed to cast variant value "" to TIMESTAMP_NTZ**
Как загрузить NULL
вместо пустой строки ""
с параметрами копирования MATCH_BY_COLUMN_NAME= CASE_INSENSITIVE