1 of 1 people found this helpful
Teiid effectively ignores constraints on datatypes. The parsing support was added for DDL, but I don't see an explicit reference in the docs that they are effectively ignored in casts so one will need to be added.
The HSQL issue is a bug. The translator needs to be aware that the cast requires a length.
In general you'd want to use the the left function. You can also log an enhancement for Teiid to respect the length for a varchar cast.
I will create a bug for the HSQL issue. Unfortunately this query was created by Tableau, and I doubt I can convince it to use the LEFT function instead of a CAST to VARCHAR,