Adding column name to the Ambulance data file getting failed. Please have a look at my code
Hi,
I have added column names and added below script. This below script is showing error. USING Outputters.Csv(); @searchlog = EXTRACT ID1 int, ID2 int, Date DateTime, Rs string, Rs1 string, Number string, Direction string, ID3 int FROM @"D:\JR\Azure\Redical\usql-master\usql-master\Examples\Samples\Data\AmbulanceData\vehicle1_09142014_JR.csv" USING Extractors.Csv();
OUTPUT @searchlog TO @"D:\JR\Azure\Redical\usql-master\usql-master\Examples\Samples\Data\AmbulanceData\vehicle1_09172014_1_JR.csv" USING Outputters.Csv();
The error is :
Severity Code Description Project File Line Suppression State Error E_CSC_USER_SYNTAXERROR: syntax error. Expected one of: '.' OPTION ';' Description: Invalid syntax found in the script. Resolution: Correct the script syntax, using expected token(s) as a guide. USQLApplication2 D:\JR\Radical-Azure\USQLApplication2\USQLApplication2\Script.usql 7
How to resolve this? Please try the same script from you end and let me know if you successes. Edit:
After commenting : USING Outputters.Csv(); I submitted this on my local and I'm getting this error: Execution failed with error '1_SV1_Extract Error : '{"diagnosticCode":195887140,"severity":"Error","component":"RUNTIME","source":"User","errorId":"E_RUNTIME_USER_EXTRACT_ROW_ERROR","message":"Error occured while extracting row after processing 0 record(s) in the vertex' input split. Column index: 0, column name: 'ID1'.","description":"","resolution":"","helpLink":"","details":"","internalDiagnostics":"","innerError":{"diagnosticCode":195887133,"severity":"Error","component":"RUNTIME","source":"User","errorId":"E_RUNTIME_USER_EXTRACT_COLUMN_CONVERSION_INVALID_ERROR","message":"Invalid character when attempting to convert column data.","description":"Invalid character when converting input string.\nHEX: '2249443122'","resolution":"Check the input for errors or use "silent" switch to ignore conversion errors for nullable types.\nConsider that ignoring "invalid" rows may influence job results and that types have to be nullable for conversion errors to be ignored.","helpLink":"","details":"============================================================================================\nRow Delimiter: 0x0\nColumn Delimiter: 0x2C\nHEX: 49 44 31 2C ### 49 44 32 2C 44 61 74 65 2C 52 73 2C 52 73 31 2C 4E 75 6D 62 65 72 2C 44 69 72 65 63 74 69 6F 6E 2C 49 44 33 0D 0A 31 2C 31 2C 39 2F 31 34 2F 32 30 31 34 20 30 3A 30 30 2C 34 36 2E 38 31 30 30 36 2C\nTEXT: ID1, ### ID2,Date,Rs,Rs1,Number,Direction,ID3\r\n1,1,9/14/2014 0:00,46.81006,\n============================================================================================\n"
Is there any problem with the CSV file? Thanks.
TEXT: ID1, ### ID2,Date,Rs,Rs1,Number,Direction,ID3\r\n1,1,9/14/2014 0:00,46.81006,
It looks like your file contains a header row. You should use skipFirstNRows parameter of CSV extractor:
USING Extractors.Csv(skipFirstNRows: 1);
Oh, and I eventually noticed USING Outputters.Csv(); on the first line of the script. You do not need it. Just remove it and your script should be OK. This clause only makes sense within an OUTPUT statement.