TobikoData / sqlmesh

Efficient data transformation and modeling framework that is backwards compatible with dbt.
https://sqlmesh.com
Apache License 2.0
1.65k stars 147 forks source link

Fix: Invalidate the optimized query cache entry when a macro definition changes within the model model definition #3194

Closed izeigerman closed 2 days ago

izeigerman commented 2 days ago

Model example:

MODEL (
  name agreement.stg_testing,
  kind FULL,
);

@DEF(filter_, txmetasource IN ('A'));

SELECT
  *
FROM iceberg.dbo.table1
WHERE
  @filter_
LIMIT 10

Prior to this fix, changing the filter_ macro resulted in a metadata change unless the cache was manually cleaned up.