]
Steven Hawkins resolved TEIID-4221.
-----------------------------------
Fix Version/s: 9.0
8.12.5
Resolution: Done
Used an approach similar to the above casting the substring from isoweek to an integer.
HANA translator: incorrect pushdown of week function
----------------------------------------------------
Key: TEIID-4221
URL:
https://issues.jboss.org/browse/TEIID-4221
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.12.5
Reporter: Jan Stastny
Assignee: Steven Hawkins
Fix For: 9.0, 8.12.5
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:
{code:plain}
2000-W01 for date 'Jan 3, 2000'
{code}
So it should be possible to push Teiid's WEEK function as:
{code:sql}
SUBSTR_REGEXPR('[[:digit:]]{4}\-W([[:digit:]]{2})' IN ISOWEEK(datevalue) GROUP
1)
{code}
where 'datevalue' is column of DATE datatype.