Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2400

Incorrect data returned by TMUDF with selection predicate on input table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0-incubating
    • sql-cmp
    • 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.

      Attachments

        Activity

          People

            hzeller Hans Zeller
            hzeller Hans Zeller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: