The workaround is to change the Teiid source type on the Oracle table representing the materialization from being a bigdecimal to a long to match the view definition.
It may be good to relax some of the type expectations here as it would be allowable to implicitly convert.
In oracle, we can use only NUMBER data type for the result of the function TIMESTAMPDIFF, I did not get which data type I should use to match the java type Long.
Isn't better to expect sql data type result from TIMESTAMPDIFF in the case of materialized view instead of java Long datatype?
Now I'm getting the same issue with Oracle when using the date functions Year and Month : Expected integer, but was bigdecimal.
All of the concerned views were working fine with Teiid 8.11.3, once we migrated to the version 9.0.0, we started getting the error.
The concerned columns in the materialized views has the Oracle data type number(10)
The issue is being caused by the additional validation of [TEIID-3999] more aspects of materialization metadata should be validated - JBoss Issue Tracker
We'll work on https://issues.jboss.org/browse/TEIID-4427 to make things compatible.