SEZ9 commented on issue #12515:
URL: https://github.com/apache/seatunnel/issues/12515#issuecomment-6393041106

   Thanks for the update, @hutiefang76. Agreed on the sequencing: #12516 stays 
closed, and the save-mode follow-up waits until the attached-catalog routing in 
#12506 has landed and the follow-up is rebased on it.
   
   On scope, I think we can settle it here so nobody duplicates work. The 
follow-up should be limited to the save-mode gap originally reported: 
`DuckDBCatalog` must override `getDropTableSql`, `getTruncateTableSql` and 
`getExistDataSql` so that `RECREATE_SCHEMA`, `DROP_DATA` and 
`ERROR_WHEN_DATA_EXISTS` no longer fail with `UnsupportedOperationException`. 
The one addition that came out of the earlier verification is that those SQL 
statements, plus the metadata lookup and CREATE TABLE path they feed into, must 
keep the attached-catalog qualifier end to end; otherwise `RECREATE_SCHEMA` 
drops the attached table and then silently creates or keeps a local `main` 
table, which is worse than the current failure.
   
   Concrete asks for whoever opens the follow-up PR:
   
   1. Real JDBC-backed tests (not mocked SQL strings) exercising the actual 
save-mode handler, with an attached target table and a same-named local `main` 
table present at the same time, asserting that:
      - `RECREATE_SCHEMA` recreates only the intended attached table and leaves 
the local `main` table untouched;
      - `DROP_DATA` clears only the attached table's rows and preserves its 
schema;
      - `ERROR_WHEN_DATA_EXISTS` accepts an empty attached target and rejects a 
populated one.
   2. A short note in the PR description explaining how the qualifier is 
carried from `#12506`'s routing into the three new SQL builders, so reviewers 
can check the two pieces fit without re-deriving it.
   
   I can't speak to the status of other open work referenced in this thread; if 
someone else intends to pick up the follow-up, please have them confirm here 
first so we agree on a single owner. Once #12506 is in, ping me on this issue 
and I'll review the follow-up promptly.
   
   <!-- streview-comment:2022 -->


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