sqlmesh
sqlmesh copied to clipboard
"schema_name" config not applied to unqualified models with Athena
Hi,
This issue references a discussion in the Tobiko Slack.
When using Athena as a gateway, the schema_name config is not applied to unqualified models and default is used instead.
@erindru 's explanation:
schema_name is a passed to the PyAthena driver, which injects it into the QueryExecutionContext part of the AWS API calls as Database (so the idea here is that the database driver effectively calls SET SCHEMA <schema_name> before running a query).
Gonna go ahead and mark this as a bug for now. My theory is that SET SCHEMA at the driver level isn't useful in SQLMesh's case, because we automatically qualify models with a default schema before reaching the engine.