fix(catalog): refresh schema after table replacement - #242
Conversation
Preserve Lance's zero-row overwrite commit semantics for schema-only CREATE OR REPLACE TABLE operations. After a successful overwrite, invalidate only the replaced directory dataset cache entry and evict its stale attached-catalog entry so lazy discovery reloads the committed schema. Leave cached handles and catalog state unchanged when the writer fails, and preserve cross-query reuse for untouched datasets. Add regression coverage for schema refresh, failed replacements, precise cache invalidation, and untouched cache reuse.
Use the physical identifier returned by case-insensitive namespace discovery when replacing a table. This keeps writes, cache invalidation, and catalog refresh scoped to the existing dataset instead of creating a case-variant sibling.
Resolve directory namespace lookups through the listed table name so case-variant replacements retain the physical dataset identifier. Use that identifier for DROP and add replacement and drop regressions.
There was a problem hiding this comment.
The case-variant replacement and DROP paths now preserve the physical table identifier, and the prior schema-only and CTAS rediscovery failure is fixed.
The author intentionally accepts that a second DuckDB connection may continue reading a stale cached Lance dataset after another connection commits a replacement. No further change is requested for that behavior in this pull request.
|
@Xuanwo Could you review fix/dir-namespace-replace-v6? It keeps directory CREATE OR REPLACE TABLE on the existing dataset (including case-insensitive names), refreshes only that table after a successful overwrite, and adds replace/DROP regressions. Thanks. |
|
@lance-community Lance Gatekeeper pipeline could not complete on the last run, could you please rerun it? |
Preserve Lance's zero-row overwrite commit semantics for schema-only CREATE OR REPLACE TABLE operations.
After a successful overwrite, invalidate only the replaced directory dataset cache entry and evict its stale attached-catalog entry so lazy discovery reloads the committed schema. Leave cached handles and catalog state unchanged when the writer fails, and preserve cross-query reuse for untouched datasets.
Add regression coverage for schema refresh, failed replacements, precise cache invalidation, and untouched cache reuse.