feat(nodejs): add order_by method to Query#3123
Conversation
ec7181f to
6072c67
Compare
|
The current CI failure appears to be unrelated to my changes in this PR. Fixed it in #3124 |
|
@ddupg I merged 3124, could you help rebase? |
Change-Id: Iae6a968081a9aed9b7cd0db0d6e32710b693cb83
rust/lancedb/src/query.rs
Outdated
| self | ||
| } | ||
|
|
||
| fn order_by(mut self, column: impl Into<String>, direction: SortDirection) -> Self { |
There was a problem hiding this comment.
why not match the lance api and just expose order_by(&mut self, ordering: Option<Vec<ColumnOrdering>>)?
| * .toArray(); | ||
| * ``` | ||
| */ | ||
| orderBy(column: string, direction: "asc" | "desc" = "asc"): this { |
There was a problem hiding this comment.
in general we need to keep parity of python and typescript implementation, this is small enough change can we just add them in the same PR?
There was a problem hiding this comment.
Thanks for the review.
Python currently supports ordering by providing the ordering_field_name field during search, like:
def search(
self,
query: Optional[
Union[VEC, str, "PIL.Image.Image", Tuple, FullTextQuery]
] = None,
vector_column_name: Optional[str] = None,
query_type: QueryType = "auto",
ordering_field_name: Optional[str] = None,
fts_columns: Optional[Union[str, List[str]]] = None,
) -> LanceQueryBuilder:
When you mentioned "keep parity of Python and TypeScript implementation", are you referring to the ordoring direction?
- Update QueryBase::order_by signature to accept Option<Vec<ColumnOrdering>> - Re-export ColumnOrdering from Lance in lib.rs - Update QueryRequest.order_by field type - Remove unused SortDirection import from table/query.rs - Update table/query.rs to pass order_by directly to scanner Change-Id: I82667e17e8f3e0d82be71227bbb480353edb92a7
- Update QueryBase::order_by signature to accept Option<Vec<ColumnOrdering>> - Re-export ColumnOrdering from Lance in lib.rs - Update QueryRequest.order_by field type - Remove unused SortDirection import from table/query.rs - Update table/query.rs to pass order_by directly to scanner Change-Id: I5a9610f2b5679c1a8a6a48621962bc912606c1db
- Update RemoteTable to pass Vec<ColumnOrdering> to scanner - Fix serialization of order_by parameter Change-Id: Ic2f988e5be2744e3b6ce045b02539712ca2ae822
- Update RemoteTable to pass Vec<ColumnOrdering> to scanner - Fix serialization of order_by parameter Change-Id: I8b7436814ca2bf56a5bab7a30b8466b72f0dbd03
Change-Id: Id4bf2c48027d9382f84293d5383dac09045e0eec
No description provided.