When there are columns with the same name coming from different sources (e.g. source table and a joined table) then findColumnIndexesFromLegacyRefs won't match the columns correctly even if field_ref has the correct join alias.
To Reproduce
Create native question Q1 select ID, PRODUCT_ID, TOTAL from orders
Create native question Q2 select * from products
Create GUI question Q3 based on Q1, joins Q2 on Q1.PRODUCT_ID = Q2.ID
Visualize the question in branch new-table-viz-settings-2
Q2.ID column would not be shown in the table because the corresponding table setting wasn't matched with the column
Context: @ranquild lowered the priority here because he found a workaround for the worst symptoms and committed it. This should still be fixed, but it's not on fire now.
Describe the bug
When there are columns with the same name coming from different sources (e.g. source table and a joined table) then
findColumnIndexesFromLegacyRefs
won't match the columns correctly even iffield_ref
has the correct join alias.To Reproduce
select ID, PRODUCT_ID, TOTAL from orders
select * from products
new-table-viz-settings-2
Q2.ID
column would not be shown in the table because the corresponding table setting wasn't matched with the columnFor this question
doesn't match for one of the joined columns.
Expected behavior
All columns should be matched given that all data here is coming from QP
Logs
No response
Information about your Metabase installation
Severity
P1/P2 no data shown
Additional context
No response