Warm tip: This article is reproduced from serverfault.com, please click

apache spark-使用 HTTP 源读取 CSV 导出的 Cloud Data Fusion 问题

(apache spark - Cloud Data Fusion problems reading a CSV export with the HTTP source)

发布于 2021-02-25 19:44:03

我是第一次尝试 Cloud Data Fusion。我有这个端点,我想使用 testwise:

https://waidlife.com/backend/export/index/export.csv?feedID=1&hash=4ebfa063359a73c356913df45b3fbe7f (这是一个商店出口)

标题行说明以下结构:

id,title,description,link,image_link,price,availability,condition,google_product_category

在配置 HTTP 源(Data Fusion Hub 中可用的插件)时,我设置了以下记录(请注意,我将 设置为google_product_category可为空)

在此处输入图片说明

我还将它配置为 CSV 作为格式并跳过标题行:

在此处输入图片说明

现在,如果你查看 API 端点 URL(如上所述),你会发现该列google_product_category是空的。我认为这不会成为问题,因为数据融合的输出模式可以忽略那里的值

2021-02-25 19:38:37,192 - ERROR [Executor task launch worker for task 0:o.a.s.u.Utils@91] - Aborting task
java.lang.RuntimeException: Cannot convert line '"10042","NeoShell Reliance Jacket","Das Filson NeoShell Reliance Jacket besteht aus Polartec  NeoShell  der aktuell atmungsaktivsten und wasserdichtesten Membrane die es gibt. Im Gegensatz zu gewöhnlichem Shell-Material, ist NeoShell  besonders soft und geräuscharm und eignet sich somit auch perfekt für die Jagd. Die Nähte der wasserdichten Reißverschlüsse sind vollständig versiegelt. Die Reißverschlüsse unter den Achseln verhindern, dass sich bei hoher Aktivität Wärme anstaut und sorgen für die richtige Belüftung. Die...","https://www.waidlife.com/regenjacken/neoshell-reliance-jacket","https://www.waidlife.com/media/image/c8/ab/aa/NeoShellRelianceJacketLifestyle2.jpg","366.75 EUR","in stock","new",""' to a record. Reason: 'java.util.NoSuchElementException: null'
    at io.cdap.plugin.http.source.batch.HttpBatchSource.transform(HttpBatchSource.java:109) ~[1614281902851-0/:na]

我尝试了所有可能的配置组合,但无法弄清楚为什么整个过程无法成功运行。

对于复制,这里是整个管道的 JSON 导出:https : //pastebin.com/0qkvTSvh

Questioner
xetra11
Viewed
0
Greeshma Swaminathan 2021-03-02 07:46:49

发生这种情况是因为,在带引号的字符串中有额外的字符。截至目前,我们不支持带有分隔符的引用字段的 CSV。如果这只是一个测试输入,我建议你尝试使用,内部没有的字符串值支持空值并且应该按预期工作。

为此创建了一个错误