【发布时间】:2019-11-08 13:31:20
【问题描述】:
我想将 csv 文件插入我的 postgres 数据库。我使用处理器:
Getfiles ->
Split (cause files are big) ->
UpdateAttribute (to add avro.schema) ->
ConvertCSvToAvro ->
Putdatabaserecord.
如果我只使用字符串/文本字段(在我的 avro 模式和列 postgres 数据库中),结果是可以的。 但是当我尝试格式化日期字段时,我遇到了错误。
我的原始数据(CSV)是:
date_export|num_etiquette|key
07/11/2019 01:36:00|BAROMETRExxxxx|BAROMETRE-xxxxx
我的 avro 架构是:
{
"type":"record",
"name":"public.data_scope_gp_temp",
"fields":[
{"name":"date_export","type":{ "type": "int", "logicalType": "date"}},
{"name":"num_etiquette","type":"string"},
{"name":"cle_scope","type":"string"}
]}
我的 postgres 架构是:
date_export date,
num_etiquette text COLLATE pg_catalog."default",
key text COLLATE pg_catalog."default"
任何想法?问候
【问题讨论】:
标签: postgresql csv apache-nifi avro