Apache nifi 无法分析csv中的双值

Apache nifi 无法分析csv中的双值,apache-nifi,Apache Nifi,来源:csv: ReportDay;SKU;ProductName;Price;Type;ShowsCondition;Impressions;Clicks;CTR;CPM;Budget;Orders;Revenue;ModelOrders;RevenueByModel 15.04.2021;1362254;Product1;71,00;Search;Shelf;1;0;0,00;35,00;0,04;0;0,00;0;0,00 15.04.2021;145406;Product2;129,00

来源:csv:

ReportDay;SKU;ProductName;Price;Type;ShowsCondition;Impressions;Clicks;CTR;CPM;Budget;Orders;Revenue;ModelOrders;RevenueByModel
15.04.2021;1362254;Product1;71,00;Search;Shelf;1;0;0,00;35,00;0,04;0;0,00;0;0,00
15.04.2021;145406;Product2;129,00;Promo;Shelf;1;0;0,00;35,00;0,04;0;0,00;0;0,00
要分析csv的自定义架构:

{
    "type": "record",
    "name": "SKU",
    "namespace": "test",
    "fields": [
        {"name": "ReportDay", "type": "string"},
        {"name": "SKU", "type": ["long","null"]},
        {"name": "ProductName", "type": ["string","null"]},
        {"name": "Price", "type": ["double","null"]},
        {"name": "Type", "type": ["string","null"]},
        {"name": "ShowsCondition", "type": ["string","null"]},
        {"name": "Impressions", "type": ["long","null"]},
        {"name": "Clicks", "type": ["long","null"]},
        {"name": "CTR", "type": ["double","null"]},
        {"name": "CPM", "type": ["double","null"]},
        {"name": "Budget", "type": ["double","null"]},
        {"name": "Orders", "type": ["long","null"]},
        {"name": "Revenue", "type": ["double","null"]},
        {"name": "ModelOrders", "type": ["long","null"]},
        {"name": "RevenueByModel", "type": ["double","null"]}
    ]
}
还包括以下设置:

当我试图在
UpdateRecord
处理器中使用此读卡器读取.csv时,我收到一个错误:

Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "0,00"

如果我将所有
double
类型更改为
string
,它将毫无问题地解析它。但我在数据库中将这些值存储为
numeric
,因此我需要将这些值“读取”为双精度类型,而不是字符串。我错了什么?

我想这是因为你的替身使用逗号作为分隔符,而不是点。我认为没有参数来设置数字区域设置。最好的方法是将源数据更改为使用点。否则,您可以更新记录,将逗号替换为点,这样可以将它们解析为双倍。我无法更改源csv,它来自RESTAPI。我将尝试替换逗号。在updaterecord之前的初始获取之后,您可以将所有“.”替换为“.”。您应该考虑不必要的替换。如果将CSV解析器属性设置为杰克逊,它是否有效?@ Matyb,不起作用。