Open RyuSA opened 11 months ago
I just hit the same problem with equivalent context - a bigquery partitioned table and assertions from within the file config block. the assertions are failing due to the wrong sql that is auto-generated.
my solution is to avoid using the built-in assertions from within the config block as you cannot rely on the sql it generates.
it's been quite some time since this was reported - i was wondering if there were any developments in the meantime ? @Ekrekr thank you in advance for your thoughts.
Problem Summary:
I found that assertions for SQLX scripts fail with the following error when
config.bigquery.requirePartitionFilter: true
:Minimal Reproduction:
The error message originates from BigQuery. I found BigQueryAdaptor uses Adaptor.indexAssertion for the assertion, ignoring BigQueryOptions.
This means the generated assertion SQL does not contain filters for partition columns.
Problem Details:
This is the assertion SQL for the minimal reproduction.
The SQL is generated by Adaptor.indexAssertion and it is missing the filter. This is because that
BigQueryAdaptor{.indexAssertion || .rowConditionsAssertion}
disregardsBigQueryOptions
during assertions, causing partition settings to be neglected(=assertion query does not contain partition clause.).BigQueryAdaptor
should have implementations for the methods, like below.