Closed BaudoinWR closed 1 day ago
In case of normal query submitted to Trino like select column_name as a, data_type as a from prism.information_schema.columns
- the optimizer tends to add alias towards the end so it doesn't fail - but the same query would fail when we try to create a table based on the same query.
Wrt to query passthrough also we translate the query to table handle and it requires all the columns name to be unique in-order to identify the which column name to load - so this is a known limitation
I'll be closing this ticket - Feel free to re-open if it doesn't answers your question and feel free to discuss the same in our slack channel as well.
When sending a pass through query to a JDBC connector, if the results contain columns with the same name, trino returns an error. This can be reproduced with a mysql source (also tested with postgres with similar results)
With a mysql catalog named
prism
:returns:
The same occurs if the underlying column is different, as long as the name is identical
returns:
For reference, sending the request without using pass through works as expected
The underlying issue appears to be the creation of the ColumnHandle map in that code path.