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

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/paimon-rust/issues) and found nothing 
similar.
   
   
   ### Please describe the bug 🐞
   
   ### Describe the bug 
   
   When a temporary table or view shadows a persistent table, SELECT reads the 
temporary object, but TRUNCATE TABLE clears the hidden persistent table.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE default.t (id INT);
   INSERT INTO default.t VALUES (1), (2);
   
   CREATE TEMPORARY VIEW default.t AS
   SELECT CAST(999 AS INT) AS id;
   
   SELECT * FROM default.t; -- Returns 999
   
   TRUNCATE TABLE default.t;
   
   DROP TEMPORARY VIEW default.t;
   SELECT * FROM default.t; -- Unexpectedly returns no rows
   ```
   
   ### Expected behavior
   
   Reject TRUNCATE on temporary objects before modifying the hidden persistent 
table. This should also apply to IF EXISTS and partition truncation.
   
   ### Solution
   
   Check for temporary targets before resolving and modifying the persistent 
table, consistent with UPDATE and DELETE.
   
   ### 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