slfan1989 opened a new issue, #1372:
URL: https://github.com/apache/paimon-rust/issues/1372

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/paimon-rust/issues) and found nothing 
similar.
   
   
   ### Please describe the bug 🐞
   
   When a temporary view shadows a persistent Paimon table, `SELECT` resolves 
to the temporary view, but `ALTER TABLE ... DROP PARTITION` deletes data from 
the underlying persistent table.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE paimon.default.events (id INT, pt INT) PARTITIONED BY (pt);
   INSERT INTO paimon.default.events VALUES (1, 1), (2, 2);
   
   CREATE TEMPORARY VIEW paimon.default.events AS SELECT 99 AS id;
   SELECT id FROM paimon.default.events;
   
   ALTER TABLE paimon.default.events DROP PARTITION (pt = 1);
   
   DROP TEMPORARY VIEW paimon.default.events;
   SELECT id, pt FROM paimon.default.events ORDER BY id;
   ```
   
   - Expected: `DROP PARTITION` rejects the temporary target, and the final 
query returns both `(1, 1)` and `(2, 2)`.
   
   - Actual: `DROP PARTITION` succeeds, and the final query returns only `(2, 
2)`.
   
   
   ### Solution
   
   Reuse the existing temporary-object lookup to reject DROP PARTITION on 
temporary tables and views before modifying the persistent table.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
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]

Reply via email to