Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions java/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.iml
.java-version
.classpath
.project
.settings
34 changes: 32 additions & 2 deletions python/python/lance/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2762,8 +2762,38 @@ def prewarm_index(self, name: str):
"""
return self._ds.prewarm_index(name)

def merge_index_metadata(self, index_uuid: str):
return self._ds.merge_index_metadata(index_uuid)
def merge_index_metadata(
self,
index_uuid: str,
index_type: str,
batch_readhead: Optional[int] = None,
):
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the refactor. My previous design wasn’t thoroughly considered; yours is a significant improvement

Merge an index which is not commit at present.

Parameters
----------
index_uuid: str
The uuid of the index which want to merge.
index_type: str
The type of the index.
Only "BTREE" and "INVERTED" are supported now.
Comment thread
xloya marked this conversation as resolved.
batch_readhead: int, optional
The number of prefetch batches of sub-page files for merging.
Default 1.
"""
index_type = index_type.upper()
if index_type not in [
"BTREE",
"INVERTED",
]:
raise NotImplementedError(
Comment thread
xloya marked this conversation as resolved.
(
'Only "BTREE" or "INVERTED" are supported for '
f"merge index metadata. Received {index_type}",
)
)
return self._ds.merge_index_metadata(index_uuid, index_type, batch_readhead)

def session(self) -> Session:
"""
Expand Down
4 changes: 3 additions & 1 deletion python/python/lance/lance/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ class _Dataset:
): ...
def drop_index(self, name: str): ...
def prewarm_index(self, name: str): ...
def merge_index_metadata(self, index_uuid: str): ...
def merge_index_metadata(
self, index_uuid: str, index_type: str, batch_readhead: Optional[int] = None
): ...
def count_fragments(self) -> int: ...
def num_small_files(self, max_rows_per_group: int) -> int: ...
def get_fragments(self) -> List[_Fragment]: ...
Expand Down
Loading
Loading