‘Ask a question’ errors when used on a table that is configured with the following properties:
- Sandboxing based on column values
- A column with a foreign key relationship
- A display value taken from the foreign table
The ‘Ask a question’ features appears to generate an invalid query. When attempting to use the feature with a simple question based on the table in question, the UI immediately shows an error ‘There was a problem with your question’ after selecting the table.
Step to reproduce:
- Create a model with a fact table that looks rougly like this
orders (tenant_id, id, widget_id)
widgets (tenant_id, id, name) - Set the widget_id on the order table as foreign key mapping to widgets (id)
- Change the display value for the widget_id column to the foreign value widgets (name)
- Define a sandbox permission on the orders table restricting access to users that have an attribute which matches the tenant_id column
- Using a sandboxed user account, select: Ask a Question -> Simple Question -> Database -> Orders table
Expected:
A table with some set of orders are shown as usually
Actual:
The UI immediately display an error: ‘There was a problem with your question’, and the error details explainsUnknown column 'source.name' in 'field list'
This has been reproduced using both a AWS Redshift database and an MySQL database