Skip to content

Commit

Permalink
Fix minimumKeyScanByteRange to show also the default if it was null.
Browse files Browse the repository at this point in the history
  • Loading branch information
jurmous committed Feb 26, 2025
1 parent d49b512 commit 6301cb4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ fun <DM: IsRootDataModel> DM.optimizeTableScan(
}
}

if (keyScanRanges.equalBytes < (this.Meta.minimumKeyScanByteRange ?: this.Meta.keyByteSize.toUInt())) {
throw StorageException("Key scan bytes (${keyScanRanges.equalBytes}) must be more or equal than minimum key scan bytes (${this.Meta.minimumKeyScanByteRange}). Or set an order to guide scan to an index")
val minimumKeyScanByteRange = this.Meta.minimumKeyScanByteRange ?: this.Meta.keyByteSize.toUInt()

if (keyScanRanges.equalBytes < minimumKeyScanByteRange) {
throw StorageException("Key scan bytes (${keyScanRanges.equalBytes}) must be more or equal than minimum key scan bytes ($minimumKeyScanByteRange). Or set an order to guide scan to an index")
}

return tableScan
Expand Down

0 comments on commit 6301cb4

Please sign in to comment.