none
USQL Extract

    Question

  • Hello,

    We have written a USQL script to extract a (.CSV file) ,in which all columns are extracted as a row. 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.

    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();
       
    "@

    Monday, October 30, 2017 4:55 AM

All replies

  • I'd be happy to help.  This looks like a duplicate of the same question on Stackoverflow.  Let's use that Stackoverflow for get you an answer.

    Thank you,

    Guy

    Monday, October 30, 2017 10:58 PM