Skip to content

fix: implement dropTable and fix deregisterTable semantics for hive2/hive3#12

Merged
jackye1995 merged 4 commits intolance-format:mainfrom
hfutatzhanghb:zhb-dev-droptable-delete-data
Feb 6, 2026
Merged

fix: implement dropTable and fix deregisterTable semantics for hive2/hive3#12
jackye1995 merged 4 commits intolance-format:mainfrom
hfutatzhanghb:zhb-dev-droptable-delete-data

Conversation

@hfutatzhanghb
Copy link
Contributor

@hfutatzhanghb hfutatzhanghb commented Jan 23, 2026

Summary

  • Implement dropTable() method that deletes both metadata and data (deleteData=true)
  • Fix deregisterTable() to only remove metadata without deleting data (deleteData=false)
  • Update both Java and Python implementations for hive2 and hive3

Semantic Behavior

LanceNamespace Method HMS deleteData Behavior
dropTable() true Removes metadata AND deletes data files
deregisterTable() false Removes metadata only, preserves data files

Changes

  • Java Hive2Namespace: Added dropTable(), fixed deregisterTable(), refactored doDropTable() to accept deleteData parameter
  • Java Hive3Namespace: Same changes as Hive2
  • Python hive2.py: Added drop_table() method with deleteData=True
  • Python hive3.py: Same changes as hive2

Test plan

  • Run Java integration tests for hive2 and hive3
  • Run Python integration tests for hive2 and hive3
  • Verify dropTable deletes data files
  • Verify deregisterTable preserves data files

🤖 Generated with Claude Code

@hfutatzhanghb
Copy link
Contributor Author

Hi, @majin1102 @jackye1995 @yanghua . cc this PR when you have free time, Thanks a lot~

@jackye1995 jackye1995 changed the title chore: dropTable deletes data when using hive2 namespace and hive3 namespace fix: implement dropTable and fix deregisterTable semantics for hive2/hive3 Feb 6, 2026
@github-actions github-actions bot added python bug Something isn't working labels Feb 6, 2026
@jackye1995 jackye1995 force-pushed the zhb-dev-droptable-delete-data branch from d741601 to 7bc8356 Compare February 6, 2026 00:23
@jackye1995 jackye1995 force-pushed the zhb-dev-droptable-delete-data branch 2 times, most recently from fa529c3 to eecb2fa Compare February 6, 2026 01:00
zhanghaobo@kanzhun.com and others added 2 commits February 5, 2026 17:01
…hive3

- Add dropTable() method that deletes both metadata and data (deleteData=true)
- Fix deregisterTable() to only remove metadata without deleting data (deleteData=false)
- Update both Java and Python implementations for hive2 and hive3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jackye1995 jackye1995 force-pushed the zhb-dev-droptable-delete-data branch from eecb2fa to be194a6 Compare February 6, 2026 01:01
@github-actions github-actions bot added the docs label Feb 6, 2026
jackye1995 added a commit to lance-format/lance-spark that referenced this pull request Feb 6, 2026
…209)

## Summary

- `dropTable()` now calls `namespace.deregisterTable()` which only
removes metadata without deleting the underlying data
- `purgeTable()` now calls `namespace.dropTable()` which removes
metadata and deletes the underlying data

## Changes

- Modified `dropTable()` to use `DeregisterTableRequest` and call
`namespace.deregisterTable()`
- Modified `purgeTable()` to use `DropTableRequest` and call
`namespace.dropTable()`
- Updated DirectoryNamespace tests to disable `extra_level` config and
explicitly create the "default" namespace so that manifest mode is used
instead of directory listing mode

## Related PR

- lance-format/lance-namespace-impls#12
(implements `dropTable` and `deregisterTable` with proper `deleteData`
handling in hive2/hive3 namespaces)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for bringing this up!

@jackye1995 jackye1995 merged commit 0a3c180 into lance-format:main Feb 6, 2026
9 checks passed
@hfutatzhanghb
Copy link
Contributor Author

thanks for bringing this up!

Very complete and excellent implementation. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants