-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38767: exec: fix planning of count operator r=yuzefovich a=yuzefovich Previously, when planning a count operator, we would add it to the flow and would ignore any post-operator planning (like projections). Now, this is fixed. Additionally, this commit fixes slicing within projections operators - previously, we would always slice up to BatchSize, but the underlying memory not always has sufficient capacity (for example, count operator uses a batch with a capacity of 1) which would cause an index out of bounds. Fixes: #38752. Release note: None 38881: exec: fix NaN comparison logic r=solongordon a=solongordon I added special NaN handling for float comparisons. In SQL, NaNs are treated as less than any other float value. Thankfully I'm not seeing a performance hit when I run our sort benchmarks with float64 values. Fixes #38751 Release note: None 38891: c-deps: bump rocksdb for macOS build fix r=ajkr a=ajkr Pick up cockroachdb/rocksdb#39 Release note: None Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com> Co-authored-by: Solon Gordon <solon@cockroachlabs.com> Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
- Loading branch information
Showing
10 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2019 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package exec | ||
|
||
import "math" | ||
|
||
// compareFloats compares two float values. This function is necessary for NaN | ||
// handling. In SQL, NaN is treated as less than all other float values. In Go, | ||
// any comparison with NaN returns false. | ||
func compareFloats(a, b float64) int { | ||
if a < b { | ||
return -1 | ||
} | ||
if a > b { | ||
return 1 | ||
} | ||
// Compare bits so that NaN == NaN. | ||
if math.Float64bits(a) == math.Float64bits(b) { | ||
return 0 | ||
} | ||
// Either a or b is NaN. | ||
if math.IsNaN(a) { | ||
return -1 | ||
} | ||
return 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters