forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…db#97443 cockroachdb#97473 cockroachdb#97484 96235: sem/tree: add support for producing vectorized data from strings r=cucaroach a=cucaroach tree.ValueHandler exposes raw machine type hooks that are used by vec_handler to build coldata.Vec's. Epic: CRDB-18892 Informs: cockroachdb#91831 Release note: None 96460: upgrades,systemschema: add covering index to system.privileges on `path` r=andyyang890 a=e-mbrown Resolves cockroachdb#93525 Queries to the `system.privileges` table are usually filtered by path. With a primary key using `(user,path)` all those queries were full scans. This commit changes the primary key to be `(path,user)`. Release note: None 97272: *: update to use full package name for `option go_package` in protos r=rail,stevendanna,RaduBerinde a=rickystewart Everywhere in the entire tree we use `option go_package` statements like the following: ``` option go_package = "build"; ``` We do this *instead of* using the entire fully-qualified package name, like: ``` option go_package = "github.com/cockroachdb/cockroach/pkg/build"; ``` This is apparently just an error. All the documentation I have seen (https://github.com/cockroachdb/gogoproto/blob/master/README) suggests that the fully-qualified package name should be used here. Further, this caused the `make` build to break after a refactor as the code generator doesn't know how to import a package like `"roachpb"` (since it should instead be importing `"github.com/cockroachdb/cockroach/pkg/roachpb"`). Correct this problem *everywhere* and update the `Makefile` to set `paths=source_relative` to tell `protoc` that output files should be placed next to input files. Epic: none Release note: None 97443: kv: configure transaction uncertainty interval for reverse scan r=arulajmani a=nvanbenschoten This commit configures the transaction uncertainty intervals for reverse scans. This was initially missed in 261fc35, which broke the use of observed timestamps for reverse scans. In 0ee3bbd, we started using this new plumbing path for the entire uncertainty interval, so the pessimization became a correctness bug that could lead to a loss of real-time ordering between a write and a reverse scan in cases with moderate but bounded clock skew between nodes. The commit adds testing for this case and the ScanRequest case. I should have exercised these cases back in 8445150 when I noticed there was a complete absence of end-to-end testing for uncertainty interval errors. Unfortunately, that commit only added testing for the GetRequest case, allowing the bug to slip in for ReverseScanRequest. Release note (bug fix): Transaction uncertainty intervals are correctly configured for reverse scans again, ensuring that reverse scans cannot serve stale reads when clocks in a cluster are skewed. Epic: None 97473: ccl/multiregionccl: Skip stress testing flaky secondary region test r=rafiss a=e-mbrown Informs: cockroachdb#92235 Release note: None 97484: release: fetch all tags for pick sha r=celiala a=rail Previously, the pick sha step relies on querying existing tags, but when a release is created on cherry-pick branch (staging-*), we don't have those tags in the local git checkout. This PR explicitly fetches all tags to have the cherry-pick release tags available locally. Fixes: RE-386 Epic: none Release note: None Co-authored-by: Tommy Reilly <[email protected]> Co-authored-by: e-mbrown <[email protected]> Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]> Co-authored-by: Rail Aliiev <[email protected]>
- Loading branch information
Showing
172 changed files
with
1,090 additions
and
234 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
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
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
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
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,159 @@ | ||
// Copyright 2023 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 coldataext | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/cockroachdb/apd/v3" | ||
"github.com/cockroachdb/cockroach/pkg/col/coldata" | ||
"github.com/cockroachdb/cockroach/pkg/col/typeconv" | ||
"github.com/cockroachdb/cockroach/pkg/sql/colexecerror" | ||
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree" | ||
"github.com/cockroachdb/cockroach/pkg/sql/types" | ||
"github.com/cockroachdb/cockroach/pkg/util/duration" | ||
"github.com/cockroachdb/cockroach/pkg/util/encoding" | ||
"github.com/cockroachdb/cockroach/pkg/util/json" | ||
"github.com/cockroachdb/cockroach/pkg/util/timeutil/pgdate" | ||
"github.com/cockroachdb/errors" | ||
) | ||
|
||
// MakeVecHandler makes a tree.ValueHandler that stores values to a coldata.Vec. | ||
func MakeVecHandler(vec coldata.Vec) tree.ValueHandler { | ||
v := vecHandler{nulls: vec.Nulls()} | ||
switch vec.CanonicalTypeFamily() { | ||
case types.BoolFamily: | ||
v.bools = vec.Bool() | ||
case types.BytesFamily: | ||
v.bytes = vec.Bytes() | ||
case types.DecimalFamily: | ||
v.decimals = vec.Decimal() | ||
case types.IntFamily: | ||
v.ints = vec.Int64() | ||
case types.FloatFamily: | ||
v.floats = vec.Float64() | ||
case types.TimestampTZFamily: | ||
v.timestamps = vec.Timestamp() | ||
case types.IntervalFamily: | ||
v.intervals = vec.Interval() | ||
case types.JsonFamily: | ||
v.jsons = vec.JSON() | ||
case typeconv.DatumVecCanonicalTypeFamily: | ||
v.datums = vec.Datum() | ||
default: | ||
colexecerror.InternalError(errors.AssertionFailedf("unhandled type %s", vec.Type())) | ||
} | ||
return &v | ||
} | ||
|
||
type vecHandler struct { | ||
nulls *coldata.Nulls | ||
bools coldata.Bools | ||
bytes *coldata.Bytes | ||
decimals coldata.Decimals | ||
// TODO(cucaroach): implement small int types | ||
//int16s coldata.Int16s | ||
//int32s coldata.Int32s | ||
ints coldata.Int64s | ||
floats coldata.Float64s | ||
timestamps coldata.Times | ||
intervals coldata.Durations | ||
jsons *coldata.JSONs | ||
datums coldata.DatumVec | ||
row int | ||
} | ||
|
||
var _ tree.ValueHandler = (*vecHandler)(nil) | ||
|
||
// Reset is used to re-use a batch handler across batches. | ||
func (v *vecHandler) Reset() { | ||
v.row = 0 | ||
} | ||
|
||
// Len returns the current length of the vector. | ||
func (v *vecHandler) Len() int { | ||
return v.row | ||
} | ||
|
||
// Decimal implements tree.ValueHandler interface. It returns a pointer into the | ||
// vec to allow the decimal to be constructed in place which avoids expensive | ||
// copying and temporary allocations. | ||
func (v *vecHandler) Decimal() *apd.Decimal { | ||
d := &v.decimals[v.row] | ||
v.row++ | ||
return d | ||
} | ||
|
||
// Null implements tree.ValueHandler interface. | ||
func (v *vecHandler) Null() { | ||
v.nulls.SetNull(v.row) | ||
v.row++ | ||
} | ||
|
||
// String is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) String(s string) { | ||
v.bytes.Set(v.row, encoding.UnsafeConvertStringToBytes(s)) | ||
v.row++ | ||
} | ||
|
||
// Date is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Date(d pgdate.Date) { | ||
v.ints[v.row] = d.UnixEpochDaysWithOrig() | ||
v.row++ | ||
} | ||
|
||
// Datum is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Datum(d tree.Datum) { | ||
v.datums.Set(v.row, d) | ||
v.row++ | ||
} | ||
|
||
// Bool is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Bool(b bool) { | ||
v.bools[v.row] = b | ||
v.row++ | ||
} | ||
|
||
// Bytes is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Bytes(b []byte) { | ||
v.bytes.Set(v.row, b) | ||
v.row++ | ||
} | ||
|
||
// Float is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Float(f float64) { | ||
v.floats[v.row] = f | ||
v.row++ | ||
} | ||
|
||
// Int is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Int(i int64) { | ||
v.ints[v.row] = i | ||
v.row++ | ||
} | ||
|
||
// Duration is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) Duration(d duration.Duration) { | ||
v.intervals[v.row] = d | ||
v.row++ | ||
} | ||
|
||
// JSON is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) JSON(j json.JSON) { | ||
v.jsons.Set(v.row, j) | ||
v.row++ | ||
} | ||
|
||
// TimestampTZ is part of the tree.ValueHandler interface. | ||
func (v *vecHandler) TimestampTZ(t time.Time) { | ||
v.timestamps[v.row] = t | ||
v.row++ | ||
} |
Oops, something went wrong.