Skip to content

Commit

Permalink
Minor cleanup.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Gasser <[email protected]>
  • Loading branch information
ppanopticon committed Nov 28, 2024
1 parent 19423e7 commit 69ca5b9
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class VectorDescriptorReader(field: Schema.Field<*, VectorDescriptor<*, *>>, con
*/
override fun query(query: Query): Sequence<VectorDescriptor<*, *>> = sequence {
when (val predicate = query.predicate) {
is ProximityPredicate<*> -> prepareProximity(predicate).use { stmt ->
stmt.executeQuery().use { result ->
while (result.next()) {
yield(rowToDescriptor(result))
}
}
}
is ProximityPredicate<*> -> prepareProximity(predicate)
is BooleanPredicate -> prepareBoolean(predicate)
else -> throw UnsupportedOperationException("Query of typ ${query::class} is not supported by VectorDescriptorReader.")
}.use { stmt ->
stmt.executeQuery().use { result ->
while (result.next()) {
yield(rowToDescriptor(result))
}
}
}
}

Expand Down

0 comments on commit 69ca5b9

Please sign in to comment.