DataLake Analytics USQL : Failed to compare two elements in the array

191 Views Asked by At

I created a Database in Data lake Analytics. Then populated with data from files in my data lake. When I then query the table I have made, I have some success, but some strange errors. (Strange to me !)

This works: WHERE [Stamped Serial number] == "000074O1" This does not: WHERE [CTN Number] == "000074-1"

Error :

"A system failure has occurred during code generation. Failed to compare two elements in the array."

Both fields are strings, so I'm not sure what the difference is. One (the failing one) is also part of my index & distribution - but I'm lost if that is anything to do with my problems.

All the code for table def, populating and final queries are below. If anyone can help me understand what I am doing wrong ... !? ... will be extremely grateful :)

Script: Create Table

CREATE TABLE IF NOT EXISTS Play.RawData
(
    [CTN Number] string
    ,[SeqNo] long
    ,[UTC Time Stamp for Event] string
    ,[Biz step Description] string
    ,[Stamped Serial number] string
    ,[Container Status] string
    < -- more columns -- >,
INDEX 
    idx_CTN CLUSTERED ([CTN Number],[SeqNo])

DISTRIBUTED BY HASH ([CTN Number],[SeqNo])
);

Script: Populate Table

DECLARE @dir string = "/myDataPath/";
DECLARE @file_set_path string = @dir + "File_{date:yyyy}{date:MM}{date:dd}.DAT";

@results_1 = 
    EXTRACT 
        [CTN Number] string
        ,[UTC Time Stamp for Event] string
        ,[Biz step Description] string
        ,[Stamped Serial number] string
        ,[Container Status] string
        < -- more columns -- >,
        ,date DateTime // virtual file set column
    FROM @file_set_path 
USING Extractors.Tsv();

INSERT INTO Play.RawData(
    [CTN Number],
    [SeqNo],
    [UTC Time Stamp for Event],
    [Biz step Description],
    [Stamped Serial number],
    [Container Status],
        < -- more columns -- >
)
    SELECT 
        [CTN Number],
        ROW_NUMBER() OVER(PARTITION BY [CTN Number] ORDER BY [UTC Time Stamp for Event] ASC) ?? -1 AS [SeqNo],
        [UTC Time Stamp for Event],
        [Biz step Description],
        [Stamped Serial number],
        [Container Status]
FROM @results_1 
WHERE 
        date >= DateTime.Parse("2013-01-01") 
        AND 
        date < DateTime.Parse("2013-02-01");

Script: Test Query

@table =
    SELECT [UTC Time Stamp for Event],
           [Biz step Description],
           [CTN Number],
           [Stamped Serial number]
    FROM [CTN].[Play].[RawData]
    WHERE 
        //[Stamped Serial number] == "000074O1";
       [CTN Number] == "000074-1";

OUTPUT @table
    TO "/output/results.tsv"
    USING Outputters.Tsv(outputHeader:true);
1

There are 1 best solutions below

2
On

This looks like a bug to me. Can you please send me a link to the failed job at usql (at) microsoft dot com?

Thanks Michael