HANA translator: boolean column is not valid boolean expression in
HANA
-----------------------------------------------------------------------
Key: TEIID-4246
URL:
https://issues.jboss.org/browse/TEIID-4246
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.12.5
Reporter: Jan Stastny
Assignee: Steven Hawkins
Priority: Critical
Fix For: 9.0, 8.12.5
SAP HANA does not take boolean column or literal as boolean expressions.
Query like this won't pass (invoked on HANA directly):
{code:sql}
SELECT (CASE WHEN BooleanValue THEN 'a' ELSE 'b' END) FROM BQT1.smalla;
{code}
The following could serve as workaround (invoked on HANA directly):
{code:sql}
SELECT (CASE WHEN BooleanValue=true THEN 'a' ELSE 'b' END) FROM
BQT1.smalla;
{code}
The problem is observable when using boolean column in string function (invoked on
Teiid):
{code:sql}
SELECT INTKEY, ('test+' || (BOOLEANVALUE || '+test')) FROM BQT1.SmallA
ORDER BY IntKey
{code}
Which results in following error:
{code:sql}
TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 HanaSource: 257
TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT
g_0."INTKEY" AS c_0, concat('test+', concat(CASE WHEN
g_0."BOOLEANVALUE" THEN 'true' WHEN not(g_0."BOOLEANVALUE")
THEN 'false' END, '+test')) AS c_1 FROM
"BQT1"."SMALLA" AS g_0 ORDER BY c_0]
{code}