我正在尝试azure datalake,并试图在我的测试文件上测试u-sql .
这是我的测试脚本
@input =
EXTRACT TagName string,
time DateTime,
valuee float,
Quality int
FROM "/MCVD/{*}/{*}/{*}/{*}/{*}/{*}/{*}.csv"
USING Extractors.Csv(skipFirstNRows:1, nullEscape:"");
OUTPUT @input
TO "/output/Test-query.csv"
USING Outputters.Csv();
在datalake analytics中运行时,我在第56行得到了一个列值为value的错误 .
这是第56行的内容
"M32_Amp_FurnaceAluTemperatureTubeReference",2018-02-08T14:48:53.5780000,"",1
我知道这是因为保存该值的列为空(它是文件中的第一个空行) . 我试图使用各种NullEscape paterns,但它仍然失败 .
我试图将列提取为字符串,这不会产生任何错误 .
这是错误:
Vertex failed
Vertex failure triggered quick job abort. Vertex failed: SV1_Extract[0][0] with error: Vertex user code error.
VertexFailedFast: Vertex failed with a fail-fast error
E_RUNTIME_USER_EXTRACT_ROW_ERROR: Error occurred while extracting row after processing 56 record(s) in the vertex' input split. Column index: 2, column name: 'valuee'.
E_RUNTIME_USER_EXTRACT_COLUMN_CONVERSION_EMPTY_ERROR: Failure when attempting to convert empty column data.
2 回答
从csv中提取时,我的文件中的值为“null”(不带引号)时出现相同的错误 . 我期望nullEscape参数的默认空值将处理提取但它抛出空值转换错误 .
很难,可能是因为我的csv没有双引号作为引用 .
使用nullEscape:"null"参数在我的情况下解决了它 .
U-SQL支持nullable data-types . 只需在数据类型后用问号标记它们,例如
您还可以使用提取器的
silent
开关设置为true
来抑制错误行 . 但是,我的脚本和示例数据会出现一些不同的错误 . 这是一个准确的复制品吗?