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

HANA translator: incorrect pushdown of week function

    XMLWordPrintable

Details

    Description

      Hana translator pushes down function week to SAP HANA datasource as its WEEK function. But it is not in accordance with the ISO8601 rule.

      For this standard, HANA has function ISOWEEK, which returns results in following format:

      Unable to find source-code formatter for language: plain. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      2000-W01 for date 'Jan 3, 2000'
      

      So it should be possible to push Teiid's WEEK function as:

      SUBSTR_REGEXPR('[[:digit:]]{4}\-W([[:digit:]]{2})' IN ISOWEEK(datevalue) GROUP 1)
      

      where 'datevalue' is column of DATE datatype.

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            jstastny@redhat.com Jan Stastny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: