In some cases, duplicates are not correctly removed when a UNION clause and a GROUP BY are used in a subquery.
Given, for example, these two views:
running the following query (both col1 and col2 are projected by the main query):
only 1 row is returned as expected:
but if only "col2" is projected by the main query:
three rows are returned:
This behavior can be reproduced in Teiid-8.12-Beta1.