简体   繁体   English

提取中的U-Sql错误

[英]U-Sql Error in Extracting

We have written a USQL script to extract a (.CSV file) ,in which all columns are extracted as a row. 我们编写了一个USQL脚本来提取(.CSV文件),其中所有列都提取为一行。 But we are unable to process all the files as the job gets failed. 但是,由于作业失败,我们无法处理所有文件。 The error message we get is "VERTEX FAILED FAST" However if we convert the file format to (.Csv)(MS-DOS) extension the job gets executed. 我们收到的错误消息是“ VERTEX FAILED FAST”,但是,如果将文件格式转换为(.Csv)(MS-DOS)扩展名,则作业将被执行。 Can someone please figure out the issues and tell us how to solve it. 有人可以找出问题并告诉我们如何解决。 Or any other way to extract all column's as a row would also help. 或以其他方式将所有列提取为一行也将有所帮助。 We also attach the script. 我们还附上​​了脚本。

$scripts = @"
@rs =
    EXTRACT 
        line string,
        filename string 
    FROM "$filepath/$jobid/{filename}.csv"
    USING Extractors.Text(delimiter:'\n', skipFirstNRows: 1);
@j =
    SELECT *
    FROM @rs;
@rs1 =
    SELECT *
    FROM @j 
    WHERE $output;

@k=
    SELECT filename,COUNT() AS Count1
    FROM @j 
    WHERE $output
    GROUP BY filename;
OUTPUT @rs1 
    TO "$filepath/$jobid/logdata.txt"
    USING Outputters.Text(); 

OUTPUT @k
    TO "$filepath/$jobid/count.txt"
    USING Outputters.Text();

"@

First my apologies that currently the error message is not better visible. 首先,我很抱歉目前看不到错误消息。 Vertex Failed fast error messages contain more details that should tell you what actually caused the vertex to fail. 顶点失败快速错误消息包含更多详细信息,这些细节应该告诉您实际上导致顶点失败的原因。 Do you have that information? 你有那个信息吗? Without it, it is hard to answer the question without speculating. 没有它,很难不去猜测就回答这个问题。

Having said that, often the root causes for Vertex failed fast fit into one of the following categories: 话虽如此,但顶点的根源往往无法迅速归入以下类别之一:

  1. Your row has a different number of columns than what you expect. 您的行与预期的列数不同。 This is not likely to be the case here. 这里不太可能是这种情况。

  2. Your row contains data that cannot be cast into the column's specified data type. 您的行包含无法转换为列的指定数据类型的数据。 Again, unlikely in your case. 同样,在您的情况下不太可能。

  3. Your row/cell contains data that is too large for the datatype. 您的行/单元格包含的数据对于数据类型而言太大。 This could be the case for you, although since you mention that changing the CSV file encoding makes it work seems to indicate it could also be 4. If this is the case, you will have to find a way to either truncate or split the row over several rows. 尽管您提到更改CSV文件编码使其可以正常工作,但您可能会遇到这种情况,尽管这似乎表明它也可能是4。如果是这种情况,您将必须找到一种方法来截断或拆分行多行。

  4. The encoding of the file is not UTF-8 (as the default setting assumes) but some other encoding and it leads to an error (invalid encoding at best, or any of the first 3 options). 文件的编码不是UTF-8(默认设置是假定的),而是其他一些编码,并且会导致错误(最好是无效的编码,或者前三个选项中的任何一个)。 If this is the case, please specify the right encoding or change the encoding of the file. 在这种情况下,请指定正确的编码或更改文件的编码。

If this does not help you to resolve the issue, please forward me the job link at usql (at) microsoft dot com. 如果这不能帮助您解决问题,请转发给我位于Microsoft dot com上usql的工作链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM