You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Hans Zeller (JIRA)" <ji...@apache.org> on 2016/12/15 04:32:58 UTC

[jira] [Created] (TRAFODION-2400) Incorrect data returned by TMUDF with selection predicate on input table

Hans Zeller created TRAFODION-2400:
--------------------------------------

             Summary: Incorrect data returned by TMUDF with selection predicate on input table
                 Key: TRAFODION-2400
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2400
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-cmp
            Reporter: Hans Zeller
            Assignee: Hans Zeller
             Fix For: 2.0-incubating


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:

{noformat}
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));
{noformat}

For some reason I had to do the same select twice, the first one didn't show a corrupted userid and/or ipAddr field.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)