Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
We saw incorrect results from a query with the following characteristics:
- the incorrect data is read from the input table
- there is an equals predicate col=const on the input table
- the constant const has a data type that is smaller than the column (e.g. comparing an int to a constant 1000 which is a smallint or comparing a char(20) column to a char(1) constant 'x'.
To demonstrate the issue, I added the following to regression test udr/TEST001:
SELECT cast(CONVERTTIMESTAMP(ts) as TIME(6)), userid, session_id, ipAddr FROM UDF(sessionize_dynamic(TABLE(SELECT userid, JULIANTIMESTAMP(ts) as TS, ipAddr FROM clicks WHERE userid='super-user' PARTITION BY 1 ORDER BY 2), 'USERID', 'TS', 60000000)); SELECT cast(CONVERTTIMESTAMP(ts) as TIME(6)), userid, session_id, ipAddr FROM UDF(sessionize_dynamic(TABLE(SELECT userid, JULIANTIMESTAMP(ts) as TS, ipAddr FROM clicks WHERE userid='super-user' PARTITION BY 1 ORDER BY 2), 'USERID', 'TS', 60000000));
For some reason I had to do the same select twice, the first one didn't show a corrupted userid and/or ipAddr field.