Skip to content

Commit

Permalink
Fixes an issue in the execution of NNS search.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Gasser committed Aug 14, 2024
1 parent a3d7b61 commit 1c75f83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class IndexScanOperator(
*/
override fun toFlow(): Flow<Tuple> = flow {
val columns = this@IndexScanOperator.fetch.map { it.column }.toTypedArray()
val physical = this@IndexScanOperator.fetch.mapNotNull { it.physical }.toTypedArray()
val physical = this@IndexScanOperator.fetch.map { it.physical ?: it.column }.toTypedArray()
var read = 0L
if (this@IndexScanOperator.partitions == 1) {
this@IndexScanOperator.index.filter(this@IndexScanOperator.predicate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ object NNSIndexScanClass1Rule : RewriteRule {
/* If candidate has been found, execute replacement. */
if (candidate != null) {
val produces = candidate.columnsFor(predicate)
val distanceColumn = predicate.distanceColumn
if (produces.contains(predicate.distanceColumn.column)) {
var replacement: OperatorNode.Physical = IndexScanPhysicalOperatorNode(node.groupId, listOf(node.out.copy()), candidate, predicate)
val newFetch = scan.columns.filter { !produces.contains(it.physical) && it != predicate.column }
Expand Down

0 comments on commit 1c75f83

Please sign in to comment.