Pablo-aps commented on PR #76828:
URL: https://github.com/apache/airflow/pull/76828#issuecomment-6915002347
I found a qualification-dependent result in
`test_partition_guard_insert_into_select`. With the test's mapping
`{"target_tbl": ["dt"]}` and the locked SQLGlot 30.29.0, this fails with “Query
on table 'target_tbl' lacks required partition filter”:
```sql
INSERT INTO target_tbl
SELECT s.dt FROM source_tbl AS s WHERE s.dt = '2026-01-01'
```
Changing only `WHERE s.dt` to `WHERE dt` makes it pass. Both forms read the
same source rows. The validator adds the insert destination to the tables
checked against the source predicate, then credits an unqualified column to the
destination. Qualifying the column correctly resolves it to the source and
exposes the mismatch.
For a scan guard I'd check `source_tbl` in the SELECT scope and test both
spellings with that mapping. If the goal is also to constrain which destination
partitions get written, that needs a separate check on how the SELECT output
maps to the inserted columns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]