Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4224

HANA translator : incorrect pushdown of DAYOFWEEK function

    Details

      Description

      Teiid's DAYOFWEEK function:

      DAYOFWEEK(x) 	Return day of week (Sunday=1, Saturday=7) 
      

      is pushed down as:

      dayname(g_0."DATEVALUE")
      

      but this function returns string representation of the day.

      More appropriate would be to push DAYOFWEEK as WEEKDAY function, but the returned value has to be adapted to Teiid's representation (Sunday=1 and Saturday=7, vs. HANA's Monday=0,Sunday=6). So the solution would be to push:

      MOD((WEEKDAY(datevalue)+1),7)+1
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                jstastny Jan Stastny
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: