Hi
We observed that teiid hints are lot when the query is unioned.hintsexec.random_hintsview is a view which has sourcehint and general hint in its tranformation query. when we execute select * we see hints getting passed , but when unioned with something hints are lost.
Please find the attached testcase. Below is the output from the unittest.
Unit test can be found in com.ca.chorus.server.translator.hints.SysviewHintsExecutionTest.testTeiidHintsDuringUnion() .
transformation is SELECT /*+ sh:'general_hint' random:'source_hint' */ random_number FROM (CALL random.random_number(3)) AS b
1 [DEBUG] CHORUS-QUERY - select * from hintsexec.random_hintsview
GeneralHint ** general_hint
getSourceHint ** source_hint
275 [DEBUG] CHORUS-QUERY - select * from hintsexec.random_hintsview
GeneralHint ** general_hint
getSourceHint ** source_hint
277 [DEBUG] CHORUS-QUERY - select * from hintsexec.random_hintsview union select 0
GeneralHint ** null
getSourceHint ** null
This is mostly by design as the intention was for the source hint to appear at the top level of the user query. For any new scenarios, please start with the existing issue https://issues.jboss.org/browse/TEIID-2381