hash
stringlengths
40
40
date
stringdate
2016-01-09 03:44:20
2025-03-21 23:04:15
author
stringclasses
177 values
commit_message
stringlengths
11
157
is_merge
bool
1 class
masked_commit_message
stringlengths
6
148
type
stringclasses
87 values
git_diff
stringlengths
172
12.1M
75a7aa9d1c89b4987a4c333807a9f58aacfcec26
2021-11-12 01:09:40
Andrei Matei
backupccl: fix data race
false
fix data race
backupccl
diff --git a/pkg/ccl/backupccl/split_and_scatter_processor.go b/pkg/ccl/backupccl/split_and_scatter_processor.go index 3143c6ecdb8f..7f8b73b23b7c 100644 --- a/pkg/ccl/backupccl/split_and_scatter_processor.go +++ b/pkg/ccl/backupccl/split_and_scatter_processor.go @@ -244,14 +244,14 @@ func newSplitAndScatterProcessor( // Start is part of the RowSource interface. func (ssp *splitAndScatterProcessor) Start(ctx context.Context) { ctx = ssp.StartInternal(ctx, splitAndScatterProcessorName) + // Note that the loop over doneScatterCh in Next should prevent the goroutine + // below from leaking when there are no errors. However, if that loop needs to + // exit early, runSplitAndScatter's context will be canceled. + scatterCtx, cancel := context.WithCancel(ctx) + ssp.stopScattering = cancel go func() { - // Note that the loop over doneScatterCh in Next should prevent this - // goroutine from leaking when there are no errors. However, if that loop - // needs to exit early, runSplitAndScatter's context will be canceled. - scatterCtx, stopScattering := context.WithCancel(ctx) - ssp.stopScattering = stopScattering - defer close(ssp.doneScatterCh) + defer cancel() ssp.scatterErr = ssp.runSplitAndScatter(scatterCtx, ssp.flowCtx, &ssp.spec, ssp.scatterer) }() } @@ -310,9 +310,7 @@ func (ssp *splitAndScatterProcessor) ConsumerClosed() { // don't leak goroutines. func (ssp *splitAndScatterProcessor) close() { if ssp.InternalClose() { - if ssp.stopScattering != nil { - ssp.stopScattering() - } + ssp.stopScattering() } }
f2f78e805a2ee77cbded39677fab0e5021c0cbe1
2023-04-15 03:45:02
maryliag
ui: improvements on sort warning
false
improvements on sort warning
ui
diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx index 88c45af1b912..73779a54dde4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx @@ -91,6 +91,7 @@ import { getSortLabel, getSortColumn, getSubsetWarning, + getReqSortColumn, } from "src/util/sqlActivityConstants"; import { SearchCriteria } from "src/searchCriteria/searchCriteria"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; @@ -295,6 +296,17 @@ export class StatementsPage extends React.Component< this.changeSortSetting(ss); }; + onUpdateSortSettingAndApply = (): void => { + this.setState( + { + reqSortSetting: getReqSortColumn(this.props.sortSetting.columnTitle), + }, + () => { + this.updateRequestParams(); + }, + ); + }; + resetPagination = (): void => { this.setState(prevState => { return { @@ -573,6 +585,10 @@ export class StatementsPage extends React.Component< this.props.reqSortSetting, "Statement", ); + const showSortWarning = + !this.isSortSettingSameAsReqSort() && + this.hasReqSortOption() && + data.length == this.props.limit; return ( <> @@ -644,15 +660,15 @@ export class StatementsPage extends React.Component< onRemoveFilter={this.onSubmitFilters} onClearFilters={this.onClearFilters} /> - {!this.isSortSettingSameAsReqSort() && ( + {showSortWarning && ( <InlineAlert intent="warning" title={getSubsetWarning( "statement", this.props.limit, sortSettingLabel, - this.hasReqSortOption(), this.props.sortSetting.columnTitle as StatisticTableColumnKeys, + this.onUpdateSortSettingAndApply, )} className={cx("margin-bottom")} /> diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx index 7ce9a56a0aee..ea929da73992 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx @@ -81,6 +81,7 @@ import { getSortLabel, getSortColumn, getSubsetWarning, + getReqSortColumn, } from "src/util/sqlActivityConstants"; import { SearchCriteria } from "src/searchCriteria/searchCriteria"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; @@ -427,6 +428,17 @@ export class TransactionsPage extends React.Component< this.onChangeSortSetting(ss); }; + onUpdateSortSettingAndApply = (): void => { + this.setState( + { + reqSortSetting: getReqSortColumn(this.props.sortSetting.columnTitle), + }, + () => { + this.updateRequestParams(); + }, + ); + }; + hasReqSortOption = (): boolean => { let found = false; Object.values(SqlStatsSortOptions).forEach((option: SqlStatsSortType) => { @@ -529,6 +541,10 @@ export class TransactionsPage extends React.Component< this.props.reqSortSetting, "Transaction", ); + const showSortWarning = + !this.isSortSettingSameAsReqSort() && + this.hasReqSortOption() && + transactionsToDisplay.length == this.props.limit; return ( <> @@ -600,15 +616,15 @@ export class TransactionsPage extends React.Component< onRemoveFilter={this.onSubmitFilters} onClearFilters={this.onClearFilters} /> - {!this.isSortSettingSameAsReqSort() && ( + {showSortWarning && ( <InlineAlert intent="warning" title={getSubsetWarning( "transaction", this.props.limit, sortSettingLabel, - this.hasReqSortOption(), this.props.sortSetting.columnTitle as StatisticTableColumnKeys, + this.onUpdateSortSettingAndApply, )} className={cx("margin-bottom")} /> diff --git a/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.ts b/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx similarity index 70% rename from pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.ts rename to pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx index 780081aca520..a5cd56764b11 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx @@ -8,12 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import React from "react"; import { duration } from "moment-timezone"; import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; import { getLabel, StatisticTableColumnKeys, } from "../statsTableUtil/statsTableUtil"; +import classNames from "classnames/bind"; +import styles from "src/sqlActivity/sqlActivity.module.scss"; + +const cx = classNames.bind(styles); export const limitOptions = [ { value: 25, label: "25" }, @@ -63,6 +68,25 @@ export function getSortColumn(sort: SqlStatsSortType): string { } } +export function getReqSortColumn(sort: string): SqlStatsSortType { + switch (sort) { + case "time": + return SqlStatsSortOptions.SERVICE_LAT; + case "executionCount": + return SqlStatsSortOptions.EXECUTION_COUNT; + case "cpu": + return SqlStatsSortOptions.CPU_TIME; + case "latencyP99": + return SqlStatsSortOptions.P99_STMTS_ONLY; + case "contention": + return SqlStatsSortOptions.CONTENTION_TIME; + case "workloadPct": + return SqlStatsSortOptions.PCT_RUNTIME; + default: + return SqlStatsSortOptions.SERVICE_LAT; + } +} + export const stmtRequestSortOptions = Object.values(SqlStatsSortOptions) .map(sortVal => ({ value: sortVal as SqlStatsSortType, @@ -96,13 +120,21 @@ export function getSubsetWarning( type: "statement" | "transaction", limit: number, sortLabel: string, - showSuggestion: boolean, columnTitle: StatisticTableColumnKeys, -): string { - const warningSuggestion = showSuggestion - ? `Update the search criteria to see the ${type} fingerprints - sorted on ${getLabel(columnTitle, type)}.` - : ""; - return `You are viewing a subset (Top ${limit}) of fingerprints by ${sortLabel}. - ${warningSuggestion}`; + onUpdateSortSettingAndApply: () => void, +): React.ReactElement { + return ( + <span className={cx("row")}> + {`You are viewing a subset (Top ${limit}) of fingerprints by ${sortLabel}.`} + &nbsp; + <a onClick={onUpdateSortSettingAndApply} className={cx("action")}> + Update the search criteria + </a> + &nbsp; + {`to see the ${type} fingerprints sorted on ${getLabel( + columnTitle, + type, + )}.`} + </span> + ); }
fd5f9b84a8e8165c69702cfc31fec885389cc604
2020-06-30 03:42:57
Andrei Matei
kvclient: modernize a test
false
modernize a test
kvclient
diff --git a/pkg/kv/kvclient/kvcoord/dist_sender_test.go b/pkg/kv/kvclient/kvcoord/dist_sender_test.go index c1b44fa2793d..1f4b1db40f28 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender_test.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender_test.go @@ -624,7 +624,8 @@ func TestRetryOnNotLeaseHolderError(t *testing.T) { func TestBackoffOnNotLeaseHolderErrorDuringTransfer(t *testing.T) { defer leaktest.AfterTest(t)() stopper := stop.NewStopper() - defer stopper.Stop(context.Background()) + ctx := context.Background() + defer stopper.Stop(ctx) clock := hlc.NewClock(hlc.UnixNano, time.Nanosecond) rpcContext := rpc.NewInsecureTestingContext(clock, stopper) @@ -687,20 +688,22 @@ func TestBackoffOnNotLeaseHolderErrorDuringTransfer(t *testing.T) { leaseSequences []roachpb.LeaseSequence expected int64 }{ - {[]roachpb.LeaseSequence{1, 0, 1, 2}, 2}, + {[]roachpb.LeaseSequence{2, 1, 2, 3}, 2}, {[]roachpb.LeaseSequence{0}, 0}, - {[]roachpb.LeaseSequence{1, 0, 1, 2, 1}, 3}, + {[]roachpb.LeaseSequence{2, 1, 2, 3, 2}, 3}, } { - sequences = c.leaseSequences - ds := NewDistSender(cfg) - v := roachpb.MakeValueFromString("value") - put := roachpb.NewPut(roachpb.Key("a"), v) - if _, pErr := kv.SendWrapped(context.Background(), ds, put); !testutils.IsPError(pErr, "boom") { - t.Fatalf("%d: unexpected error: %v", i, pErr) - } - if got := ds.Metrics().InLeaseTransferBackoffs.Count(); got != c.expected { - t.Fatalf("%d: expected %d backoffs, got %d", i, c.expected, got) - } + t.Run("", func(t *testing.T) { + sequences = c.leaseSequences + ds := NewDistSender(cfg) + v := roachpb.MakeValueFromString("value") + put := roachpb.NewPut(roachpb.Key("a"), v) + if _, pErr := kv.SendWrapped(ctx, ds, put); !testutils.IsPError(pErr, "boom") { + t.Fatalf("%d: unexpected error: %v", i, pErr) + } + if got := ds.Metrics().InLeaseTransferBackoffs.Count(); got != c.expected { + t.Fatalf("%d: expected %d backoffs, got %d", i, c.expected, got) + } + }) } }
f0480945ffabafbdf3b2689a7f7570acfd6dcba6
2020-03-06 00:19:28
Nathan VanBenschoten
roachpb: redefine Transaction.IsWriting to IsLocking
false
redefine Transaction.IsWriting to IsLocking
roachpb
diff --git a/pkg/ccl/followerreadsccl/followerreads.go b/pkg/ccl/followerreadsccl/followerreads.go index 24970c1eda58..a5a19c092b23 100644 --- a/pkg/ccl/followerreadsccl/followerreads.go +++ b/pkg/ccl/followerreadsccl/followerreads.go @@ -82,7 +82,11 @@ func batchCanBeEvaluatedOnFollower(ba roachpb.BatchRequest) bool { // txnCanPerformFollowerRead determines if the provided transaction can perform // follower reads. func txnCanPerformFollowerRead(txn *roachpb.Transaction) bool { - return txn != nil && !txn.IsWriting() + // If the request is transactional and that transaction has acquired any + // locks then that request should not perform follower reads. Doing so could + // allow the request to miss its own writes or observe state that conflicts + // with its locks. + return txn != nil && !txn.IsLocking() } // canUseFollowerRead determines if a query can be sent to a follower. diff --git a/pkg/internal/client/txn_test.go b/pkg/internal/client/txn_test.go index e64ad23cb708..4ea39c23ad7d 100644 --- a/pkg/internal/client/txn_test.go +++ b/pkg/internal/client/txn_test.go @@ -57,7 +57,7 @@ func TestTxnSnowballTrace(t *testing.T) { // dump: // 0.105ms 0.000ms event:inside txn // 0.275ms 0.171ms event:client.Txn did AutoCommit. err: <nil> - //txn: "internal/client/txn_test.go:67 TestTxnSnowballTrace" id=<nil> key=/Min rw=false pri=0.00000000 iso=SERIALIZABLE stat=COMMITTED epo=0 ts=0.000000000,0 orig=0.000000000,0 max=0.000000000,0 wto=false rop=false + //txn: "internal/client/txn_test.go:67 TestTxnSnowballTrace" id=<nil> key=/Min lock=false pri=0.00000000 iso=SERIALIZABLE stat=COMMITTED epo=0 ts=0.000000000,0 orig=0.000000000,0 max=0.000000000,0 wto=false rop=false // 0.278ms 0.173ms event:txn complete found, err := regexp.MatchString( // The (?s) makes "." match \n. This makes the test resilient to other log diff --git a/pkg/kv/kvserver/replica_evaluate.go b/pkg/kv/kvserver/replica_evaluate.go index ac4b17380d0a..a43fa4eeca4d 100644 --- a/pkg/kv/kvserver/replica_evaluate.go +++ b/pkg/kv/kvserver/replica_evaluate.go @@ -168,15 +168,13 @@ func evaluateBatch( if baHeader.Txn != nil { baHeader.Txn = baHeader.Txn.Clone() - // Check whether this transaction has been aborted, if applicable. - // This applies to writes that leave intents (the use of the - // IsTransactionWrite flag excludes operations like HeartbeatTxn), - // and reads that occur in a transaction that has already written - // (see #2231 for more about why we check for aborted transactions - // on reads). Note that 1PC transactions have had their - // transaction field cleared by this point so we do not execute - // this check in that case. - if ba.IsTransactionWrite() || baHeader.Txn.IsWriting() { + // Check whether this transaction has been aborted, if applicable. This + // applies to reads and writes once a transaction that has begun to + // acquire locks (see #2231 for more about why we check for aborted + // transactions on reads). Note that 1PC transactions have had their + // transaction field cleared by this point so we do not execute this + // check in that case. + if baHeader.Txn.IsLocking() { // We don't check the abort span for a couple of special requests: // - if the request is asking to abort the transaction, then don't check the // AbortSpan; we don't want the request to be rejected if the transaction diff --git a/pkg/kv/kvserver/replica_follower_read.go b/pkg/kv/kvserver/replica_follower_read.go index b5c6fa66b15e..9311cecb8723 100644 --- a/pkg/kv/kvserver/replica_follower_read.go +++ b/pkg/kv/kvserver/replica_follower_read.go @@ -55,7 +55,7 @@ func (r *Replica) canServeFollowerRead( if lErr, ok := pErr.GetDetail().(*roachpb.NotLeaseHolderError); ok && lErr.LeaseHolder != nil && lErr.Lease.Type() == roachpb.LeaseEpoch && ba.IsAllTransactional() && // followerreadsccl.batchCanBeEvaluatedOnFollower - (ba.Txn == nil || !ba.Txn.IsWriting()) && // followerreadsccl.txnCanPerformFollowerRead + (ba.Txn == nil || !ba.Txn.IsLocking()) && // followerreadsccl.txnCanPerformFollowerRead FollowerReadsEnabled.Get(&r.store.cfg.Settings.SV) { ts := ba.Timestamp diff --git a/pkg/kv/kvserver/txnwait/queue.go b/pkg/kv/kvserver/txnwait/queue.go index 8e997ea50c99..ba5ec7a6bf24 100644 --- a/pkg/kv/kvserver/txnwait/queue.go +++ b/pkg/kv/kvserver/txnwait/queue.go @@ -473,7 +473,7 @@ func (q *Queue) MaybeWaitForPush( var readyCh chan struct{} // signaled when pusher txn should be queried // Query the pusher if it's a valid read-write transaction. - if req.PusherTxn.ID != uuid.Nil && req.PusherTxn.IsWriting() { + if req.PusherTxn.ID != uuid.Nil && req.PusherTxn.IsLocking() { // Create a context which will be canceled once this call completes. // This ensures that the goroutine created to query the pusher txn // is properly cleaned up. diff --git a/pkg/roachpb/data.go b/pkg/roachpb/data.go index 5bbe73ab6aac..79e2e188ea42 100644 --- a/pkg/roachpb/data.go +++ b/pkg/roachpb/data.go @@ -1077,9 +1077,9 @@ func (t *Transaction) UpgradePriority(minPriority enginepb.TxnPriority) { } } -// IsWriting returns whether the transaction has begun writing intents. -// This method will never return true for a read-only transaction. -func (t *Transaction) IsWriting() bool { +// IsLocking returns whether the transaction has begun acquiring locks. +// This method will never return false for a writing transaction. +func (t *Transaction) IsLocking() bool { return t.Key != nil } @@ -1091,8 +1091,8 @@ func (t Transaction) String() string { if len(t.Name) > 0 { fmt.Fprintf(&buf, "%q ", t.Name) } - fmt.Fprintf(&buf, "meta={%s} rw=%t stat=%s rts=%s wto=%t max=%s", - t.TxnMeta, t.IsWriting(), t.Status, t.ReadTimestamp, t.WriteTooOld, t.MaxTimestamp) + fmt.Fprintf(&buf, "meta={%s} lock=%t stat=%s rts=%s wto=%t max=%s", + t.TxnMeta, t.IsLocking(), t.Status, t.ReadTimestamp, t.WriteTooOld, t.MaxTimestamp) if ni := len(t.IntentSpans); t.Status != PENDING && ni > 0 { fmt.Fprintf(&buf, " int=%d", ni) } @@ -1114,8 +1114,8 @@ func (t Transaction) SafeMessage() string { if len(t.Name) > 0 { fmt.Fprintf(&buf, "%q ", t.Name) } - fmt.Fprintf(&buf, "meta={%s} rw=%t stat=%s rts=%s wto=%t max=%s", - t.TxnMeta.SafeMessage(), t.IsWriting(), t.Status, t.ReadTimestamp, t.WriteTooOld, t.MaxTimestamp) + fmt.Fprintf(&buf, "meta={%s} lock=%t stat=%s rts=%s wto=%t max=%s", + t.TxnMeta.SafeMessage(), t.IsLocking(), t.Status, t.ReadTimestamp, t.WriteTooOld, t.MaxTimestamp) if ni := len(t.IntentSpans); t.Status != PENDING && ni > 0 { fmt.Fprintf(&buf, " int=%d", ni) } diff --git a/pkg/roachpb/string_test.go b/pkg/roachpb/string_test.go index 6bbaab66c769..113a17363ac5 100644 --- a/pkg/roachpb/string_test.go +++ b/pkg/roachpb/string_test.go @@ -44,7 +44,7 @@ func TestTransactionString(t *testing.T) { MaxTimestamp: hlc.Timestamp{WallTime: 40, Logical: 41}, } expStr := `"name" meta={id=d7aa0f5e key="foo" pri=44.58039917 epo=2 ts=0.000000020,21 min=0.000000010,11 seq=15}` + - ` rw=true stat=COMMITTED rts=0.000000030,31 wto=false max=0.000000040,41` + ` lock=true stat=COMMITTED rts=0.000000030,31 wto=false max=0.000000040,41` if str := txn.String(); str != expStr { t.Errorf( diff --git a/pkg/storage/testdata/mvcc_histories/clear_range b/pkg/storage/testdata/mvcc_histories/clear_range index a15d11531f1e..0361c68debc9 100644 --- a/pkg/storage/testdata/mvcc_histories/clear_range +++ b/pkg/storage/testdata/mvcc_histories/clear_range @@ -11,7 +11,7 @@ with t=A v=abc resolve put k=c ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000044,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000044,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000044,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000044,0 wto=false max=0,0 data: "a"/0.000000044,0 -> /BYTES/abc data: "a/123"/0.000000044,0 -> /BYTES/abc data: "b"/0.000000044,0 -> /BYTES/abc diff --git a/pkg/storage/testdata/mvcc_histories/conditional_put_with_txn b/pkg/storage/testdata/mvcc_histories/conditional_put_with_txn index da1c1e374cd4..52692f88fc27 100644 --- a/pkg/storage/testdata/mvcc_histories/conditional_put_with_txn +++ b/pkg/storage/testdata/mvcc_histories/conditional_put_with_txn @@ -2,7 +2,7 @@ run ok txn_begin t=A ts=123 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 # Write value1. @@ -12,7 +12,7 @@ with t=A cput k=k v=v ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=1} ts=0.000000123,0 del=false klen=12 vlen=6 data: "k"/0.000000123,0 -> /BYTES/v @@ -25,7 +25,7 @@ with t=A cput k=k v=v2 cond=v ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=2} rw=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=2} lock=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000123,0 min=0,0 seq=2} ts=0.000000123,0 del=false klen=12 vlen=7 ih={{1 /BYTES/v}} data: "k"/0.000000123,0 -> /BYTES/v2 @@ -38,7 +38,7 @@ with t=A cput k=k v=v3 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000123,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000123,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000123,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000123,0 min=0,0 seq=1} ts=0.000000123,0 del=false klen=12 vlen=7 data: "k"/0.000000123,0 -> /BYTES/v3 @@ -86,7 +86,7 @@ with t=A cput k=c v=cput cond=value ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 meta: "c"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=1} ts=0.000000002,0 del=false klen=12 vlen=9 data: "c"/0.000000002,0 -> /BYTES/cput data: "c"/0.000000001,0 -> /BYTES/value @@ -100,9 +100,9 @@ with t=A cput k=c v=cput cond=value ---- >> txn_restart ts=3 t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000003,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000003,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000003,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000003,0 wto=false max=0,0 >> txn_step t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000003,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000003,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000003,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000003,0 wto=false max=0,0 >> cput k=c v=cput cond=value t=A meta: "c"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000003,0 min=0,0 seq=1} ts=0.000000003,0 del=false klen=12 vlen=9 data: "c"/0.000000003,0 -> /BYTES/cput diff --git a/pkg/storage/testdata/mvcc_histories/conditional_put_write_too_old b/pkg/storage/testdata/mvcc_histories/conditional_put_write_too_old index 0a412d246979..9290189c79e8 100644 --- a/pkg/storage/testdata/mvcc_histories/conditional_put_write_too_old +++ b/pkg/storage/testdata/mvcc_histories/conditional_put_write_too_old @@ -34,7 +34,7 @@ with t=a cput k=k v=v2 cond=v1 ---- >> at end: -txn: "a" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "a" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 data: "k"/0.000000010,1 -> /BYTES/v2 data: "k"/0.000000010,0 -> /BYTES/v1 error: (*roachpb.ConditionFailedError:) unexpected value: <nil> diff --git a/pkg/storage/testdata/mvcc_histories/empty_key b/pkg/storage/testdata/mvcc_histories/empty_key index 08a7960ffe49..6234ffbcb037 100644 --- a/pkg/storage/testdata/mvcc_histories/empty_key +++ b/pkg/storage/testdata/mvcc_histories/empty_key @@ -28,6 +28,6 @@ txn_begin t=A resolve_intent t=A k= ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0,0 min=0,0 seq=0} rw=true stat=PENDING rts=0,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0,0 min=0,0 seq=0} lock=true stat=PENDING rts=0,0 wto=false max=0,0 <no data> error: (*errors.fundamental:) attempted access to empty key diff --git a/pkg/storage/testdata/mvcc_histories/idempotent_transactions b/pkg/storage/testdata/mvcc_histories/idempotent_transactions index 79fb3852553a..e06252bd9e5c 100644 --- a/pkg/storage/testdata/mvcc_histories/idempotent_transactions +++ b/pkg/storage/testdata/mvcc_histories/idempotent_transactions @@ -7,7 +7,7 @@ with t=a k=a put v=first ---- >> at end: -txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} ts=0.000000011,0 del=false klen=12 vlen=10 data: "a"/0.000000011,0 -> /BYTES/first @@ -36,7 +36,7 @@ with t=a k=a ---- meta: "a" -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} ts=0.000000011,0 del=false klen=12 vlen=11 ih={{0 /BYTES/first}} >> at end: -txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} ts=0.000000011,0 del=false klen=12 vlen=11 ih={{0 /BYTES/first}} data: "a"/0.000000011,0 -> /BYTES/second @@ -47,7 +47,7 @@ with t=a k=a put v=second ---- >> at end: -txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=-1} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=-1} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} ts=0.000000011,0 del=false klen=12 vlen=11 ih={{0 /BYTES/first}} data: "a"/0.000000011,0 -> /BYTES/second error: (*withstack.withStack:) transaction 00000000-0000-0000-0000-000000000001 with sequence 1 missing an intent with lower sequence -1 @@ -67,7 +67,7 @@ inc: current value = 1 inc: current value = 1 inc: current value = 1 >> at end: -txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=2} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=2} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} ts=0.000000011,0 del=false klen=12 vlen=11 ih={{0 /BYTES/first}} data: "a"/0.000000011,0 -> /BYTES/second meta: "i"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=2} ts=0.000000011,0 del=false klen=12 vlen=6 @@ -89,7 +89,7 @@ inc: current value = 1 inc: current value = 1 inc: current value = 1 >> at end: -txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=2} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "a" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=2} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=1} ts=0.000000011,0 del=false klen=12 vlen=11 ih={{0 /BYTES/first}} data: "a"/0.000000011,0 -> /BYTES/second meta: "i"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=3} ts=0.000000011,0 del=false klen=12 vlen=6 ih={{2 /INT/1}} diff --git a/pkg/storage/testdata/mvcc_histories/ignored_seq_nums b/pkg/storage/testdata/mvcc_histories/ignored_seq_nums index 6e9699ad8144..07090a6e39e5 100644 --- a/pkg/storage/testdata/mvcc_histories/ignored_seq_nums +++ b/pkg/storage/testdata/mvcc_histories/ignored_seq_nums @@ -16,7 +16,7 @@ with t=A txn_step seq=40 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=30} ts=0.000000011,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} data: "k"/0.000000011,0 -> /BYTES/c meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 @@ -46,7 +46,7 @@ get: "k" -> /BYTES/b @0,0 get: "k" -> /BYTES/b @0,0 get: "k" -> /BYTES/b @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # Mask a write in the middle. @@ -62,7 +62,7 @@ scan: "k/10" -> /BYTES/10 @0.000000011,0 scan: "k/30" -> /BYTES/30 @0.000000011,0 get: "k" -> /BYTES/c @0.000000011,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # Mask all the writes. @@ -76,7 +76,7 @@ with t=A scan: "k"-"l" -> <no data> get: "k" -> <no data> >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # Disjoint masks. @@ -91,7 +91,7 @@ scan: "k" -> /BYTES/b @0,0 scan: "k/20" -> /BYTES/20 @0.000000011,0 get: "k" -> /BYTES/b @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=2 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=2 # A historical read before the ignored range should retrieve the # historical value visible at that point. @@ -107,7 +107,7 @@ scan: "k" -> /BYTES/a @0,0 scan: "k/10" -> /BYTES/10 @0.000000011,0 get: "k" -> /BYTES/a @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=12} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=12} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # A historical read with an ignored range before it should hide # the historical value hidden at that point. @@ -123,7 +123,7 @@ scan: "k" -> /BYTES/b @0,0 scan: "k/20" -> /BYTES/20 @0.000000011,0 get: "k" -> /BYTES/b @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=22} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=22} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # A historical read with an ignored range that overlaps should hide # the historical value hidden at that point. @@ -140,7 +140,7 @@ scan: "k/10" -> /BYTES/10 @0.000000011,0 scan: "k/20" -> /BYTES/20 @0.000000011,0 get: "k" -> /BYTES/b @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=32} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=32} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # Do an intent push by advancing the transaction timestamp, while also having # a range of ignored seqnums. This should permanently delete the value at seqnum @@ -164,7 +164,7 @@ get: "k" -> /BYTES/b @0,0 meta: "k" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} ts=0.000000014,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} get: "k" -> /BYTES/b @0.000000014,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000014,0 min=0,0 seq=32} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000014,0 min=0,0 seq=32} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} ts=0.000000014,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 @@ -189,7 +189,7 @@ scan: "k/10" -> /BYTES/10 @0.000000011,0 scan: "k/30" -> /BYTES/30 @0.000000011,0 get: "k" -> /BYTES/a @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000014,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000014,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 run ok with t=A @@ -211,7 +211,7 @@ scan: "k/10" -> /BYTES/10 @0.000000011,0 scan: "k/20" -> /BYTES/20 @0.000000011,0 get: "k" -> /BYTES/b @0.000000014,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000014,0 min=0,0 seq=25} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000014,0 min=0,0 seq=25} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 # Call mvccResolveWriteIntent with status=COMMITTED. This should fold the # intent while leaving the value unmodified. @@ -228,7 +228,7 @@ with t=B meta: "k" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} ts=0.000000014,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} get: "k" -> /BYTES/b @0.000000014,0 >> at end: -txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000020,0 wto=false max=0,0 +txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000020,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -254,7 +254,7 @@ with t=B meta: "l" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=30} ts=0.000000020,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} get: "l" -> /BYTES/c @0.000000020,0 >> at end: -txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000020,0 wto=false max=0,0 +txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000020,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -281,7 +281,7 @@ with t=B meta: "l" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=30} ts=0.000000020,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} get: "l" -> <no data> >> at end: -txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=35} rw=true stat=PENDING rts=0.000000020,0 wto=false max=0,0 isn=1 +txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000020,0 min=0,0 seq=35} lock=true stat=PENDING rts=0.000000020,0 wto=false max=0,0 isn=1 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -299,7 +299,7 @@ with t=C ---- get: "l" -> <no data> >> at end: -txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000030,0 wto=false max=0,0 +txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000030,0 wto=false max=0,0 # Put some values, then ignore all except the first, then do a commit. The @@ -319,7 +319,7 @@ with t=C meta: "m" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=30} ts=0.000000030,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} get: "m" -> /BYTES/c @0.000000030,0 >> at end: -txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000030,0 wto=false max=0,0 +txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000030,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -341,7 +341,7 @@ with t=C meta: "m" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=30} ts=0.000000030,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} get: "m" -> /BYTES/a @0,0 >> at end: -txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000030,0 wto=false max=0,0 isn=1 +txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000030,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000030,0 wto=false max=0,0 isn=1 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -369,7 +369,7 @@ get: "m" -> /BYTES/a @0.000000030,0 meta: "n" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000040,0 min=0,0 seq=30} ts=0.000000040,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} get: "n" -> /BYTES/c @0.000000040,0 >> at end: -txn: "D" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000040,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000040,0 wto=false max=0,0 +txn: "D" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000040,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000040,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -397,7 +397,7 @@ get: "n" -> /BYTES/c @0.000000040,0 meta: "n" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000040,0 min=0,0 seq=30} ts=0.000000045,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} get: "n" -> /BYTES/c @0.000000045,0 >> at end: -txn: "D" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000045,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000040,0 wto=false max=0,0 +txn: "D" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000045,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000040,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -425,7 +425,7 @@ meta: "n" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000040,0 min get: "n" -> /BYTES/c @0.000000045,0 get: "n" -> /BYTES/c @0.000000045,0 >> at end: -txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 +txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -457,7 +457,7 @@ with t=E get: "n" -> /BYTES/c @0.000000045,0 get: "o" -> <no data> >> at end: -txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 +txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -484,7 +484,7 @@ with t=E get: "n" -> /BYTES/c @0.000000045,0 get: "o" -> <no data> >> at end: -txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 isn=1 +txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 isn=1 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -532,7 +532,7 @@ with t=E ---- meta: "o" -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} ts=0.000000050,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} >> at end: -txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 isn=1 +txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000050,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 isn=1 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 @@ -555,7 +555,7 @@ with t=E ---- get: "o" -> <no data> >> at end: -txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000055,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 isn=1 +txn: "E" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000055,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000050,0 wto=false max=0,0 isn=1 data: "k"/0.000000014,0 -> /BYTES/b meta: "k/10"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=7 data: "k/10"/0.000000011,0 -> /BYTES/10 diff --git a/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_commit b/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_commit index 0578acad2861..9a0812615e63 100644 --- a/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_commit +++ b/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_commit @@ -23,7 +23,7 @@ with t=A resolve_intent k=k/30 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 data: "k"/0.000000011,0 -> /BYTES/b data: "k/10"/0.000000011,0 -> /BYTES/10 data: "k/20"/0.000000011,0 -> /BYTES/20 @@ -64,7 +64,7 @@ with t=A resolve_intent k=k/30 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 data: "k"/0.000000011,0 -> /BYTES/c data: "k/10"/0.000000011,0 -> /BYTES/10 data: "k/30"/0.000000011,0 -> /BYTES/30 diff --git a/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_cput b/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_cput index 6c72c25761a3..78a879dddd91 100644 --- a/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_cput +++ b/pkg/storage/testdata/mvcc_histories/ignored_seq_nums_cput @@ -18,7 +18,7 @@ with t=A txn_step seq=20 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=10} ts=0.000000011,0 del=false klen=12 vlen=6 data: "k"/0.000000011,0 -> /BYTES/a data: "k"/0.000000001,0 -> /BYTES/first @@ -64,7 +64,7 @@ with t=B txn_step seq=30 ---- >> at end: -txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} ts=0.000000011,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} data: "k"/0.000000011,0 -> /BYTES/b data: "k"/0.000000001,0 -> /BYTES/first @@ -112,7 +112,7 @@ with t=C txn_step seq=40 ---- >> at end: -txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "C" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=30} ts=0.000000011,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}{20 /BYTES/b}} data: "k"/0.000000011,0 -> /BYTES/c data: "k"/0.000000001,0 -> /BYTES/first @@ -168,7 +168,7 @@ with t=D txn_step seq=30 ---- >> at end: -txn: "D" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=30} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 +txn: "D" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=30} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 isn=1 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=20} ts=0.000000011,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} data: "k"/0.000000011,0 -> /BYTES/b data: "k"/0.000000001,0 -> /BYTES/first diff --git a/pkg/storage/testdata/mvcc_histories/increment b/pkg/storage/testdata/mvcc_histories/increment index fbef37446b6a..204e18000981 100644 --- a/pkg/storage/testdata/mvcc_histories/increment +++ b/pkg/storage/testdata/mvcc_histories/increment @@ -34,7 +34,7 @@ with k=k t=a ts=0,1 inc: current value = 1 inc: current value = 2 >> at end: -txn: "a" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=2} rw=true stat=PENDING rts=0,1 wto=false max=0,0 +txn: "a" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=2} lock=true stat=PENDING rts=0,1 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=2} ts=0,1 del=false klen=12 vlen=6 ih={{1 /INT/1}} data: "k"/0,1 -> /INT/2 @@ -72,7 +72,7 @@ with t=r increment k=r ---- >> at end: -txn: "r" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 +txn: "r" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=2} ts=0,1 del=false klen=12 vlen=6 ih={{1 /INT/1}} data: "k"/0,1 -> /INT/2 meta: "r"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=0} ts=0.000000003,2 del=false klen=12 vlen=6 diff --git a/pkg/storage/testdata/mvcc_histories/intent_history b/pkg/storage/testdata/mvcc_histories/intent_history index 6e3b6f427ae0..a84d51379ba0 100644 --- a/pkg/storage/testdata/mvcc_histories/intent_history +++ b/pkg/storage/testdata/mvcc_histories/intent_history @@ -25,25 +25,25 @@ with t=A resolve_intent ---- >> txn_begin ts=2 t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 >> put v=first k=a t=A meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=0} ts=0.000000002,0 del=false klen=12 vlen=10 data: "a"/0.000000002,0 -> /BYTES/first data: "a"/0.000000001,0 -> /BYTES/default >> txn_step k=a t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 >> put v=second k=a t=A meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=1} ts=0.000000002,0 del=false klen=12 vlen=11 ih={{0 /BYTES/first}} data: "a"/0.000000002,0 -> /BYTES/second data: "a"/0.000000001,0 -> /BYTES/default >> txn_step n=2 k=a t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=3} rw=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=3} lock=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 >> del k=a t=A meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=3} ts=0.000000002,0 del=true klen=12 vlen=0 ih={{0 /BYTES/first}{1 /BYTES/second}} data: "a"/0.000000002,0 -> /<empty> data: "a"/0.000000001,0 -> /BYTES/default >> txn_step n=6 k=a t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=9} rw=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=9} lock=true stat=PENDING rts=0.000000002,0 wto=false max=0,0 >> put v=first k=a t=A meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,0 min=0,0 seq=9} ts=0.000000002,0 del=false klen=12 vlen=10 ih={{0 /BYTES/first}{1 /BYTES/second}{3 /<empty>}} data: "a"/0.000000002,0 -> /BYTES/first diff --git a/pkg/storage/testdata/mvcc_histories/merges b/pkg/storage/testdata/mvcc_histories/merges index 2c6bdb8876ba..b712bb4db25a 100644 --- a/pkg/storage/testdata/mvcc_histories/merges +++ b/pkg/storage/testdata/mvcc_histories/merges @@ -36,4 +36,4 @@ with t=A ---- get: "a" -> /BYTES/defghi @0,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000033,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000033,0 wto=false max=0,0 diff --git a/pkg/storage/testdata/mvcc_histories/no_read_after_abort b/pkg/storage/testdata/mvcc_histories/no_read_after_abort index fbfab0a3f448..dd95f9652598 100644 --- a/pkg/storage/testdata/mvcc_histories/no_read_after_abort +++ b/pkg/storage/testdata/mvcc_histories/no_read_after_abort @@ -8,7 +8,7 @@ with t=A k=a txn_remove ---- >> txn_begin ts=22 t=A k=a -txn: "A" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000022,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000022,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000022,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000022,0 wto=false max=0,0 >> put v=cde t=A k=a meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000022,0 min=0,0 seq=0} ts=0.000000022,0 del=false klen=12 vlen=8 data: "a"/0.000000022,0 -> /BYTES/cde diff --git a/pkg/storage/testdata/mvcc_histories/put_after_rollback b/pkg/storage/testdata/mvcc_histories/put_after_rollback index 340274cd7936..c77653f25516 100644 --- a/pkg/storage/testdata/mvcc_histories/put_after_rollback +++ b/pkg/storage/testdata/mvcc_histories/put_after_rollback @@ -13,7 +13,7 @@ with t=A k=k2 get: "k2" -> /BYTES/b @0.000000001,0 get: "k2" -> <no data> >> at end: -txn: "A" meta={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=20} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=20} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 isn=1 meta: "k2"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=20} ts=0.000000001,0 del=false klen=12 vlen=6 data: "k2"/0.000000001,0 -> /BYTES/b @@ -26,7 +26,7 @@ with t=A k=k3 del ---- >> at end: -txn: "A" meta={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 isn=1 meta: "k2"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=20} ts=0.000000001,0 del=false klen=12 vlen=6 data: "k2"/0.000000001,0 -> /BYTES/b meta: "k3"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=40} ts=0.000000001,0 del=true klen=12 vlen=0 @@ -43,7 +43,7 @@ with t=A k=k4 cput v=c ---- >> at end: -txn: "A" meta={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=60} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 isn=1 +txn: "A" meta={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=60} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 isn=1 meta: "k2"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=20} ts=0.000000001,0 del=false klen=12 vlen=6 data: "k2"/0.000000001,0 -> /BYTES/b meta: "k3"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=40} ts=0.000000001,0 del=true klen=12 vlen=0 @@ -72,7 +72,7 @@ with t=B k=k5 meta: "k5" -> txn={id=00000000 key="k5" pri=0.00000000 epo=0 ts=0.000000005,0 min=0,0 seq=30} ts=0.000000005,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} meta: "k5" -> txn={id=00000000 key="k5" pri=0.00000000 epo=0 ts=0.000000005,0 min=0,0 seq=40} ts=0.000000005,0 del=false klen=12 vlen=6 ih={{10 /BYTES/a}} >> at end: -txn: "B" meta={id=00000000 key="k5" pri=0.00000000 epo=0 ts=0.000000005,0 min=0,0 seq=40} rw=true stat=PENDING rts=0.000000005,0 wto=false max=0,0 isn=1 +txn: "B" meta={id=00000000 key="k5" pri=0.00000000 epo=0 ts=0.000000005,0 min=0,0 seq=40} lock=true stat=PENDING rts=0.000000005,0 wto=false max=0,0 isn=1 meta: "k2"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=20} ts=0.000000001,0 del=false klen=12 vlen=6 data: "k2"/0.000000001,0 -> /BYTES/b meta: "k3"/0,0 -> txn={id=00000000 key="k2" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=40} ts=0.000000001,0 del=true klen=12 vlen=0 diff --git a/pkg/storage/testdata/mvcc_histories/put_new_epoch_lower_sequence b/pkg/storage/testdata/mvcc_histories/put_new_epoch_lower_sequence index c44b4726797a..a60056f1646d 100644 --- a/pkg/storage/testdata/mvcc_histories/put_new_epoch_lower_sequence +++ b/pkg/storage/testdata/mvcc_histories/put_new_epoch_lower_sequence @@ -21,7 +21,7 @@ with t=A ---- get: "k" -> /BYTES/v @0.000000001,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=5} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=5} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=5} ts=0.000000001,0 del=false klen=12 vlen=6 data: "k"/0.000000001,0 -> /BYTES/v @@ -31,7 +31,7 @@ with t=A txn_step n=4 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000001,0 min=0,0 seq=4} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=1 ts=0.000000001,0 min=0,0 seq=4} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 # We're operating at a higher epoch but a lower seqnum. diff --git a/pkg/storage/testdata/mvcc_histories/put_out_of_order b/pkg/storage/testdata/mvcc_histories/put_out_of_order index e253926b6b31..90d89c579874 100644 --- a/pkg/storage/testdata/mvcc_histories/put_out_of_order +++ b/pkg/storage/testdata/mvcc_histories/put_out_of_order @@ -8,7 +8,7 @@ with t=A put ts=1 k=k v=v ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,1 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,1 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000002,1 min=0,0 seq=0} ts=0.000000002,1 del=false klen=12 vlen=6 data: "k"/0.000000002,1 -> /BYTES/v @@ -20,7 +20,7 @@ with t=A put ts=1 k=k v=v2 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} ts=0.000000002,1 del=false klen=12 vlen=7 ih={{0 /BYTES/v}} data: "k"/0.000000002,1 -> /BYTES/v2 @@ -40,7 +40,7 @@ with t=A put ts=1 k=k v=v2 ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} ts=0.000000002,1 del=false klen=12 vlen=7 ih={{0 /BYTES/v}{1 /BYTES/v2}} data: "k"/0.000000002,1 -> /BYTES/v2 diff --git a/pkg/storage/testdata/mvcc_histories/put_with_txn b/pkg/storage/testdata/mvcc_histories/put_with_txn index 7f953fd7708b..12d19a60a08d 100644 --- a/pkg/storage/testdata/mvcc_histories/put_with_txn +++ b/pkg/storage/testdata/mvcc_histories/put_with_txn @@ -10,6 +10,6 @@ get: "k" -> /BYTES/v @0,1 get: "k" -> /BYTES/v @0,1 get: "k" -> /BYTES/v @0,1 >> at end: -txn: "A" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=0} rw=true stat=PENDING rts=0,1 wto=false max=0,0 +txn: "A" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=0} lock=true stat=PENDING rts=0,1 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=0} ts=0,1 del=false klen=12 vlen=6 data: "k"/0,1 -> /BYTES/v diff --git a/pkg/storage/testdata/mvcc_histories/read_after_write b/pkg/storage/testdata/mvcc_histories/read_after_write index bcb215a60583..0d1511cc118f 100644 --- a/pkg/storage/testdata/mvcc_histories/read_after_write +++ b/pkg/storage/testdata/mvcc_histories/read_after_write @@ -9,7 +9,7 @@ with t=A resolve_intent ---- >> txn_begin ts=11 t=A -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 >> put v=abc k=a t=A meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} ts=0.000000011,0 del=false klen=12 vlen=8 data: "a"/0.000000011,0 -> /BYTES/abc @@ -42,7 +42,7 @@ with t=A ---- get: "a" -> /BYTES/abc @0.000000011,0 >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000011,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000011,0 wto=false max=0,0 run trace ok with t=A @@ -85,5 +85,5 @@ with t=A k=a txn_remove ---- >> txn_begin ts=1 t=A k=a -txn: "A" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key="a" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 >> txn_remove t=A k=a diff --git a/pkg/storage/testdata/mvcc_histories/read_fail_on_more_recent b/pkg/storage/testdata/mvcc_histories/read_fail_on_more_recent index 2a7b73bb956d..cb928d53d243 100644 --- a/pkg/storage/testdata/mvcc_histories/read_fail_on_more_recent +++ b/pkg/storage/testdata/mvcc_histories/read_fail_on_more_recent @@ -14,7 +14,7 @@ with t=A put k=k2 v=v ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000010,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000010,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000010,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000010,0 wto=false max=0,0 data: "k1"/0.000000010,0 -> /BYTES/v meta: "k2"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000010,0 min=0,0 seq=0} ts=0.000000010,0 del=false klen=12 vlen=6 data: "k2"/0.000000010,0 -> /BYTES/v diff --git a/pkg/storage/testdata/mvcc_histories/update_existing_key_diff_txn b/pkg/storage/testdata/mvcc_histories/update_existing_key_diff_txn index 3d54be2bb6be..6602b8c01929 100644 --- a/pkg/storage/testdata/mvcc_histories/update_existing_key_diff_txn +++ b/pkg/storage/testdata/mvcc_histories/update_existing_key_diff_txn @@ -10,7 +10,7 @@ with t=B put k=a v=zzz ---- >> at end: -txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000044,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000044,0 wto=false max=0,0 +txn: "B" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000044,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000044,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} ts=0.000000033,0 del=false klen=12 vlen=8 data: "a"/0.000000033,0 -> /BYTES/xyz error: (*roachpb.WriteIntentError:) conflicting intents on "a" diff --git a/pkg/storage/testdata/mvcc_histories/update_existing_key_in_txn b/pkg/storage/testdata/mvcc_histories/update_existing_key_in_txn index b7788040f75c..6a2b03ce7e7f 100644 --- a/pkg/storage/testdata/mvcc_histories/update_existing_key_in_txn +++ b/pkg/storage/testdata/mvcc_histories/update_existing_key_in_txn @@ -4,7 +4,7 @@ with t=A put k=k v=v ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=0} rw=true stat=PENDING rts=0,1 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=0} lock=true stat=PENDING rts=0,1 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0,1 min=0,0 seq=0} ts=0,1 del=false klen=12 vlen=6 data: "k"/0,1 -> /BYTES/v @@ -18,6 +18,6 @@ with t=A put k=k v=v ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} rw=true stat=PENDING rts=0,1 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} lock=true stat=PENDING rts=0,1 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} ts=0.000000001,0 del=false klen=12 vlen=6 ih={{0 /BYTES/v}} data: "k"/0.000000001,0 -> /BYTES/v diff --git a/pkg/storage/testdata/mvcc_histories/write_too_old b/pkg/storage/testdata/mvcc_histories/write_too_old index d7c158ae6673..8f67988eaa24 100644 --- a/pkg/storage/testdata/mvcc_histories/write_too_old +++ b/pkg/storage/testdata/mvcc_histories/write_too_old @@ -20,7 +20,7 @@ with t=A del k=a ---- >> at end: -txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} rw=true stat=PENDING rts=0.000000033,0 wto=false max=0,0 +txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000033,0 wto=false max=0,0 meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} ts=0.000000044,1 del=true klen=12 vlen=0 data: "a"/0.000000044,1 -> /<empty> data: "a"/0.000000044,0 -> /BYTES/abc diff --git a/pkg/storage/testdata/mvcc_histories/write_with_sequence b/pkg/storage/testdata/mvcc_histories/write_with_sequence index a636d4517a1f..4e1027a08046 100644 --- a/pkg/storage/testdata/mvcc_histories/write_with_sequence +++ b/pkg/storage/testdata/mvcc_histories/write_with_sequence @@ -17,7 +17,7 @@ with t=t k=k ---- put: batch after write is empty >> at end: -txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=1} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} ts=0.000000001,0 del=false klen=12 vlen=7 ih={{2 /BYTES/v1}} data: "k"/0.000000001,0 -> /BYTES/v2 error: (*withstack.withStack:) transaction 00000000-0000-0000-0000-000000000001 with sequence 3 missing an intent with lower sequence 1 @@ -43,7 +43,7 @@ with t=t k=k ---- put: batch after write is empty >> at end: -txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} ts=0.000000001,0 del=false klen=12 vlen=7 ih={{2 /BYTES/v1}} data: "k"/0.000000001,0 -> /BYTES/v2 @@ -68,7 +68,7 @@ with t=t k=k ---- put: batch after write is empty >> at end: -txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=2} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} ts=0.000000001,0 del=false klen=12 vlen=7 ih={{2 /BYTES/v1}} data: "k"/0.000000001,0 -> /BYTES/v2 error: (*withstack.withStack:) transaction 00000000-0000-0000-0000-000000000003 with sequence 2 has a different value [0 0 0 0 3 118 50] after recomputing from what was written: [0 0 0 0 3 118 49] @@ -94,7 +94,7 @@ with t=t k=k ---- put: batch after write is empty >> at end: -txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} ts=0.000000001,0 del=false klen=12 vlen=7 ih={{2 /BYTES/v1}} data: "k"/0.000000001,0 -> /BYTES/v2 @@ -119,7 +119,7 @@ with t=t k=k ---- put: batch after write is empty >> at end: -txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=3} ts=0.000000001,0 del=false klen=12 vlen=7 ih={{2 /BYTES/v1}} data: "k"/0.000000001,0 -> /BYTES/v2 error: (*withstack.withStack:) transaction 00000000-0000-0000-0000-000000000005 with sequence 3 has a different value [0 0 0 0 3 118 51] after recomputing from what was written: [0 0 0 0 3 118 50] @@ -147,7 +147,7 @@ with t=t k=k ---- put: batch after write is non-empty >> at end: -txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=4} rw=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 +txn: "t" meta={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=4} lock=true stat=PENDING rts=0.000000001,0 wto=false max=0,0 meta: "k"/0,0 -> txn={id=00000000 key="k" pri=0.00000000 epo=0 ts=0.000000001,0 min=0,0 seq=4} ts=0.000000001,0 del=false klen=12 vlen=7 ih={{2 /BYTES/v1}{3 /BYTES/v2}} data: "k"/0.000000001,0 -> /BYTES/v4
0bc0947fcf41dd5498ce9df7bd60a41b8c015962
2022-01-05 04:05:40
Azhng
sql: deflake TestScheduledSQLStatsCompaction
false
deflake TestScheduledSQLStatsCompaction
sql
diff --git a/pkg/sql/sqlstats/persistedsqlstats/scheduled_sql_stats_compaction_test.go b/pkg/sql/sqlstats/persistedsqlstats/scheduled_sql_stats_compaction_test.go index 8a9dab045e4e..2d4497698fbf 100644 --- a/pkg/sql/sqlstats/persistedsqlstats/scheduled_sql_stats_compaction_test.go +++ b/pkg/sql/sqlstats/persistedsqlstats/scheduled_sql_stats_compaction_test.go @@ -155,11 +155,11 @@ func TestScheduledSQLStatsCompaction(t *testing.T) { schedule = getSQLStatsCompactionSchedule(t, helper) require.Equal(t, string(jobs.StatusSucceeded), schedule.ScheduleStatus()) - stmtStatsCnt, txnStatsCnt = getPersistedStatsEntry(t, helper.sqlDB) - require.Equal(t, 1 /* expected */, stmtStatsCnt, - "expecting exactly 1 persisted stmt fingerprints, but found: %d", stmtStatsCnt) - require.Equal(t, 1 /* expected */, txnStatsCnt, - "expecting exactly 1 persisted txn fingerprints, but found: %d", txnStatsCnt) + stmtStatsCntPostCompact, txnStatsCntPostCompact := getPersistedStatsEntry(t, helper.sqlDB) + require.Less(t, stmtStatsCntPostCompact, stmtStatsCnt, + "expecting persisted stmt fingerprints count to be less than %d, but found: %d", stmtStatsCnt, stmtStatsCntPostCompact) + require.Less(t, txnStatsCntPostCompact, txnStatsCnt, + "expecting persisted txn fingerprints count to be less than %d, but found: %d", txnStatsCnt, txnStatsCntPostCompact) } func TestSQLStatsScheduleOperations(t *testing.T) {
e68cdefcac3c5210918b00b5ff795673128655a1
2022-01-21 22:16:15
Nick Travers
vendor: bump Pebble to ec6c21662e65
false
bump Pebble to ec6c21662e65
vendor
diff --git a/DEPS.bzl b/DEPS.bzl index 9e9e6eb55bd4..0d962e5c063b 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -1218,10 +1218,10 @@ def go_deps(): name = "com_github_cockroachdb_pebble", build_file_proto_mode = "disable_global", importpath = "github.com/cockroachdb/pebble", - sha256 = "5c8f1cab6c2528bd9e6b832f2dfcd98538d5df2c15d8e3f1d959f6c0f8c9778a", - strip_prefix = "github.com/cockroachdb/[email protected]", + sha256 = "57d54c33bae9fd363a206b5a3ac1e2fe187213ae4edb025a1f4d4dff596fb02d", + strip_prefix = "github.com/cockroachdb/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20220118190613-20f8dd034791.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20220120213058-ec6c21662e65.zip", ], ) go_repository( diff --git a/go.mod b/go.mod index 1c76536cf11e..ed673c536eb3 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55 github.com/cockroachdb/gostdlib v1.13.0 github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f - github.com/cockroachdb/pebble v0.0.0-20220118190613-20f8dd034791 + github.com/cockroachdb/pebble v0.0.0-20220120213058-ec6c21662e65 github.com/cockroachdb/redact v1.1.3 github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 diff --git a/go.sum b/go.sum index 13b011598db7..c399e8922dd9 100644 --- a/go.sum +++ b/go.sum @@ -416,8 +416,8 @@ github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f h1:6jduT9Hfc0n github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/panicparse/v2 v2.0.0-20211103220158-604c82a44f1e h1:FrERdkPlRj+v7fc+PGpey3GUiDGuTR5CsmLCA54YJ8I= github.com/cockroachdb/panicparse/v2 v2.0.0-20211103220158-604c82a44f1e/go.mod h1:pMxsKyCewnV3xPaFvvT9NfwvDTcIx2Xqg0qL5Gq0SjM= -github.com/cockroachdb/pebble v0.0.0-20220118190613-20f8dd034791 h1:g5D/E80chI50RnqWv/kZys4N1xI7wwL0J5azd2S8XYk= -github.com/cockroachdb/pebble v0.0.0-20220118190613-20f8dd034791/go.mod h1:buxOO9GBtOcq1DiXDpIPYrmxY020K2A8lOrwno5FetU= +github.com/cockroachdb/pebble v0.0.0-20220120213058-ec6c21662e65 h1:HeWHKlheSiglFkLRB+SUnt6AU7A0XuWKrO5b7aoaZhE= +github.com/cockroachdb/pebble v0.0.0-20220120213058-ec6c21662e65/go.mod h1:buxOO9GBtOcq1DiXDpIPYrmxY020K2A8lOrwno5FetU= github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/redact v1.1.1/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index c1dd8bab3241..21bf793bc0ac 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -427,8 +427,11 @@ const mvccWallTimeIntervalCollector = "MVCCTimeInterval" // BlockPropertyCollectors. var PebbleBlockPropertyCollectors = []func() pebble.BlockPropertyCollector{ func() pebble.BlockPropertyCollector { - return sstable.NewBlockIntervalCollector(mvccWallTimeIntervalCollector, - &pebbleDataBlockMVCCTimeIntervalCollector{}) + return sstable.NewBlockIntervalCollector( + mvccWallTimeIntervalCollector, + &pebbleDataBlockMVCCTimeIntervalCollector{}, /* points */ + nil, /* ranges */ + ) }, } diff --git a/vendor b/vendor index 4c70094c23a6..fce5a99b6c68 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 4c70094c23a64ef3211ebaa4c541734f310b3102 +Subproject commit fce5a99b6c68001ff5376918067c99dd1629ce6e
48d3d981ebe3b595fd80d80cd4ad990df38051e8
2021-06-16 10:44:36
Zijie Lu
util: Fix interval division with float rounds differently from PostgreSQL
false
Fix interval division with float rounds differently from PostgreSQL
util
diff --git a/pkg/sql/logictest/testdata/logic_test/datetime b/pkg/sql/logictest/testdata/logic_test/datetime index a6caeac1b865..16ec98256da3 100644 --- a/pkg/sql/logictest/testdata/logic_test/datetime +++ b/pkg/sql/logictest/testdata/logic_test/datetime @@ -1522,8 +1522,8 @@ ORDER BY ---- 01:00:00 00:30:00 02:00:00 00:30:00 02:00:00 04:14:01.320914 00:14:10.32 1 day 12:00:00 2 days 12:00:00 2 days 4 days 05:36:31.701948 05:40:07.68 -1 mon 15 days 2 mons 15 days 2 mons 4 mons 7 days 00:15:51.058425 7 days 02:03:50.4 -1 mon 2 days 04:00:00 16 days 02:00:00 2 mons 4 days 08:00:00 16 days 02:00:00 2 mons 4 days 08:00:00 4 mons 15 days 28:24:59.745978 7 days 14:20:47.04 +1 mon 15 days 2 mons 15 days 2 mons 4 mons 7 days 00:15:51.0912 7 days 02:03:50.4 +1 mon 2 days 04:00:00 16 days 02:00:00 2 mons 4 days 08:00:00 16 days 02:00:00 2 mons 4 days 08:00:00 4 mons 15 days 28:24:59.778753 7 days 14:20:47.04 subtest tz_utc_normalization diff --git a/pkg/sql/logictest/testdata/logic_test/interval b/pkg/sql/logictest/testdata/logic_test/interval index d8fb3d0a891f..c57da75253c7 100644 --- a/pkg/sql/logictest/testdata/logic_test/interval +++ b/pkg/sql/logictest/testdata/logic_test/interval @@ -367,3 +367,28 @@ subtest regression_62369 query error "10000000000000000000000000000000000": value out of range SELECT INTERVAL '10000000000000000000000000000000000 year' + +query T +SELECT i / 2 FROM ( VALUES + ('0 days 0.253000 seconds'::interval), + (INTERVAL '0.000001'::interval), + (INTERVAL '0.000002'::interval), + (INTERVAL '0.000003'::interval), + (INTERVAL '0.000004'::interval), + (INTERVAL '0.000005'::interval), + (INTERVAL '0.000006'::interval), + (INTERVAL '0.000007'::interval), + (INTERVAL '0.000008'::interval), + (INTERVAL '0.000009'::interval) +) regression_66118(i) +---- +00:00:00.1265 +00:00:00 +00:00:00.000001 +00:00:00.000002 +00:00:00.000002 +00:00:00.000002 +00:00:00.000003 +00:00:00.000004 +00:00:00.000004 +00:00:00.000004 diff --git a/pkg/util/duration/duration.go b/pkg/util/duration/duration.go index 70e8311463e4..aad49525ba23 100644 --- a/pkg/util/duration/duration.go +++ b/pkg/util/duration/duration.go @@ -617,16 +617,39 @@ func (d Duration) MulFloat(x float64) Duration { // DivFloat returns a Duration representing a time length of d/x. func (d Duration) DivFloat(x float64) Duration { - monthInt, monthFrac := math.Modf(float64(d.Months) / x) - dayInt, dayFrac := math.Modf((float64(d.Days) / x) + (monthFrac * DaysPerMonth)) + // In order to keep it compatible with PostgreSQL, we use the same logic. + // Refer to https://github.com/postgres/postgres/blob/e56bce5d43789cce95d099554ae9593ada92b3b7/src/backend/utils/adt/timestamp.c#L3266-L3304. + month := int32(float64(d.Months) / x) + day := int32(float64(d.Days) / x) + + remainderDays := (float64(d.Months)/x - float64(month)) * DaysPerMonth + remainderDays = secRoundToEven(remainderDays) + secRemainder := (float64(d.Days)/x - float64(day) + + remainderDays - float64(int64(remainderDays))) * SecsPerDay + secRemainder = secRoundToEven(secRemainder) + if math.Abs(secRemainder) >= SecsPerDay { + day += int32(secRemainder / SecsPerDay) + secRemainder -= float64(int32(secRemainder/SecsPerDay) * SecsPerDay) + } + day += int32(remainderDays) + microSecs := float64(time.Duration(d.nanos).Microseconds())/x + secRemainder*MicrosPerMilli*MillisPerSec + retNanos := time.Duration(int64(math.RoundToEven(microSecs))) * time.Microsecond return MakeDuration( - int64((float64(d.nanos)/x)+(dayFrac*float64(nanosInDay))), - int64(dayInt), - int64(monthInt), + retNanos.Nanoseconds(), + int64(day), + int64(month), ) } +// secRoundToEven rounds the given float to the nearest second, +// assuming the input float is a microsecond representation of +// time +// This maps to the TSROUND macro in Postgres. +func secRoundToEven(f float64) float64 { + return math.RoundToEven(f*MicrosPerMilli*MillisPerSec) / (MicrosPerMilli * MillisPerSec) +} + // normalized returns a new Duration transformed using the equivalence rules. // Each quantity of days greater than the threshold is moved into months, // likewise for nanos. Integer overflow is avoided by partial transformation. diff --git a/pkg/util/duration/duration_test.go b/pkg/util/duration/duration_test.go index 78d25b166b49..da10335f1ffd 100644 --- a/pkg/util/duration/duration_test.go +++ b/pkg/util/duration/duration_test.go @@ -498,6 +498,18 @@ func TestFloatMath(t *testing.T) { Duration{Months: 2, Days: 34, nanos: nanosInHour * 4}, Duration{Days: 23, nanos: nanosInHour * 13}, }, + { + Duration{Months: 0, Days: 0, nanos: nanosInSecond * 0.253000}, + 3.2, + Duration{Months: 0, Days: 0, nanos: nanosInSecond * 0.8096}, + Duration{Months: 0, Days: 0, nanos: nanosInSecond * 0.079062}, + }, + { + Duration{Months: 0, Days: 0, nanos: nanosInSecond * 0.000001}, + 2.0, + Duration{Months: 0, Days: 0, nanos: nanosInSecond * 0.000002}, + Duration{Months: 0, Days: 0, nanos: nanosInSecond * 0}, + }, } for i, test := range tests {
c3e4a5ea75a59cd1da17877d6763470ce0213d17
2024-07-29 14:28:30
Herko Lategan
roachprod: move cert signal to redist certs
false
move cert signal to redist certs
roachprod
diff --git a/pkg/roachprod/BUILD.bazel b/pkg/roachprod/BUILD.bazel index e4af1abd5327..14d9606fde5b 100644 --- a/pkg/roachprod/BUILD.bazel +++ b/pkg/roachprod/BUILD.bazel @@ -36,7 +36,6 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_errors//oserror", "@com_github_dataexmachina_dev_side_eye_go//sideeyeclient", - "@org_golang_x_sys//unix", ], ) diff --git a/pkg/roachprod/install/BUILD.bazel b/pkg/roachprod/install/BUILD.bazel index e9f20ff68390..be8c2f011347 100644 --- a/pkg/roachprod/install/BUILD.bazel +++ b/pkg/roachprod/install/BUILD.bazel @@ -45,6 +45,7 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@org_golang_x_exp//maps", "@org_golang_x_sync//errgroup", + "@org_golang_x_sys//unix", ], ) diff --git a/pkg/roachprod/install/cluster_synced.go b/pkg/roachprod/install/cluster_synced.go index e24814880209..92e0c3929190 100644 --- a/pkg/roachprod/install/cluster_synced.go +++ b/pkg/roachprod/install/cluster_synced.go @@ -45,6 +45,7 @@ import ( "github.com/cockroachdb/errors" "golang.org/x/exp/maps" "golang.org/x/sync/errgroup" + "golang.org/x/sys/unix" ) // A SyncedCluster is created from the cluster metadata in the synced clusters @@ -1634,8 +1635,10 @@ func tenantCertsTarName(virtualClusterID int) string { } // DistributeCerts will generate and distribute certificates to all the nodes. -func (c *SyncedCluster) DistributeCerts(ctx context.Context, l *logger.Logger) error { - if c.checkForCertificates(ctx, l) { +func (c *SyncedCluster) DistributeCerts( + ctx context.Context, l *logger.Logger, redistribute bool, +) error { + if !redistribute && c.checkForCertificates(ctx, l) { return nil } @@ -1682,7 +1685,15 @@ tar cvf %[5]s %[2]s // Skip the first node which is where we generated the certs. nodes := allNodes(len(c.VMs))[1:] - return c.distributeLocalCertsTar(ctx, l, tarfile, nodes, 0) + if err = c.distributeLocalCertsTar(ctx, l, tarfile, nodes, 0); err != nil { + return err + } + if redistribute { + if err = c.Signal(ctx, l, int(unix.SIGHUP)); err != nil { + return err + } + } + return nil } // RedistributeNodeCert will generate a new node cert to capture any new hosts @@ -1722,7 +1733,12 @@ tar cvf %[5]s %[2]s // Skip the first node which is where we generated the certs. nodes := allNodes(len(c.VMs))[1:] - return c.distributeLocalCertsTar(ctx, l, tarfile, nodes, 0) + + if err := c.distributeLocalCertsTar(ctx, l, tarfile, nodes, 0); err != nil { + return err + } + // Send a SIGHUP to the nodes to reload the certificates. + return c.Signal(ctx, l, int(unix.SIGHUP)) } // DistributeTenantCerts will generate and distribute certificates to all of the diff --git a/pkg/roachprod/install/cockroach.go b/pkg/roachprod/install/cockroach.go index 65fc0e1912ef..d7a22865a8f5 100644 --- a/pkg/roachprod/install/cockroach.go +++ b/pkg/roachprod/install/cockroach.go @@ -1390,7 +1390,7 @@ func (c *SyncedCluster) distributeCerts(ctx context.Context, l *logger.Logger) e } for _, node := range c.TargetNodes() { if node == 1 { - return c.DistributeCerts(ctx, l) + return c.DistributeCerts(ctx, l, false) } } return nil diff --git a/pkg/roachprod/roachprod.go b/pkg/roachprod/roachprod.go index 4b10e6e96ddf..97d887119230 100644 --- a/pkg/roachprod/roachprod.go +++ b/pkg/roachprod/roachprod.go @@ -58,7 +58,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/timeutil" "github.com/cockroachdb/errors" "github.com/cockroachdb/errors/oserror" - "golang.org/x/sys/unix" ) // MalformedClusterNameError is returned when the cluster name passed to Create is invalid. @@ -1008,7 +1007,7 @@ func DistributeCerts(ctx context.Context, l *logger.Logger, clusterName string) if err != nil { return err } - return c.DistributeCerts(ctx, l) + return c.DistributeCerts(ctx, l, false) } // Put copies a local file to the nodes in a cluster. @@ -1667,7 +1666,7 @@ func Grow( if err != nil { return err } - err = c.RedistributeNodeCert(ctx, l) + err = c.DistributeCerts(ctx, l, true) if err != nil { return err } @@ -2719,11 +2718,6 @@ func CreateLoadBalancer( if err != nil { return err } - // Send a SIGHUP to the nodes to reload the certificates. - err = c.Signal(ctx, l, int(unix.SIGHUP)) - if err != nil { - return err - } } return nil }
79e66ed7e4baa0bd5bfb535043efefbc69ebb593
2020-06-25 01:15:57
Oliver Tan
lint: downgrade honnef.co/go/tools
false
downgrade honnef.co/go/tools
lint
diff --git a/go.mod b/go.mod index 5406afd2a57e..460d7700db28 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/Azure/go-autorest/autorest/to v0.3.0 github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect github.com/BurntSushi/toml v0.3.1 + github.com/DataDog/zstd v1.4.4 // indirect github.com/MichaelTJones/walk v0.0.0-20161122175330-4748e29d5718 github.com/PuerkitoBio/goquery v1.5.0 github.com/Shopify/sarama v1.22.2-0.20190604114437-cd910a683f9f @@ -52,11 +53,14 @@ require ( github.com/docker/distribution v2.7.0+incompatible github.com/docker/docker v17.12.0-ce-rc1.0.20190115172544-0dc531243dd3+incompatible github.com/docker/go-connections v0.4.0 + github.com/docker/go-units v0.4.0 // indirect github.com/dustin/go-humanize v1.0.0 + github.com/eapache/go-resiliency v1.2.0 // indirect github.com/edsrzf/mmap-go v1.0.0 github.com/elastic/gosigar v0.10.0 github.com/elazarl/go-bindata-assetfs v1.0.0 github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a + github.com/frankban/quicktest v1.7.3 // indirect github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9 github.com/go-ole/go-ole v1.2.2 // indirect github.com/go-sql-driver/mysql v1.4.1-0.20181218123637-c45f530f8e7f @@ -78,18 +82,22 @@ require ( github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163 github.com/googleapis/gax-go v2.0.2+incompatible // indirect github.com/gorhill/cronexpr v0.0.0-20140423231348-a557574d6c02 + github.com/gorilla/mux v1.7.4 // indirect github.com/goware/modvendor v0.3.0 github.com/grpc-ecosystem/grpc-gateway v1.13.0 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 + github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/ianlancetaylor/cgosymbolizer v0.0.0-20170921033129-f5072df9c550 // indirect github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect github.com/jackc/pgx v3.6.2+incompatible - github.com/jaegertracing/jaeger v1.17.1 + github.com/jaegertracing/jaeger v1.17.0 + github.com/jcmturner/gofork v1.0.0 // indirect github.com/kevinburke/go-bindata v3.13.0+incompatible github.com/kisielk/errcheck v1.2.0 github.com/kisielk/gotool v1.0.0 github.com/knz/go-libedit v1.10.1 github.com/knz/strtime v0.0.0-20200318182718-be999391ffa9 + github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.2.0 github.com/kr/text v0.2.0 github.com/leanovate/gopter v0.2.5-0.20190402064358-634a59d12406 @@ -113,13 +121,16 @@ require ( github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect github.com/opentracing/opentracing-go v1.1.0 github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5 + github.com/pborman/uuid v1.2.0 // indirect github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 + github.com/pierrec/lz4 v2.4.1+incompatible // indirect github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 github.com/pmezard/go-difflib v1.0.0 github.com/prometheus/client_golang v1.1.0 github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.9.1 + github.com/prometheus/procfs v0.0.10 // indirect github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 github.com/sasha-s/go-deadlock v0.2.0 github.com/shirou/gopsutil v2.18.12+incompatible @@ -143,9 +154,12 @@ require ( golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5 google.golang.org/api v0.1.0 + google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 // indirect google.golang.org/grpc v1.29.1 + gopkg.in/jcmturner/goidentity.v3 v3.0.0 // indirect + gopkg.in/jcmturner/gokrb5.v7 v7.5.0 // indirect gopkg.in/yaml.v2 v2.3.0 - honnef.co/go/tools v0.0.1-2019.2.3 + honnef.co/go/tools v0.0.0-20190530104931-1f0868a609b7 vitess.io/vitess v0.0.0-00010101000000-000000000000 ) diff --git a/go.sum b/go.sum index bda37f6ffbcd..382a240ce576 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-pipeline-go v0.1.8 h1:KmVRa8oFMaargVesEuuEoiLCQ4zCCwQ8QX/xg++KS20= github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= github.com/Azure/azure-sdk-for-go v33.4.0+incompatible h1:yzJKzcKTX0WwDdZC8kAqxiGVZz66uqpajhgphstEUN0= @@ -62,12 +61,8 @@ github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+q github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk= github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.22.2-0.20190604114437-cd910a683f9f h1:SgZvxOvp9NLnAjkIiby0LQgXH0yQNTk2eDzbYPVoTA4= github.com/Shopify/sarama v1.22.2-0.20190604114437-cd910a683f9f/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= @@ -77,14 +72,11 @@ github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIO github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andy-kimball/arenaskl v0.0.0-20200617143215-f701008588b9 h1:vCvyXiLsgAs7qgclk56iBTJQ+gdfiVuzfe5T6sVBL+w= github.com/andy-kimball/arenaskl v0.0.0-20200617143215-f701008588b9/go.mod h1:V2fyPx0Gm2VBNpGPq4z0bjNRaBPR+kC3aSqIuiWCdg4= github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= @@ -94,15 +86,11 @@ github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxB github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/apache/arrow/go/arrow v0.0.0-20200610220642-670890229854 h1:kLPoYgtEyqP5M5o1H+oAe5ZjOrL4LLo7jwF9W4hnNq8= github.com/apache/arrow/go/arrow v0.0.0-20200610220642-670890229854/go.mod h1:QNYViu/X0HXDHw7m3KXzWSVXIbfUvJqBFe6Gj8/pYA0= -github.com/apache/thrift v0.0.0-20151001171628-53dd39833a08/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.0.0-20181211084444-2b7365c54f82 h1:v7Gpsj71uh9fOCX0v9mS7thFJdguCgV11wTv0wMe4pE= github.com/apache/thrift v0.0.0-20181211084444-2b7365c54f82/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/aws/aws-sdk-go v1.16.19 h1:eQypou1JciH0C87wYbj9uii0YVG3hS0S4UY78oWmUvM= github.com/aws/aws-sdk-go v1.16.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/axiomhq/hyperloglog v0.0.0-20181223111420-4b99d0c2c99e h1:190ugM9MsyFauTkR/UqcHG/mn5nmFe6SvHJqEHIrtrA= @@ -117,17 +105,12 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/biogo/store v0.0.0-20160505134755-913427a1d5e8 h1:tYoz1OeRpx3dJZlh9T4dQt4kAndcmpl+VNdzbSgFC/0= github.com/biogo/store v0.0.0-20160505134755-913427a1d5e8/go.mod h1:Iev9Q3MErcn+w3UOJD/DkEzllvugfdx7bGcMOFhvr/4= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q= -github.com/bsm/sarama-cluster v2.1.13+incompatible/go.mod h1:r7ao+4tTNXvWm+VRpRJchr2kQhqxgmAp2iEX5W96gMM= github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894 h1:JLaf/iINcLyjwbtTsCJjc6rtlASgHeIJPrB6QmwURnA= github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -186,19 +169,15 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crossdock/crossdock-go v0.0.0-20160816171116-049aabb0122b/go.mod h1:v9FBN7gdVTpiD/+LZ7Po0UKvROyT87uLVxTHVky/dlQ= github.com/d4l3k/messagediff v1.2.1 h1:ZcAIMYsUg0EAp9X+tt8/enBE/Q8Yd5kzPynLyKptt9U= github.com/d4l3k/messagediff v1.2.1/go.mod h1:Oozbb1TVXFac9FtSIxHBMnBCq2qeH/2KkEQxENCrlLo= github.com/dave/dst v0.24.0 h1:5wtsjxee7nUDlKEz4i6ewJVn1193vfv2UpEXKqzmaUI= @@ -210,15 +189,12 @@ github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWE github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger v1.5.3/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc h1:8WFBn63wegobsYAX0YjD+8suexZDga5CctH4CCTx2+8= github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/docker/distribution v2.7.0+incompatible h1:neUDAlf3wX6Ml4HdqTrbcOHXtfRN0TFIwt6YFL7N9RU= @@ -258,7 +234,6 @@ github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.7.3 h1:kV0lw0TH1j1hozahVmcpFCsbV5hcS4ZalH+U7UoeTow= github.com/frankban/quicktest v1.7.3/go.mod h1:V1d2J5pfxYH6EjBAgSK7YNXcXlTWxUHdE1sVDXkjnig= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= @@ -274,8 +249,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= @@ -288,90 +261,15 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.2 h1:QNWhweRd9D5Py2rRVboZ2L4SEoW/dyraWJCc8bgS8kE= github.com/go-ole/go-ole v1.2.2/go.mod h1:pnvuG7BrDMZ8ifMurTQmxwhQM/odqm9sSqNe5BUI7v4= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.7/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.11/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-sql-driver/mysql v1.4.1-0.20181218123637-c45f530f8e7f h1:V53hwNJdyT/R1Vd4oIoQllhkt6m+czKLY4MIgYr3wgA= github.com/go-sql-driver/mysql v1.4.1-0.20181218123637-c45f530f8e7f/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gocql/gocql v0.0.0-20200226121155-e5c8c1f505c5/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.0.1-0.20180501115203-b23578765ee5/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-commonmark/html v0.0.0-20180910111043-7d7c804e1d46 h1:FeNEDxIy7XouGTJKiJ9Ze5vUbcAIW/FRhQbtKBNmEz8= github.com/golang-commonmark/html v0.0.0-20180910111043-7d7c804e1d46/go.mod h1:LVbxopYhspqklDpfaS/qDc6HhWwkpF1ptTj3vMFRoSQ= @@ -388,7 +286,6 @@ github.com/golang/geo v0.0.0-20200319012246-673a6f80352d/go.mod h1:QZ0nwyI2jOfgR github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -402,7 +299,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf h1:gFVkHXmVAhEbxZVDln5V9GKrLaluNoFHDbrZwAWZgws= @@ -427,7 +323,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/pprof v0.0.0-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163 h1:beB+Da4k9B1zmgag78k3k1Bx4L/fdWr5FwNa0f8RxmY= github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -436,7 +331,6 @@ github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorhill/cronexpr v0.0.0-20140423231348-a557574d6c02 h1:Spo+4PFAGDqULAsZ7J69MOxq4/fwgZ0zvmDTBqpq7yU= github.com/gorhill/cronexpr v0.0.0-20140423231348-a557574d6c02/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -445,23 +339,15 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/goware/modvendor v0.3.0 h1:pQoHt7SOUiWSwN/W5FzibTQLx/1Xa3VMBRcZGtdb1wo= github.com/goware/modvendor v0.3.0/go.mod h1:rtogeSlPLJT6MlypJyGp24o/vnHvF+ebCoTQrDX6oGY= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -482,14 +368,13 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 h1:vr3AYkKovP8uR8AvSGGU github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= -github.com/jaegertracing/jaeger v1.17.1 h1:4R6ZMBniHB5eb25ejNsAZRNetzHNyxwQ5rsjSdAMWBI= -github.com/jaegertracing/jaeger v1.17.1/go.mod h1:JEzihxnncdfZIHUSEuXyRBffQQTCG9PVIViXVCVQ+ag= +github.com/jaegertracing/jaeger v1.17.0 h1:SekUYENjk7gp38SJWM7kKuJjZ1EK7dNqE9UjKaCNJD8= +github.com/jaegertracing/jaeger v1.17.0/go.mod h1:LUWPSnzNPGRubM8pk0inANGitpiMOOxihXx0+53llXI= github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -499,8 +384,6 @@ github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVE github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= @@ -513,7 +396,6 @@ github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/knz/go-libedit v1.10.1 h1:0pHpWtx9vcvC0xGZqEQlQdfSQs7WRlAjuPvk3fOZDCo= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= @@ -528,8 +410,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -537,7 +417,6 @@ github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvf github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.5-0.20190402064358-634a59d12406 h1:+OUpk+IVvmKU0jivOVFGtOzA6U5AWFs8HE4DRzWLOUE= github.com/leanovate/gopter v0.2.5-0.20190402064358-634a59d12406/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.5.2 h1:yTSXVswvWUOQ3k1sd7vJfDrbSl8lKuscqFJRqjC0ifw= github.com/lib/pq v1.5.2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -552,15 +431,6 @@ github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5/go.mod h1:c2mYKR github.com/lusis/slack-test v0.0.0-20190426140909-c40012f20018 h1:MNApn+Z+fIT4NPZopPfCc1obT6aY3SVM6DOctz1A9ZU= github.com/lusis/slack-test v0.0.0-20190426140909-c40012f20018/go.mod h1:sFlOUpQL1YcjhFVXhg1CG8ZASEs/Mf1oVb6H75JL/zg= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/maruel/panicparse v1.1.2-0.20180806203336-f20d4c4d746f h1:mtX2D0ta3lWxCvv276VVIH6mMYzm4jhSfYP70ZJSOQU= github.com/maruel/panicparse v1.1.2-0.20180806203336-f20d4c4d746f/go.mod h1:nty42YY5QByNC5MM7q/nj938VbgPU7avs45z6NClpxI= github.com/marusama/semaphore v0.0.0-20190110074507-6952cef993b2 h1:sq+a5mb8zHbmHhrIH06oqIMGsanjpbxNgxEgZVfgpvQ= @@ -590,45 +460,31 @@ github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/le github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mjibson/esc v0.2.0/go.mod h1:9Hw9gxxfHulMF5OJKCyhYD7PzlSdhzXyaGEBRPH1OPs= github.com/mmatczuk/go_generics v0.0.0-20181212143635-0aaa050f9bab h1:QjLgi/L+MjxysinrA8KkNZLf3cAhTluBoSXUvFeN144= github.com/mmatczuk/go_generics v0.0.0-20181212143635-0aaa050f9bab/go.mod h1:Fs8p4al9GNa3b42YfZOoUVMdjQ2WlNEYlnoboJKPpJ8= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.4.1-0.20190115100425-713f2944833c h1:l4v5f5zMxqzCwPRRIlL5yCD/REWJ94PrId/ESmRPEDc= github.com/montanaflynn/stats v0.4.1-0.20190115100425-713f2944833c/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/nlopes/slack v0.4.0 h1:OVnHm7lv5gGT5gkcHsZAyw++oHVFihbjWbL3UceUpiA= github.com/nlopes/slack v0.4.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olivere/elastic v6.2.27+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= @@ -640,7 +496,6 @@ github.com/opennota/wd v0.0.0-20180911144301-b446539ab1e7 h1:cVQhwfBgiKTMAdYPbVe github.com/opennota/wd v0.0.0-20180911144301-b446539ab1e7/go.mod h1:CS6cd3lWylVJV6EWs4Q/lkDEVGQOrEbBdwCowzzkN6A= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5 h1:82Tnq9OJpn+h5xgGpss5/mOv3KXdjtkdorFSOUusjM8= @@ -650,8 +505,6 @@ github.com/ory/dockertest v3.3.4+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnh github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk= github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= @@ -670,10 +523,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prashantv/protectmem v0.0.0-20171002184600-e20412882b3a/go.mod h1:lzZQ3Noex5pfAy7mkAeCjcBDteYU85uWWnJ/y6gKU8k= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= @@ -683,36 +534,26 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.10 h1:QJQN3jYQhkamO4mhfUWqdDH2asK7ONOI9MTWjyAxNKM= github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sectioneight/md-to-godoc v0.0.0-20161108233149-55e43be6c335/go.mod h1:lPZq22klO8la1kyImIDhrGytugMV0TsrsZB55a+xxI0= -github.com/securego/gosec v0.0.0-20200203094520-d13bb6d2420c/go.mod h1:gp0gaHj0WlmPh9BdsTmo1aq6C27yIPWdxCKGFGdVKBE= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= @@ -725,53 +566,38 @@ github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXY github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= -github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25/go.mod h1:lbP8tGiBjZ5YWIc2fzuRpTaz0b/53vT6PEs3QuAWzuU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/twpayne/go-geom v1.3.0 h1:jwhmbnQv5VTfAgohevKBuzisQSdXGjfquZ7FC8aVUzU= github.com/twpayne/go-geom v1.3.0/go.mod h1:90yvs0wf/gyT5eQ9W4v5WOZ9w/Xnrj5RMlA9XNKqxyA= github.com/twpayne/go-kml v1.5.0 h1:CNWBxCmyWg1158dWbfdZsuUkUtHITrkntJS3iJhazJQ= github.com/twpayne/go-kml v1.5.0/go.mod h1:g/OG8Q8JUxqFw8LGXE44W7osn1uXDAYaVFr1Yld43yc= github.com/twpayne/go-polyline v1.0.0/go.mod h1:ICh24bcLYBX8CknfvNPKqoTbe+eg+MX1NPyJmSBo7pU= -github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/uber/tchannel-go v1.16.0/go.mod h1:Rrgz1eL8kMjW/nEzZos0t+Heq0O4LhnUJVA32OvWKHo= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -780,12 +606,9 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5/go.mod h1:ppEjwdhyy7Y31EnHRDm1JkChoC7LXIJ7Ex0VYLWtZtQ= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= @@ -797,40 +620,20 @@ github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FB github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/arch v0.0.0-20180920145803-b19384d3c130/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -843,12 +646,9 @@ golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -858,25 +658,19 @@ golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= @@ -893,7 +687,6 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -901,21 +694,15 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -923,8 +710,6 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867 h1:JoRuNIf+rpHl+VhScRQQvzbHed86tKkqwPMV34T8myw= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -937,31 +722,16 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181112210238-4b1f3b6b1646/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200203023011-6f24f261dadb/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d h1:7M9AXzLrJWWGdDYtBblPHBTnHtaN6KKQ98OYb35mLlY= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5 h1:MeC2gMlMdkd67dn17MEby3rGXRxZtWeiRXOnISfTQ74= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -988,13 +758,10 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1011,14 +778,10 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM= @@ -1040,6 +803,6 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.0-20190530104931-1f0868a609b7 h1:RFEMAhc9/Ej5KcaFZooS1PGYAhVl+CUxVj2gyKYGxKQ= +honnef.co/go/tools v0.0.0-20190530104931-1f0868a609b7/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/vendor b/vendor index 16b932992a14..742cef8b62c5 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 16b932992a1409d6b70c623e30f3d94ed2e52f3b +Subproject commit 742cef8b62c569bd88f9c26791009dac1085a1a2
5f606d5cd080909a100af5c76e95be1a536dc3fc
2024-01-05 01:13:33
Marcus Gartner
opt: optimize building WithScan functional dependencies
false
optimize building WithScan functional dependencies
opt
diff --git a/pkg/sql/opt/memo/logical_props_builder.go b/pkg/sql/opt/memo/logical_props_builder.go index 2cc2b11e9711..d11e81c6dbea 100644 --- a/pkg/sql/opt/memo/logical_props_builder.go +++ b/pkg/sql/opt/memo/logical_props_builder.go @@ -968,11 +968,7 @@ func (b *logicalPropsBuilder) buildWithScanProps(withScan *WithScanExpr, rel *pr // ----------------------- // Inherit dependencies from the referenced expression (remapping the // columns). - rel.FuncDeps.CopyFrom(&bindingProps.FuncDeps) - for i := range withScan.InCols { - rel.FuncDeps.AddEquivalency(withScan.InCols[i], withScan.OutCols[i]) - } - rel.FuncDeps.ProjectCols(withScan.OutCols.ToSet()) + rel.FuncDeps.RemapFrom(&bindingProps.FuncDeps, withScan.InCols, withScan.OutCols) // Cardinality // -----------
2f9f77bd1bc4c8789079c818f655b15708909c52
2021-03-08 20:40:26
Eric Wang
sql: only qualify sequences with database names
false
only qualify sequences with database names
sql
diff --git a/pkg/ccl/importccl/import_stmt_test.go b/pkg/ccl/importccl/import_stmt_test.go index 762923518c47..122c88195e9b 100644 --- a/pkg/ccl/importccl/import_stmt_test.go +++ b/pkg/ccl/importccl/import_stmt_test.go @@ -5668,7 +5668,7 @@ func TestImportPgDump(t *testing.T) { if c.expected == expectAll { sqlDB.CheckQueryResults(t, `SHOW CREATE TABLE seqtable`, [][]string{{ "seqtable", `CREATE TABLE public.seqtable ( - a INT8 NULL DEFAULT nextval('foo.public.a_seq':::STRING::REGCLASS), + a INT8 NULL DEFAULT nextval('public.a_seq':::STRING::REGCLASS), b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), diff --git a/pkg/sql/catalog/schemaexpr/column.go b/pkg/sql/catalog/schemaexpr/column.go index 630da66a132b..f37aacbedda1 100644 --- a/pkg/sql/catalog/schemaexpr/column.go +++ b/pkg/sql/catalog/schemaexpr/column.go @@ -302,11 +302,19 @@ func replaceIDsWithFQNames( if err != nil { return true, expr, nil //nolint:returnerrcheck } + + // Omit the database qualification if the sequence lives in the current database. + currDb := semaCtx.TableNameResolver.CurrentDatabase() + if seqName.Catalog() == currDb { + seqName.CatalogName = "" + seqName.ExplicitCatalog = false + } + // Swap out this node to use the qualified table name for the sequence. return false, &tree.CastExpr{ Type: types.RegClass, SyntaxMode: tree.CastShort, - Expr: tree.NewStrVal(seqName.FQString()), + Expr: tree.NewStrVal(seqName.String()), }, nil } diff --git a/pkg/sql/logictest/testdata/logic_test/drop_sequence b/pkg/sql/logictest/testdata/logic_test/drop_sequence index 6718f2b5050e..bcb20bee53fa 100644 --- a/pkg/sql/logictest/testdata/logic_test/drop_sequence +++ b/pkg/sql/logictest/testdata/logic_test/drop_sequence @@ -31,7 +31,7 @@ query TT SHOW CREATE TABLE t1 ---- t1 CREATE TABLE public.t1 ( - i INT8 NOT NULL DEFAULT nextval('test.public.drop_test':::STRING::REGCLASS), + i INT8 NOT NULL DEFAULT nextval('public.drop_test':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) @@ -93,7 +93,7 @@ SHOW CREATE TABLE foo ---- foo CREATE TABLE public.foo ( i INT8 NOT NULL DEFAULT nextval('other_db.public.s':::STRING::REGCLASS), - j INT8 NOT NULL DEFAULT nextval('test.public.s':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('public.s':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) @@ -115,7 +115,7 @@ SHOW CREATE TABLE foo ---- foo CREATE TABLE public.foo ( i INT8 NOT NULL, - j INT8 NOT NULL DEFAULT nextval('test.public.s':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('public.s':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) @@ -151,8 +151,8 @@ query TT SHOW CREATE TABLE bar ---- bar CREATE TABLE public.bar ( - i INT8 NOT NULL DEFAULT nextval('test.other_sc.s':::STRING::REGCLASS), - j INT8 NOT NULL DEFAULT nextval('test.public.s':::STRING::REGCLASS), + i INT8 NOT NULL DEFAULT nextval('other_sc.s':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('public.s':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) @@ -174,7 +174,7 @@ SHOW CREATE TABLE bar ---- bar CREATE TABLE public.bar ( i INT8 NOT NULL, - j INT8 NOT NULL DEFAULT nextval('test.public.s':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('public.s':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) diff --git a/pkg/sql/logictest/testdata/logic_test/int_size b/pkg/sql/logictest/testdata/logic_test/int_size index dbf969ad3108..aa19845dfd2e 100644 --- a/pkg/sql/logictest/testdata/logic_test/int_size +++ b/pkg/sql/logictest/testdata/logic_test/int_size @@ -134,7 +134,7 @@ query TT SHOW CREATE TABLE i4_sql_sequence ---- i4_sql_sequence CREATE TABLE public.i4_sql_sequence ( - a INT4 NOT NULL DEFAULT nextval('test.public.i4_sql_sequence_a_seq':::STRING::REGCLASS), + a INT4 NOT NULL DEFAULT nextval('public.i4_sql_sequence_a_seq':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) @@ -150,7 +150,7 @@ query TT SHOW CREATE TABLE i8_sql_sequence ---- i8_sql_sequence CREATE TABLE public.i8_sql_sequence ( - a INT8 NOT NULL DEFAULT nextval('test.public.i8_sql_sequence_a_seq':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.i8_sql_sequence_a_seq':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) @@ -170,7 +170,7 @@ query TT SHOW CREATE TABLE i4_virtual_sequence ---- i4_virtual_sequence CREATE TABLE public.i4_virtual_sequence ( - a INT8 NOT NULL DEFAULT nextval('test.public.i4_virtual_sequence_a_seq':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.i4_virtual_sequence_a_seq':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) @@ -186,7 +186,7 @@ query TT SHOW CREATE TABLE i8_virtual_sequence ---- i8_virtual_sequence CREATE TABLE public.i8_virtual_sequence ( - a INT8 NOT NULL DEFAULT nextval('test.public.i8_virtual_sequence_a_seq':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.i8_virtual_sequence_a_seq':::STRING::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) diff --git a/pkg/sql/logictest/testdata/logic_test/sequences_regclass b/pkg/sql/logictest/testdata/logic_test/sequences_regclass index 6273a828c713..987759544e44 100644 --- a/pkg/sql/logictest/testdata/logic_test/sequences_regclass +++ b/pkg/sql/logictest/testdata/logic_test/sequences_regclass @@ -8,14 +8,14 @@ statement ok CREATE SEQUENCE test_seq statement ok -CREATE SEQUENCE test_seq2 +CREATE DATABASE diff_db + +statement ok +CREATE SEQUENCE diff_db.test_seq let $test_seq_id SELECT 'test_seq'::regclass::int -let $test_seq2_id -SELECT 'test_seq2'::regclass::int - statement ok CREATE TABLE foo (i SERIAL PRIMARY KEY) @@ -29,19 +29,19 @@ statement ok ALTER TABLE foo ADD COLUMN l INT NOT NULL statement ok -ALTER TABLE FOO ALTER COLUMN l SET DEFAULT currval('test_seq2') +ALTER TABLE FOO ALTER COLUMN l SET DEFAULT currval('diff_db.test_seq') statement ok -SELECT nextval('test_seq2') +SELECT nextval('diff_db.test_seq') query TT SHOW CREATE TABLE foo ---- foo CREATE TABLE public.foo ( - i INT8 NOT NULL DEFAULT nextval('test.public.foo_i_seq':::STRING::REGCLASS), - j INT8 NOT NULL DEFAULT nextval('test.public.test_seq':::STRING::REGCLASS), - k INT8 NOT NULL DEFAULT nextval('test.public.foo_k_seq':::STRING::REGCLASS), - l INT8 NOT NULL DEFAULT currval('test.public.test_seq2':::STRING::REGCLASS), + i INT8 NOT NULL DEFAULT nextval('public.foo_i_seq':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('public.test_seq':::STRING::REGCLASS), + k INT8 NOT NULL DEFAULT nextval('public.foo_k_seq':::STRING::REGCLASS), + l INT8 NOT NULL DEFAULT currval('diff_db.public.test_seq':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (i ASC), FAMILY "primary" (i, j, k, l) ) @@ -130,9 +130,9 @@ query TT SHOW CREATE TABLE bar ---- bar CREATE TABLE public.bar ( - i INT8 NOT NULL DEFAULT nextval('test.public.new_bar_i_seq':::STRING::REGCLASS), - j INT8 NOT NULL DEFAULT currval('test.public.new_s1':::STRING::REGCLASS), - k INT8 NOT NULL DEFAULT nextval('test.public.new_s2':::STRING::REGCLASS), + i INT8 NOT NULL DEFAULT nextval('public.new_bar_i_seq':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT currval('public.new_s1':::STRING::REGCLASS), + k INT8 NOT NULL DEFAULT nextval('public.new_s2':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (i ASC), FAMILY fam_0_i_j_k (i, j, k) ) @@ -251,9 +251,9 @@ query TT SHOW CREATE TABLE tb ---- tb CREATE TABLE public.tb ( - i INT8 NOT NULL DEFAULT nextval('test.test_schema.tb_i_seq':::STRING::REGCLASS), - j INT8 NOT NULL DEFAULT nextval('test.test_schema.sc_s1':::STRING::REGCLASS), - k INT8 NOT NULL DEFAULT currval('test.test_schema.sc_s2':::STRING::REGCLASS), + i INT8 NOT NULL DEFAULT nextval('test_schema.tb_i_seq':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('test_schema.sc_s1':::STRING::REGCLASS), + k INT8 NOT NULL DEFAULT currval('test_schema.sc_s2':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (i ASC), FAMILY fam_0_i_j_k (i, j, k) ) @@ -306,9 +306,9 @@ query TT SHOW CREATE TABLE new_test_schema.foo ---- new_test_schema.foo CREATE TABLE new_test_schema.foo ( - i INT8 NOT NULL DEFAULT nextval('test.new_test_schema.foo_i_seq':::STRING::REGCLASS), - j INT8 NOT NULL DEFAULT nextval('test.new_test_schema.s3':::STRING::REGCLASS), - k INT8 NOT NULL DEFAULT currval('test.new_test_schema.s4':::STRING::REGCLASS), + i INT8 NOT NULL DEFAULT nextval('new_test_schema.foo_i_seq':::STRING::REGCLASS), + j INT8 NOT NULL DEFAULT nextval('new_test_schema.s3':::STRING::REGCLASS), + k INT8 NOT NULL DEFAULT currval('new_test_schema.s4':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (i ASC), FAMILY fam_0_i_j_k (i, j, k) ) diff --git a/pkg/sql/logictest/testdata/logic_test/serial b/pkg/sql/logictest/testdata/logic_test/serial index 990879e65ccc..2871d23da1b9 100644 --- a/pkg/sql/logictest/testdata/logic_test/serial +++ b/pkg/sql/logictest/testdata/logic_test/serial @@ -117,9 +117,9 @@ query TT SHOW CREATE TABLE serial ---- serial CREATE TABLE public.serial ( - a INT8 NOT NULL DEFAULT nextval('test.public.serial_a_seq':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.serial_a_seq':::STRING::REGCLASS), b INT8 NULL DEFAULT 7:::INT8, - c INT8 NOT NULL DEFAULT nextval('test.public.serial_c_seq2':::STRING::REGCLASS), + c INT8 NOT NULL DEFAULT nextval('public.serial_c_seq2':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (a ASC), UNIQUE INDEX serial_c_key (c ASC), FAMILY "primary" (a, b, c) @@ -160,8 +160,8 @@ query TT SHOW CREATE TABLE smallbig ---- smallbig CREATE TABLE public.smallbig ( - a INT8 NOT NULL DEFAULT nextval('test.public.smallbig_a_seq':::STRING::REGCLASS), - b INT8 NOT NULL DEFAULT nextval('test.public.smallbig_b_seq':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.smallbig_a_seq':::STRING::REGCLASS), + b INT8 NOT NULL DEFAULT nextval('public.smallbig_b_seq':::STRING::REGCLASS), c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), @@ -183,9 +183,9 @@ query TT SHOW CREATE TABLE serials ---- serials CREATE TABLE public.serials ( - a INT8 NOT NULL DEFAULT nextval('test.public.serials_a_seq':::STRING::REGCLASS), - b INT8 NOT NULL DEFAULT nextval('test.public.serials_b_seq':::STRING::REGCLASS), - c INT8 NOT NULL DEFAULT nextval('test.public.serials_c_seq':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.serials_a_seq':::STRING::REGCLASS), + b INT8 NOT NULL DEFAULT nextval('public.serials_b_seq':::STRING::REGCLASS), + c INT8 NOT NULL DEFAULT nextval('public.serials_c_seq':::STRING::REGCLASS), d INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), @@ -222,9 +222,9 @@ query TT SHOW CREATE TABLE serial ---- serial CREATE TABLE public.serial ( - a INT8 NOT NULL DEFAULT nextval('test.public.serial_a_seq1':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public.serial_a_seq1':::STRING::REGCLASS), b INT8 NULL DEFAULT 7:::INT8, - c INT8 NOT NULL DEFAULT nextval('test.public.serial_c_seq3':::STRING::REGCLASS), + c INT8 NOT NULL DEFAULT nextval('public.serial_c_seq3':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (a ASC), UNIQUE INDEX serial_c_key (c ASC), FAMILY "primary" (a, b, c) @@ -278,9 +278,9 @@ query TT SHOW CREATE TABLE "serial_MixedCase" ---- "serial_MixedCase" CREATE TABLE public."serial_MixedCase" ( - a INT8 NOT NULL DEFAULT nextval('test.public."serial_MixedCase_a_seq"':::STRING::REGCLASS), + a INT8 NOT NULL DEFAULT nextval('public."serial_MixedCase_a_seq"':::STRING::REGCLASS), b INT8 NULL DEFAULT 7:::INT8, - c INT8 NOT NULL DEFAULT nextval('test.public."serial_MixedCase_c_seq"':::STRING::REGCLASS), + c INT8 NOT NULL DEFAULT nextval('public."serial_MixedCase_c_seq"':::STRING::REGCLASS), CONSTRAINT "primary" PRIMARY KEY (a ASC), UNIQUE INDEX "serial_MixedCase_c_key" (c ASC), FAMILY "primary" (a, b, c) @@ -305,8 +305,8 @@ query TT SHOW CREATE TABLE smallbig ---- smallbig CREATE TABLE public.smallbig ( - a INT2 NOT NULL DEFAULT nextval('test.public.smallbig_a_seq1':::STRING::REGCLASS), - b INT8 NOT NULL DEFAULT nextval('test.public.smallbig_b_seq1':::STRING::REGCLASS), + a INT2 NOT NULL DEFAULT nextval('public.smallbig_a_seq1':::STRING::REGCLASS), + b INT8 NOT NULL DEFAULT nextval('public.smallbig_b_seq1':::STRING::REGCLASS), c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), @@ -328,9 +328,9 @@ query TT SHOW CREATE TABLE serials ---- serials CREATE TABLE public.serials ( - a INT2 NOT NULL DEFAULT nextval('test.public.serials_a_seq1':::STRING::REGCLASS), - b INT4 NOT NULL DEFAULT nextval('test.public.serials_b_seq1':::STRING::REGCLASS), - c INT8 NOT NULL DEFAULT nextval('test.public.serials_c_seq1':::STRING::REGCLASS), + a INT2 NOT NULL DEFAULT nextval('public.serials_a_seq1':::STRING::REGCLASS), + b INT4 NOT NULL DEFAULT nextval('public.serials_b_seq1':::STRING::REGCLASS), + c INT8 NOT NULL DEFAULT nextval('public.serials_c_seq1':::STRING::REGCLASS), d INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT "primary" PRIMARY KEY (rowid ASC), diff --git a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables index 007ac9b7fe4d..5b0784024c45 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables +++ b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables @@ -208,7 +208,7 @@ CREATE TABLE public.c ( ); CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; CREATE TABLE public.s_tbl ( - id INT8 NOT NULL DEFAULT nextval('test_fk_order.public.s':::STRING::REGCLASS), + id INT8 NOT NULL DEFAULT nextval('public.s':::STRING::REGCLASS), v INT8 NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY f1 (id, v) diff --git a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin index 092d55b6e5e7..3697f140fa20 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin +++ b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin @@ -202,7 +202,7 @@ CREATE TABLE public.c ( ); CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; CREATE TABLE public.s_tbl ( - id INT8 NOT NULL DEFAULT nextval('test_fk_order.public.s':::STRING::REGCLASS), + id INT8 NOT NULL DEFAULT nextval('public.s':::STRING::REGCLASS), v INT8 NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY f1 (id, v) diff --git a/pkg/sql/sem/tree/name_resolution.go b/pkg/sql/sem/tree/name_resolution.go index 75bb45874285..436cde375e86 100644 --- a/pkg/sql/sem/tree/name_resolution.go +++ b/pkg/sql/sem/tree/name_resolution.go @@ -262,9 +262,12 @@ type ObjectNameExistingResolver interface { } // QualifiedNameResolver is the helper interface to resolve qualified -// table names given an ID and the required table kind. +// table names given an ID and the required table kind, as well as the +// current database to determine whether or not to include the +// database in the qualification. type QualifiedNameResolver interface { GetQualifiedTableNameByID(ctx context.Context, id int64, requiredType RequiredTableKind) (*TableName, error) + CurrentDatabase() string } // NameResolutionResult is an opaque reference returned by LookupObject().
e45e3378fc0f29694e81a29b4894c8f920dfd41a
2024-03-14 16:26:14
Herko Lategan
roachtest: deprecate multitenant_utils
false
deprecate multitenant_utils
roachtest
diff --git a/pkg/cmd/roachtest/tests/cluster_to_cluster.go b/pkg/cmd/roachtest/tests/cluster_to_cluster.go index c66063653635..41b39bd0ec06 100644 --- a/pkg/cmd/roachtest/tests/cluster_to_cluster.go +++ b/pkg/cmd/roachtest/tests/cluster_to_cluster.go @@ -531,14 +531,14 @@ func (rd *replicationDriver) setupC2C( overrideSrcAndDestTenantTTL(t, srcSQL, destSQL, rd.rs.overrideTenantTTL) - createTenantAdminRole(t, "src-system", srcSQL) - createTenantAdminRole(t, "dst-system", destSQL) + deprecatedCreateTenantAdminRole(t, "src-system", srcSQL) + deprecatedCreateTenantAdminRole(t, "dst-system", destSQL) srcTenantID, destTenantID := 2, 2 srcTenantName := "src-tenant" destTenantName := "destination-tenant" - createInMemoryTenant(ctx, t, c, srcTenantName, srcCluster, true) + deprecatedCreateInMemoryTenant(ctx, t, c, srcTenantName, srcCluster, true) pgURL, err := copyPGCertsAndMakeURL(ctx, t, c, srcNode, srcClusterSetting.PGUrlCertsDir, addr[0]) require.NoError(t, err) @@ -983,7 +983,7 @@ func (rd *replicationDriver) main(ctx context.Context) { rd.metrics.cutoverEnd = newMetricSnapshot(metricSnapper, timeutil.Now()) rd.t.L().Printf("starting the destination tenant") - conn := startInMemoryTenant(ctx, rd.t, rd.c, rd.setup.dst.name, rd.setup.dst.gatewayNodes) + conn := deprecatedStartInMemoryTenant(ctx, rd.t, rd.c, rd.setup.dst.name, rd.setup.dst.gatewayNodes) conn.Close() rd.metrics.export(rd.t, len(rd.setup.src.nodes)) diff --git a/pkg/cmd/roachtest/tests/multitenant.go b/pkg/cmd/roachtest/tests/multitenant.go index 5f5b84ad1979..c255bf922ab3 100644 --- a/pkg/cmd/roachtest/tests/multitenant.go +++ b/pkg/cmd/roachtest/tests/multitenant.go @@ -120,7 +120,7 @@ func runAcceptanceMultitenantMultiRegion(ctx context.Context, t test.Test, c clu for i, node := range c.All() { region := regions[i] regionInfo := fmt.Sprintf("cloud=%s,region=%s,zone=%s", c.Cloud(), regionOnly(region), region) - tenant := createTenantNode(ctx, t, c, c.All(), tenantID, node, tenantHTTPPort, tenantSQLPort, createTenantRegion(regionInfo)) + tenant := deprecatedCreateTenantNode(ctx, t, c, c.All(), tenantID, node, tenantHTTPPort, tenantSQLPort, createTenantRegion(regionInfo)) tenant.start(ctx, t, c, "./cockroach") tenants = append(tenants, tenant) diff --git a/pkg/cmd/roachtest/tests/multitenant_upgrade.go b/pkg/cmd/roachtest/tests/multitenant_upgrade.go index 99f9e3a2b3c6..585f295907ce 100644 --- a/pkg/cmd/roachtest/tests/multitenant_upgrade.go +++ b/pkg/cmd/roachtest/tests/multitenant_upgrade.go @@ -113,13 +113,13 @@ func runMultiTenantUpgrade( // Create two instances of tenant 11 so that we can test with two pods // running during migration. const tenantNode = 2 - tenant11a := createTenantNode(ctx, t, c, kvNodes, tenant11ID, tenantNode, tenant11aHTTPPort, tenant11aSQLPort) + tenant11a := deprecatedCreateTenantNode(ctx, t, c, kvNodes, tenant11ID, tenantNode, tenant11aHTTPPort, tenant11aSQLPort) tenant11a.start(ctx, t, c, predecessorBinary) defer tenant11a.stop(ctx, t, c) - // Since the certs are created with the createTenantNode call above, we + // Since the certs are created with the deprecatedCreateTenantNode call above, we // call the "no certs" version of create tenant here. - tenant11b := createTenantNodeNoCerts(ctx, t, c, kvNodes, tenant11ID, tenantNode, tenant11bHTTPPort, tenant11bSQLPort) + tenant11b := deprecatedCreateTenantNodeNoCerts(ctx, t, c, kvNodes, tenant11ID, tenantNode, tenant11bHTTPPort, tenant11bSQLPort) tenant11b.start(ctx, t, c, predecessorBinary) defer tenant11b.stop(ctx, t, c) @@ -174,7 +174,7 @@ func runMultiTenantUpgrade( withResults([][]string{{"1", "bar"}})) t.Status("starting tenant 12 server with older binary") - tenant12 := createTenantNode(ctx, t, c, kvNodes, tenant12ID, tenantNode, tenant12HTTPPort, tenant12SQLPort) + tenant12 := deprecatedCreateTenantNode(ctx, t, c, kvNodes, tenant12ID, tenantNode, tenant12HTTPPort, tenant12SQLPort) tenant12.start(ctx, t, c, predecessorBinary) defer tenant12.stop(ctx, t, c) @@ -196,7 +196,7 @@ func runMultiTenantUpgrade( runner.Exec(t, `SELECT crdb_internal.create_tenant($1::INT)`, tenant13ID) t.Status("starting tenant 13 server with new binary") - tenant13 := createTenantNode(ctx, t, c, kvNodes, tenant13ID, tenantNode, tenant13HTTPPort, tenant13SQLPort) + tenant13 := deprecatedCreateTenantNode(ctx, t, c, kvNodes, tenant13ID, tenantNode, tenant13HTTPPort, tenant13SQLPort) tenant13.start(ctx, t, c, currentBinary) defer tenant13.stop(ctx, t, c) @@ -356,7 +356,7 @@ func runMultiTenantUpgrade( runner.Exec(t, `SELECT crdb_internal.create_tenant($1::INT)`, tenant14ID) t.Status("verifying that the tenant 14 server works and has the proper version") - tenant14 := createTenantNode(ctx, t, c, kvNodes, tenant14ID, tenantNode, tenant14HTTPPort, tenant14SQLPort) + tenant14 := deprecatedCreateTenantNode(ctx, t, c, kvNodes, tenant14ID, tenantNode, tenant14HTTPPort, tenant14SQLPort) tenant14.start(ctx, t, c, currentBinary) defer tenant14.stop(ctx, t, c) verifySQL(t, tenant14.pgURL, diff --git a/pkg/cmd/roachtest/tests/multitenant_utils.go b/pkg/cmd/roachtest/tests/multitenant_utils.go index 39ac17bf1ba5..81e63de4e4fc 100644 --- a/pkg/cmd/roachtest/tests/multitenant_utils.go +++ b/pkg/cmd/roachtest/tests/multitenant_utils.go @@ -107,7 +107,8 @@ func createTenantNodeInternal( return tn } -func createTenantNode( +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedCreateTenantNode( ctx context.Context, t test.Test, c cluster.Cluster, @@ -118,7 +119,8 @@ func createTenantNode( return createTenantNodeInternal(ctx, t, c, kvnodes, tenantID, node, httpPort, sqlPort, true /* certs */, opts...) } -func createTenantNodeNoCerts( +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedCreateTenantNodeNoCerts( ctx context.Context, t test.Test, c cluster.Cluster, @@ -189,7 +191,7 @@ func (tn *tenantNode) start(ctx context.Context, t test.Test, c cluster.Cluster, randomSeed := rand.Int63() c.SetRandomSeed(randomSeed) require.NoError(t, err) - tn.errCh = startTenantServer( + tn.errCh = deprecatedStartTenantServer( ctx, c, c.Node(tn.node), internalIPs[0], binary, tn.kvAddrs, tn.tenantID, tn.httpPort, tn.sqlPort, tn.envVars, randomSeed, extraArgs..., @@ -251,7 +253,8 @@ func (tn *tenantNode) start(ctx context.Context, t test.Test, c cluster.Cluster, t.L().Printf("sql server for tenant %d (instance %d) now running", tn.tenantID, tn.instanceID) } -func startTenantServer( +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedStartTenantServer( tenantCtx context.Context, c cluster.Cluster, node option.NodeListOption, @@ -289,8 +292,11 @@ func startTenantServer( return errCh } -// createTenantAdminRole creates a role that can be used to log into a secure cluster's db console. -func createTenantAdminRole(t test.Test, tenantName string, tenantSQL *sqlutils.SQLRunner) { +// deprecatedCreateTenantAdminRole creates a role that can be used to log into a secure cluster's db console. +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedCreateTenantAdminRole( + t test.Test, tenantName string, tenantSQL *sqlutils.SQLRunner, +) { tenantSQL.Exec(t, fmt.Sprintf(`CREATE ROLE IF NOT EXISTS %s WITH LOGIN PASSWORD '%s'`, install.DefaultUser, install.DefaultPassword)) tenantSQL.Exec(t, fmt.Sprintf(`GRANT ADMIN TO %s`, install.DefaultUser)) t.L().Printf(`Log into %s db console with username "%s" and password "%s"`, @@ -299,9 +305,10 @@ func createTenantAdminRole(t test.Test, tenantName string, tenantSQL *sqlutils.S const appTenantName = "app" -// createInMemoryTenant runs through the necessary steps to create an in-memory +// deprecatedCreateInMemoryTenant runs through the necessary steps to create an in-memory // tenant without resource limits and full dbconsole viewing privileges. -func createInMemoryTenant( +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedCreateInMemoryTenant( ctx context.Context, t test.Test, c cluster.Cluster, @@ -309,15 +316,16 @@ func createInMemoryTenant( nodes option.NodeListOption, secure bool, ) { - db := createInMemoryTenantWithConn(ctx, t, c, tenantName, nodes, secure) + db := deprecatedCreateInMemoryTenantWithConn(ctx, t, c, tenantName, nodes, secure) db.Close() } -// createInMemoryTenantWithConn runs through the necessary steps to create an +// deprecatedCreateInMemoryTenantWithConn runs through the necessary steps to create an // in-memory tenant without resource limits and full dbconsole viewing // privileges. As a convenience, it also returns a connection to the tenant (on // a random node in the cluster). -func createInMemoryTenantWithConn( +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedCreateInMemoryTenantWithConn( ctx context.Context, t test.Test, c cluster.Cluster, @@ -330,19 +338,20 @@ func createInMemoryTenantWithConn( sysSQL := sqlutils.MakeSQLRunner(sysDB) sysSQL.Exec(t, "CREATE TENANT $1", tenantName) - tenantConn := startInMemoryTenant(ctx, t, c, tenantName, nodes) + tenantConn := deprecatedStartInMemoryTenant(ctx, t, c, tenantName, nodes) tenantSQL := sqlutils.MakeSQLRunner(tenantConn) if secure { - createTenantAdminRole(t, tenantName, tenantSQL) + deprecatedCreateTenantAdminRole(t, tenantName, tenantSQL) } return tenantConn } -// startInMemoryTenant starts an in memory tenant that has already been created. +// deprecatedStartInMemoryTenant starts an in memory tenant that has already been created. // This function also removes tenant rate limiters and sets a few cluster // settings on the tenant. As a convenience, it also returns a connection to // the tenant (on a random node in the cluster). -func startInMemoryTenant( +// Deprecated: use Cluster.StartServiceForVirtualCluster instead. +func deprecatedStartInMemoryTenant( ctx context.Context, t test.Test, c cluster.Cluster,
f81a9f91a583a794d8accfe2d53303acf9249631
2022-12-21 18:03:48
Tobias Grieger
kvserver: move run{Pre,Post}AddTriggers to appBatch
false
move run{Pre,Post}AddTriggers to appBatch
kvserver
diff --git a/pkg/kv/kvserver/app_batch.go b/pkg/kv/kvserver/app_batch.go index 09c989c01d8c..00478ef9cb85 100644 --- a/pkg/kv/kvserver/app_batch.go +++ b/pkg/kv/kvserver/app_batch.go @@ -105,6 +105,14 @@ func (b *appBatch) toCheckedCmd( } } +// runPreAddTriggers runs any triggers that must fire before the command is +// added to the appBatch's pebble batch. That is, the pebble batch at this point +// will have materialized the raft log up to but excluding the current command. +func (b *appBatch) runPreAddTriggers(ctx context.Context, cmd *raftlog.ReplicatedCmd) error { + // None currently. + return nil +} + // addWriteBatch adds the command's writes to the batch. func (b *appBatch) addWriteBatch( ctx context.Context, batch storage.Batch, cmd *replicatedCmd, @@ -123,3 +131,9 @@ func (b *appBatch) addWriteBatch( } return nil } + +func (b *appBatch) runPostAddTriggers(ctx context.Context, cmd *raftlog.ReplicatedCmd) error { + // TODO(sep-raft-log): currently they are commingled in runPostAddTriggersReplicaOnly, + // extract them from that method. + return nil +} diff --git a/pkg/kv/kvserver/replica_app_batch.go b/pkg/kv/kvserver/replica_app_batch.go index 2f0eac34a52c..549a326f15f2 100644 --- a/pkg/kv/kvserver/replica_app_batch.go +++ b/pkg/kv/kvserver/replica_app_batch.go @@ -126,7 +126,7 @@ func (b *replicaAppBatch) Stage( // Run any triggers that should occur before the batch is applied // and before the write batch is staged in the batch. - if err := b.runPreAddTriggers(ctx, cmd); err != nil { + if err := b.ab.runPreAddTriggers(ctx, &cmd.ReplicatedCmd); err != nil { return nil, err } @@ -141,7 +141,11 @@ func (b *replicaAppBatch) Stage( // Run any triggers that should occur before the batch is applied // but after the write batch is staged in the batch. - if err := b.runPostAddTriggers(ctx, cmd); err != nil { + if err := b.ab.runPostAddTriggers(ctx, &cmd.ReplicatedCmd); err != nil { + return nil, err + } + + if err := b.runPostAddTriggersReplicaOnly(ctx, cmd); err != nil { return nil, err } @@ -174,19 +178,10 @@ func changeRemovesStore( return !existsInChange } -// runPreAddTriggers runs any triggers that must fire -// before a command is applied to the state machine but after the command is -// staged in the replicaAppBatch's write batch. The batch at this point will -// represent the raft log up to but excluding the command that is currently -// being applied. -func (b *replicaAppBatch) runPreAddTriggers(ctx context.Context, cmd *replicatedCmd) error { - // None currently. - return nil -} - -// runPreAddTriggersReplicaOnly is like runPreAddTriggers (and is called right after -// it), except that it must only contain ephemeral side effects that have no influence -// on durable state. It is not invoked during stand-alone log application. +// runPreAddTriggersReplicaOnly is like (appBatch).runPreAddTriggers (and is +// called right after it), except that it must only contain ephemeral side +// effects that have no influence on durable state. It is not invoked during +// stand-alone log application. func (b *replicaAppBatch) runPreAddTriggersReplicaOnly( ctx context.Context, cmd *replicatedCmd, ) error { @@ -203,14 +198,16 @@ func (b *replicaAppBatch) runPreAddTriggersReplicaOnly( return nil } -// runPostAddTriggers runs any triggers that must fire +// runPostAddTriggersReplicaOnly runs any triggers that must fire // before a command is applied to the state machine but after the command is // staged in the replicaAppBatch's write batch. // // May mutate `cmd`. // // All errors from this method are fatal for this Replica. -func (b *replicaAppBatch) runPostAddTriggers(ctx context.Context, cmd *replicatedCmd) error { +func (b *replicaAppBatch) runPostAddTriggersReplicaOnly( + ctx context.Context, cmd *replicatedCmd, +) error { res := cmd.ReplicatedResult() // Acquire the split or merge lock, if this is a split or a merge. From this
9f2683bbd0e31f15afeb1266c6805c3bf19b29db
2020-12-14 23:05:12
Radu Berinde
sql: add test for EXPLAIN ANALYZE (DISTSQL) with multiple diagrams
false
add test for EXPLAIN ANALYZE (DISTSQL) with multiple diagrams
sql
diff --git a/pkg/sql/logictest/testdata/logic_test/explain_analyze_plans b/pkg/sql/logictest/testdata/logic_test/explain_analyze_plans index 536b62755d37..558fa0084afe 100644 --- a/pkg/sql/logictest/testdata/logic_test/explain_analyze_plans +++ b/pkg/sql/logictest/testdata/logic_test/explain_analyze_plans @@ -234,3 +234,69 @@ vectorized: <hidden> Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyMkMFKw0AQhu8-xTBeV5JcF4SiRCxVK2mpB8lhmx1qSLq77k6KJeSxfAGfTJItFBHB4__9M__wT4_hvUWJq_whv11DA3fF8hGaA7zc50UODVxDigKN1fSk9hRQvmKGpUDnbUUhWD-ifhqY6w-UqcDauI5HXAqsrCeUPXLNLaHEtdq2VJDS5JMxWBOrup1im8PM-Xqv_BEFrpwyQUKSXiVpcokClx1LmGUocLEBrvckIf36DFFX1jAZrq35ZXHnWgrgSWk5VVlsYHvkM4IbFLhVXL1RANuxGw-Ng6fNMyoHgVGdygVWO0KZDeL_DygoOGsC_ej-V3I6lAJJ7yg-OdjOV_TsbTWdiXI57U1AU-DoZlHMTbSGcrj4DgAA__8CVp2C · WARNING: this statement is experimental! + +# Test a query that has a subquery and a postquery. +statement ok +CREATE TABLE parent (p INT PRIMARY KEY); +INSERT INTO parent VALUES (1), (2); +CREATE TABLE child (c INT PRIMARY KEY, p INT REFERENCES parent(p)) + +query T +EXPLAIN ANALYZE (DISTSQL) INSERT INTO child VALUES (1, (SELECT min(p) FROM parent)) +---- +planning time: 10µs +execution time: 100µs +distribution: <hidden> +vectorized: <hidden> +· +• root +│ +├── • insert +│ │ into: child(c, p) +│ │ +│ └── • buffer +│ │ label: buffer 1 +│ │ +│ └── • values +│ size: 2 columns, 1 row +│ +├── • subquery +│ │ id: @S1 +│ │ original sql: (SELECT min(p) FROM parent) +│ │ exec mode: one row +│ │ +│ └── • group (scalar) +│ │ actual row count: 1 +│ │ +│ └── • scan +│ actual row count: 1 +│ KV rows read: 1 +│ KV bytes read: 8 B +│ missing stats +│ table: parent@primary +│ spans: LIMITED SCAN +│ limit: 1 +│ +└── • fk-check + │ + └── • error if rows + │ + └── • lookup join (anti) + │ actual row count: 0 + │ KV rows read: 1 + │ table: parent@primary + │ equality: (column2) = (p) + │ equality cols are key + │ + └── • filter + │ actual row count: 1 + │ filter: column2 IS NOT NULL + │ + └── • scan buffer + label: buffer 1 +· +Diagram 1 (subquery): https://cockroachdb.github.io/distsqlplan/decode.html#eJy0UtGK2zoQfb9fIeYpAS2xs1woetq0pBA2dUriDZRiFkUevKK2pErj7qYhn9Uf6JcV2-sQszRlKX2cMzqac2bOAcLXEgQsks18nbJFkq6YetBlzraz5d18w0YxZ6PNfDl_l7JKm5Ebs_fr1QfmpEdD4zFwMDbHRFYYQHyGGDj8DxkH563CEKxv4EP7aJE_gYg4aONqauCMg7IeQRyANJUIAhJ7Zd1kChxyJKnL9lN8QlWTtoaRrlCw6OePABx2ktQDBmZrcjUJFgEHql15BsWQHTl01fPEQLJAENdHfqYqvqwqlbsS1yhz9JNoqK1bxI3zupJ-Dxw2Tpog2BVwWOpKE2tWcrsdSr_dMmUNoXnpqnnamfAoc9HTd3s6QW_Y27-1H7_G_qwoPBaSrJ_EQ_ez5NN9skrvk7vlcnQTN3H4F8eaDtT-IUJrDM6agAOlv_s5OmYcMC-wi2mwtVf40VvVjunKVctrgRwDdd3rrliYrtUIPCfHF8nTy-TpRXI0JLdWWldgkB6t_8JKSWjU_rT7Hn-UmoZXyTGg17LU3-XLk_W0UxwV6m_4HMm-2eey770qm9nxv18BAAD__1R7fzs= +Diagram 2 (main-query): https://cockroachdb.github.io/distsqlplan/decode.html#eJyMj8FqtEAQhO__UzR1Uhj49Tq3EAwIGw1qcgkeZKbZCLPTZmaEgPjuYfWQ6x7rq6ouekP8dtCom77qBqqboSXzNTtLH0-X96qnrFSU9dWleh7oNvtsyemla19pmQL7lOdQ8GK5mW4coT9RYlRYghiOUcIdbUegtj_QhcLslzXd8ahgJDD0hjQnx9BwYiZHRlafqPhfQMFymmZ3xHcFWdNfOabpytDlrh4f6Dgu4iM_dLnYRwW2Vz6fiLIGw29BzDFzyvboHcByTKdbnqL2p7WP-7_fAAAA__93xnPL +Diagram 3 (postquery): https://cockroachdb.github.io/distsqlplan/decode.html#eJyUU01u2zwQ3X-nGMzKBghYtLPiysEHGVCqSoWtZFNowUrjlC1NqiSFNjB8rF6gJyskBm2dwEK8nMd5P3wSj-i_aRSYFbt0W0FWVCU0n5Vu4eE2v093MOMMZrs0T_-v4KDMrJvDZlu-h046MmE-R4bGtlTIA3kUH5FjzbBztiHvrRug47iQtT9QJAyV6fowwDXDxjpCccSggiYUqG0jNfhGGvjU7_fkIFkkyLClIJUe5cs-CFgvsT4xtH34q-WDfCQU_MTe7rdROpAjt-DnJhEXsOaQ7aAoKyju8xyfxSD0nSYvgP9BfJBaQ1AHEpD8-umRYVyCmHHYvZR4eU3iO6vMlmRLbrE8z1w9dSQgTzcV3BZVBndlViDD-JnWnVMH6Z6QYW7t176DL1YZsGa4I7LnVvl1N3z38GpurAlkgrLm9Wrsw5Fso-6LgpKLBa2uKSj-QuScdaD24Ox3D3yxOuvqktHNNUZb8p01nt6knJxqhtQ-UnwP3vauoQ_ONqNNHMuRNwIt-RBPeRwyE4-GgP-S-SR5OU1eTpJX0-TVJPnmBbk-_fc7AAD__yVxcZc= +· +WARNING: this statement is experimental!
7cf7e67df7e3537813a463d39f55c4f5708e5bb5
2021-06-24 22:37:30
Rebecca Taft
opt: eliminate unnecessary index join inside group by
false
eliminate unnecessary index join inside group by
opt
diff --git a/pkg/sql/opt/xform/groupby_funcs.go b/pkg/sql/opt/xform/groupby_funcs.go index ceabbd13f128..1d89d0810f92 100644 --- a/pkg/sql/opt/xform/groupby_funcs.go +++ b/pkg/sql/opt/xform/groupby_funcs.go @@ -256,3 +256,13 @@ func (c *CustomFuncs) SplitGroupByScanIntoUnionScans( intraOrd, scan, sp, cons, 0 /* limit */, keyPrefixLength, ) } + +// GroupingColumns returns the grouping columns from the grouping private. +func (c *CustomFuncs) GroupingColumns(private *memo.GroupingPrivate) opt.ColSet { + return private.GroupingCols +} + +// GroupingOrdering returns the ordering from the grouping private. +func (c *CustomFuncs) GroupingOrdering(private *memo.GroupingPrivate) props.OrderingChoice { + return private.Ordering +} diff --git a/pkg/sql/opt/xform/rules/groupby.opt b/pkg/sql/opt/xform/rules/groupby.opt index b3fd5b3d5001..348a46a7e663 100644 --- a/pkg/sql/opt/xform/rules/groupby.opt +++ b/pkg/sql/opt/xform/rules/groupby.opt @@ -211,3 +211,81 @@ ) => ((OpName) (Select $unionScans $filters) $aggs $private) + +# EliminateIndexJoinInsideGroupBy removes an IndexJoin operator if it can be +# proven that the removal does not affect the output of the parent grouping +# operator. This is the case if: +# +# 1. Only columns from the index join's input are being used by the grouping +# operator. +# +# 2. The OrderingChoice of the grouping operator can be expressed with only +# columns from the index join's input. Or in other words, at least one column +# in every ordering group is one of the output columns from the index join's +# input. +# +# This rule is useful when using partial indexes. When generating partial index +# scans, expressions can be removed from filters because they exactly match +# expressions in partial index predicates and there is no need to apply the +# filter after the scan. Columns referenced in the removed expressions may no +# longer need to be fetched. +# +# Consider the example: +# +# CREATE TABLE t (i INT, s STRING, INDEX (i) WHERE s IN ('foo','bar')) +# +# SELECT DISTINCT i FROM t WHERE s IN ('foo','bar') +# +# The normalized expression for the SELECT query is: +# +# distinct-on +# ├── columns: i:1 +# ├── grouping columns: i:1 +# └── select +# ├── columns: i:1 s:2!null +# ├── scan t +# │ └── columns: i:1 s:2 +# └── filters +# └── s:2 IN ('foo','bar') +# +# GeneratePartialIndexScans will generate this expression: +# +# distinct-on +# ├── columns: i:1 +# ├── grouping columns: i:1 +# └── index-join t +# ├── columns: i:1 s:2!null +# └── scan t@secondary,partial +# └── columns: i:1 rowid:4!null +# +# The IndexJoin is created because the Select expression in the previous +# expression required s in order to apply the (s IN ('foo','bar')) filter. +# However, because rows in the partial index are already filtered by +# (s IN ('foo','bar')), column s does not need to be fetched. The IndexJoin +# can be eliminated, resulting in the expression: +# +# distinct-on +# ├── columns: i:1 +# ├── grouping columns: i:1 +# └── scan t@secondary,partial +# └── columns: i:1 rowid:4!null +# +[EliminateIndexJoinInsideGroupBy, Explore] +(GroupBy | DistinctOn | EnsureUpsertDistinctOn + (IndexJoin $input:*) + $aggs:* + $private:* & + (OrderingCanProjectCols + (GroupingOrdering $private) + $inputCols:(OutputCols $input) + ) & + (ColsAreSubset + (UnionCols + (GroupingColumns $private) + (AggregationOuterCols $aggs) + ) + $inputCols + ) +) +=> +((OpName) $input $aggs $private) diff --git a/pkg/sql/opt/xform/rules/project.opt b/pkg/sql/opt/xform/rules/project.opt index a7b353573b52..4e17c434078f 100644 --- a/pkg/sql/opt/xform/rules/project.opt +++ b/pkg/sql/opt/xform/rules/project.opt @@ -3,7 +3,7 @@ # ============================================================================= # EliminateIndexJoinInsideProject discards an IndexJoin operator inside a -# Project operator when the input of the IndexJoin produces all the rows +# Project operator when the input of the IndexJoin produces all the columns # required by the Project. # # This rule is useful when using partial indexes. When generating partial index @@ -14,7 +14,7 @@ # # Consider the example: # -# CREATE TABLE t (i INT, s STRING, INDEX (a) WHERE s = 'foo') +# CREATE TABLE t (i INT, s STRING, INDEX (i) WHERE s = 'foo') # # SELECT i FROM t WHERE s = 'foo' # diff --git a/pkg/sql/opt/xform/testdata/rules/groupby b/pkg/sql/opt/xform/testdata/rules/groupby index 4d9389411cae..1604892022ef 100644 --- a/pkg/sql/opt/xform/testdata/rules/groupby +++ b/pkg/sql/opt/xform/testdata/rules/groupby @@ -1928,10 +1928,39 @@ CREATE TABLE regional ( d INT, e INT, UNIQUE (r, a, b) STORING (c), - UNIQUE (r, d, e) + UNIQUE (r, d, e), + UNIQUE INDEX partial_a (r, a) WHERE b > 0 ) ---- +exec-ddl +ALTER TABLE regional INJECT STATISTICS '[ + { + "columns": ["r"], + "distinct_count": 2, + "row_count": 100000, + "created_at": "2018-01-01 1:00:00.00000+00:00" + }, + { + "columns": ["a"], + "distinct_count": 100000, + "row_count": 100000, + "created_at": "2018-01-01 1:00:00.00000+00:00" + }, + { + "columns": ["b"], + "distinct_count": 100000, + "row_count": 100000, + "created_at": "2018-01-01 1:00:00.00000+00:00", + "histo_col_type": "int", + "histo_buckets": [ + {"num_eq": 0, "num_range": 0, "distinct_range": 0, "upper_bound": "0"}, + {"num_eq": 1, "num_range": 99999, "distinct_range": 99999, "upper_bound": "100000"} + ] + } +]' +---- + # This query mimics the validation query for new unique constraints in REGIONAL # BY ROW tables. opt expect=SplitGroupByScanIntoUnionScans @@ -2045,6 +2074,61 @@ project │ └── count_rows:10 > 1 [outer=(10), constraints=(/10: [/2 - ]; tight)] └── 1 +# This query mimics the validation query for new partial unique constraints in +# REGIONAL BY ROW tables. +opt expect=(SplitGroupByScanIntoUnionScans,EliminateIndexJoinInsideGroupBy) +SELECT a +FROM regional +WHERE a IS NOT NULL AND b > 0 +GROUP BY a +HAVING count(*) > 1 +LIMIT 1 +---- +project + ├── columns: a:2!null + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(2) + └── limit + ├── columns: a:2!null count_rows:10!null + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(2,10) + ├── select + │ ├── columns: a:2!null count_rows:10!null + │ ├── key: (2) + │ ├── fd: (2)-->(10) + │ ├── limit hint: 1.00 + │ ├── group-by + │ │ ├── columns: a:2!null count_rows:10!null + │ │ ├── grouping columns: a:2!null + │ │ ├── internal-ordering: +2 + │ │ ├── key: (2) + │ │ ├── fd: (2)-->(10) + │ │ ├── limit hint: 3.00 + │ │ ├── union-all + │ │ │ ├── columns: a:2!null rowid:7!null + │ │ │ ├── left columns: a:48 rowid:53 + │ │ │ ├── right columns: a:57 rowid:62 + │ │ │ ├── ordering: +2 + │ │ │ ├── scan regional@partial_a,partial + │ │ │ │ ├── columns: a:48!null rowid:53!null + │ │ │ │ ├── constraint: /47/48: [/'east' - /'east'] + │ │ │ │ ├── key: (53) + │ │ │ │ ├── fd: (53)-->(48), (48)-->(53) + │ │ │ │ └── ordering: +48 + │ │ │ └── scan regional@partial_a,partial + │ │ │ ├── columns: a:57!null rowid:62!null + │ │ │ ├── constraint: /56/57: [/'west' - /'west'] + │ │ │ ├── key: (62) + │ │ │ ├── fd: (62)-->(57), (57)-->(62) + │ │ │ └── ordering: +57 + │ │ └── aggregations + │ │ └── count-rows [as=count_rows:10] + │ └── filters + │ └── count_rows:10 > 1 [outer=(10), constraints=(/10: [/2 - ]; tight)] + └── 1 + # Rule applies for distinct-on. opt expect=SplitGroupByScanIntoUnionScans SELECT DISTINCT a, b @@ -2339,3 +2423,174 @@ group-by └── aggregations └── array-agg [as=array_agg:10, outer=(1)] └── r:1 + +# ------------------------------------------------------------------------ +# EliminateIndexJoinInsideGroupBy +# ------------------------------------------------------------------------ + +exec-ddl +CREATE TABLE abcd ( + a INT, + b FLOAT, + c INT, + d INT, + INDEX partial_ab (a, b) WHERE c > 0 +) +---- + +# Rule applies for group-by. +opt expect=EliminateIndexJoinInsideGroupBy +SELECT max(b), a FROM abcd WHERE c > 0 GROUP BY a +---- +group-by + ├── columns: max:8 a:1 + ├── grouping columns: a:1 + ├── internal-ordering: +1 + ├── key: (1) + ├── fd: (1)-->(8) + ├── scan abcd@partial_ab,partial + │ ├── columns: a:1 b:2 rowid:5!null + │ ├── key: (5) + │ ├── fd: (5)-->(1,2) + │ └── ordering: +1 + └── aggregations + └── max [as=max:8, outer=(2)] + └── b:2 + +# Rule applies for distinct-on. +opt expect=EliminateIndexJoinInsideGroupBy +SELECT DISTINCT a, b FROM abcd WHERE c > 0 +---- +distinct-on + ├── columns: a:1 b:2 + ├── grouping columns: a:1 b:2 + ├── internal-ordering: +1,+2 + ├── key: (1,2) + └── scan abcd@partial_ab,partial + ├── columns: a:1 b:2 rowid:5!null + ├── key: (5) + ├── fd: (5)-->(1,2) + └── ordering: +1,+2 + +# Rule applies for ensure-upsert-distinct-on. +opt expect=EliminateIndexJoinInsideGroupBy +INSERT INTO xyz SELECT a, a, b FROM abcd WHERE c > 0 ON CONFLICT (x) DO UPDATE SET z=2.0 +---- +upsert xyz + ├── columns: <none> + ├── arbiter indexes: primary + ├── canary column: x:13 + ├── fetch columns: x:13 y:14 z:15 + ├── insert-mapping: + │ ├── a:6 => x:1 + │ ├── a:6 => y:2 + │ └── b:7 => z:3 + ├── update-mapping: + │ └── upsert_z:21 => z:3 + ├── cardinality: [0 - 0] + ├── volatile, mutations + └── project + ├── columns: upsert_z:21 a:6 b:7 x:13 y:14 z:15 + ├── lax-key: (6,13) + ├── fd: (6)~~>(7), (13)-->(14,15), (6,13)~~>(7,21) + ├── right-join (merge) + │ ├── columns: a:6 b:7 x:13 y:14 z:15 + │ ├── left ordering: +13 + │ ├── right ordering: +6 + │ ├── lax-key: (6,13) + │ ├── fd: (6)~~>(7), (13)-->(14,15) + │ ├── scan xyz + │ │ ├── columns: x:13!null y:14 z:15 + │ │ ├── key: (13) + │ │ ├── fd: (13)-->(14,15) + │ │ └── ordering: +13 + │ ├── ensure-upsert-distinct-on + │ │ ├── columns: a:6 b:7 + │ │ ├── grouping columns: a:6 + │ │ ├── error: "UPSERT or INSERT...ON CONFLICT command cannot affect row a second time" + │ │ ├── lax-key: (6) + │ │ ├── fd: (6)~~>(7) + │ │ ├── ordering: +6 + │ │ ├── scan abcd@partial_ab,partial + │ │ │ ├── columns: a:6 b:7 rowid:10!null + │ │ │ ├── key: (10) + │ │ │ ├── fd: (10)-->(6,7) + │ │ │ └── ordering: +6 + │ │ └── aggregations + │ │ └── first-agg [as=b:7, outer=(7)] + │ │ └── b:7 + │ └── filters (true) + └── projections + └── CASE WHEN x:13 IS NULL THEN b:7 ELSE 2.0 END [as=upsert_z:21, outer=(7,13)] + +# Rule does not apply because c is used as a grouping column. +opt expect-not=EliminateIndexJoinInsideGroupBy +SELECT max(b), c FROM abcd WHERE c > 0 GROUP BY c +---- +group-by + ├── columns: max:8 c:3!null + ├── grouping columns: c:3!null + ├── key: (3) + ├── fd: (3)-->(8) + ├── select + │ ├── columns: b:2 c:3!null + │ ├── scan abcd + │ │ ├── columns: b:2 c:3 + │ │ └── partial index predicates + │ │ └── partial_ab: filters + │ │ └── c:3 > 0 [outer=(3), constraints=(/3: [/1 - ]; tight)] + │ └── filters + │ └── c:3 > 0 [outer=(3), constraints=(/3: [/1 - ]; tight)] + └── aggregations + └── max [as=max:8, outer=(2)] + └── b:2 + +# Rule does not apply because c is used in an aggregate. +opt expect-not=EliminateIndexJoinInsideGroupBy +SELECT max(c), a FROM abcd WHERE c > 0 GROUP BY a +---- +group-by + ├── columns: max:8!null a:1 + ├── grouping columns: a:1 + ├── key: (1) + ├── fd: (1)-->(8) + ├── select + │ ├── columns: a:1 c:3!null + │ ├── scan abcd + │ │ ├── columns: a:1 c:3 + │ │ └── partial index predicates + │ │ └── partial_ab: filters + │ │ └── c:3 > 0 [outer=(3), constraints=(/3: [/1 - ]; tight)] + │ └── filters + │ └── c:3 > 0 [outer=(3), constraints=(/3: [/1 - ]; tight)] + └── aggregations + └── max [as=max:8, outer=(3)] + └── c:3 + +# Rule does not apply because c is needed for the ordering of array_agg. +opt expect-not=EliminateIndexJoinInsideGroupBy +SELECT a, array_agg(b) +FROM (SELECT a, b FROM abcd WHERE c > 0 ORDER BY c) +GROUP BY a +---- +group-by + ├── columns: a:1 array_agg:8 + ├── grouping columns: a:1 + ├── internal-ordering: +3 opt(1) + ├── key: (1) + ├── fd: (1)-->(8) + ├── sort + │ ├── columns: a:1 b:2 c:3!null + │ ├── ordering: +3 opt(1) [actual: +3] + │ └── select + │ ├── columns: a:1 b:2 c:3!null + │ ├── scan abcd + │ │ ├── columns: a:1 b:2 c:3 + │ │ └── partial index predicates + │ │ └── partial_ab: filters + │ │ └── c:3 > 0 [outer=(3), constraints=(/3: [/1 - ]; tight)] + │ └── filters + │ └── c:3 > 0 [outer=(3), constraints=(/3: [/1 - ]; tight)] + └── aggregations + └── array-agg [as=array_agg:8, outer=(2)] + └── b:2
d08176a6c2902f71059d91d1cf090e52e0627774
2024-04-08 23:01:19
Renato Costa
workload: skip TestRandRun under duress
false
skip TestRandRun under duress
workload
diff --git a/pkg/workload/rand/BUILD.bazel b/pkg/workload/rand/BUILD.bazel index 9d342bb1b6c7..8e9b6f5b1d34 100644 --- a/pkg/workload/rand/BUILD.bazel +++ b/pkg/workload/rand/BUILD.bazel @@ -35,6 +35,7 @@ go_test( "//pkg/sql/sem/tree", "//pkg/sql/types", "//pkg/testutils/serverutils", + "//pkg/testutils/skip", "//pkg/testutils/sqlutils", "//pkg/util/leaktest", "//pkg/util/log", diff --git a/pkg/workload/rand/rand_test.go b/pkg/workload/rand/rand_test.go index d4bd3200d1f5..966e857db4ec 100644 --- a/pkg/workload/rand/rand_test.go +++ b/pkg/workload/rand/rand_test.go @@ -24,6 +24,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" + "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/log" @@ -47,6 +48,8 @@ func TestRandRun(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) + skip.UnderDuress(t, "random test, can time out under duress") + ctx, cancel := context.WithCancel(context.Background()) defer cancel()
c09fc39fb457ab218a01f76d9e161645fb8f0e77
2022-11-08 03:22:27
Andrew Werner
sql: allow root to make the system db MR
false
allow root to make the system db MR
sql
diff --git a/pkg/ccl/logictestccl/testdata/logic_test/multi_region b/pkg/ccl/logictestccl/testdata/logic_test/multi_region index e85be073b462..d3538107adfb 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/multi_region +++ b/pkg/ccl/logictestccl/testdata/logic_test/multi_region @@ -526,10 +526,23 @@ USE new_db statement error cannot set LOCALITY on a table in a database that is not multi-region enabled CREATE TABLE cannot_create_table_no_multiregion (a int) LOCALITY GLOBAL +# For now, just test to see that non-root admin users cannot make the system +# database a multi-region database. + +statement ok +GRANT admin TO testuser + +user testuser + # Test adding a primary region to the system database. statement error adding a primary region to the system database is not supported ALTER DATABASE system PRIMARY REGION "ap-southeast-2" +user root + +statement ok +REVOKE admin FROM testuser + statement ok CREATE DATABASE alter_test_db primary region "ca-central-1" diff --git a/pkg/sql/alter_database.go b/pkg/sql/alter_database.go index 8013aabdfed2..337a5738b949 100644 --- a/pkg/sql/alter_database.go +++ b/pkg/sql/alter_database.go @@ -1004,9 +1004,14 @@ func (n *alterDatabasePrimaryRegionNode) setInitialPrimaryRegion(params runParam } func (n *alterDatabasePrimaryRegionNode) startExec(params runParams) error { - // Block adding a primary region to the system database. This ensures that the system - // database can never be made into a multi-region database. - if n.desc.GetID() == keys.SystemDatabaseID { + // Block adding a primary region to the system database unless the user is + // root. This ensures that the system database can only be made into a + // multi-region database by the root user. + // + // TODO(ajwerner): In the future, lock this down even further under clearer + // semantics. + if n.desc.GetID() == keys.SystemDatabaseID && + !params.SessionData().User().IsRootUser() { return pgerror.Newf( pgcode.FeatureNotSupported, "adding a primary region to the system database is not supported",
af2f084b98a73e017c5ca951d97c2c6e0c3daffb
2018-09-12 19:38:09
Andrew Couch
ui: add multiple charts to Custom Chart page
false
add multiple charts to Custom Chart page
ui
diff --git a/pkg/ui/src/views/reports/containers/customChart/customChart.styl b/pkg/ui/src/views/reports/containers/customChart/customChart.styl index 49f0147da3ff..8b701b01644a 100644 --- a/pkg/ui/src/views/reports/containers/customChart/customChart.styl +++ b/pkg/ui/src/views/reports/containers/customChart/customChart.styl @@ -31,6 +31,10 @@ &--add margin 17px 9px +.chart-edit-button + padding 3px 9px + margin 0px 9px + .metric-table &__header background white diff --git a/pkg/ui/src/views/reports/containers/customChart/customMetric.tsx b/pkg/ui/src/views/reports/containers/customChart/customMetric.tsx index 9f309c63b296..fd347c312205 100644 --- a/pkg/ui/src/views/reports/containers/customChart/customMetric.tsx +++ b/pkg/ui/src/views/reports/containers/customChart/customMetric.tsx @@ -3,11 +3,18 @@ import * as React from "react"; import Select from "react-select"; import * as protos from "src/js/protos"; -import { DropdownOption } from "src/views/shared/components/dropdown"; +import { AxisUnits } from "src/views/shared/components/metricQuery"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import TimeSeriesQueryAggregator = protos.cockroach.ts.tspb.TimeSeriesQueryAggregator; import TimeSeriesQueryDerivative = protos.cockroach.ts.tspb.TimeSeriesQueryDerivative; +const axisUnitsOptions: DropdownOption[] = [ + AxisUnits.Count, + AxisUnits.Bytes, + AxisUnits.Duration, +].map(au => ({ label: AxisUnits[au], value: au.toString() })); + const downsamplerOptions: DropdownOption[] = [ TimeSeriesQueryAggregator.AVG, TimeSeriesQueryAggregator.MAX, @@ -32,6 +39,11 @@ export class CustomMetricState { source = ""; } +export class CustomChartState { + metrics: CustomMetricState[] = []; + axisUnits: AxisUnits = AxisUnits.Count; +} + interface CustomMetricRowProps { metricOptions: DropdownOption[]; nodeOptions: DropdownOption[]; @@ -161,9 +173,113 @@ export class CustomMetricRow extends React.Component<CustomMetricRowProps> { <input type="checkbox" checked={perNode} onChange={this.changePerNode} /> </td> <td> - <button className="metric-edit-button" onClick={this.deleteOption}>Remove</button> + <button className="metric-edit-button" onClick={this.deleteOption}>Remove Metric</button> </td> </tr> ); } } + +interface CustomChartTableProps { + metricOptions: DropdownOption[]; + nodeOptions: DropdownOption[]; + index: number; + chartState: CustomChartState; + onChange: (index: number, newState: CustomChartState) => void; + onDelete: (index: number) => void; +} + +export class CustomChartTable extends React.Component<CustomChartTableProps> { + currentMetrics() { + return this.props.chartState.metrics; + } + + addMetric = () => { + this.props.onChange(this.props.index, { + metrics: [...this.currentMetrics(), new CustomMetricState()], + axisUnits: this.currentAxisUnits(), + }); + } + + updateMetricRow = (index: number, newState: CustomMetricState) => { + const metrics = this.currentMetrics().slice(); + metrics[index] = newState; + this.props.onChange(this.props.index, { + metrics, + axisUnits: this.currentAxisUnits(), + }); + } + + removeMetric = (index: number) => { + const metrics = this.currentMetrics(); + this.props.onChange(this.props.index, { + metrics: metrics.slice(0, index).concat(metrics.slice(index + 1)), + axisUnits: this.currentAxisUnits(), + }); + } + + currentAxisUnits(): AxisUnits { + return this.props.chartState.axisUnits; + } + + changeAxisUnits = (selected: DropdownOption) => { + this.props.onChange(this.props.index, { + metrics: this.currentMetrics(), + axisUnits: +selected.value, + }); + } + + removeChart = () => { + this.props.onDelete(this.props.index); + } + + render() { + const metrics = this.currentMetrics(); + let table: JSX.Element = null; + + if (!_.isEmpty(metrics)) { + table = ( + <table className="metric-table"> + <thead> + <tr> + <td className="metric-table__header">Metric Name</td> + <td className="metric-table__header">Downsampler</td> + <td className="metric-table__header">Aggregator</td> + <td className="metric-table__header">Rate</td> + <td className="metric-table__header">Source</td> + <td className="metric-table__header">Per Node</td> + <td className="metric-table__header"></td> + </tr> + </thead> + <tbody> + { metrics.map((row, i) => + <CustomMetricRow + key={i} + metricOptions={this.props.metricOptions} + nodeOptions={this.props.nodeOptions} + index={i} + rowState={row} + onChange={this.updateMetricRow} + onDelete={this.removeMetric} + />, + )} + </tbody> + </table> + ); + } + + return ( + <div> + <Dropdown + title="Units" + selected={this.currentAxisUnits().toString()} + options={axisUnitsOptions} + onChange={this.changeAxisUnits} + /> + <button className="chart-edit-button chart-edit-button--remove" onClick={this.removeChart}>Remove Chart</button> + { table } + <button className="metric-edit-button metric-edit-button--add" onClick={this.addMetric}>Add Metric</button> + </div> + ); + } +} diff --git a/pkg/ui/src/views/reports/containers/customChart/index.tsx b/pkg/ui/src/views/reports/containers/customChart/index.tsx index d4787b0977eb..3f491bc2b7e7 100644 --- a/pkg/ui/src/views/reports/containers/customChart/index.tsx +++ b/pkg/ui/src/views/reports/containers/customChart/index.tsx @@ -10,22 +10,16 @@ import { nodesSummarySelector, NodesSummary } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; import { LineGraph } from "src/views/cluster/components/linegraph"; import TimeScaleDropdown from "src/views/cluster/containers/timescale"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; +import { DropdownOption } from "src/views/shared/components/dropdown"; import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import { Metric, Axis, AxisUnits } from "src/views/shared/components/metricQuery"; import { PageConfig, PageConfigItem } from "src/views/shared/components/pageconfig"; -import { CustomMetricState, CustomMetricRow } from "./customMetric"; +import { CustomChartState, CustomChartTable } from "./customMetric"; import "./customChart.styl"; import { INodeStatus } from "src/util/proto"; -const axisUnitsOptions: DropdownOption[] = [ - AxisUnits.Count, - AxisUnits.Bytes, - AxisUnits.Duration, -].map(au => ({ label: AxisUnits[au], value: au.toString() })); - export interface CustomChartProps { refreshNodes: typeof refreshNodes; nodesQueryValid: boolean; @@ -33,8 +27,7 @@ export interface CustomChartProps { } interface UrlState { - metrics: string; - units: string; + charts: string; } class CustomChart extends React.Component<CustomChartProps & WithRouterProps> { @@ -95,9 +88,20 @@ class CustomChart extends React.Component<CustomChartProps & WithRouterProps> { this.refresh(props); } - currentMetrics(): CustomMetricState[] { + currentCharts(): CustomChartState[] { + if ("metrics" in this.props.location.query) { + try { + return [{ + metrics: JSON.parse(this.props.location.query.metrics), + axisUnits: AxisUnits.Count, + }]; + } catch (e) { + return []; + } + } + try { - return JSON.parse(this.props.location.query.metrics); + return JSON.parse(this.props.location.query.charts); } catch (e) { return []; } @@ -111,43 +115,34 @@ class CustomChart extends React.Component<CustomChartProps & WithRouterProps> { }); } - updateUrlMetrics(newState: CustomMetricState[]) { - const metrics = JSON.stringify(newState); + updateUrlCharts(newState: CustomChartState[]) { + const charts = JSON.stringify(newState); this.updateUrl({ - metrics, + charts, }); } - updateMetricRow = (index: number, newState: CustomMetricState) => { - const arr = this.currentMetrics().slice(); + updateChartRow = (index: number, newState: CustomChartState) => { + const arr = this.currentCharts().slice(); arr[index] = newState; - this.updateUrlMetrics(arr); - } - - addMetric = () => { - this.updateUrlMetrics([...this.currentMetrics(), new CustomMetricState()]); + this.updateUrlCharts(arr); } - removeMetric = (index: number) => { - const metrics = this.currentMetrics(); - this.updateUrlMetrics(metrics.slice(0, index).concat(metrics.slice(index + 1))); + addChart = () => { + this.updateUrlCharts([...this.currentCharts(), new CustomChartState()]); } - currentAxisUnits(): AxisUnits { - return +this.props.location.query.units || AxisUnits.Count; - } - - changeAxisUnits = (selected: DropdownOption) => { - this.updateUrl({ - units: selected.value, - }); + removeChart = (index: number) => { + const charts = this.currentCharts(); + this.updateUrlCharts(charts.slice(0, index).concat(charts.slice(index + 1))); } // Render a chart of the currently selected metrics. - renderChart() { - const metrics = this.currentMetrics(); - const units = this.currentAxisUnits(); + renderChart = (chart: CustomChartState, index: number) => { + const metrics = chart.metrics; + const units = chart.axisUnits; const { nodesSummary } = this.props; + if (_.isEmpty(metrics)) { return ( <div> @@ -157,8 +152,8 @@ class CustomChart extends React.Component<CustomChartProps & WithRouterProps> { } return ( - <div> - <MetricsDataProvider id="debug-custom-chart"> + <React.Fragment key={ index }> + <MetricsDataProvider id={`debug-custom-chart.${index}`}> <LineGraph> <Axis units={units}> { @@ -200,57 +195,51 @@ class CustomChart extends React.Component<CustomChartProps & WithRouterProps> { </Axis> </LineGraph> </MetricsDataProvider> - </div> + </React.Fragment> ); } - // Render a table containing all of the currently added metrics, with editing - // inputs for each metric. - renderMetricsTable() { - const metrics = this.currentMetrics(); - let table: JSX.Element = null; - - if (!_.isEmpty(metrics)) { - table = ( - <table className="metric-table"> - <thead> - <tr> - <td className="metric-table__header">Metric Name</td> - <td className="metric-table__header">Downsampler</td> - <td className="metric-table__header">Aggregator</td> - <td className="metric-table__header">Rate</td> - <td className="metric-table__header">Source</td> - <td className="metric-table__header">Per Node</td> - <td className="metric-table__header metric-table__header--no-title"></td> - </tr> - </thead> - <tbody> - { metrics.map((row, i) => - <CustomMetricRow - key={i} - metricOptions={this.metricOptions(this.props.nodesSummary)} - nodeOptions={this.nodeOptions(this.props.nodesSummary)} - index={i} - rowState={row} - onChange={this.updateMetricRow} - onDelete={this.removeMetric} - />, - )} - </tbody> - </table> + renderCharts() { + const charts = this.currentCharts(); + + if (_.isEmpty(charts)) { + return ( + <h3>Click "Add Chart" to add a chart to the custom dashboard.</h3> ); } + return ( + <React.Fragment> + { charts.map(this.renderChart) } + </React.Fragment> + ); + } + + // Render a table containing all of the currently added metrics, with editing + // inputs for each metric. + renderChartTables() { + const charts = this.currentCharts(); + return ( <div> - { table } - <button className="metric-edit-button metric-edit-button--add" onClick={this.addMetric}>Add Metric</button> + { + charts.map((chart, i) => ( + <CustomChartTable + metricOptions={ this.metricOptions(this.props.nodesSummary) } + nodeOptions={ this.nodeOptions(this.props.nodesSummary) } + index={ i } + chartState={ chart } + onChange={ this.updateChartRow } + onDelete={ this.removeChart } + /> + )) + } + <button className="chart-edit-button chart-edit-button--add" onClick={this.addChart}>Add Chart</button> </div> ); } render() { - const units = this.currentAxisUnits(); return ( <div> <Helmet> @@ -261,26 +250,18 @@ class CustomChart extends React.Component<CustomChartProps & WithRouterProps> { <PageConfigItem> <TimeScaleDropdown /> </PageConfigItem> - <PageConfigItem> - <Dropdown - title="Units" - selected={units.toString()} - options={axisUnitsOptions} - onChange={this.changeAxisUnits} - /> - </PageConfigItem> </PageConfig> <section className="section"> <div className="l-columns"> <div className="chart-group l-columns__left"> - { this.renderChart() } + { this.renderCharts() } </div> <div className="l-columns__right"> </div> </div> </section> <section className="section"> - { this.renderMetricsTable() } + { this.renderChartTables() } </section> </div> );
6b6bfee06499b46100b459aaca42dfb9d7714039
2023-06-27 13:04:13
Erik Grinaker
kvserver: add `Replica.forgetLeaderLocked()`
false
add `Replica.forgetLeaderLocked()`
kvserver
diff --git a/pkg/kv/kvserver/replica_raft.go b/pkg/kv/kvserver/replica_raft.go index d33eece0989e..f49b0c355fda 100644 --- a/pkg/kv/kvserver/replica_raft.go +++ b/pkg/kv/kvserver/replica_raft.go @@ -2221,10 +2221,12 @@ func shouldCampaignOnLeaseRequestRedirect( // Only followers enforce the CheckQuorum recent leader condition though, so if // a quorum of followers consider the leader dead and choose to become // pre-candidates and campaign then they will grant prevotes and can hold an -// election without waiting out the election timeout, but this can result in -// election ties if a quorum does so simultaneously. Followers and -// pre-candidates will also grant any number of pre-votes, both for themselves -// and anyone else that's eligible. +// election without waiting out the election timeout. This can result in +// election ties, so it's often better for followers to choose to forget their +// current leader via forgetLeaderLocked(), allowing them to immediately grant +// (pre)votes without campaigning themselves. Followers and pre-candidates will +// also grant any number of pre-votes, both for themselves and anyone else +// that's eligible. func (r *Replica) campaignLocked(ctx context.Context) { log.VEventf(ctx, 3, "campaigning") if err := r.mu.internalRaftGroup.Campaign(); err != nil { @@ -2250,6 +2252,43 @@ func (r *Replica) forceCampaignLocked(ctx context.Context) { r.store.enqueueRaftUpdateCheck(r.RangeID) } +// forgetLeaderLocked forgets a follower's current raft leader, remaining a +// leaderless follower in the current term. The replica will not campaign unless +// the election timeout elapses. However, this allows it to grant (pre)votes if +// a different candidate is campaigning, or revert to a follower if it receives +// a message from the leader. It still won't grant prevotes to a lagging +// follower. This is a noop on non-followers. +// +// This is useful with PreVote+CheckQuorum, where a follower will not grant +// (pre)votes if it has a current leader. Forgetting the leader allows the +// replica to vote without waiting out the election timeout if it has good +// reason to believe the current leader is dead. If a quorum of followers +// independently consider the leader dead, a campaigner can win despite them +// having heard from a leader recently (in ticks). +// +// The motivating case is a quiesced range that unquiesces to a long-dead +// leader: the first replica will campaign and solicit pre-votes, but normally +// the other replicas won't grant the prevote because they heard from the leader +// in the past election timeout (in ticks), requiring waiting for an election +// timeout. However, if they independently see the leader dead in liveness when +// unquiescing, they can forget the leader and grant the prevote. If a quorum of +// replicas independently consider the leader dead, the candidate wins the +// election. If the leader isn't dead after all, the replica will revert to a +// follower upon hearing from it. +// +// In particular, since a quorum must agree that the leader is dead and forget +// it for a candidate to win a pre-campaign, this avoids disruptions during +// partial/asymmetric partitions where individual replicas can mistakenly +// believe the leader is dead and steal leadership away, which can otherwise +// lead to persistent unavailability. +func (r *Replica) forgetLeaderLocked(ctx context.Context) { + log.VEventf(ctx, 3, "forgetting leader") + msg := raftpb.Message{To: uint64(r.replicaID), Type: raftpb.MsgForgetLeader} + if err := r.mu.internalRaftGroup.Step(msg); err != nil { + log.VEventf(ctx, 1, "failed to forget leader: %s", err) + } +} + // a lastUpdateTimesMap is maintained on the Raft leader to keep track of the // last communication received from followers, which in turn informs the quota // pool and log truncations.
2aa1e612b2c3c4dd9bfb764de7b6c79a23785e31
2023-07-27 20:31:52
wenyihu6
asim: skip TestAllocatorSimulatorDeterministic and example_fulldisk
false
skip TestAllocatorSimulatorDeterministic and example_fulldisk
asim
diff --git a/pkg/kv/kvserver/asim/BUILD.bazel b/pkg/kv/kvserver/asim/BUILD.bazel index ec6c8e127985..33ae641c796c 100644 --- a/pkg/kv/kvserver/asim/BUILD.bazel +++ b/pkg/kv/kvserver/asim/BUILD.bazel @@ -29,6 +29,7 @@ go_test( "//pkg/kv/kvserver/asim/metrics", "//pkg/kv/kvserver/asim/state", "//pkg/kv/kvserver/asim/workload", + "//pkg/testutils/skip", "@com_github_stretchr_testify//require", ], ) diff --git a/pkg/kv/kvserver/asim/asim_test.go b/pkg/kv/kvserver/asim/asim_test.go index 0e786eeadbb9..59aee4d16cc6 100644 --- a/pkg/kv/kvserver/asim/asim_test.go +++ b/pkg/kv/kvserver/asim/asim_test.go @@ -21,6 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/metrics" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/state" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/workload" + "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/stretchr/testify/require" ) @@ -39,7 +40,7 @@ func TestRunAllocatorSimulator(t *testing.T) { } func TestAllocatorSimulatorDeterministic(t *testing.T) { - + skip.WithIssue(t, 105904, "asim is non-deterministic") settings := config.DefaultSimulationSettings() runs := 3 diff --git a/pkg/kv/kvserver/asim/tests/BUILD.bazel b/pkg/kv/kvserver/asim/tests/BUILD.bazel index 318976935691..f84a355a05cf 100644 --- a/pkg/kv/kvserver/asim/tests/BUILD.bazel +++ b/pkg/kv/kvserver/asim/tests/BUILD.bazel @@ -22,6 +22,7 @@ go_test( "//pkg/roachpb", "//pkg/spanconfig/spanconfigtestutils", "//pkg/testutils/datapathutils", + "//pkg/testutils/skip", "//pkg/util/log", "@com_github_cockroachdb_datadriven//:datadriven", "@com_github_guptarohit_asciigraph//:asciigraph", diff --git a/pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go b/pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go index 7f24069d41d8..95714763b2d9 100644 --- a/pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go +++ b/pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go @@ -29,6 +29,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/spanconfig/spanconfigtestutils" "github.com/cockroachdb/cockroach/pkg/testutils/datapathutils" + "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/datadriven" "github.com/guptarohit/asciigraph" @@ -158,6 +159,9 @@ func TestDataDriven(t *testing.T) { ctx := context.Background() dir := datapathutils.TestDataPath(t, ".") datadriven.Walk(t, dir, func(t *testing.T, path string) { + if strings.Contains(path, "example_fulldisk") { + skip.WithIssue(t, 105904, "asim is non-deterministic") + } const defaultKeyspace = 10000 loadGen := gen.BasicLoad{} var clusterGen gen.ClusterGen
e4c47ae6d65125f7d6f6ddf2e6efb5e51fdaf2b6
2020-01-31 22:10:33
Andrii Vorobiov
ui: Fix Active links highlighting in navigation side panel
false
Fix Active links highlighting in navigation side panel
ui
diff --git a/pkg/ui/src/views/app/components/layoutSidebar/index.tsx b/pkg/ui/src/views/app/components/layoutSidebar/index.tsx index 53a3517cc09f..db97fcf2b828 100644 --- a/pkg/ui/src/views/app/components/layoutSidebar/index.tsx +++ b/pkg/ui/src/views/app/components/layoutSidebar/index.tsx @@ -15,26 +15,44 @@ import { Link, withRouter, RouteComponentProps } from "react-router-dom"; import { SideNavigation } from "src/components"; import "./navigation-bar.styl"; +interface RouteParam { + path: string; + text: string; + activeFor: string[]; + // ignoreFor allows exclude specific paths from been recognized as active + // even if path is matched with activeFor paths. + ignoreFor?: string[]; +} + /** * Sidebar represents the static navigation sidebar available on all pages. It * displays a number of graphic icons representing available pages; the icon of * the page which is currently active will be highlighted. */ class Sidebar extends React.Component<RouteComponentProps> { - readonly routes = [ + readonly routes: RouteParam[] = [ { path: "/overview", text: "Overview", activeFor: ["/node"] }, { path: "/metrics", text: "Metrics", activeFor: [] }, { path: "/databases", text: "Databases", activeFor: ["/database"] }, { path: "/statements", text: "Statements", activeFor: ["/statement"] }, { path: "/reports/network", text: "Network Latency", activeFor: ["/reports/network"] }, { path: "/jobs", text: "Jobs", activeFor: [] }, - { path: "/debug", text: "Advanced Debug", activeFor: ["/reports", "/data-distribution", "/raft"] }, + { + path: "/debug", + text: "Advanced Debug", + activeFor: ["/reports", "/data-distribution", "/raft"], + ignoreFor: ["/reports/network"], + }, ]; isActiveNavigationItem = (path: string): boolean => { const { pathname } = this.props.location; - const { activeFor } = this.routes.find(route => route.path === path); - return [...activeFor, path].some(p => pathname.startsWith(p)); + const { activeFor, ignoreFor = []} = this.routes.find(route => route.path === path); + return [...activeFor, path].some(p => { + const isMatchedToIgnoredPaths = ignoreFor.some(ignorePath => pathname.startsWith(ignorePath)); + const isMatchedToActiveFor = pathname.startsWith(p); + return isMatchedToActiveFor && !isMatchedToIgnoredPaths; + }); } render() {
e193e50df1b373042ebd6c55959329680c216a6f
2018-12-03 18:26:27
Tobias Schottdorf
storage: bump collectChecksumTimeout from 5s to 15s
false
bump collectChecksumTimeout from 5s to 15s
storage
diff --git a/pkg/storage/replica_consistency.go b/pkg/storage/replica_consistency.go index 45dd1fb35ebf..e3387e52a110 100644 --- a/pkg/storage/replica_consistency.go +++ b/pkg/storage/replica_consistency.go @@ -51,7 +51,7 @@ const ( // because the checksum might never be computed for a replica if that replica // is caught up via a snapshot and never performs the ComputeChecksum // operation. - collectChecksumTimeout = 5 * time.Second + collectChecksumTimeout = 15 * time.Second ) // CheckConsistency runs a consistency check on the range. It first applies a
c6a6112a4f3db407f36f715408c75c13bab4a0d2
2025-02-10 21:28:29
Matt Spilchen
sql: Fix trigger dependency cleanup in legacy schema changer
false
Fix trigger dependency cleanup in legacy schema changer
sql
diff --git a/pkg/ccl/logictestccl/testdata/logic_test/triggers b/pkg/ccl/logictestccl/testdata/logic_test/triggers index c5c8220eb1c9..c26ec208e4d2 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/triggers +++ b/pkg/ccl/logictestccl/testdata/logic_test/triggers @@ -4018,4 +4018,54 @@ DROP TRIGGER foo ON xy; statement ok CREATE OR REPLACE FUNCTION f() RETURNS TRIGGER LANGUAGE PLpgSQL AS $$ BEGIN RETURN NEW; END $$; +# ============================================================================== +# Test that descriptor backreferences are cleaned up +# ============================================================================== + +subtest ensure_back_ref_cleanup + +statement ok +create table listings_balance (c1 int); + +# Create a function that references listings_balance +statement ok +create or replace function update_listing_balance() +returns TRIGGER language PLpgSQL AS +$$ +BEGIN + INSERT INTO listings_balance VALUES (1); + RETURN NEW; +END +$$; + +statement ok +CREATE TABLE transaction_entries (c1 int); + +# Create a trigger that references listings_balance through the trigger function. +statement ok +create trigger tr AFTER INSERT OR UPDATE ON transaction_entries FOR EACH ROW execute function update_listing_balance(); + +# Force the legacy schema change for the drop table. We will save the original +# DSC setting so that it be reset properly. +let $use_decl_sc +SHOW use_declarative_schema_changer + +statement ok +SET use_declarative_schema_changer = off; + +# This should cleanup the dependency in listings_balance. +statement ok +DROP TABLE transaction_entries; + +# Reinstate original DSC setting +statement ok +SET use_declarative_schema_changer = $use_decl_sc; + +statement ok +DROP FUNCTION update_listing_balance ; + +# Sanity to verify the dependency no longer exists. +statement ok +drop table listings_balance cascade; + subtest end diff --git a/pkg/sql/drop_table.go b/pkg/sql/drop_table.go index 0e8ea131bf9d..aa72582765bc 100644 --- a/pkg/sql/drop_table.go +++ b/pkg/sql/drop_table.go @@ -278,7 +278,7 @@ func (p *planner) dropTableImpl( for i := range tableDesc.Triggers { trigger := &tableDesc.Triggers[i] for _, id := range trigger.DependsOn { - if err := p.removeTriggerBackReference(ctx, tableDesc, id); err != nil { + if err := p.removeTriggerBackReference(ctx, tableDesc, id, trigger.Name); err != nil { return droppedViews, err } } @@ -672,7 +672,7 @@ func removeFKBackReferenceFromTable( // removeTriggerBackReference removes the trigger back reference for the // referenced table with the given ID. func (p *planner) removeTriggerBackReference( - ctx context.Context, tableDesc *tabledesc.Mutable, refID descpb.ID, + ctx context.Context, tableDesc *tabledesc.Mutable, refID descpb.ID, triggerName string, ) error { var refTableDesc *tabledesc.Mutable // We don't want to lookup/edit a second copy of the same table. @@ -690,7 +690,18 @@ func (p *planner) removeTriggerBackReference( return nil } refTableDesc.DependedOnBy = removeMatchingReferences(refTableDesc.DependedOnBy, tableDesc.ID) - return nil + + name, err := p.getQualifiedTableName(ctx, tableDesc) + if err != nil { + return err + } + refName, err := p.getQualifiedTableName(ctx, refTableDesc) + if err != nil { + return err + } + jobDesc := fmt.Sprintf("updating table %q after removing trigger %q from table %q", + refName.FQString(), triggerName, name.FQString()) + return p.writeSchemaChange(ctx, refTableDesc, descpb.InvalidMutationID, jobDesc) } // removeMatchingReferences removes all refs from the provided slice that
0e4037936be6f99d7f3b5bb6f19d7b7fe9b63b8d
2022-08-30 21:25:22
Eric Harmeling
ui: fixes to copy in insight workload pages
false
fixes to copy in insight workload pages
ui
diff --git a/pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts index 4284452a8cff..515077fe095e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts @@ -67,16 +67,16 @@ function transactionContentionResultsToEventState( .asMilliseconds(), contentionThreshold: moment.duration(row.threshold).asMilliseconds(), application: row.app_name, - insightName: highContentionTimeQuery.name, + insightName: highContentionQuery.name, execType: InsightExecEnum.TRANSACTION, })); } -const highContentionTimeQuery: InsightQuery< +const highContentionQuery: InsightQuery< TransactionContentionResponseColumns, TransactionInsightEventsResponse > = { - name: InsightNameEnum.highContentionTime, + name: InsightNameEnum.highContention, query: `SELECT * FROM (SELECT blocking_txn_id, encode(blocking_txn_fingerprint_id, 'hex') AS blocking_txn_fingerprint_id, @@ -103,20 +103,20 @@ const highContentionTimeQuery: InsightQuery< toState: transactionContentionResultsToEventState, }; -// getTransactionInsightEventState is currently hardcoded to use the High Contention Time insight type +// getTransactionInsightEventState is currently hardcoded to use the High Contention insight type // for transaction contention events. export function getTransactionInsightEventState(): Promise<TransactionInsightEventsResponse> { const request: SqlExecutionRequest = { statements: [ { - sql: `${highContentionTimeQuery.query}`, + sql: `${highContentionQuery.query}`, }, ], execute: true, }; return executeSql<TransactionContentionResponseColumns>(request).then( result => { - return highContentionTimeQuery.toState(result); + return highContentionQuery.toState(result); }, ); } @@ -174,19 +174,19 @@ function transactionContentionDetailsResultsToEventState( tableName: row.table_name, indexName: row.index_name, contendedKey: row.key, - insightName: highContentionTimeQuery.name, + insightName: highContentionQuery.name, execType: InsightExecEnum.TRANSACTION, })); } -const highContentionTimeDetailsQuery = ( +const highContentionDetailsQuery = ( id: string, ): InsightQuery< TransactionContentionDetailsResponseColumns, TransactionInsightEventDetailsResponse > => { return { - name: InsightNameEnum.highContentionTime, + name: InsightNameEnum.highContention, query: `SELECT collection_ts, blocking_txn_id, encode(blocking_txn_fingerprint_id, 'hex') AS blocking_txn_fingerprint_id, @@ -232,12 +232,12 @@ const highContentionTimeDetailsQuery = ( }; }; -// getTransactionInsightEventState is currently hardcoded to use the High Contention Time insight type +// getTransactionInsightEventState is currently hardcoded to use the High Contention insight type // for transaction contention events. export function getTransactionInsightEventDetailsState( req: TransactionInsightEventDetailsRequest, ): Promise<TransactionInsightEventDetailsResponse> { - const detailsQuery = highContentionTimeDetailsQuery(req.id); + const detailsQuery = highContentionDetailsQuery(req.id); const request: SqlExecutionRequest = { statements: [ { @@ -321,7 +321,7 @@ const statementInsightsQuery: InsightQuery< ExecutionInsightsResponseRow, StatementInsights > = { - name: InsightNameEnum.highContentionTime, + name: InsightNameEnum.highContention, // We only surface the most recently observed problem for a given statement. query: `SELECT *, prettify_statement(non_prettified_query, 108, 2, 1) as query from ( SELECT diff --git a/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx index 218c2123930f..20258f3149d2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx @@ -24,7 +24,7 @@ import styles from "../statementDetails/statementDetails.module.scss"; const cx = classNames.bind(styles); export const WaitTimeInsightsLabels = { - SECTION_HEADING: "Contention Time Insights", + SECTION_HEADING: "Contention Insights", BLOCKED_SCHEMA: "Blocked Schema", BLOCKED_DATABASE: "Blocked Database", BLOCKED_TABLE: "Blocked Table", @@ -36,6 +36,8 @@ export const WaitTimeInsightsLabels = { `${capitalize(execType)} ID: ${id} waiting on`, WAITING_TXNS_TABLE_TITLE: (id: string, execType: ExecutionType): string => `${capitalize(execType)}s waiting for ID: ${id}`, + WAITED_TXNS_TABLE_TITLE: (id: string, execType: ExecutionType): string => + `${capitalize(execType)}s that waited for ID: ${id}`, }; type WaitTimeInsightsPanelProps = { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts index 87a5a033e3e2..921de33f5f92 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts @@ -11,9 +11,10 @@ import { Moment } from "moment"; import { Filters } from "../queryFilter"; +// This enum corresponds to the string enum for `problems` in `cluster_execution_insights` export enum InsightNameEnum { failedExecution = "FailedExecution", - highContentionTime = "HighContentionTime", + highContention = "HighContentionTime", highRetryCount = "HighRetryCount", planRegression = "PlanRegression", suboptimalPlan = "SuboptimalPlan", @@ -99,14 +100,19 @@ export type EventExecution = { execType: InsightExecEnum; }; -const highContentionTimeInsight = ( +const highContentionInsight = ( execType: InsightExecEnum = InsightExecEnum.TRANSACTION, latencyThreshold: number, ): Insight => { - const description = `This ${execType} has been waiting for more than ${latencyThreshold}ms on other ${execType}s to execute.`; + let threshold = latencyThreshold + "ms"; + if (!latencyThreshold) { + threshold = + "the value of the sql.insights.latency_threshold cluster setting"; + } + const description = `This ${execType} has been waiting on other ${execType}s to execute for longer than ${threshold}.`; return { - name: InsightNameEnum.highContentionTime, - label: "High Contention Time", + name: InsightNameEnum.highContention, + label: "High Contention", description: description, tooltipDescription: description + ` Click the ${execType} execution ID to see more details.`, @@ -178,7 +184,7 @@ const failedExecutionInsight = (execType: InsightExecEnum): Insight => { }; }; -export const InsightTypes = [highContentionTimeInsight]; +export const InsightTypes = [highContentionInsight]; // only used by getTransactionInsights to iterate over txn insights export const getInsightFromProblem = ( problem: string, @@ -186,8 +192,8 @@ export const getInsightFromProblem = ( latencyThreshold?: number, ): Insight => { switch (problem) { - case InsightNameEnum.highContentionTime: - return highContentionTimeInsight(execOption, latencyThreshold); + case InsightNameEnum.highContention: + return highContentionInsight(execOption, latencyThreshold); case InsightNameEnum.failedExecution: return failedExecutionInsight(execOption); case InsightNameEnum.planRegression: diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts b/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts index 328612466271..184321bc169f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/utils.ts @@ -219,7 +219,7 @@ export function insightType(type: InsightType): string { case "ReplaceIndex": return "Replace Index"; case "HighContentionTime": - return "High Contention Time"; + return "High Contention"; case "HighRetryCount": return "High Retry Counts"; case "SuboptimalPlan": diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx index 011e707531c2..775fe65d1112 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx @@ -74,7 +74,7 @@ export class StatementInsightDetails extends React.Component<StatementInsightDet insightDetails.insights.forEach(insight => { switch (insight.name) { - case InsightNameEnum.highContentionTime: + case InsightNameEnum.highContention: rec = { type: "HighContentionTime", execution: execDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx index 904306f40acc..37b497dd2948 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx @@ -112,7 +112,7 @@ export class TransactionInsightDetails extends React.Component<TransactionInsigh let rec: InsightRecommendation; insightDetails.insights.forEach(insight => { switch (insight.name) { - case InsightNameEnum.highContentionTime: + case InsightNameEnum.highContention: rec = { type: "HighContentionTime", details: { @@ -189,7 +189,7 @@ export class TransactionInsightDetails extends React.Component<TransactionInsigh <Col> <Row> <Heading type="h5"> - {WaitTimeInsightsLabels.WAITING_TXNS_TABLE_TITLE( + {WaitTimeInsightsLabels.WAITED_TXNS_TABLE_TITLE( insightDetails.executionID, insightDetails.execType, )}
0e6de2b50476178f8900b32cf43e04a4a44d29aa
2023-10-06 08:32:32
Nathan VanBenschoten
kv: bump timestamp cache when releasing replicated locks synchronously
false
bump timestamp cache when releasing replicated locks synchronously
kv
diff --git a/pkg/kv/kvpb/api.proto b/pkg/kv/kvpb/api.proto index 695f9e102375..5eb02a13b835 100644 --- a/pkg/kv/kvpb/api.proto +++ b/pkg/kv/kvpb/api.proto @@ -978,6 +978,18 @@ message EndTxnResponse { // The commit timestamp of the STAGING transaction record written // by the request. Only set if the transaction record was staged. util.hlc.Timestamp staging_timestamp = 5 [(gogoproto.nullable) = false]; + // ReplicatedLocksReleasedOnCommit, if non-empty, indicate that replicated + // locks with strength Shared or Exclusive were released in the referenced key + // spans when committing this transaction. Notably, this field is left unset + // if only write intents were resolved. The field is also left unset for + // transactions that aborted. + // + // The caller must bump the timestamp cache across these spans to the + // transaction's commit timestamp. Doing so ensures that the released locks + // (acquired by the now committed transaction) continue to provide protection + // against other writers up to the commit timestamp, even after the locks have + // been released. + repeated Span replicated_locks_released_on_commit = 6 [(gogoproto.nullable) = false]; } // An AdminSplitRequest is the argument to the AdminSplit() method. The @@ -1483,7 +1495,7 @@ message ResolveIntentResponse { // replicated lock with strength Shared or Exclusive was released by a // transaction who committed at this timestamp. Notably, this field is left // unset if only a write intent was resolved. The field is also left unset for - // transactions who aborted. + // transactions that aborted. // // The caller must bump the timestamp cache across the resolution span to this // commit timestamp. Doing so ensures that the released lock (acquired by a @@ -1538,7 +1550,7 @@ message ResolveIntentRangeResponse { // least one replicated lock with strength Shared or Exclusive was released by // a transaction who committed at this timestamp. Notably, this field is left // unset if only a write intent was resolved. The field is also left unset for - // transactions who aborted. + // transactions that aborted. // // The caller must bump the timestamp cache across the resolution span to this // commit timestamp. Doing so ensures that the released lock (acquired by a diff --git a/pkg/kv/kvserver/batcheval/cmd_end_transaction.go b/pkg/kv/kvserver/batcheval/cmd_end_transaction.go index 635d90228cf9..6937eec6121c 100644 --- a/pkg/kv/kvserver/batcheval/cmd_end_transaction.go +++ b/pkg/kv/kvserver/batcheval/cmd_end_transaction.go @@ -289,7 +289,7 @@ func EndTxn( // The transaction has already been aborted by other. // Do not return TransactionAbortedError since the client anyway // wanted to abort the transaction. - resolvedLocks, externalLocks, err := resolveLocalLocks(ctx, readWriter, cArgs.EvalCtx, ms, args, reply.Txn) + resolvedLocks, _, externalLocks, err := resolveLocalLocks(ctx, readWriter, cArgs.EvalCtx, ms, args, reply.Txn) if err != nil { return result.Result{}, err } @@ -436,7 +436,8 @@ func EndTxn( // we position the transaction record next to the first write of a transaction. // This avoids the need for the intentResolver to have to return to this range // to resolve locks for this transaction in the future. - resolvedLocks, externalLocks, err := resolveLocalLocks(ctx, readWriter, cArgs.EvalCtx, ms, args, reply.Txn) + resolvedLocks, releasedReplLocks, externalLocks, err := resolveLocalLocks( + ctx, readWriter, cArgs.EvalCtx, ms, args, reply.Txn) if err != nil { return result.Result{}, err } @@ -472,8 +473,16 @@ func EndTxn( txnResult.Local.UpdatedTxns = []*roachpb.Transaction{reply.Txn} txnResult.Local.ResolvedLocks = resolvedLocks - // Run the commit triggers if successfully committed. if reply.Txn.Status == roachpb.COMMITTED { + // Return whether replicated {shared, exclusive} locks were released by + // the committing transaction. If such locks were released, we still + // need to make sure other transactions can't write underneath the + // transaction's commit timestamp to the key spans previously protected + // by the locks. We return the spans on the response and update the + // timestamp cache a few layers above to ensure this. + reply.ReplicatedLocksReleasedOnCommit = releasedReplLocks + + // Run the commit triggers if successfully committed. triggerResult, err := RunCommitTrigger( ctx, cArgs.EvalCtx, readWriter.(storage.Batch), ms, args, reply.Txn, ) @@ -539,7 +548,7 @@ func resolveLocalLocks( ms *enginepb.MVCCStats, args *kvpb.EndTxnRequest, txn *roachpb.Transaction, -) (resolvedLocks []roachpb.LockUpdate, externalLocks []roachpb.Span, _ error) { +) (resolvedLocks []roachpb.LockUpdate, releasedReplLocks, externalLocks []roachpb.Span, _ error) { var resolveAllowance int64 = lockResolutionBatchSize var targetBytes int64 = lockResolutionBatchByteSize if args.InternalCommitTrigger != nil { @@ -563,7 +572,7 @@ func resolveLocalLocksWithPagination( txn *roachpb.Transaction, maxKeys int64, targetBytes int64, -) (resolvedLocks []roachpb.LockUpdate, externalLocks []roachpb.Span, _ error) { +) (resolvedLocks []roachpb.LockUpdate, releasedReplLocks, externalLocks []roachpb.Span, _ error) { desc := evalCtx.Desc() if mergeTrigger := args.InternalCommitTrigger.GetMergeTrigger(); mergeTrigger != nil { // If this is a merge, then use the post-merge descriptor to determine @@ -595,7 +604,7 @@ func resolveLocalLocksWithPagination( // // Note that the underlying pebbleIterator will still be reused // since readWriter is a pebbleBatch in the typical case. - ok, numBytes, resumeSpan, _, err := storage.MVCCResolveWriteIntent(ctx, readWriter, ms, update, + ok, numBytes, resumeSpan, wereReplLocksReleased, err := storage.MVCCResolveWriteIntent(ctx, readWriter, ms, update, storage.MVCCResolveWriteIntentOptions{TargetBytes: targetBytes}) if err != nil { return 0, 0, 0, errors.Wrapf(err, "resolving write intent at %s on end transaction [%s]", span, txn.Status) @@ -621,6 +630,9 @@ func resolveLocalLocksWithPagination( } } } + if wereReplLocksReleased { + releasedReplLocks = append(releasedReplLocks, update.Span) + } return numKeys, numBytes, resumeReason, nil } // For update ranges, cut into parts inside and outside our key @@ -630,7 +642,7 @@ func resolveLocalLocksWithPagination( externalLocks = append(externalLocks, outSpans...) if inSpan != nil { update.Span = *inSpan - numKeys, numBytes, resumeSpan, resumeReason, _, err := + numKeys, numBytes, resumeSpan, resumeReason, wereReplLocksReleased, err := storage.MVCCResolveWriteIntentRange(ctx, readWriter, ms, update, storage.MVCCResolveWriteIntentRangeOptions{MaxKeys: maxKeys, TargetBytes: targetBytes}, ) @@ -655,6 +667,9 @@ func resolveLocalLocksWithPagination( span, txn.Status) } } + if wereReplLocksReleased { + releasedReplLocks = append(releasedReplLocks, update.Span) + } return numKeys, numBytes, resumeReason, nil } return 0, 0, 0, nil @@ -662,7 +677,7 @@ func resolveLocalLocksWithPagination( numKeys, _, _, err := storage.MVCCPaginate(ctx, maxKeys, targetBytes, false /* allowEmpty */, f) if err != nil { - return nil, nil, err + return nil, nil, nil, err } externalLocks = append(externalLocks, remainingLockSpans...) @@ -670,10 +685,10 @@ func resolveLocalLocksWithPagination( removedAny := numKeys > 0 if WriteAbortSpanOnResolve(txn.Status, args.Poison, removedAny) { if err := UpdateAbortSpan(ctx, evalCtx, readWriter, ms, txn.TxnMeta, args.Poison); err != nil { - return nil, nil, err + return nil, nil, nil, err } } - return resolvedLocks, externalLocks, nil + return resolvedLocks, releasedReplLocks, externalLocks, nil } // updateStagingTxn persists the STAGING transaction record with updated status diff --git a/pkg/kv/kvserver/batcheval/cmd_end_transaction_test.go b/pkg/kv/kvserver/batcheval/cmd_end_transaction_test.go index a86c1715d3ea..9aafc947beec 100644 --- a/pkg/kv/kvserver/batcheval/cmd_end_transaction_test.go +++ b/pkg/kv/kvserver/batcheval/cmd_end_transaction_test.go @@ -1651,7 +1651,7 @@ func TestResolveLocalLocks(t *testing.T) { err := storage.MVCCPut(ctx, batch, intToKey(i), ts, roachpb.MakeValueFromString("a"), storage.MVCCWriteOptions{Txn: &txn}) require.NoError(t, err) } - resolvedLocks, externalLocks, err := resolveLocalLocksWithPagination( + resolvedLocks, releasedReplLocks, externalLocks, err := resolveLocalLocksWithPagination( ctx, batch, (&MockEvalCtx{ @@ -1674,6 +1674,7 @@ func TestResolveLocalLocks(t *testing.T) { require.Equal(t, tc.expectedResolvedLocks[i].Key, lock.Key) require.Equal(t, tc.expectedResolvedLocks[i].EndKey, lock.EndKey) } + require.Len(t, releasedReplLocks, 0) require.Equal(t, len(tc.expectedExternalLocks), len(externalLocks)) for i, lock := range externalLocks { require.Equal(t, tc.expectedExternalLocks[i].Key, lock.Key) diff --git a/pkg/kv/kvserver/replica_test.go b/pkg/kv/kvserver/replica_test.go index d821615fe4e3..9928f896d13d 100644 --- a/pkg/kv/kvserver/replica_test.go +++ b/pkg/kv/kvserver/replica_test.go @@ -14410,19 +14410,21 @@ func TestResolveIntentReplicatedLocksBumpsTSCache(t *testing.T) { _, pErr = tc.Sender().Send(ctx, ba) require.Nil(t, pErr) - expectedRTS := makeTS(t1.UnixNano(), 0) // we scanned at t1 over [a, e) + notBumpedTs := makeTS(t1.UnixNano(), 0) // we scanned at t1 over [a, e) + bumpedTs := makeTS(t2.UnixNano(), 0) // if we committed, it was at t2 + expTs := notBumpedTs if isCommit && isReplicated { - expectedRTS = makeTS(t2.UnixNano(), 0) + expTs = bumpedTs } rTS, _ := tc.store.tsCache.GetMax(roachpb.Key("a"), nil) - require.Equal(t, expectedRTS, rTS) + require.Equal(t, expTs, rTS) rTS, _ = tc.store.tsCache.GetMax(roachpb.Key("b"), nil) - require.Equal(t, expectedRTS, rTS) + require.Equal(t, expTs, rTS) rTS, _ = tc.store.tsCache.GetMax(roachpb.Key("c"), nil) - require.Equal(t, expectedRTS, rTS) + require.Equal(t, expTs, rTS) rTS, _ = tc.store.tsCache.GetMax(roachpb.Key("d"), nil) - require.Equal(t, makeTS(t1.UnixNano(), 0), rTS) // we scanned at t1 over [a, e) + require.Equal(t, notBumpedTs, rTS) } testutils.RunTrueAndFalse(t, "isCommit", func(t *testing.T, isCommit bool) { @@ -14523,14 +14525,16 @@ func TestResolveIntentRangeReplicatedLocksBumpsTSCache(t *testing.T) { _, pErr = tc.Sender().Send(ctx, ba) require.Nil(t, pErr) - expectedRTS := makeTS(t1.UnixNano(), 0) // we scanned at t1 over [a, e) + notBumpedTs := makeTS(t1.UnixNano(), 0) // we scanned at t1 over [a, e) + bumpedTs := makeTS(t2.UnixNano(), 0) // if we committed, it was at t2 + expTs := notBumpedTs if isCommit && isReplicated { - expectedRTS = makeTS(t2.UnixNano(), 0) + expTs = bumpedTs } for _, keyStr := range []string{"a", "b", "c", "d"} { rTS, _ := tc.store.tsCache.GetMax(roachpb.Key(keyStr), nil) - require.Equal(t, expectedRTS, rTS) + require.Equal(t, expTs, rTS) } } @@ -14544,3 +14548,106 @@ func TestResolveIntentRangeReplicatedLocksBumpsTSCache(t *testing.T) { }) }) } + +// TestEndTxnReplicatedLocksBumpsTSCache is like +// TestResolveIntentReplicatedLocksBumpsTSCache, except it tests EndTxn requests +// (which synchronously resolve local locks) instead of ResolveIntent requests. +func TestEndTxnReplicatedLocksBumpsTSCache(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + newTxn := func(key string, ts hlc.Timestamp) *roachpb.Transaction { + // We're going to use read committed isolation level here, as that's the + // only one which makes sense in the context of this test. That's because + // serializable transactions cannot commit before refreshing their reads, + // and refreshing reads bumps the timestamp cache. + txn := roachpb.MakeTransaction("test", roachpb.Key(key), isolation.ReadCommitted, roachpb.NormalUserPriority, ts, 0, 0, 0) + return &txn + } + + run := func(t *testing.T, isCommit, isReplicated bool, str lock.Strength) { + ctx := context.Background() + tc := testContext{} + stopper := stop.NewStopper() + defer stopper.Stop(ctx) + startTime := timeutil.Unix(0, 123) + tc.manualClock = timeutil.NewManualTime(startTime) + sc := TestStoreConfig(hlc.NewClockForTesting(tc.manualClock)) + sc.TestingKnobs.DisableCanAckBeforeApplication = true + tc.StartWithStoreConfig(ctx, t, stopper, sc) + + // Write some keys at time t0. + t0 := timeutil.Unix(1, 0) + tc.manualClock.MustAdvanceTo(t0) + err := tc.store.DB().Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { + for _, keyStr := range []string{"a", "b", "c"} { + err := txn.Put(ctx, roachpb.Key(keyStr), "value") + if err != nil { + return err + } + } + return nil + }) + require.NoError(t, err) + + // Scan [a, e) at t1, acquiring locks as dictated by the test setup. Verify + // the scan result is correct. + t1 := timeutil.Unix(2, 0) + ba := &kvpb.BatchRequest{} + txn := newTxn("a", makeTS(t1.UnixNano(), 0)) + ba.Timestamp = makeTS(t1.UnixNano(), 0) + ba.Txn = txn + span := roachpb.Span{Key: roachpb.Key("a"), EndKey: roachpb.Key("e")} + sArgs := scanArgs(span.Key, span.EndKey) + sArgs.KeyLockingStrength = str + sArgs.KeyLockingDurability = lock.Unreplicated + if isReplicated { + sArgs.KeyLockingDurability = lock.Replicated + } + ba.Add(sArgs) + _, pErr := tc.Sender().Send(ctx, ba) + require.Nil(t, pErr) + + // Commit the transaction at t2. + t2 := timeutil.Unix(3, 0) + ba = &kvpb.BatchRequest{} + txn.WriteTimestamp = makeTS(t2.UnixNano(), 0) + ba.Txn = txn + et, _ := endTxnArgs(txn, isCommit) + // Assign lock spans to the EndTxn request. Assign one point lock span + // and one range lock span. + et.LockSpans = []roachpb.Span{ + {Key: roachpb.Key("a")}, + {Key: roachpb.Key("c"), EndKey: roachpb.Key("e")}, + } + ba.Add(&et) + _, pErr = tc.Sender().Send(ctx, ba) + require.Nil(t, pErr) + + notBumpedTs := makeTS(t1.UnixNano(), 0) // we scanned at t1 over [a, e) + bumpedTs := makeTS(t2.UnixNano(), 0) // if we committed, it was at t2 + expTs := notBumpedTs + if isCommit && isReplicated { + expTs = bumpedTs + } + + rTS, _ := tc.store.tsCache.GetMax(roachpb.Key("a"), nil) + require.Equal(t, expTs, rTS) + rTS, _ = tc.store.tsCache.GetMax(roachpb.Key("b"), nil) + require.Equal(t, notBumpedTs, rTS) + rTS, _ = tc.store.tsCache.GetMax(roachpb.Key("c"), nil) + require.Equal(t, expTs, rTS) + rTS, _ = tc.store.tsCache.GetMax(roachpb.Key("d"), nil) + require.Equal(t, expTs, rTS) + } + + testutils.RunTrueAndFalse(t, "isCommit", func(t *testing.T, isCommit bool) { + testutils.RunTrueAndFalse(t, "isReplicated", func(t *testing.T, isReplicated bool) { + for _, str := range []lock.Strength{lock.Shared, lock.Exclusive} { + t.Run(str.String(), func(t *testing.T) { + run(t, isCommit, isReplicated, str) + }) + } + }) + }) +} diff --git a/pkg/kv/kvserver/replica_tscache.go b/pkg/kv/kvserver/replica_tscache.go index 1bbde283e32d..3bbc1038cd40 100644 --- a/pkg/kv/kvserver/replica_tscache.go +++ b/pkg/kv/kvserver/replica_tscache.go @@ -138,6 +138,14 @@ func (r *Replica) updateTimestampCache( // transaction's MinTimestamp, which is consulted in CanCreateTxnRecord. key := transactionTombstoneMarker(start, txnID) addToTSCache(key, nil, ts, txnID) + // Additionally, EndTxn requests that release replicated locks for + // committed transactions bump the timestamp cache over those lock + // spans to the commit timestamp of the transaction to ensure that + // the released locks continue to provide protection against writes + // underneath the transaction's commit timestamp. + for _, sp := range resp.(*kvpb.EndTxnResponse).ReplicatedLocksReleasedOnCommit { + addToTSCache(sp.Key, sp.EndKey, br.Txn.WriteTimestamp, txnID) + } case *kvpb.HeartbeatTxnRequest: // HeartbeatTxn requests record a tombstone entry when the record is // initially written. This is used when considering potential 1PC
ad380a4bce9ab1ddb7cd6af1bd03cf9d9d1b5639
2020-07-14 23:25:24
irfan sharif
roachprod: explicitly bootstrap cluster instead of relying on auto-init
false
explicitly bootstrap cluster instead of relying on auto-init
roachprod
diff --git a/pkg/cmd/roachprod/install/cockroach.go b/pkg/cmd/roachprod/install/cockroach.go index 7a865835c489..4edd1fe7b6b2 100644 --- a/pkg/cmd/roachprod/install/cockroach.go +++ b/pkg/cmd/roachprod/install/cockroach.go @@ -112,17 +112,17 @@ func argExists(args []string, target string) int { // Start implements the ClusterImpl.NodeDir interface. func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) { - // Check to see if node 1 was started indicating the cluster was + // Check to see if node 1 was started, indicating the cluster is to be // bootstrapped. - var bootstrapped bool + var bootstrappable bool for _, i := range c.ServerNodes() { if i == 1 { - bootstrapped = true + bootstrappable = true break } } - if c.Secure && bootstrapped { + if c.Secure && bootstrappable { c.DistributeCerts() } @@ -217,7 +217,8 @@ func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) { args = append(args, "--locality="+locality) } } - if nodes[i] != 1 { + // `cockroach start` without `--join` is no longer supported as 20.1. + if nodes[i] != 1 || vers.AtLeast(version.MustParse("v20.1.0")) { args = append(args, fmt.Sprintf("--join=%s:%d", host1, r.NodePort(c, 1))) } if advertisePublicIP { @@ -271,11 +272,13 @@ func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) { // unhelpful empty error (since everything has been redirected away). This is // unfortunately equally awkward to address. cmd := "ulimit -c unlimited; mkdir -p " + logDir + "; " + // TODO(peter): The ps and lslocks stuff is intended to debug why killing // of a cockroach process sometimes doesn't release file locks immediately. cmd += `echo ">>> roachprod start: $(date)" >> ` + logDir + "/roachprod.log; " + `ps axeww -o pid -o command >> ` + logDir + "/roachprod.log; " + `[ -x /usr/bin/lslocks ] && /usr/bin/lslocks >> ` + logDir + "/roachprod.log; " + cmd += keyCmd + fmt.Sprintf(" export ROACHPROD=%d%s && ", nodes[i], c.Tag) + "GOTRACEBACK=crash " + @@ -297,49 +300,96 @@ func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) { return nil, nil }) - if bootstrapped { - license := envutil.EnvOrDefaultString("COCKROACH_DEV_LICENSE", "") - if license == "" { - fmt.Printf("%s: COCKROACH_DEV_LICENSE unset: enterprise features will be unavailable\n", - c.Name) + if !bootstrappable { + return + } + + var initOut string + display = fmt.Sprintf("%s: bootstrapping cluster", c.Name) + c.Parallel(display, 1, 0, func(i int) ([]byte, error) { + vers, err := getCockroachVersion(c, nodes[i]) + if err != nil { + return nil, err } + if !vers.AtLeast(version.MustParse("v20.1.0")) { + // `cockroach start` without `--join` is no longer supported as v20.1. + return nil, nil + } + sess, err := c.newSession(1) + if err != nil { + return nil, err + } + defer sess.Close() - var msg string - display = fmt.Sprintf("%s: initializing cluster settings", c.Name) - c.Parallel(display, 1, 0, func(i int) ([]byte, error) { - sess, err := c.newSession(1) - if err != nil { - return nil, err - } - defer sess.Close() + var cmd string + if c.IsLocal() { + cmd = `cd ${HOME}/local/1 ; ` + } - var cmd string - if c.IsLocal() { - cmd = `cd ${HOME}/local/1 ; ` - } - dir := c.Impl.NodeDir(c, nodes[i]) - cmd += ` -if ! test -e ` + dir + `/settings-initialized ; then - COCKROACH_CONNECT_TIMEOUT=0 ` + cockroachNodeBinary(c, 1) + " sql --url " + - r.NodeURL(c, "localhost", r.NodePort(c, 1)) + " -e " + - fmt.Sprintf(`" -SET CLUSTER SETTING server.remote_debugging.mode = 'any'; -SET CLUSTER SETTING cluster.organization = 'Cockroach Labs - Production Testing'; -SET CLUSTER SETTING enterprise.license = '%s';"`, license) + ` && - touch ` + dir + `/settings-initialized -fi -` - out, err := sess.CombinedOutput(cmd) - if err != nil { - return nil, errors.Wrapf(err, "~ %s\n%s", cmd, out) - } - msg = strings.TrimSpace(string(out)) - return nil, nil - }) + binary := cockroachNodeBinary(c, 1) + path := fmt.Sprintf("%s/%s", c.Impl.NodeDir(c, nodes[i]), "cluster-bootstrapped") + url := r.NodeURL(c, "localhost", r.NodePort(c, 1)) - if msg != "" { - fmt.Println(msg) + cmd += fmt.Sprintf(` + if ! test -e %s ; then + COCKROACH_CONNECT_TIMEOUT=0 %s init --url %s && touch %s + fi`, path, binary, url, path) + + out, err := sess.CombinedOutput(cmd) + if err != nil { + return nil, errors.Wrapf(err, "~ %s\n%s", cmd, out) + } + initOut = strings.TrimSpace(string(out)) + return nil, nil + }) + + if initOut != "" { + fmt.Println(initOut) + } + + license := envutil.EnvOrDefaultString("COCKROACH_DEV_LICENSE", "") + if license == "" { + fmt.Printf("%s: COCKROACH_DEV_LICENSE unset: enterprise features will be unavailable\n", + c.Name) + } + + var clusterSettingsOut string + display = fmt.Sprintf("%s: initializing cluster settings", c.Name) + c.Parallel(display, 1, 0, func(i int) ([]byte, error) { + sess, err := c.newSession(1) + if err != nil { + return nil, err + } + defer sess.Close() + + var cmd string + if c.IsLocal() { + cmd = `cd ${HOME}/local/1 ; ` } + + binary := cockroachNodeBinary(c, 1) + path := fmt.Sprintf("%s/%s", c.Impl.NodeDir(c, nodes[i]), "settings-initialized") + url := r.NodeURL(c, "localhost", r.NodePort(c, 1)) + + cmd += fmt.Sprintf(` + if ! test -e %s ; then + COCKROACH_CONNECT_TIMEOUT=0 %s sql --url %s -e " + SET CLUSTER SETTING server.remote_debugging.mode = 'any'; + SET CLUSTER SETTING cluster.organization = 'Cockroach Labs - Production Testing'; + SET CLUSTER SETTING enterprise.license = '%s';" \ + && touch %s + fi`, path, binary, url, license, path) + + out, err := sess.CombinedOutput(cmd) + if err != nil { + return nil, errors.Wrapf(err, "~ %s\n%s", cmd, out) + } + clusterSettingsOut = strings.TrimSpace(string(out)) + return nil, nil + }) + + if clusterSettingsOut != "" { + fmt.Println(clusterSettingsOut) } } diff --git a/pkg/cmd/roachtest/fixtures/1/checkpoint-v20.1.tgz b/pkg/cmd/roachtest/fixtures/1/checkpoint-v20.1.tgz index 5e50212d936a..836fbc64d4b8 100644 Binary files a/pkg/cmd/roachtest/fixtures/1/checkpoint-v20.1.tgz and b/pkg/cmd/roachtest/fixtures/1/checkpoint-v20.1.tgz differ
0ffc720da46640ab47b6c34614082de22b0a27d6
2022-02-10 23:28:27
Santamaura
ui: dispay circuit breakers in problem ranges and range status
false
dispay circuit breakers in problem ranges and range status
ui
diff --git a/docs/generated/http/full.md b/docs/generated/http/full.md index ee226f4f2aad..05112e63a7d6 100644 --- a/docs/generated/http/full.md +++ b/docs/generated/http/full.md @@ -1314,6 +1314,7 @@ RangeProblems describes issues reported by a range. For internal use only. | no_lease | [bool](#cockroach.server.serverpb.RaftDebugResponse-bool) | | | [reserved](#support-status) | | quiescent_equals_ticking | [bool](#cockroach.server.serverpb.RaftDebugResponse-bool) | | Quiescent ranges do not tick by definition, but we track this in two different ways and suspect that they're getting out of sync. If the replica's quiescent flag doesn't agree with the store's list of replicas that are ticking, warn about it. | [reserved](#support-status) | | raft_log_too_large | [bool](#cockroach.server.serverpb.RaftDebugResponse-bool) | | When the raft log is too large, it can be a symptom of other issues. | [reserved](#support-status) | +| circuit_breaker_error | [bool](#cockroach.server.serverpb.RaftDebugResponse-bool) | | | [reserved](#support-status) | @@ -1520,6 +1521,7 @@ RangeProblems describes issues reported by a range. For internal use only. | no_lease | [bool](#cockroach.server.serverpb.RangesResponse-bool) | | | [reserved](#support-status) | | quiescent_equals_ticking | [bool](#cockroach.server.serverpb.RangesResponse-bool) | | Quiescent ranges do not tick by definition, but we track this in two different ways and suspect that they're getting out of sync. If the replica's quiescent flag doesn't agree with the store's list of replicas that are ticking, warn about it. | [reserved](#support-status) | | raft_log_too_large | [bool](#cockroach.server.serverpb.RangesResponse-bool) | | When the raft log is too large, it can be a symptom of other issues. | [reserved](#support-status) | +| circuit_breaker_error | [bool](#cockroach.server.serverpb.RangesResponse-bool) | | | [reserved](#support-status) | @@ -3049,6 +3051,7 @@ Support status: [reserved](#support-status) | overreplicated_range_ids | [int64](#cockroach.server.serverpb.ProblemRangesResponse-int64) | repeated | | [reserved](#support-status) | | quiescent_equals_ticking_range_ids | [int64](#cockroach.server.serverpb.ProblemRangesResponse-int64) | repeated | | [reserved](#support-status) | | raft_log_too_large_range_ids | [int64](#cockroach.server.serverpb.ProblemRangesResponse-int64) | repeated | | [reserved](#support-status) | +| circuit_breaker_error_range_ids | [int64](#cockroach.server.serverpb.ProblemRangesResponse-int64) | repeated | | [reserved](#support-status) | @@ -3344,6 +3347,7 @@ RangeProblems describes issues reported by a range. For internal use only. | no_lease | [bool](#cockroach.server.serverpb.RangeResponse-bool) | | | [reserved](#support-status) | | quiescent_equals_ticking | [bool](#cockroach.server.serverpb.RangeResponse-bool) | | Quiescent ranges do not tick by definition, but we track this in two different ways and suspect that they're getting out of sync. If the replica's quiescent flag doesn't agree with the store's list of replicas that are ticking, warn about it. | [reserved](#support-status) | | raft_log_too_large | [bool](#cockroach.server.serverpb.RangeResponse-bool) | | When the raft log is too large, it can be a symptom of other issues. | [reserved](#support-status) | +| circuit_breaker_error | [bool](#cockroach.server.serverpb.RangeResponse-bool) | | | [reserved](#support-status) | diff --git a/docs/generated/swagger/spec.json b/docs/generated/swagger/spec.json index 7213cf361fb0..9b7341c99c2a 100644 --- a/docs/generated/swagger/spec.json +++ b/docs/generated/swagger/spec.json @@ -1022,6 +1022,10 @@ "type": "object", "title": "RangeProblems describes issues reported by a range. For internal use only.", "properties": { + "circuit_breaker_error": { + "type": "boolean", + "x-go-name": "CircuitBreakerError" + }, "leader_not_lease_holder": { "type": "boolean", "x-go-name": "LeaderNotLeaseHolder" diff --git a/pkg/server/problem_ranges.go b/pkg/server/problem_ranges.go index 3a3b1e78b13c..8c0c24c84d85 100644 --- a/pkg/server/problem_ranges.go +++ b/pkg/server/problem_ranges.go @@ -129,6 +129,10 @@ func (s *statusServer) ProblemRanges( problems.RaftLogTooLargeRangeIDs = append(problems.RaftLogTooLargeRangeIDs, info.State.Desc.RangeID) } + if info.Problems.CircuitBreakerError { + problems.CircuitBreakerErrorRangeIDs = + append(problems.CircuitBreakerErrorRangeIDs, info.State.Desc.RangeID) + } } sort.Sort(roachpb.RangeIDSlice(problems.UnavailableRangeIDs)) sort.Sort(roachpb.RangeIDSlice(problems.RaftLeaderNotLeaseHolderRangeIDs)) @@ -138,6 +142,7 @@ func (s *statusServer) ProblemRanges( sort.Sort(roachpb.RangeIDSlice(problems.OverreplicatedRangeIDs)) sort.Sort(roachpb.RangeIDSlice(problems.QuiescentEqualsTickingRangeIDs)) sort.Sort(roachpb.RangeIDSlice(problems.RaftLogTooLargeRangeIDs)) + sort.Sort(roachpb.RangeIDSlice(problems.CircuitBreakerErrorRangeIDs)) response.ProblemsByNodeID[resp.nodeID] = problems case <-ctx.Done(): return nil, status.Errorf(codes.DeadlineExceeded, ctx.Err().Error()) diff --git a/pkg/server/serverpb/status.proto b/pkg/server/serverpb/status.proto index 87747bda1697..a26e9dbcdcad 100644 --- a/pkg/server/serverpb/status.proto +++ b/pkg/server/serverpb/status.proto @@ -389,6 +389,7 @@ message RangeProblems { // When the raft log is too large, it can be a symptom of other issues. bool raft_log_too_large = 7; + bool circuit_breaker_error = 9; } // RangeStatistics describes statistics reported by a range. For internal use @@ -1044,6 +1045,11 @@ message ProblemRangesResponse { (gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID" ]; + repeated int64 circuit_breaker_error_range_ids = 10 [ + (gogoproto.customname) = "CircuitBreakerErrorRangeIDs", + (gogoproto.casttype) = + "github.com/cockroachdb/cockroach/pkg/roachpb.RangeID" + ]; } reserved 1 to 7; // NodeID is the node that submitted all the requests. diff --git a/pkg/server/status.go b/pkg/server/status.go index d58bf5bdf4a0..07c06270ba6c 100644 --- a/pkg/server/status.go +++ b/pkg/server/status.go @@ -1993,6 +1993,7 @@ func (s *statusServer) rangesHelper( NoLease: metrics.Leader && !metrics.LeaseValid && !metrics.Quiescent, QuiescentEqualsTicking: raftStatus != nil && metrics.Quiescent == metrics.Ticking, RaftLogTooLarge: metrics.RaftLogTooLarge, + CircuitBreakerError: len(state.CircuitBreakerError) > 0, }, LeaseStatus: metrics.LeaseStatus, Quiescent: metrics.Quiescent, diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/connectionsTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/connectionsTable.tsx index 1940d6f0cdda..bdd7fccd8496 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/connectionsTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/connectionsTable.tsx @@ -71,6 +71,10 @@ const connectionTableColumns: ConnectionTableColumn[] = [ title: "Raft log too large", extract: problem => problem.raft_log_too_large_range_ids.length, }, + { + title: "Circuit breaker error", + extract: problem => problem.circuit_breaker_error_range_ids.length, + }, { title: "Total", extract: problem => { @@ -82,7 +86,8 @@ const connectionTableColumns: ConnectionTableColumn[] = [ problem.underreplicated_range_ids.length + problem.overreplicated_range_ids.length + problem.quiescent_equals_ticking_range_ids.length + - problem.raft_log_too_large_range_ids.length + problem.raft_log_too_large_range_ids.length + + problem.circuit_breaker_error_range_ids.length ); }, }, diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx index c955634edfc8..e8e733486802 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx @@ -203,6 +203,11 @@ export class ProblemRanges extends React.Component<ProblemRangesProps, {}> { problems={problems} extract={problem => problem.quiescent_equals_ticking_range_ids} /> + <ProblemRangeList + name="Circuit breaker error" + problems={problems} + extract={problem => problem.circuit_breaker_error_range_ids} + /> </div> ); } diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx index 5aa568aa6e2e..d6b8451506d4 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx @@ -239,6 +239,11 @@ const rangeTableDisplayList: RangeTableRow[] = [ display: "Closed timestamp LAI - side transport (centralized state)", compareToLeader: false, }, + { + variable: "circuitBreakerError", + display: "Circuit Breaker Error", + compareToLeader: false, + }, ]; const rangeTableEmptyContent: RangeTableCellContent = { @@ -854,6 +859,9 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> { ? "range-table__cell--warning" : "", ), + circuitBreakerError: this.createContent( + info.state.circuit_breaker_error, + ), }); }); diff --git a/pkg/ui/workspaces/db-console/styl/pages/reports.styl b/pkg/ui/workspaces/db-console/styl/pages/reports.styl index 777ecb696249..ff24987c3993 100644 --- a/pkg/ui/workspaces/db-console/styl/pages/reports.styl +++ b/pkg/ui/workspaces/db-console/styl/pages/reports.styl @@ -311,6 +311,8 @@ $reports-table list-style-type none margin 0 padding 0 + white-space normal + overflow-x auto .debug-table margin 0 0 40px
d60dcdfc173b2804c7cf384624a745cb4362fc05
2024-09-25 20:04:22
Austen McClernon
kvserver: pass tokens into token deduction override test knob
false
pass tokens into token deduction override test knob
kvserver
diff --git a/pkg/kv/kvserver/flow_control_integration_test.go b/pkg/kv/kvserver/flow_control_integration_test.go index 98d1d36eefce..62b0564ee155 100644 --- a/pkg/kv/kvserver/flow_control_integration_test.go +++ b/pkg/kv/kvserver/flow_control_integration_test.go @@ -800,7 +800,7 @@ func TestFlowControlRaftSnapshot(t *testing.T) { Store: &kvserver.StoreTestingKnobs{ FlowControlTestingKnobs: &kvflowcontrol.TestingKnobs{ UseOnlyForScratchRanges: true, - OverrideTokenDeduction: func() kvflowcontrol.Tokens { + OverrideTokenDeduction: func(_ kvflowcontrol.Tokens) kvflowcontrol.Tokens { // This test makes use of (small) increment // requests, but wants to see large token // deductions/returns. @@ -1210,7 +1210,7 @@ func TestFlowControlRaftTransportCulled(t *testing.T) { Store: &kvserver.StoreTestingKnobs{ FlowControlTestingKnobs: &kvflowcontrol.TestingKnobs{ UseOnlyForScratchRanges: true, - OverrideTokenDeduction: func() kvflowcontrol.Tokens { + OverrideTokenDeduction: func(_ kvflowcontrol.Tokens) kvflowcontrol.Tokens { // This test asserts on the exact values of tracked // tokens. In non-test code, the tokens deducted are // a few bytes off (give or take) from the size of @@ -1723,7 +1723,7 @@ func TestFlowControlQuiescedRange(t *testing.T) { Knobs: base.TestingKnobs{ Store: &kvserver.StoreTestingKnobs{ FlowControlTestingKnobs: &kvflowcontrol.TestingKnobs{ - OverrideTokenDeduction: func() kvflowcontrol.Tokens { + OverrideTokenDeduction: func(_ kvflowcontrol.Tokens) kvflowcontrol.Tokens { // This test asserts on the exact values of tracked // tokens. In non-test code, the tokens deducted are // a few bytes off (give or take) from the size of @@ -1861,7 +1861,7 @@ func TestFlowControlUnquiescedRange(t *testing.T) { Knobs: base.TestingKnobs{ Store: &kvserver.StoreTestingKnobs{ FlowControlTestingKnobs: &kvflowcontrol.TestingKnobs{ - OverrideTokenDeduction: func() kvflowcontrol.Tokens { + OverrideTokenDeduction: func(_ kvflowcontrol.Tokens) kvflowcontrol.Tokens { // This test asserts on the exact values of tracked // tokens. In non-test code, the tokens deducted are // a few bytes off (give or take) from the size of @@ -2236,7 +2236,7 @@ func TestFlowControlGranterAdmitOneByOne(t *testing.T) { Store: &kvserver.StoreTestingKnobs{ FlowControlTestingKnobs: &kvflowcontrol.TestingKnobs{ UseOnlyForScratchRanges: true, - OverrideTokenDeduction: func() kvflowcontrol.Tokens { + OverrideTokenDeduction: func(_ kvflowcontrol.Tokens) kvflowcontrol.Tokens { // This test asserts on the exact values of tracked // tokens. In non-test code, the tokens deducted are // a few bytes off (give or take) from the size of diff --git a/pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go b/pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go index 4cddf1ebbf1c..82062567966f 100644 --- a/pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go +++ b/pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go @@ -163,7 +163,7 @@ func (h *Handle) deductTokensForInner( } if fn := h.knobs.OverrideTokenDeduction; fn != nil { - tokens = fn() + tokens = fn(tokens) } for _, c := range h.mu.connections { diff --git a/pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go b/pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go index 12e93d788bd5..46c5dab3606a 100644 --- a/pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go +++ b/pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go @@ -802,7 +802,7 @@ func (rs *replicaState) handleReadyEntries(ctx context.Context, entries []entryF } tokens := entry.tokens if fn := rs.parent.opts.Knobs.OverrideTokenDeduction; fn != nil { - tokens = fn() + tokens = fn(tokens) } rs.sendStream.mu.tracker.Track(ctx, entry.term, entry.index, entry.pri, tokens) rs.evalTokenCounter.Deduct( diff --git a/pkg/kv/kvserver/kvflowcontrol/testing_knobs.go b/pkg/kv/kvserver/kvflowcontrol/testing_knobs.go index 1dc470b44c07..6ad28b520204 100644 --- a/pkg/kv/kvserver/kvflowcontrol/testing_knobs.go +++ b/pkg/kv/kvserver/kvflowcontrol/testing_knobs.go @@ -22,7 +22,7 @@ type TestingKnobs struct { UseOnlyForScratchRanges bool // OverrideTokenDeduction is used to override how many tokens are deducted // post-evaluation. - OverrideTokenDeduction func() Tokens + OverrideTokenDeduction func(tokens Tokens) Tokens // OverrideV2EnabledWhenLeaderLevel is used to override the level at which // RACv2 is enabled when a replica is the leader. OverrideV2EnabledWhenLeaderLevel func() V2EnabledWhenLeaderLevel
79a683d1571000165f598d3020f8d4fd1764a9b2
2021-06-30 06:39:00
Rail Aliiev
build: install 2 go version on TeamCity agents
false
install 2 go version on TeamCity agents
build
diff --git a/build/packer/teamcity-agent.sh b/build/packer/teamcity-agent.sh index 2169dd26857c..57bf3cfba9d2 100644 --- a/build/packer/teamcity-agent.sh +++ b/build/packer/teamcity-agent.sh @@ -49,6 +49,15 @@ b12c23023b68de22f74c0524f10b753e7b08b1504cb7e417eccebdd3fae49061 /tmp/go.tgz EOF tar -C /usr/local -zxf /tmp/go.tgz && rm /tmp/go.tgz +# Install the older version in parallel in order to run the acceptance test on older branches +# TODO: Remove this when 21.1 is EOL +curl -fsSL https://dl.google.com/go/go1.15.11.linux-amd64.tar.gz > /tmp/go_old.tgz +sha256sum -c - <<EOF +8825b72d74b14e82b54ba3697813772eb94add3abf70f021b6bdebe193ed01ec /tmp/go_old.tgz +EOF +mkdir -p /usr/local/go1.15 +tar -C /usr/local/go1.15 --strip-components=1 -zxf /tmp/go_old.tgz && rm /tmp/go_old.tgz + # Explicitly symlink the pinned version to /usr/bin. for f in `ls /usr/local/go/bin`; do ln -s /usr/local/go/bin/$f /usr/bin
7cb3bf0f1837abac6f7d86682f6e5d28748133d4
2022-03-25 02:46:30
shralex
kvserver: replica might crash evaluating a condition as leaseholder, when it isn't
false
replica might crash evaluating a condition as leaseholder, when it isn't
kvserver
diff --git a/pkg/kv/kvserver/replica_command.go b/pkg/kv/kvserver/replica_command.go index ac0e703b3b24..e264bed88e95 100644 --- a/pkg/kv/kvserver/replica_command.go +++ b/pkg/kv/kvserver/replica_command.go @@ -1210,11 +1210,20 @@ func (r *Replica) maybeTransferLeaseDuringLeaveJoint( } if voterIncomingTarget == (roachpb.ReplicaDescriptor{}) { - // Couldn't find a VOTER_INCOMING target. This should not happen since we only go into the - // JOINT config if the leaseholder is being removed, when there is a VOTER_INCOMING replica. - // Killing the leaseholder to force lease transfer. - log.Fatalf(ctx, "no VOTER_INCOMING to transfer lease to. "+ - "Range descriptor: %v", desc) + // Couldn't find a VOTER_INCOMING target. When the leaseholder is being + // removed, we only enter a JOINT config if there is a VOTER_INCOMING + // replica. We also do not allow a demoted replica to accept the lease + // during a JOINT config. However, it is possible that our replica lost + // the lease and the new leaseholder is trying to remove it. In this case, + // it is possible that there is no VOTER_INCOMING replica. + // We check for this case in replica_raft propose, so here it is safe + // to continue trying to leave the JOINT config. If this is the case, + // our replica will not be able to leave the JOINT config, but the new + // leaseholder will be able to do so. + log.Infof(ctx, "no VOTER_INCOMING to transfer lease to. This replica probably lost the lease,"+ + " but still thinks its the leaseholder. In this case the new leaseholder is expected to "+ + "complete LEAVE_JOINT. Range descriptor: %v", desc) + return nil } log.VEventf(ctx, 5, "current leaseholder %v is being removed through an"+ " atomic replication change. Transferring lease to %v", r.String(), voterIncomingTarget)
50a19b643ef3de90c50a3d3396e2fc84dc62e5b7
2023-05-26 19:19:15
Erik Grinaker
roachtest: export `Failer` in `failover` tests
false
export `Failer` in `failover` tests
roachtest
diff --git a/pkg/cmd/roachtest/tests/failover.go b/pkg/cmd/roachtest/tests/failover.go index cd52c1b1104a..1761654a6cfc 100644 --- a/pkg/cmd/roachtest/tests/failover.go +++ b/pkg/cmd/roachtest/tests/failover.go @@ -165,7 +165,7 @@ func runFailoverPartialLeaseGateway( opts := option.DefaultStartOpts() settings := install.MakeClusterSettings() - failer := makeFailer(t, c, failureModeBlackhole, opts, settings).(partialFailer) + failer := makeFailer(t, c, failureModeBlackhole, opts, settings).(PartialFailer) failer.Setup(ctx) defer failer.Cleanup(ctx) @@ -317,7 +317,7 @@ func runFailoverPartialLeaseLeader( settings := install.MakeClusterSettings() settings.Env = append(settings.Env, "COCKROACH_DISABLE_LEADER_FOLLOWS_LEASEHOLDER=true") - failer := makeFailer(t, c, failureModeBlackhole, opts, settings).(partialFailer) + failer := makeFailer(t, c, failureModeBlackhole, opts, settings).(PartialFailer) failer.Setup(ctx) defer failer.Cleanup(ctx) @@ -469,7 +469,7 @@ func runFailoverPartialLeaseLiveness( opts := option.DefaultStartOpts() settings := install.MakeClusterSettings() - failer := makeFailer(t, c, failureModeBlackhole, opts, settings).(partialFailer) + failer := makeFailer(t, c, failureModeBlackhole, opts, settings).(PartialFailer) failer.Setup(ctx) defer failer.Cleanup(ctx) @@ -1026,7 +1026,7 @@ func makeFailer( failureMode failureMode, opts option.StartOpts, settings install.ClusterSettings, -) failer { +) Failer { f := makeFailerWithoutLocalNoop(t, c, failureMode, opts, settings) if c.IsLocal() && !f.CanUseLocal() { t.Status(fmt.Sprintf( @@ -1043,7 +1043,7 @@ func makeFailerWithoutLocalNoop( failureMode failureMode, opts option.StartOpts, settings install.ClusterSettings, -) failer { +) Failer { switch failureMode { case failureModeBlackhole: return &blackholeFailer{ @@ -1101,8 +1101,8 @@ func makeFailerWithoutLocalNoop( } } -// failer fails and recovers a given node in some particular way. -type failer interface { +// Failer fails and recovers a given node in some particular way. +type Failer interface { fmt.Stringer // CanUseLocal returns true if the failer can be run with a local cluster. @@ -1125,9 +1125,9 @@ type failer interface { Recover(ctx context.Context, nodeID int) } -// partialFailer supports partial failures between specific node pairs. -type partialFailer interface { - failer +// PartialFailer supports partial failures between specific node pairs. +type PartialFailer interface { + Failer // FailPartial fails the node for the given peers. FailPartial(ctx context.Context, nodeID int, peerIDs []int)
5026038e028eb1d6ce800394489e5deeeeb470a2
2022-11-08 01:16:42
Yahor Yuzefovich
logictest: fix a couple of nits
false
fix a couple of nits
logictest
diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row index 0587ee7c19a8..4b248ce03a2e 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row @@ -1,8 +1,6 @@ # tenant-cluster-setting-override-opt: allow-zone-configs-for-secondary-tenants allow-multi-region-abstractions-for-secondary-tenants # LogicTest: multiregion-9node-3region-3azs multiregion-9node-3region-3azs-vec-off multiregion-9node-3region-3azs-tenant multiregion-9node-3region-3azs-no-los -statement ok - statement ok CREATE DATABASE multi_region_test_db PRIMARY REGION "ca-central-1" REGIONS "ap-southeast-2", "us-east-1" SURVIVE REGION FAILURE diff --git a/pkg/sql/logictest/testdata/logic_test/distsql_union b/pkg/sql/logictest/testdata/logic_test/distsql_union index 233cb0726163..a6960819a3ce 100644 --- a/pkg/sql/logictest/testdata/logic_test/distsql_union +++ b/pkg/sql/logictest/testdata/logic_test/distsql_union @@ -282,13 +282,10 @@ NULL 2 query I rowsort -(SELECT y FROM xyz ORDER BY z) INTERSECT ALL (SELECT y FROM xyz ORDER BY z) +(SELECT y FROM xyz ORDER BY z) INTERSECT (SELECT y FROM xyz ORDER BY z) ---- NULL 1 -1 -1 -2 2 # INTERSECT ALL and INTERSECT with a projection on the result.
806e1c5378492f8186994abae4aa5c4ff4fe2108
2024-10-17 02:21:57
Arul Ajmani
raft: de-fortify when stepping down as leader in outgoing config
false
de-fortify when stepping down as leader in outgoing config
raft
diff --git a/pkg/raft/testdata/confchange_v2_replace_leader.txt b/pkg/raft/testdata/confchange_v2_replace_leader.txt index 45e262f41bdd..f19700e5f589 100644 --- a/pkg/raft/testdata/confchange_v2_replace_leader.txt +++ b/pkg/raft/testdata/confchange_v2_replace_leader.txt @@ -172,15 +172,39 @@ campaign 1 ---- WARN 1 is unpromotable and can not campaign -# TODO(arul): this is a hack until -# https://github.com/cockroachdb/cockroach/issues/129098 is fixed. -bump-epoch 1 ----- - 1 2 3 4 -1 2 1 1 1 -2 2 1 1 1 -3 2 1 1 1 -4 2 1 1 1 +support-expired 1 +---- +ok + +tick-heartbeat 1 +---- +ok + +stabilize log-level=debug +---- +> 1 handling Ready + Ready MustSync=true: + HardState Term:1 Vote:1 Commit:5 Lead:1 LeadEpoch:0 + Messages: + 1->2 MsgDeFortifyLeader Term:1 Log:0/0 + 1->3 MsgDeFortifyLeader Term:1 Log:0/0 + 1->4 MsgDeFortifyLeader Term:1 Log:0/0 +> 2 receiving messages + 1->2 MsgDeFortifyLeader Term:1 Log:0/0 +> 3 receiving messages + 1->3 MsgDeFortifyLeader Term:1 Log:0/0 +> 4 receiving messages + 1->4 MsgDeFortifyLeader Term:1 Log:0/0 +> 2 handling Ready + Ready MustSync=true: + HardState Term:1 Vote:1 Commit:5 Lead:1 LeadEpoch:0 +> 3 handling Ready + Ready MustSync=true: + HardState Term:1 Vote:1 Commit:5 Lead:1 LeadEpoch:0 +> 4 handling Ready + Ready MustSync=true: + HardState Term:1 Commit:5 Lead:1 LeadEpoch:0 + # Campaign the dedicated voter n2 to become the new leader. campaign 2
bbaa378443b7712867bc2f0c9f40c4d91745b7f4
2017-03-11 04:42:42
Raphael 'kena' Poss
sql: re-order and document the fields of Session.
false
re-order and document the fields of Session.
sql
diff --git a/pkg/sql/session.go b/pkg/sql/session.go index e8779ea69a41..2d397a3c5510 100644 --- a/pkg/sql/session.go +++ b/pkg/sql/session.go @@ -65,40 +65,69 @@ const keyFor7881Sample = "found#7881" // Session contains the state of a SQL client connection. // Create instances using NewSession(). type Session struct { + // + // Session parameters, user-configurable. + // + + // Database indicates the "current" database for the purpose of + // resolving names. See searchAndQualifyDatabase() for details. Database string + // DefaultIsolationLevel indicates the default isolation level of + // newly created transactions. + DefaultIsolationLevel enginepb.IsolationType + // DistSQLMode indicates whether to run queries using the distributed + // execution engine. + DistSQLMode distSQLExecMode + // Location indicates the current time zone. + Location *time.Location // SearchPath is a list of databases that will be searched for a table name // before the database. Currently, this is used only for SELECTs. // Names in the search path must have been normalized already. SearchPath parser.SearchPath - // User is the name of the user logged into the session. - User string // Syntax determine which lexical structure to use for parsing. Syntax parser.Syntax + // User is the name of the user logged into the session. + User string - DistSQLMode distSQLExecMode - - virtualSchemas virtualSchemaHolder + // + // State structures for the logical SQL session. + // - // Info about the open transaction (if any). + // TxnState carries information about the open transaction (if any), + // including the retry status and the KV client Txn object. TxnState txnState - - planner planner - memMetrics *MemoryMetrics + // PreparedStatements and PreparedPortals store the statements/portals + // that have been prepared via pgwire. PreparedStatements PreparedStatements PreparedPortals PreparedPortals + // virtualSchemas aliases Executor.virtualSchemas. + // It is duplicated in Session to provide easier access to + // the various methods that need this reference. + // TODO(knz): place this in an executionContext parameter-passing + // structure. + virtualSchemas virtualSchemaHolder - Location *time.Location - DefaultIsolationLevel enginepb.IsolationType - // context is the Session's base context. See Ctx(). - context context.Context + // + // Run-time state. + // + + // planner is the planner in charge of this session. + planner planner + // context is the Session's base context, to be used for all + // SQL-related logging. See Ctx(). + context context.Context + // finishEventLog indicates whether an event log was started for + // this session. finishEventLog bool - // TODO(andrei): We need to either get rid of this cancel field, or it needs - // to move to the TxnState and become a per-txn cancel. Right now, we're - // cancelling all the txns that have ever run on this session when the session - // is closed, as opposed to cancelling the individual transactions as soon as - // they COMMIT/ROLLBACK. + // cancel is a method to call when the session terminates, to + // release resources associated with the context above. + // TODO(andrei): We need to either get rid of this cancel field, or + // it needs to move to the TxnState and become a per-txn + // cancel. Right now, we're cancelling all the txns that have ever + // run on this session when the session is closed, as opposed to + // cancelling the individual transactions as soon as they + // COMMIT/ROLLBACK. cancel context.CancelFunc - // mon tracks memory usage for SQL activity within this session. It // is not directly used, but rather indirectly used via sessionMon // and TxnState.mon. sessionMon tracks session-bound objects like prepared @@ -113,6 +142,15 @@ type Session struct { mon mon.MemoryMonitor sessionMon mon.MemoryMonitor + // + // Per-session statistics. + // + + // memMetrics track memory usage by SQL execution. + memMetrics *MemoryMetrics + + // noCopy is placed here to guarantee that Session objects are not + // copied. noCopy util.NoCopy }
7e77a57b310c95153490cb37732b0acaf7122044
2023-07-12 00:41:13
Andrew Baptist
server: reduce usage of NodeLivenesssStatus
false
reduce usage of NodeLivenesssStatus
server
diff --git a/pkg/server/admin.go b/pkg/server/admin.go index 1137ee0bccda..ae89625164b6 100644 --- a/pkg/server/admin.go +++ b/pkg/server/admin.go @@ -2203,29 +2203,6 @@ func (s *systemAdminServer) checkReadinessForHealthCheck(ctx context.Context) er return nil } -// getLivenessStatusMap generates a map from NodeID to LivenessStatus for all -// nodes known to gossip. Nodes that haven't pinged their liveness record for -// more than server.time_until_store_dead are considered dead. -// -// To include all nodes (including ones not in the gossip network), callers -// should consider calling (statusServer).NodesWithLiveness() instead where -// possible. -// -// getLivenessStatusMap() includes removed nodes (dead + decommissioned). -func getLivenessStatusMap( - ctx context.Context, nl *liveness.NodeLiveness, now hlc.Timestamp, st *cluster.Settings, -) (map[roachpb.NodeID]livenesspb.NodeLivenessStatus, error) { - nodeVitalityMap, err := nl.ScanNodeVitalityFromKV(ctx) - if err != nil { - return nil, err - } - statusMap := make(map[roachpb.NodeID]livenesspb.NodeLivenessStatus, len(nodeVitalityMap)) - for nodeID, vitality := range nodeVitalityMap { - statusMap[nodeID] = vitality.LivenessStatus() - } - return statusMap, nil -} - // getLivenessResponse returns LivenessResponse: a map from NodeID to LivenessStatus and // a slice containing the liveness record of all nodes that have ever been a part of the // cluster. @@ -2718,7 +2695,7 @@ func (s *systemAdminServer) DecommissionPreCheck( // Initially evaluate node liveness status, so we filter the nodes to check. var nodesToCheck []roachpb.NodeID - livenessStatusByNodeID, err := getLivenessStatusMap(ctx, s.nodeLiveness, s.clock.Now(), s.st) + vitality, err := s.nodeLiveness.ScanNodeVitalityFromKV(ctx) if err != nil { return nil, serverError(ctx, err) } @@ -2728,17 +2705,18 @@ func (s *systemAdminServer) DecommissionPreCheck( // Any nodes that are already decommissioned or have unknown liveness should // not be checked, and are added to response without replica counts or errors. + // TODO(baptist): Revisit if the handling of unknown nodes is correct. for _, nID := range req.NodeIDs { - livenessStatus := livenessStatusByNodeID[nID] - if livenessStatus == livenesspb.NodeLivenessStatus_UNKNOWN { + vitality := vitality[nID] + if vitality.IsDecommissioned() { resultsByNodeID[nID] = serverpb.DecommissionPreCheckResponse_NodeCheckResult{ NodeID: nID, - DecommissionReadiness: serverpb.DecommissionPreCheckResponse_UNKNOWN, + DecommissionReadiness: serverpb.DecommissionPreCheckResponse_ALREADY_DECOMMISSIONED, } - } else if livenessStatus == livenesspb.NodeLivenessStatus_DECOMMISSIONED { + } else if vitality.LivenessStatus() == livenesspb.NodeLivenessStatus_UNKNOWN { resultsByNodeID[nID] = serverpb.DecommissionPreCheckResponse_NodeCheckResult{ NodeID: nID, - DecommissionReadiness: serverpb.DecommissionPreCheckResponse_ALREADY_DECOMMISSIONED, + DecommissionReadiness: serverpb.DecommissionPreCheckResponse_UNKNOWN, } } else { nodesToCheck = append(nodesToCheck, nID) diff --git a/pkg/server/auto_upgrade.go b/pkg/server/auto_upgrade.go index ac8c292d1e5a..e8c7e7fb2f1f 100644 --- a/pkg/server/auto_upgrade.go +++ b/pkg/server/auto_upgrade.go @@ -14,7 +14,6 @@ import ( "context" "time" - "github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness/livenesspb" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" "github.com/cockroachdb/cockroach/pkg/util/log" @@ -127,8 +126,7 @@ func (s *Server) upgradeStatus( if err != nil { return upgradeBlockedDueToError, err } - clock := s.admin.server.clock - statusMap, err := getLivenessStatusMap(ctx, s.nodeLiveness, clock.Now(), s.st) + vitalities, err := s.nodeLiveness.ScanNodeVitalityFromKV(ctx) if err != nil { return upgradeBlockedDueToError, err } @@ -137,20 +135,19 @@ func (s *Server) upgradeStatus( var notRunningErr error for _, node := range nodes.Nodes { nodeID := node.Desc.NodeID - st := statusMap[nodeID] + v := vitalities[nodeID] // Skip over removed nodes. - if st == livenesspb.NodeLivenessStatus_DECOMMISSIONED { + if v.IsDecommissioned() { continue } - if st != livenesspb.NodeLivenessStatus_LIVE && - st != livenesspb.NodeLivenessStatus_DECOMMISSIONING { + if !v.IsAvailableNotDraining() { // We definitely won't be able to upgrade, but defer this error as // we may find out that we are already at the latest version (the // cluster may be up-to-date, but a node is down). if notRunningErr == nil { - notRunningErr = errors.Errorf("node %d not running (%s), cannot determine version", nodeID, st) + notRunningErr = errors.Errorf("node %d not running (%d), cannot determine version", nodeID, st) } continue } diff --git a/pkg/server/fanout_clients.go b/pkg/server/fanout_clients.go index 7cb7a1372ab0..0451f539ec53 100644 --- a/pkg/server/fanout_clients.go +++ b/pkg/server/fanout_clients.go @@ -239,11 +239,16 @@ func (k kvFanoutClient) listNodes(ctx context.Context) (*serverpb.NodesResponse, Nodes: statuses, } - clock := k.clock - resp.LivenessByNodeID, err = getLivenessStatusMap(ctx, k.nodeLiveness, clock.Now(), k.st) + nodeStatusMap, err := k.nodeLiveness.ScanNodeVitalityFromKV(ctx) if err != nil { return nil, err } + // TODO(baptist): Consider returning something better than LivenessStatus. It + // is an unfortunate mix of values. + resp.LivenessByNodeID = make(map[roachpb.NodeID]livenesspb.NodeLivenessStatus, len(nodeStatusMap)) + for nodeID, status := range nodeStatusMap { + resp.LivenessByNodeID[nodeID] = status.LivenessStatus() + } return &resp, nil } diff --git a/pkg/server/status.go b/pkg/server/status.go index 2fad36d60b2d..dceb81191802 100644 --- a/pkg/server/status.go +++ b/pkg/server/status.go @@ -44,6 +44,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/kv/kvserver" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/allocator/storepool" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness" + "github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness/livenesspb" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/rpc" "github.com/cockroachdb/cockroach/pkg/security" @@ -2019,11 +2020,16 @@ func (s *systemStatusServer) nodesHelper( Nodes: statuses, } - clock := s.clock - resp.LivenessByNodeID, err = getLivenessStatusMap(ctx, s.nodeLiveness, clock.Now(), s.st) + nodeStatusMap, err := s.nodeLiveness.ScanNodeVitalityFromKV(ctx) if err != nil { return nil, 0, err } + // TODO(baptist): Consider returning something better than LivenessStatus. It + // is an unfortunate mix of values. + resp.LivenessByNodeID = make(map[roachpb.NodeID]livenesspb.NodeLivenessStatus, len(nodeStatusMap)) + for nodeID, status := range nodeStatusMap { + resp.LivenessByNodeID[nodeID] = status.LivenessStatus() + } return &resp, next, nil }
31d0d4f00335bdd3ad892843d6ca0401cbb33ffb
2024-06-24 23:50:01
Marcus Gartner
sql: remove unnecessary `convertNodeOrdinalsToInts` function
false
remove unnecessary `convertNodeOrdinalsToInts` function
sql
diff --git a/pkg/sql/distsql_physical_planner.go b/pkg/sql/distsql_physical_planner.go index 7c2b4734f524..6b7f3b9a5b61 100644 --- a/pkg/sql/distsql_physical_planner.go +++ b/pkg/sql/distsql_physical_planner.go @@ -2291,7 +2291,7 @@ type aggregatorPlanningInfo struct { aggregations []execinfrapb.AggregatorSpec_Aggregation argumentsColumnTypes [][]*types.T isScalar bool - groupCols []int + groupCols []exec.NodeColumnOrdinal groupColOrdering colinfo.ColumnOrdering inputMergeOrdering execinfrapb.Ordering reqOrdering ReqOrdering @@ -2757,7 +2757,7 @@ func (dsp *DistSQLPlanner) planAggregators( intermediateTypes = append(intermediateTypes, inputTypes[groupColIdx]) } finalGroupCols[i] = uint32(idx) - if orderedGroupColSet.Contains(info.groupCols[i]) { + if orderedGroupColSet.Contains(int(info.groupCols[i])) { finalOrderedGroupCols = append(finalOrderedGroupCols, uint32(idx)) } } @@ -2769,7 +2769,7 @@ func (dsp *DistSQLPlanner) planAggregators( // Find the group column. found := false for j, col := range info.groupCols { - if col == o.ColIdx { + if int(col) == o.ColIdx { ordCols[i].ColIdx = finalGroupCols[j] found = true break diff --git a/pkg/sql/distsql_spec_exec_factory.go b/pkg/sql/distsql_spec_exec_factory.go index 472b7c7144cd..b679cdfa0b19 100644 --- a/pkg/sql/distsql_spec_exec_factory.go +++ b/pkg/sql/distsql_spec_exec_factory.go @@ -546,7 +546,7 @@ func (e *distSQLSpecExecFactory) constructAggregators( aggregations: aggregationSpecs, argumentsColumnTypes: argumentsColumnTypes, isScalar: isScalar, - groupCols: convertNodeOrdinalsToInts(groupCols), + groupCols: groupCols, groupColOrdering: groupColOrdering, inputMergeOrdering: physPlan.MergeOrdering, reqOrdering: ReqOrdering(reqOrdering), diff --git a/pkg/sql/exec_factory_util.go b/pkg/sql/exec_factory_util.go index 29fa733657ce..c0736523e478 100644 --- a/pkg/sql/exec_factory_util.go +++ b/pkg/sql/exec_factory_util.go @@ -233,16 +233,6 @@ func getResultColumnsForGroupBy( return columns } -// convertNodeOrdinalsToInts converts a slice of exec.NodeColumnOrdinals to a slice -// of ints. -func convertNodeOrdinalsToInts(ordinals []exec.NodeColumnOrdinal) []int { - ints := make([]int, len(ordinals)) - for i := range ordinals { - ints[i] = int(ordinals[i]) - } - return ints -} - func constructVirtualScan( ef exec.Factory, p *planner, diff --git a/pkg/sql/group.go b/pkg/sql/group.go index 03d969bfc004..18b690a5b171 100644 --- a/pkg/sql/group.go +++ b/pkg/sql/group.go @@ -14,6 +14,7 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo" + "github.com/cockroachdb/cockroach/pkg/sql/opt/exec" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -27,7 +28,7 @@ type groupNode struct { plan planNode // Indices of the group by columns in the source plan. - groupCols []int + groupCols []exec.NodeColumnOrdinal // Set when we have an input ordering on (a subset of) grouping columns. Only // column indices in groupCols can appear in this ordering. @@ -68,7 +69,7 @@ type aggregateFuncHolder struct { funcName string // The argument of the function is a single value produced by the renderNode // underneath. If the function has no argument (COUNT_ROWS), it is empty. - argRenderIdxs []int + argRenderIdxs []exec.NodeColumnOrdinal // If there is a filter, the result is a single value produced by the // renderNode underneath. If there is no filter, it is set to // tree.NoColumnIdx. @@ -92,7 +93,7 @@ type aggregateFuncHolder struct { // argRenderIdx is noRenderIdx. func newAggregateFuncHolder( funcName string, - argRenderIdxs []int, + argRenderIdxs []exec.NodeColumnOrdinal, arguments tree.Datums, isDistinct bool, distsqlBlocklist bool, diff --git a/pkg/sql/opt_exec_factory.go b/pkg/sql/opt_exec_factory.go index a03a2f0ffb34..add9e6fd9201 100644 --- a/pkg/sql/opt_exec_factory.go +++ b/pkg/sql/opt_exec_factory.go @@ -509,7 +509,7 @@ func (ef *execFactory) ConstructGroupBy( plan: inputPlan, funcs: make([]*aggregateFuncHolder, 0, len(groupCols)+len(aggregations)), columns: getResultColumnsForGroupBy(inputCols, groupCols, aggregations), - groupCols: convertNodeOrdinalsToInts(groupCols), + groupCols: groupCols, groupColOrdering: groupColOrdering, isScalar: false, reqOrdering: ReqOrdering(reqOrdering), @@ -519,7 +519,7 @@ func (ef *execFactory) ConstructGroupBy( // TODO(radu): only generate the grouping columns we actually need. f := newAggregateFuncHolder( builtins.AnyNotNull, - []int{col}, + []exec.NodeColumnOrdinal{col}, nil, /* arguments */ false, /* isDistinct */ false, /* distsqlBlocklist */ @@ -535,11 +535,10 @@ func (ef *execFactory) ConstructGroupBy( func (ef *execFactory) addAggregations(n *groupNode, aggregations []exec.AggInfo) error { for i := range aggregations { agg := &aggregations[i] - renderIdxs := convertNodeOrdinalsToInts(agg.ArgCols) f := newAggregateFuncHolder( agg.FuncName, - renderIdxs, + agg.ArgCols, agg.ConstArgs, agg.Distinct, agg.DistsqlBlocklist,
4c1f452285ce03b590f028fb430389ff1497d1a8
2021-04-07 21:10:15
Rail Aliiev
release: publish to RedHat should use explicit tag
false
publish to RedHat should use explicit tag
release
diff --git a/build/release/teamcity-publish-redhat-release.sh b/build/release/teamcity-publish-redhat-release.sh index 3864effd15b9..d40aa92b1cfa 100755 --- a/build/release/teamcity-publish-redhat-release.sh +++ b/build/release/teamcity-publish-redhat-release.sh @@ -6,9 +6,12 @@ source "$(dirname "${0}")/teamcity-support.sh" source "$(dirname "${0}")/../shlib.sh" tc_start_block "Sanity Check" -# Make sure that the version is a substring of TC branch name (e.g. v20.2.4-57-abcd345) -# The "-" suffix makes sure we differentiate v20.2.4-57 and v20.2.4-5 -if [[ $TC_BUILD_BRANCH != "${NAME}-"* ]]; then +# Make sure that the version matches the TeamCity branch name. The TeamCity +# branch name becomes available only after the new tag is pushed to GitHub by +# the `teamcity-publish-release.sh` script. +# In the future, when this script becomes a part of the automated process, we +# may need to change this check to match the tag used by the process. +if [[ $TC_BUILD_BRANCH != ${NAME} ]]; then echo "Release name \"$NAME\" cannot be built using \"$TC_BUILD_BRANCH\"" exit 1 fi
85cfb844b07da0bb777cd050b4fe295ef4873428
2024-12-11 01:31:35
Aerin Freilich
changefeedccl: remove duplicate columns from parquet output
false
remove duplicate columns from parquet output
changefeedccl
diff --git a/pkg/ccl/changefeedccl/encoder.go b/pkg/ccl/changefeedccl/encoder.go index 905acbf6f696..0aad928b62f8 100644 --- a/pkg/ccl/changefeedccl/encoder.go +++ b/pkg/ccl/changefeedccl/encoder.go @@ -22,7 +22,7 @@ type Encoder interface { // `TableDescriptor`, but only the primary key fields will be used. The // returned bytes are only valid until the next call to Encode*. EncodeKey(context.Context, cdcevent.Row) ([]byte, error) - // EncodeValue encodes the primary key of the given row. The columns of the + // EncodeValue encodes the values of the given row. The columns of the // datums are expected to match 1:1 with the `Columns` field of the // `TableDescriptor`. The returned bytes are only valid until the next call // to Encode*. diff --git a/pkg/ccl/changefeedccl/parquet.go b/pkg/ccl/changefeedccl/parquet.go index e83425b5354a..c139148fcc63 100644 --- a/pkg/ccl/changefeedccl/parquet.go +++ b/pkg/ccl/changefeedccl/parquet.go @@ -52,9 +52,18 @@ func newParquetSchemaDefintion( ) (*parquet.SchemaDefinition, error) { var columnNames []string var columnTypes []*types.T + seenColumnNames := make(map[string]bool) numCols := 0 if err := row.ForAllColumns().Col(func(col cdcevent.ResultColumn) error { + if _, ok := seenColumnNames[col.Name]; ok { + // If a column is both the primary key and one of the selected columns in + // a cdc query, we do not want to duplicate it in the parquet output. We + // deduplicate that here and where we populate the datums (see + // populateDatums). + return nil + } + seenColumnNames[col.Name] = true columnNames = append(columnNames, col.Name) columnTypes = append(columnTypes, col.Typ) numCols += 1 @@ -164,7 +173,16 @@ func (w *parquetWriter) populateDatums( ) error { datums := w.datumAlloc[:0] - if err := updatedRow.ForAllColumns().Datum(func(d tree.Datum, _ cdcevent.ResultColumn) error { + seenColumnNames := make(map[string]bool) + if err := updatedRow.ForAllColumns().Datum(func(d tree.Datum, col cdcevent.ResultColumn) error { + if _, ok := seenColumnNames[col.Name]; ok { + // If a column is both the primary key and one of the selected columns in + // a cdc query, we do not want to duplicate it in the parquet output. We + // deduplicate that here and in the schema definition (see + // newParquetSchemaDefintion). + return nil + } + seenColumnNames[col.Name] = true datums = append(datums, d) return nil }); err != nil { @@ -229,7 +247,7 @@ func addParquetTestMetadata( ) ([]parquet.Option, error) { // NB: Order matters. When iterating using ForAllColumns, which is used when // writing datums and defining the schema, the order of columns usually - // matches the underlying table. If a composite keys defined, the order in + // matches the underlying table. If a composite key is defined, the order in // ForEachKeyColumn may not match. In tests, we want to use the latter // order when printing the keys. keyCols := map[string]int{} @@ -262,7 +280,16 @@ func addParquetTestMetadata( // cdcevent.ResultColumn. The Ordinal() method may return an invalid // number for virtual columns. idx := 0 + seenColumnNames := make(map[string]bool) if err := row.ForAllColumns().Col(func(col cdcevent.ResultColumn) error { + if _, ok := seenColumnNames[col.Name]; ok { + // Since we deduplicate columns with the same name in the parquet output, + // we should not even increment our index for columns we've seen before. + // Since we have already seen this column name we have also already found + // the relevant index. + return nil + } + seenColumnNames[col.Name] = true if _, colIsInKey := keyCols[col.Name]; colIsInKey { keyCols[col.Name] = idx } diff --git a/pkg/ccl/changefeedccl/parquet_test.go b/pkg/ccl/changefeedccl/parquet_test.go index 6d49074aca92..c5731e526202 100644 --- a/pkg/ccl/changefeedccl/parquet_test.go +++ b/pkg/ccl/changefeedccl/parquet_test.go @@ -7,6 +7,7 @@ package changefeedccl import ( "context" + "fmt" "math/rand" "os" "slices" @@ -307,3 +308,68 @@ func TestParquetResolvedTimestamps(t *testing.T) { cdcTest(t, testFn, feedTestForceSink("cloudstorage")) } + +func TestParquetDuplicateColumns(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + testFn := func(t *testing.T, s TestServer, f cdctest.TestFeedFactory) { + sqlDB := sqlutils.MakeSQLRunner(s.DB) + sqlDB.Exec(t, `CREATE TABLE t (id INT8 PRIMARY KEY)`) + sqlDB.Exec(t, `INSERT INTO t VALUES (1)`) + foo := feed(t, f, `CREATE CHANGEFEED WITH format=parquet,initial_scan='only' AS SELECT id FROM t`) + defer closeFeed(t, foo) + + // Test that this should not fail with this error: + // `Number of datums in parquet output row doesn't match number of distinct + // columns, Expected: %d, Recieved: %d`. + assertPayloads(t, foo, []string{ + `t: [1]->{"id": 1}`, + }) + } + + cdcTest(t, testFn, feedTestForceSink("cloudstorage")) +} + +func TestParquetSpecifiedDuplicateQueryColumns(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + testFn := func(t *testing.T, s TestServer, f cdctest.TestFeedFactory) { + sqlDB := sqlutils.MakeSQLRunner(s.DB) + sqlDB.Exec(t, `CREATE TABLE t (id INT8 PRIMARY KEY, a INT8)`) + sqlDB.Exec(t, `INSERT INTO t VALUES (1, 9)`) + foo := feed(t, f, `CREATE CHANGEFEED WITH format=parquet,initial_scan='only' AS SELECT a, a, id, id FROM t`) + defer closeFeed(t, foo) + + // Test that this should not fail with this error: + // `Number of datums in parquet output row doesn't match number of distinct + // columns, Expected: %d, Recieved: %d`. + assertPayloads(t, foo, []string{ + `t: [1]->{"a": 9, "a_1": 9, "id": 1, "id_1": 1}`, + }) + } + + cdcTest(t, testFn, feedTestForceSink("cloudstorage")) +} + +func TestParquetNoUserDefinedPrimaryKey(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + + testFn := func(t *testing.T, s TestServer, f cdctest.TestFeedFactory) { + sqlDB := sqlutils.MakeSQLRunner(s.DB) + sqlDB.Exec(t, `CREATE TABLE t (id INT8)`) + var rowId int + sqlDB.QueryRow(t, `INSERT INTO t VALUES (0) RETURNING rowid`).Scan(&rowId) + foo := feed(t, f, `CREATE CHANGEFEED WITH format=parquet,initial_scan='only' AS SELECT id FROM t`) + defer closeFeed(t, foo) + + // The parquet output always includes the primary key. + assertPayloads(t, foo, []string{ + fmt.Sprintf(`t: [%d]->{"id": 0}`, rowId), + }) + } + + cdcTest(t, testFn, feedTestForceSink("cloudstorage")) +} diff --git a/pkg/ccl/changefeedccl/testfeed_test.go b/pkg/ccl/changefeedccl/testfeed_test.go index a0be728e0daf..f573ef705923 100644 --- a/pkg/ccl/changefeedccl/testfeed_test.go +++ b/pkg/ccl/changefeedccl/testfeed_test.go @@ -1318,10 +1318,40 @@ func (c *cloudFeed) appendParquetTestFeedMessages( } metaColumnNameSet := extractMetaColumns(columnNameSet) + // Count the number of distinct columns in the output so we can later verify + // that it matches the number of datums we output. Duplicating them in the + // output or missing one of these keys in the parquet output would be + // unexpected. + seenColumnNames := make(map[string]struct{}) + for _, colName := range primaryKeysNamesOrdered { + seenColumnNames[colName] = struct{}{} + } + for _, colName := range valueColumnNamesOrdered { + // No key should appear twice within the primary key list or within the + // value columns. The role of this check is to verify that a key that + // appears as both a primary and value key is not duplicated in the parquet + // output. + if _, ok := seenColumnNames[colName]; !ok { + seenColumnNames[colName] = struct{}{} + } + } + for _, row := range datums { rowJSONBuilder := json.NewObjectBuilder(len(valueColumnNamesOrdered) - len(metaColumnNameSet)) keyJSONBuilder := json.NewArrayBuilder(len(primaryKeysNamesOrdered)) + numDatumsInRow := len(row) + numDistinctColumns := len(seenColumnNames) + if numDatumsInRow != numDistinctColumns { + // If a column is duplicated in the parquet output, we would catch that in + // tests by throwing this error. + return errors.Newf( + `Number of datums in parquet output row doesn't match number of distinct columns, Expected: %d, Recieved: %d`, + numDistinctColumns, + numDatumsInRow, + ) + } + for _, primaryKeyColumnName := range primaryKeysNamesOrdered { datum := row[primaryKeyColumnSet[primaryKeyColumnName]] j, err := tree.AsJSON(datum, sessiondatapb.DataConversionConfig{}, time.UTC)
b94fe87fa28451ccc18f4c2a8fb4d4a9d3190357
2018-07-09 20:47:09
Daniel Harrison
acceptance: port the PauseUnpause test to use real kafka in docker
false
port the PauseUnpause test to use real kafka in docker
acceptance
diff --git a/build/teamcity-acceptance.sh b/build/teamcity-acceptance.sh index 73e00e843533..69c698f7bc49 100755 --- a/build/teamcity-acceptance.sh +++ b/build/teamcity-acceptance.sh @@ -27,7 +27,18 @@ tc_start_block "Compile acceptance tests" run build/builder.sh make -Otarget TYPE="$type" testbuild TAGS=acceptance PKG=./pkg/acceptance tc_end_block "Compile acceptance tests" +tc_start_block "Compile acceptanceccl tests" +run build/builder.sh make -Otarget TYPE="$type" testbuild TAGS=acceptance PKG=./pkg/ccl/acceptanceccl +tc_end_block "Compile acceptanceccl tests" + tc_start_block "Run acceptance tests" run cd pkg/acceptance run ./acceptance.test -nodes 4 -l "$TMPDIR" -test.v -test.timeout 30m 2>&1 | tee "$TMPDIR/acceptance.log" | go-test-teamcity +run cd ../.. tc_end_block "Run acceptance tests" + +tc_start_block "Run acceptanceccl tests" +run cd pkg/ccl/acceptanceccl +run ./acceptanceccl.test -nodes 4 -l "$TMPDIR" -test.v -test.timeout 30m 2>&1 | tee "$TMPDIR/acceptanceccl.log" | go-test-teamcity +run cd ../../.. +tc_end_block "Run acceptanceccl tests" diff --git a/pkg/acceptance/cluster/docker.go b/pkg/acceptance/cluster/docker.go index 5d79c4c2c615..9ab86bc9f4e6 100644 --- a/pkg/acceptance/cluster/docker.go +++ b/pkg/acceptance/cluster/docker.go @@ -71,6 +71,11 @@ type Container struct { cluster *DockerCluster } +// ID returns the container's id. +func (c Container) ID() string { + return c.id +} + // Name returns the container's name. func (c Container) Name() string { return c.name diff --git a/pkg/acceptance/cluster/dockercluster.go b/pkg/acceptance/cluster/dockercluster.go index 785a298ed768..b44849b54610 100644 --- a/pkg/acceptance/cluster/dockercluster.go +++ b/pkg/acceptance/cluster/dockercluster.go @@ -250,6 +250,37 @@ func (l *DockerCluster) OneShot( return l.oneshot.Wait(ctx, container.WaitConditionNotRunning) } +// SidecarContainer runs a container in the same bridge network as the +// CockroachDB nodes. +func (l *DockerCluster) SidecarContainer( + ctx context.Context, cfg container.Config, portMap map[string]string, +) (*Container, error) { + if err := pullImage(ctx, l, cfg.Image, types.ImagePullOptions{}); err != nil { + return nil, err + } + portBindings := nat.PortMap{} + for from, to := range portMap { + portBindings[nat.Port(from+`/tcp`)] = []nat.PortBinding{{HostPort: to}} + } + hostConfig := &container.HostConfig{ + NetworkMode: container.NetworkMode(l.networkID), + // Disable DNS search under the host machine's domain. This can catch + // upstream wildcard DNS matching and result in odd behavior. + DNSSearch: []string{"."}, + PortBindings: portBindings, + } + containerName := fmt.Sprintf(`%s-%s`, cfg.Hostname, l.clusterID) + resp, err := l.client.ContainerCreate(ctx, &cfg, hostConfig, nil, containerName) + if err != nil { + return nil, err + } + return &Container{ + id: resp.ID, + name: containerName, + cluster: l, + }, nil +} + // stopOnPanic is invoked as a deferred function in Start in order to attempt // to tear down the cluster if a panic occurs while starting it. If the panic // was initiated by the stopper being closed (which panicOnStop notices) then diff --git a/pkg/acceptance/flags.go b/pkg/acceptance/flags.go index e142bf5fd1e5..ab6a95eaf899 100644 --- a/pkg/acceptance/flags.go +++ b/pkg/acceptance/flags.go @@ -31,9 +31,9 @@ var flagNodes = flag.Int("nodes", 4, "number of nodes") var flagStores = flag.Int("stores", 1, "number of stores to use for each node") var flagLogDir = flag.String("l", "", "the directory to store log files, relative to the test source") -// readConfigFromFlags will convert the flags to a TestConfig for the purposes +// ReadConfigFromFlags will convert the flags to a TestConfig for the purposes // of starting up a cluster. -func readConfigFromFlags() cluster.TestConfig { +func ReadConfigFromFlags() cluster.TestConfig { cfg := cluster.TestConfig{ Name: fmt.Sprintf("AdHoc %dx%d", *flagNodes, *flagStores), Duration: *flagDuration, diff --git a/pkg/acceptance/gossip_peerings_test.go b/pkg/acceptance/gossip_peerings_test.go index 09b0b443e392..b4a9fbc8d897 100644 --- a/pkg/acceptance/gossip_peerings_test.go +++ b/pkg/acceptance/gossip_peerings_test.go @@ -86,7 +86,7 @@ func TestGossipRestart(t *testing.T) { defer s.Close(t) ctx := context.Background() - cfg := readConfigFromFlags() + cfg := ReadConfigFromFlags() RunLocal(t, func(t *testing.T) { c := StartCluster(ctx, t, cfg) defer c.AssertAndStop(ctx, t) @@ -210,7 +210,7 @@ func TestGossipRestartFirstNodeNeedsIncoming(t *testing.T) { defer s.Close(t) ctx := context.Background() - cfg := readConfigFromFlags() + cfg := ReadConfigFromFlags() RunLocal(t, func(t *testing.T) { c := StartCluster(ctx, t, cfg) defer c.AssertAndStop(ctx, t) diff --git a/pkg/acceptance/rapid_restart_test.go b/pkg/acceptance/rapid_restart_test.go index 5d177f0d9f06..fef18a9fe60e 100644 --- a/pkg/acceptance/rapid_restart_test.go +++ b/pkg/acceptance/rapid_restart_test.go @@ -39,7 +39,7 @@ func TestRapidRestarts(t *testing.T) { defer s.Close(t) ctx := context.Background() - cfg := readConfigFromFlags() + cfg := ReadConfigFromFlags() RunLocal(t, func(t *testing.T) { deadline := timeutil.Now().Add(cfg.Duration) // In a loop, bootstrap a new node and immediately kill it. This is more diff --git a/pkg/acceptance/test_acceptance.go b/pkg/acceptance/test_acceptance.go index 5de0fcfc7a24..91a61faf822a 100644 --- a/pkg/acceptance/test_acceptance.go +++ b/pkg/acceptance/test_acceptance.go @@ -28,10 +28,18 @@ import ( "testing" "github.com/cockroachdb/cockroach/pkg/acceptance/cluster" + "github.com/cockroachdb/cockroach/pkg/security" + "github.com/cockroachdb/cockroach/pkg/security/securitytest" + "github.com/cockroachdb/cockroach/pkg/server" + "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" + "github.com/cockroachdb/cockroach/pkg/testutils/testcluster" "github.com/cockroachdb/cockroach/pkg/util/randutil" ) func MainTest(m *testing.M) { + security.SetAssetLoader(securitytest.EmbeddedAssets) + serverutils.InitTestServerFactory(server.TestServerFactory) + serverutils.InitTestClusterFactory(testcluster.TestClusterFactory) os.Exit(RunTests(m)) } diff --git a/pkg/acceptance/test_main.go b/pkg/acceptance/test_main.go index f2553b64e8fb..ebb4506fee1d 100644 --- a/pkg/acceptance/test_main.go +++ b/pkg/acceptance/test_main.go @@ -33,5 +33,5 @@ import ( // MainTest is an exported implementation of TestMain for use by other // packages. func MainTest(m *testing.M) { - fmt.Fprintln(os.Stderr, "not running with `acceptance` build tag or against remote cluster; skipping") + fmt.Fprintln(os.Stderr, "not running with `acceptance` build tag; skipping") } diff --git a/pkg/acceptance/util_cluster.go b/pkg/acceptance/util_cluster.go index 4957a9d413d5..49b2f2d8a1d1 100644 --- a/pkg/acceptance/util_cluster.go +++ b/pkg/acceptance/util_cluster.go @@ -61,7 +61,7 @@ func runTestWithCluster( testFunc func(context.Context, *testing.T, cluster.Cluster, cluster.TestConfig), options ...func(*cluster.TestConfig), ) { - cfg := readConfigFromFlags() + cfg := ReadConfigFromFlags() ctx := context.Background() for _, opt := range options { diff --git a/pkg/acceptance/version_upgrade_test.go b/pkg/acceptance/version_upgrade_test.go index d12c26b7bad4..387caa7747b7 100644 --- a/pkg/acceptance/version_upgrade_test.go +++ b/pkg/acceptance/version_upgrade_test.go @@ -36,7 +36,7 @@ func TestVersionUpgrade(t *testing.T) { defer s.Close(t) ctx := context.Background() - cfg := readConfigFromFlags() + cfg := ReadConfigFromFlags() RunLocal(t, func(t *testing.T) { testVersionUpgrade(ctx, t, cfg) }) diff --git a/pkg/ccl/acceptanceccl/.gitignore b/pkg/ccl/acceptanceccl/.gitignore new file mode 100644 index 000000000000..2bdbf0be2fef --- /dev/null +++ b/pkg/ccl/acceptanceccl/.gitignore @@ -0,0 +1,3 @@ +# Do not add environment-specific entries here (see the top-level .gitignore +# for reasoning and alternatives). +.localcluster* diff --git a/pkg/ccl/acceptanceccl/cdc_kafka_test.go b/pkg/ccl/acceptanceccl/cdc_kafka_test.go new file mode 100644 index 000000000000..c1a3c91f5f4f --- /dev/null +++ b/pkg/ccl/acceptanceccl/cdc_kafka_test.go @@ -0,0 +1,345 @@ +// Copyright 2018 The Cockroach Authors. +// +// Licensed as a CockroachDB Enterprise file under the Cockroach Community +// License (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt + +package acceptanceccl + +import ( + "context" + "encoding/json" + "fmt" + "net" + "reflect" + "strconv" + "strings" + "testing" + "time" + + "github.com/Shopify/sarama" + "github.com/cockroachdb/cockroach/pkg/acceptance" + "github.com/cockroachdb/cockroach/pkg/acceptance/cluster" + "github.com/cockroachdb/cockroach/pkg/base" + "github.com/cockroachdb/cockroach/pkg/sql/jobs" + "github.com/cockroachdb/cockroach/pkg/testutils" + "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" + "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" + "github.com/cockroachdb/cockroach/pkg/util/log" + "github.com/cockroachdb/cockroach/pkg/util/retry" + "github.com/docker/docker/api/types/container" + "github.com/docker/go-connections/nat" +) + +func TestCDCPauseUnpause(t *testing.T) { + acceptance.RunDocker(t, func(t *testing.T) { + ctx := context.Background() + cfg := acceptance.ReadConfigFromFlags() + // Should we thread the old value of cfg.Nodes to the TestCluster? + cfg.Nodes = nil + // We're just using this DockerCluster for all its helpers. + // CockroachDB will be run via TestCluster. + c := acceptance.StartCluster(ctx, t, cfg).(*cluster.DockerCluster) + log.Infof(ctx, "cluster started successfully") + defer c.AssertAndStop(ctx, t) + testCDCPauseUnpause(ctx, t, c) + }) +} + +func testCDCPauseUnpause(ctx context.Context, t *testing.T, c *cluster.DockerCluster) { + k, err := startDockerKafka(ctx, c) + if err != nil { + t.Fatalf(`%+v`, err) + } + defer k.Close(ctx) + + defer func(prev time.Duration) { jobs.DefaultAdoptInterval = prev }(jobs.DefaultAdoptInterval) + jobs.DefaultAdoptInterval = 10 * time.Millisecond + + s, sqlDBRaw, _ := serverutils.StartServer(t, base.TestServerArgs{ + UseDatabase: "d", + }) + defer s.Stopper().Stop(ctx) + sqlDB := sqlutils.MakeSQLRunner(sqlDBRaw) + + sqlDB.Exec(t, `SET CLUSTER SETTING changefeed.experimental_poll_interval = '0ns'`) + sqlDB.Exec(t, `CREATE DATABASE d`) + sqlDB.Exec(t, `CREATE TABLE foo (a INT PRIMARY KEY, b STRING)`) + sqlDB.Exec(t, `INSERT INTO foo VALUES (1, 'a'), (2, 'b'), (4, 'c'), (7, 'd'), (8, 'e')`) + + var jobID int + sqlDB.QueryRow(t, `CREATE CHANGEFEED FOR foo INTO $1 WITH timestamps`, `kafka://localhost:`+k.kafkaPort).Scan(&jobID) + + tc, err := makeTopicsConsumer(k.consumer, `foo`) + if err != nil { + t.Fatal(err) + } + defer func() { + if err := tc.Close(); err != nil { + t.Fatal(err) + } + }() + + tc.assertPayloads(t, []string{ + `foo: [1]->{"a":1,"b":"a"}`, + `foo: [2]->{"a":2,"b":"b"}`, + `foo: [4]->{"a":4,"b":"c"}`, + `foo: [7]->{"a":7,"b":"d"}`, + `foo: [8]->{"a":8,"b":"e"}`, + }) + + // Wait for the highwater mark on the job to be updated after the initial + // scan, to make sure we don't get the initial scan data again. + m := tc.nextMessage(t) + if len(m.Key) != 0 { + t.Fatalf(`expected a resolved timestamp got %s: %s->%s`, m.Topic, m.Key, m.Value) + } + + sqlDB.Exec(t, `PAUSE JOB $1`, jobID) + sqlDB.Exec(t, `INSERT INTO foo VALUES (16, 'f')`) + sqlDB.Exec(t, `RESUME JOB $1`, jobID) + tc.assertPayloads(t, []string{ + `foo: [16]->{"a":16,"b":"f"}`, + }) +} + +const ( + confluentVersion = `4.0.0` + zookeeperImage = `docker.io/confluentinc/cp-zookeeper:` + confluentVersion + kafkaImage = `docker.io/confluentinc/cp-kafka:` + confluentVersion +) + +type dockerKafka struct { + serviceContainers map[string]*cluster.Container + zookeeperPort, kafkaPort string + + consumer sarama.Consumer +} + +func getOpenPort() (string, error) { + l, err := net.Listen(`tcp`, `:0`) + if err != nil { + return ``, err + } + err = l.Close() + return strconv.Itoa(l.Addr().(*net.TCPAddr).Port), err +} + +// startDockerKafka runs zookeeper and kafka in docker containers. +// +// There's enough complexity in Kafka that there's no way to have any confidence +// in end-to-end correctness testing based on a mock. We need real Kafka. Both +// kafka and its zookeeper dependence are java, and so we need to run them in +// Docker for these tests to be portable and reproducible. (I know, I know.) +// +// The major trick here is that kafka has an internal mechanism that lets you +// talk to any node and it redirects you to the one that has the data you're +// looking for. This is also used internally by the system. These are configured +// as advertised hosts. +// +// So, our CockroachDB changefeed needs to be able to reach Kafka at some +// address configured in the CREATE CHANGEFEED. Then it receives the list of +// advertised host:ports from Kafka, and it needs to be able to contact all of +// those. The same is true for the kafka nodes and the consumer that the test +// uses for to make assertions. Docker for mac really makes this difficult. The +// kafka nodes are running in docker, so they want to be able to talk to each +// other by their docker hostnames. We could also run CockroachDB inside docker, +// but the test is running outside (where the docker hosts don't resolve) and +// there's no easy way to change that. +// +// The easiest thing would be docker's `--network=host`, but alas that's not +// available with docker for mac. +// +// Kafka (theoretically) allows for multiple sets of named advertised listeners, +// differentiated by port. When you connect, it sends back the ones relevant to +// the port you connected to. This is designed for exactly this sort of +// situation. But this is tragically underdocumented and after *literally tens +// of hours* I could not get this to work. +// +// We could run some program inside docker to consume and proxy that information +// out to the test somehow (e.g. tailing `kafka-console-consumer`), but this is +// likely to introduce the same sort of bugs we'd have with the mock. +// +// We could also use `--network=container` instead of bridge networking, which +// lets us share the same network namespace between a bunch of containers. Then +// we make everything run on unique ports (and export them) and use "localhost" +// for the host everywhere. This works well and might be what we have to do if +// we need to run multi-node Kafka clusters. However, all the necessary ports +// have to be exported from the first container started, which requires some +// major surgery to DockerCluster. +// +// In the end, what we do is similar. Zookeeper and Kafka are assigned unique +// ports that are unassigned on the host. They run on that port inside docker +// and it's mapped to the same port on the host. (Zookeeper doesn't need to be +// available externally, but it was easy and sometimes it's nice for debugging +// the test.) A one node Kafka cluster can talk to itself on localhost and the +// unique port. CockroachDB also can, but only from outside docker. And... uh... +// we're done. \o/ +// +// This is a monstrosity, so please fix it if you can figure out a better way. +func startDockerKafka( + ctx context.Context, d *cluster.DockerCluster, topics ...string, +) (*dockerKafka, error) { + k := &dockerKafka{ + serviceContainers: make(map[string]*cluster.Container), + } + var err error + if k.zookeeperPort, err = getOpenPort(); err != nil { + return nil, err + } + if k.kafkaPort, err = getOpenPort(); err != nil { + return nil, err + } + + zookeeper, err := d.SidecarContainer(ctx, container.Config{ + Hostname: `zookeeper`, + Image: zookeeperImage, + ExposedPorts: map[nat.Port]struct{}{ + nat.Port(k.zookeeperPort + `/tcp`): {}, + }, + Env: []string{ + `ZOOKEEPER_CLIENT_PORT=` + k.zookeeperPort, + `ZOOKEEPER_TICK_TIME=2000`, + }, + }, map[string]string{k.zookeeperPort: k.zookeeperPort}) + if err != nil { + return nil, err + } + kafka, err := d.SidecarContainer(ctx, container.Config{ + Hostname: `kafka`, + Image: kafkaImage, + ExposedPorts: map[nat.Port]struct{}{ + nat.Port(k.kafkaPort + `/tcp`): {}, + }, + Env: []string{ + `KAFKA_ZOOKEEPER_CONNECT=` + zookeeper.Name() + `:` + k.zookeeperPort, + `KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1`, + `KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:` + k.kafkaPort, + }, + }, map[string]string{k.kafkaPort: k.kafkaPort}) + if err != nil { + return nil, err + } + + k.serviceContainers = map[string]*cluster.Container{ + `zookeeper`: zookeeper, + `kafka`: kafka, + } + for _, n := range []string{`zookeeper`, `kafka`} { + s := k.serviceContainers[n] + if err := s.Start(ctx); err != nil { + return nil, err + } + log.Infof(ctx, "%s is running: %s", s.Name(), s.ID()) + } + + // Wait for kafka to be available. + if err := retry.ForDuration(testutils.DefaultSucceedsSoonDuration, func() error { + addrs := []string{`localhost:` + k.kafkaPort} + var err error + k.consumer, err = sarama.NewConsumer(addrs, sarama.NewConfig()) + if err != nil { + log.Infof(ctx, "%+v", err) + } + return err + }); err != nil { + return nil, err + } + + return k, nil +} + +func (k *dockerKafka) Close(ctx context.Context) { + for _, c := range k.serviceContainers { + if err := c.Kill(ctx); err != nil { + log.Warningf(ctx, "could not kill container %s (%s)", c.Name(), c.ID()) + } + if err := c.Remove(ctx); err != nil { + log.Warningf(ctx, "could not remove container %s (%s)", c.Name(), c.ID()) + } + } +} + +type topicsConsumer struct { + sarama.Consumer + partitionConsumers []sarama.PartitionConsumer +} + +func makeTopicsConsumer(c sarama.Consumer, topics ...string) (*topicsConsumer, error) { + t := &topicsConsumer{Consumer: c} + for _, topic := range topics { + partitions, err := t.Partitions(topic) + if err != nil { + return nil, err + } + for _, partition := range partitions { + pc, err := t.ConsumePartition(topic, partition, sarama.OffsetOldest) + if err != nil { + return nil, err + } + t.partitionConsumers = append(t.partitionConsumers, pc) + } + } + return t, nil +} + +func (c *topicsConsumer) Close() error { + for _, pc := range c.partitionConsumers { + pc.AsyncClose() + // Drain the messages and errors as required by AsyncClose. + for range pc.Messages() { + } + for range pc.Errors() { + } + } + return c.Consumer.Close() +} + +func (c *topicsConsumer) tryNextMessage(t testing.TB) *sarama.ConsumerMessage { + for _, pc := range c.partitionConsumers { + select { + case m := <-pc.Messages(): + return m + default: + } + } + return nil +} + +func (c *topicsConsumer) nextMessage(t testing.TB) *sarama.ConsumerMessage { + m := c.tryNextMessage(t) + for ; m == nil; m = c.tryNextMessage(t) { + } + return m +} + +func (c *topicsConsumer) assertPayloads(t testing.TB, expected []string) { + var actual []string + for len(actual) < len(expected) { + m := c.nextMessage(t) + + // Skip resolved timestamps messages. + if len(m.Key) == 0 { + continue + } + + // Strip out the updated timestamp in the value. + var valueRaw map[string]interface{} + if err := json.Unmarshal(m.Value, &valueRaw); err != nil { + t.Fatal(err) + } + delete(valueRaw, `__crdb__`) + value, err := json.Marshal(valueRaw) + if err != nil { + t.Fatal(err) + } + + actual = append(actual, fmt.Sprintf(`%s: %s->%s`, m.Topic, m.Key, value)) + } + if !reflect.DeepEqual(expected, actual) { + t.Fatalf("expected\n %s\ngot\n %s", + strings.Join(expected, "\n "), strings.Join(actual, "\n ")) + } +} diff --git a/pkg/ccl/acceptanceccl/main_test.go b/pkg/ccl/acceptanceccl/main_test.go new file mode 100644 index 000000000000..472bd41d488a --- /dev/null +++ b/pkg/ccl/acceptanceccl/main_test.go @@ -0,0 +1,26 @@ +// Copyright 2015 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. + +package acceptanceccl + +import ( + "testing" + + "github.com/cockroachdb/cockroach/pkg/acceptance" + _ "github.com/cockroachdb/cockroach/pkg/ccl" // ccl init hooks +) + +func TestMain(m *testing.M) { + acceptance.MainTest(m) +} diff --git a/pkg/ccl/acceptanceccl/placeholder.go b/pkg/ccl/acceptanceccl/placeholder.go new file mode 100644 index 000000000000..6f798e42c45f --- /dev/null +++ b/pkg/ccl/acceptanceccl/placeholder.go @@ -0,0 +1,11 @@ +// Copyright 2018 The Cockroach Authors. +// +// Licensed as a CockroachDB Enterprise file under the Cockroach Community +// License (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt + +package acceptanceccl + +// Placeholder to get around "no non-test Go files" error in make lint. diff --git a/pkg/ccl/changefeedccl/changefeed_test.go b/pkg/ccl/changefeedccl/changefeed_test.go index 18c7632800c2..267fe7efdfa0 100644 --- a/pkg/ccl/changefeedccl/changefeed_test.go +++ b/pkg/ccl/changefeedccl/changefeed_test.go @@ -273,8 +273,8 @@ func TestChangefeedErrors(t *testing.T) { if _, err := sqlDB.DB.Exec( `CREATE CHANGEFEED FOR foo INTO $1`, `kafka://nope`, - ); !testutils.IsError(err, `no test producer: nope`) { - t.Fatalf(`expected 'no test producer: nope' error got: %+v`, err) + ); !testutils.IsError(err, `client has run out of available brokers`) { + t.Fatalf(`expected 'client has run out of available brokers' error got: %+v`, err) } if _, err := sqlDB.DB.Exec( `CREATE CHANGEFEED FOR foo INTO ''`, diff --git a/pkg/ccl/changefeedccl/kafka_test.go b/pkg/ccl/changefeedccl/kafka_test.go deleted file mode 100644 index 1d5dc2f41307..000000000000 --- a/pkg/ccl/changefeedccl/kafka_test.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2018 The Cockroach Authors. -// -// Licensed as a CockroachDB Enterprise file under the Cockroach Community -// License (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt - -package changefeedccl - -import ( - "context" - "fmt" - "reflect" - "strings" - "testing" - "time" - - "github.com/Shopify/sarama" - "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" - "github.com/cockroachdb/cockroach/pkg/sql/jobs" - "github.com/cockroachdb/cockroach/pkg/sql/jobs/jobspb" - "github.com/cockroachdb/cockroach/pkg/testutils" - "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" - "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" - "github.com/cockroachdb/cockroach/pkg/util/bufalloc" - "github.com/cockroachdb/cockroach/pkg/util/hlc" - "github.com/cockroachdb/cockroach/pkg/util/leaktest" - "github.com/cockroachdb/cockroach/pkg/util/log" - "github.com/cockroachdb/cockroach/pkg/util/protoutil" - "github.com/cockroachdb/cockroach/pkg/util/retry" - "github.com/cockroachdb/cockroach/pkg/util/syncutil" - "github.com/pkg/errors" -) - -func init() { - testKafkaProducersHook = make(map[string]sarama.SyncProducer) -} - -func TestChangefeedPauseUnpause(t *testing.T) { - defer leaktest.AfterTest(t)() - defer utilccl.TestingEnableEnterprise()() - - defer func(prev time.Duration) { jobs.DefaultAdoptInterval = prev }(jobs.DefaultAdoptInterval) - jobs.DefaultAdoptInterval = 10 * time.Millisecond - - ctx := context.Background() - s, sqlDBRaw, _ := serverutils.StartServer(t, base.TestServerArgs{ - UseDatabase: "d", - }) - defer s.Stopper().Stop(ctx) - sqlDB := sqlutils.MakeSQLRunner(sqlDBRaw) - - k := newTestKafkaProducer() - testKafkaProducersHook[t.Name()] = k - sqlDB.Exec(t, `SET CLUSTER SETTING changefeed.experimental_poll_interval = '0ns'`) - - sqlDB.Exec(t, `CREATE DATABASE d`) - sqlDB.Exec(t, `CREATE TABLE foo (a INT PRIMARY KEY, b STRING)`) - sqlDB.Exec(t, `INSERT INTO foo VALUES (1, 'a'), (2, 'b'), (4, 'c'), (7, 'd'), (8, 'e')`) - - var jobID int - sqlDB.QueryRow(t, `CREATE CHANGEFEED FOR foo INTO $1`, `kafka://`+t.Name()).Scan(&jobID) - - k.assertPayloads(t, []string{ - `foo: [1]->{"a": 1, "b": "a"}`, - `foo: [2]->{"a": 2, "b": "b"}`, - `foo: [4]->{"a": 4, "b": "c"}`, - `foo: [7]->{"a": 7, "b": "d"}`, - `foo: [8]->{"a": 8, "b": "e"}`, - }) - - // TODO(dan): To ensure the test restarts from after this point (so the - // below assertion doesn't flake), we need to wait for the highwater mark on - // the job to be updated after the initial scan. Once we support emitting - // resolved timestamps, we can just wait for one of those here, but in the - // meantime, introspect the jobs table. - testutils.SucceedsSoon(t, func() error { - var progressBytes []byte - if err := sqlDB.DB.QueryRow( - `SELECT progress FROM system.jobs WHERE id = $1`, jobID, - ).Scan(&progressBytes); err != nil { - log.Info(ctx, err) - return err - } - var progress jobspb.Progress - if err := protoutil.Unmarshal(progressBytes, &progress); err != nil { - return err - } - if progress.GetChangefeed().Highwater == (hlc.Timestamp{}) { - return errors.New(`waiting for initial scan to finish`) - } - return nil - }) - - // PAUSE JOB is asynchronous, so wait for it to notice the pause state and shut - // down. - sqlDB.Exec(t, `PAUSE JOB $1`, jobID) - testutils.SucceedsSoon(t, func() error { - k.mu.Lock() - closed := k.mu.closed - k.mu.Unlock() - if !closed { - return errors.New(`waiting for job to shut down the changefeed flow`) - } - return nil - }) - - // Nothing should happen if the job is paused. - sqlDB.Exec(t, `INSERT INTO foo VALUES (16, 'f')`) - const numPausedChecks = 5 - for i := 0; i < numPausedChecks; i++ { - if m := k.Message(); m != nil { - t.Fatalf(`expected no messages got %v`, m) - } - } - - k.Reset() - sqlDB.Exec(t, `RESUME JOB $1`, jobID) - k.assertPayloads(t, []string{ - `foo: [16]->{"a": 16, "b": "f"}`, - }) -} - -// testKafkaProducer is an implementation of sarama.SyncProducer used for -// testing. -type testKafkaProducer struct { - mu struct { - syncutil.Mutex - msgs []*sarama.ProducerMessage - closed bool - } - scratch bufalloc.ByteAllocator -} - -func newTestKafkaProducer() *testKafkaProducer { - return &testKafkaProducer{} -} - -func (k *testKafkaProducer) Reset() { - k.scratch = k.scratch[:0] - k.mu.Lock() - k.mu.closed = false - k.mu.Unlock() -} - -// SendMessage implements the KafkaProducer interface. -func (k *testKafkaProducer) SendMessage( - msg *sarama.ProducerMessage, -) (partition int32, offset int64, err error) { - key, err := msg.Key.Encode() - if err != nil { - return 0, 0, err - } - k.scratch, key = k.scratch.Copy(key, 0 /* extraCap */) - msg.Key = sarama.ByteEncoder(key) - value, err := msg.Value.Encode() - if err != nil { - return 0, 0, err - } - k.scratch, value = k.scratch.Copy(value, 0 /* extraCap */) - msg.Value = sarama.ByteEncoder(value) - - k.mu.Lock() - k.mu.msgs = append(k.mu.msgs, msg) - closed := k.mu.closed - k.mu.Unlock() - if closed { - return 0, 0, errors.New(`cannot send to closed producer`) - } - return 0, 0, nil -} - -func (k *testKafkaProducer) SendMessages(msgs []*sarama.ProducerMessage) error { - for _, msg := range msgs { - if _, _, err := k.SendMessage(msg); err != nil { - return err - } - } - return nil -} - -// Close implements the KafkaProducer interface. -func (k *testKafkaProducer) Close() error { - k.mu.Lock() - k.mu.closed = true - k.mu.Unlock() - return nil -} - -func (k *testKafkaProducer) Message() *sarama.ProducerMessage { - k.mu.Lock() - var msg *sarama.ProducerMessage - if len(k.mu.msgs) > 0 { - msg = k.mu.msgs[0] - k.mu.msgs = k.mu.msgs[1:] - } - k.mu.Unlock() - return msg -} - -func (k *testKafkaProducer) assertPayloads(t *testing.T, expected []string) { - t.Helper() - - var actual []string - for r := retry.Start(retry.Options{}); len(actual) < len(expected) && r.Next(); { - if m := k.Message(); m != nil { - key, err := m.Key.Encode() - if err != nil { - t.Fatal(err) - } - value, err := m.Value.Encode() - if err != nil { - t.Fatal(err) - } - actual = append(actual, fmt.Sprintf(`%s: %s->%s`, m.Topic, key, value)) - } - } - - if !reflect.DeepEqual(expected, actual) { - t.Fatalf("expected\n %s\ngot\n %s", - strings.Join(expected, "\n "), strings.Join(actual, "\n ")) - } -} diff --git a/pkg/ccl/changefeedccl/sink.go b/pkg/ccl/changefeedccl/sink.go index 57fd6786ef35..412b929f580d 100644 --- a/pkg/ccl/changefeedccl/sink.go +++ b/pkg/ccl/changefeedccl/sink.go @@ -34,13 +34,6 @@ type Sink interface { Close() error } -// testKafkaProducersHook is used as a Kafka mock instead of an external -// connection. The map key is the bootstrap servers part of the sink URI, so use -// it in a test with something like `INTO 'kafka://<map key>'`. If this map is -// non-nil, it's guaranteed that no external Kafka connections will be -// attempted. -var testKafkaProducersHook map[string]sarama.SyncProducer - type kafkaSink struct { // TODO(dan): This uses the shopify kafka producer library because the // official confluent one depends on librdkafka and it didn't seem worth it @@ -62,13 +55,6 @@ func getKafkaSink(kafkaTopicPrefix string, bootstrapServers string) (Sink, error topicsSeen: make(map[string]struct{}), } - if testKafkaProducersHook != nil { - if sink.SyncProducer = testKafkaProducersHook[bootstrapServers]; sink.SyncProducer == nil { - return nil, errors.Errorf(`no test producer: %s`, bootstrapServers) - } - return sink, nil - } - config := sarama.NewConfig() config.Producer.Return.Successes = true config.Producer.Partitioner = newChangefeedPartitioner
dbc1111f5f7d911ba27c41f0b75107e18c5abd85
2020-05-06 18:47:46
Tobias Schottdorf
roachtest: skip acceptance/many-splits on <=19.1
false
skip acceptance/many-splits on <=19.1
roachtest
diff --git a/pkg/cmd/roachtest/acceptance.go b/pkg/cmd/roachtest/acceptance.go index 99b9dbeda2cb..592e9b2f5ea5 100644 --- a/pkg/cmd/roachtest/acceptance.go +++ b/pkg/cmd/roachtest/acceptance.go @@ -43,7 +43,10 @@ func registerAcceptance(r *testRegistry) { {name: "gossip/restart-node-one", fn: runGossipRestartNodeOne}, {name: "gossip/locality-address", fn: runCheckLocalityIPAddress}, {name: "rapid-restart", fn: runRapidRestart}, - {name: "many-splits", fn: runManySplits}, + { + name: "many-splits", fn: runManySplits, + minVersion: "v19.2.0", // SQL syntax unsupported on 19.1.x + }, {name: "status-server", fn: runStatusServer}, { name: "version-upgrade",
44438e2c9c762314e1be17bccf44dafd916a3a80
2019-03-16 03:50:27
Nathan VanBenschoten
logictest: bump stats.DefaultAsOfTime to avoid txn retries
false
bump stats.DefaultAsOfTime to avoid txn retries
logictest
diff --git a/pkg/sql/logictest/logic.go b/pkg/sql/logictest/logic.go index 43e23f5c8e01..8e1a20c5d6b9 100644 --- a/pkg/sql/logictest/logic.go +++ b/pkg/sql/logictest/logic.go @@ -1025,7 +1025,9 @@ func (t *logicTest) setup(cfg testClusterConfig) { } // Update the defaults for automatic statistics to avoid delays in testing. - stats.DefaultAsOfTime = time.Microsecond + // Avoid making the DefaultAsOfTime too small to avoid interacting with + // schema changes and causing transaction retries. + stats.DefaultAsOfTime = 10 * time.Millisecond stats.DefaultRefreshInterval = time.Millisecond t.cluster = serverutils.StartTestCluster(t.t, cfg.numNodes, params)
9b36827eee5da94efa6ab3c4e80e88a70d115c7d
2021-09-01 22:15:07
Marcus Gartner
colexec: fix IN operator with unsorted tuple
false
fix IN operator with unsorted tuple
colexec
diff --git a/pkg/sql/colexec/colbuilder/execplan.go b/pkg/sql/colexec/colbuilder/execplan.go index 8328b56b1de2..a243a122d62b 100644 --- a/pkg/sql/colexec/colbuilder/execplan.go +++ b/pkg/sql/colexec/colbuilder/execplan.go @@ -1976,7 +1976,7 @@ func planSelectionOperators( if !ok || useDefaultCmpOpForIn(datumTuple) { break } - op, err = colexec.GetInOperator(lTyp, leftOp, leftIdx, datumTuple, negate) + op, err = colexec.GetInOperator(evalCtx, lTyp, leftOp, leftIdx, datumTuple, negate) case tree.IsDistinctFrom, tree.IsNotDistinctFrom: if constArg != tree.DNull { // Optimized IsDistinctFrom and IsNotDistinctFrom are @@ -2405,7 +2405,7 @@ func planProjectionExpr( break } op, err = colexec.GetInProjectionOperator( - allocator, typs[leftIdx], input, leftIdx, resultIdx, datumTuple, negate, + evalCtx, allocator, typs[leftIdx], input, leftIdx, resultIdx, datumTuple, negate, ) case tree.IsDistinctFrom, tree.IsNotDistinctFrom: if right != tree.DNull { diff --git a/pkg/sql/colexec/execgen/cmd/execgen/select_in_gen.go b/pkg/sql/colexec/execgen/cmd/execgen/select_in_gen.go index b0e6e7587d11..50bae7a4f02f 100644 --- a/pkg/sql/colexec/execgen/cmd/execgen/select_in_gen.go +++ b/pkg/sql/colexec/execgen/cmd/execgen/select_in_gen.go @@ -31,8 +31,8 @@ func genSelectIn(inputFileContents string, wr io.Writer) error { ) s := r.Replace(inputFileContents) - assignEq := makeFunctionRegex("_COMPARE", 5) - s = assignEq.ReplaceAllString(s, makeTemplateFunctionCall("Compare", 5)) + compare := makeFunctionRegex("_COMPARE", 5) + s = compare.ReplaceAllString(s, makeTemplateFunctionCall("Compare", 5)) s = replaceManipulationFuncs(s) diff --git a/pkg/sql/colexec/select_in.eg.go b/pkg/sql/colexec/select_in.eg.go index cb6d6fd5040e..888980d976be 100644 --- a/pkg/sql/colexec/select_in.eg.go +++ b/pkg/sql/colexec/select_in.eg.go @@ -54,6 +54,7 @@ const ( ) func GetInProjectionOperator( + evalCtx *tree.EvalContext, allocator *colmem.Allocator, t *types.T, input colexecop.Operator, @@ -75,7 +76,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowBool(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowBool(evalCtx, t, datumTuple) return obj, nil } case types.BytesFamily: @@ -89,7 +90,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowBytes(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowBytes(evalCtx, t, datumTuple) return obj, nil } case types.DecimalFamily: @@ -103,7 +104,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowDecimal(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowDecimal(evalCtx, t, datumTuple) return obj, nil } case types.IntFamily: @@ -116,7 +117,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInt16(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInt16(evalCtx, t, datumTuple) return obj, nil case 32: obj := &projectInOpInt32{ @@ -126,7 +127,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInt32(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInt32(evalCtx, t, datumTuple) return obj, nil case -1: default: @@ -137,7 +138,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInt64(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInt64(evalCtx, t, datumTuple) return obj, nil } case types.FloatFamily: @@ -151,7 +152,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowFloat64(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowFloat64(evalCtx, t, datumTuple) return obj, nil } case types.TimestampTZFamily: @@ -165,7 +166,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowTimestamp(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowTimestamp(evalCtx, t, datumTuple) return obj, nil } case types.IntervalFamily: @@ -179,7 +180,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInterval(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInterval(evalCtx, t, datumTuple) return obj, nil } case types.JsonFamily: @@ -193,7 +194,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowJSON(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowJSON(evalCtx, t, datumTuple) return obj, nil } case typeconv.DatumVecCanonicalTypeFamily: @@ -207,7 +208,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowDatum(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowDatum(evalCtx, t, datumTuple) return obj, nil } } @@ -215,7 +216,12 @@ func GetInProjectionOperator( } func GetInOperator( - t *types.T, input colexecop.Operator, colIdx int, datumTuple *tree.DTuple, negate bool, + evalCtx *tree.EvalContext, + t *types.T, + input colexecop.Operator, + colIdx int, + datumTuple *tree.DTuple, + negate bool, ) (colexecop.Operator, error) { switch typeconv.TypeFamilyToCanonicalTypeFamily(t.Family()) { case types.BoolFamily: @@ -227,7 +233,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowBool(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowBool(evalCtx, t, datumTuple) return obj, nil } case types.BytesFamily: @@ -239,7 +245,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowBytes(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowBytes(evalCtx, t, datumTuple) return obj, nil } case types.DecimalFamily: @@ -251,7 +257,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowDecimal(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowDecimal(evalCtx, t, datumTuple) return obj, nil } case types.IntFamily: @@ -262,7 +268,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInt16(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInt16(evalCtx, t, datumTuple) return obj, nil case 32: obj := &selectInOpInt32{ @@ -270,7 +276,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInt32(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInt32(evalCtx, t, datumTuple) return obj, nil case -1: default: @@ -279,7 +285,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInt64(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInt64(evalCtx, t, datumTuple) return obj, nil } case types.FloatFamily: @@ -291,7 +297,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowFloat64(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowFloat64(evalCtx, t, datumTuple) return obj, nil } case types.TimestampTZFamily: @@ -303,7 +309,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowTimestamp(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowTimestamp(evalCtx, t, datumTuple) return obj, nil } case types.IntervalFamily: @@ -315,7 +321,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowInterval(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowInterval(evalCtx, t, datumTuple) return obj, nil } case types.JsonFamily: @@ -327,7 +333,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowJSON(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowJSON(evalCtx, t, datumTuple) return obj, nil } case typeconv.DatumVecCanonicalTypeFamily: @@ -339,7 +345,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRowDatum(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRowDatum(evalCtx, t, datumTuple) return obj, nil } } @@ -368,7 +374,12 @@ type projectInOpBool struct { var _ colexecop.Operator = &projectInOpBool{} -func fillDatumRowBool(t *types.T, datumTuple *tree.DTuple) ([]bool, bool) { +func fillDatumRowBool( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]bool, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []bool hasNulls := false @@ -387,8 +398,8 @@ func fillDatumRowBool(t *types.T, datumTuple *tree.DTuple) ([]bool, bool) { func cmpInBool( targetElem bool, targetCol coldata.Bools, filterRow []bool, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowBool, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -602,7 +613,12 @@ type projectInOpBytes struct { var _ colexecop.Operator = &projectInOpBytes{} -func fillDatumRowBytes(t *types.T, datumTuple *tree.DTuple) ([][]byte, bool) { +func fillDatumRowBytes( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([][]byte, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result [][]byte hasNulls := false @@ -621,8 +637,8 @@ func fillDatumRowBytes(t *types.T, datumTuple *tree.DTuple) ([][]byte, bool) { func cmpInBytes( targetElem []byte, targetCol *coldata.Bytes, filterRow [][]byte, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowBytes, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -824,7 +840,12 @@ type projectInOpDecimal struct { var _ colexecop.Operator = &projectInOpDecimal{} -func fillDatumRowDecimal(t *types.T, datumTuple *tree.DTuple) ([]apd.Decimal, bool) { +func fillDatumRowDecimal( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]apd.Decimal, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []apd.Decimal hasNulls := false @@ -843,8 +864,8 @@ func fillDatumRowDecimal(t *types.T, datumTuple *tree.DTuple) ([]apd.Decimal, bo func cmpInDecimal( targetElem apd.Decimal, targetCol coldata.Decimals, filterRow []apd.Decimal, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowDecimal, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -1050,7 +1071,12 @@ type projectInOpInt16 struct { var _ colexecop.Operator = &projectInOpInt16{} -func fillDatumRowInt16(t *types.T, datumTuple *tree.DTuple) ([]int16, bool) { +func fillDatumRowInt16( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]int16, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []int16 hasNulls := false @@ -1069,8 +1095,8 @@ func fillDatumRowInt16(t *types.T, datumTuple *tree.DTuple) ([]int16, bool) { func cmpInInt16( targetElem int16, targetCol coldata.Int16s, filterRow []int16, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowInt16, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -1287,7 +1313,12 @@ type projectInOpInt32 struct { var _ colexecop.Operator = &projectInOpInt32{} -func fillDatumRowInt32(t *types.T, datumTuple *tree.DTuple) ([]int32, bool) { +func fillDatumRowInt32( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]int32, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []int32 hasNulls := false @@ -1306,8 +1337,8 @@ func fillDatumRowInt32(t *types.T, datumTuple *tree.DTuple) ([]int32, bool) { func cmpInInt32( targetElem int32, targetCol coldata.Int32s, filterRow []int32, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowInt32, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -1524,7 +1555,12 @@ type projectInOpInt64 struct { var _ colexecop.Operator = &projectInOpInt64{} -func fillDatumRowInt64(t *types.T, datumTuple *tree.DTuple) ([]int64, bool) { +func fillDatumRowInt64( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]int64, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []int64 hasNulls := false @@ -1543,8 +1579,8 @@ func fillDatumRowInt64(t *types.T, datumTuple *tree.DTuple) ([]int64, bool) { func cmpInInt64( targetElem int64, targetCol coldata.Int64s, filterRow []int64, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowInt64, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -1761,7 +1797,12 @@ type projectInOpFloat64 struct { var _ colexecop.Operator = &projectInOpFloat64{} -func fillDatumRowFloat64(t *types.T, datumTuple *tree.DTuple) ([]float64, bool) { +func fillDatumRowFloat64( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]float64, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []float64 hasNulls := false @@ -1780,8 +1821,8 @@ func fillDatumRowFloat64(t *types.T, datumTuple *tree.DTuple) ([]float64, bool) func cmpInFloat64( targetElem float64, targetCol coldata.Float64s, filterRow []float64, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowFloat64, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -2006,7 +2047,12 @@ type projectInOpTimestamp struct { var _ colexecop.Operator = &projectInOpTimestamp{} -func fillDatumRowTimestamp(t *types.T, datumTuple *tree.DTuple) ([]time.Time, bool) { +func fillDatumRowTimestamp( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]time.Time, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []time.Time hasNulls := false @@ -2025,8 +2071,8 @@ func fillDatumRowTimestamp(t *types.T, datumTuple *tree.DTuple) ([]time.Time, bo func cmpInTimestamp( targetElem time.Time, targetCol coldata.Times, filterRow []time.Time, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowTimestamp, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -2239,7 +2285,12 @@ type projectInOpInterval struct { var _ colexecop.Operator = &projectInOpInterval{} -func fillDatumRowInterval(t *types.T, datumTuple *tree.DTuple) ([]duration.Duration, bool) { +func fillDatumRowInterval( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]duration.Duration, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []duration.Duration hasNulls := false @@ -2258,8 +2309,8 @@ func fillDatumRowInterval(t *types.T, datumTuple *tree.DTuple) ([]duration.Durat func cmpInInterval( targetElem duration.Duration, targetCol coldata.Durations, filterRow []duration.Duration, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowInterval, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -2465,7 +2516,12 @@ type projectInOpJSON struct { var _ colexecop.Operator = &projectInOpJSON{} -func fillDatumRowJSON(t *types.T, datumTuple *tree.DTuple) ([]json.JSON, bool) { +func fillDatumRowJSON( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]json.JSON, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []json.JSON hasNulls := false @@ -2484,8 +2540,8 @@ func fillDatumRowJSON(t *types.T, datumTuple *tree.DTuple) ([]json.JSON, bool) { func cmpInJSON( targetElem json.JSON, targetCol *coldata.JSONs, filterRow []json.JSON, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowJSON, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { @@ -2693,7 +2749,12 @@ type projectInOpDatum struct { var _ colexecop.Operator = &projectInOpDatum{} -func fillDatumRowDatum(t *types.T, datumTuple *tree.DTuple) ([]interface{}, bool) { +func fillDatumRowDatum( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]interface{}, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []interface{} hasNulls := false @@ -2712,8 +2773,8 @@ func fillDatumRowDatum(t *types.T, datumTuple *tree.DTuple) ([]interface{}, bool func cmpInDatum( targetElem interface{}, targetCol coldata.DatumVec, filterRow []interface{}, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRowDatum, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { diff --git a/pkg/sql/colexec/select_in_tmpl.go b/pkg/sql/colexec/select_in_tmpl.go index 244070893ed8..0c20776649ac 100644 --- a/pkg/sql/colexec/select_in_tmpl.go +++ b/pkg/sql/colexec/select_in_tmpl.go @@ -78,6 +78,7 @@ const ( ) func GetInProjectionOperator( + evalCtx *tree.EvalContext, allocator *colmem.Allocator, t *types.T, input colexecop.Operator, @@ -100,7 +101,7 @@ func GetInProjectionOperator( outputIdx: resultIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRow_TYPE(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRow_TYPE(evalCtx, t, datumTuple) return obj, nil // {{end}} } @@ -110,7 +111,12 @@ func GetInProjectionOperator( } func GetInOperator( - t *types.T, input colexecop.Operator, colIdx int, datumTuple *tree.DTuple, negate bool, + evalCtx *tree.EvalContext, + t *types.T, + input colexecop.Operator, + colIdx int, + datumTuple *tree.DTuple, + negate bool, ) (colexecop.Operator, error) { switch typeconv.TypeFamilyToCanonicalTypeFamily(t.Family()) { // {{range .}} @@ -123,7 +129,7 @@ func GetInOperator( colIdx: colIdx, negate: negate, } - obj.filterRow, obj.hasNulls = fillDatumRow_TYPE(t, datumTuple) + obj.filterRow, obj.hasNulls = fillDatumRow_TYPE(evalCtx, t, datumTuple) return obj, nil // {{end}} } @@ -157,7 +163,12 @@ type projectInOp_TYPE struct { var _ colexecop.Operator = &projectInOp_TYPE{} -func fillDatumRow_TYPE(t *types.T, datumTuple *tree.DTuple) ([]_GOTYPE, bool) { +func fillDatumRow_TYPE( + evalCtx *tree.EvalContext, t *types.T, datumTuple *tree.DTuple, +) ([]_GOTYPE, bool) { + // Sort the contents of the tuple, if they are not already sorted. + datumTuple.Normalize(evalCtx) + conv := colconv.GetDatumToPhysicalFn(t) var result []_GOTYPE hasNulls := false @@ -176,8 +187,8 @@ func fillDatumRow_TYPE(t *types.T, datumTuple *tree.DTuple) ([]_GOTYPE, bool) { func cmpIn_TYPE( targetElem _GOTYPE, targetCol _GOTYPESLICE, filterRow []_GOTYPE, hasNulls bool, ) comparisonResult { - // Filter row input is already sorted due to normalization, so we can use a - // binary search right away. + // Filter row input was already sorted in fillDatumRow_TYPE, so we can + // perform a binary search. lo := 0 hi := len(filterRow) for lo < hi { diff --git a/pkg/sql/logictest/testdata/logic_test/vectorize b/pkg/sql/logictest/testdata/logic_test/vectorize index a1f5856c9570..ef6d84316a4d 100644 --- a/pkg/sql/logictest/testdata/logic_test/vectorize +++ b/pkg/sql/logictest/testdata/logic_test/vectorize @@ -1253,3 +1253,18 @@ query T SELECT c FROM t68040 WHERE c LIKE '%\\%' ---- string with \ backslash + +# Regression test for #68979. The IN operator should evaluate correctly when the +# tuple contents are not sorted by the optimizer. +statement ok +CREATE TABLE t68979 ( + a INT +) + +statement ok +INSERT INTO t68979 VALUES (0) + +query B +SELECT 'b' IN ('b', (SELECT NULL FROM t68979), 'a') FROM t68979 +---- +true diff --git a/pkg/sql/sem/tree/datum.go b/pkg/sql/sem/tree/datum.go index 7ea27c03772d..a21094d61b97 100644 --- a/pkg/sql/sem/tree/datum.go +++ b/pkg/sql/sem/tree/datum.go @@ -3745,9 +3745,16 @@ func (d *DTuple) Normalize(ctx *EvalContext) { func (d *DTuple) sort(ctx *EvalContext) { if !d.sorted { - sort.Slice(d.D, func(i, j int) bool { + lessFn := func(i, j int) bool { return d.D[i].Compare(ctx, d.D[j]) < 0 - }) + } + + // It is possible for the tuple to be sorted even though the sorted flag + // is not true. So before we perform the sort we check that it is not + // already sorted. + if !sort.SliceIsSorted(d.D, lessFn) { + sort.Slice(d.D, lessFn) + } d.SetSorted() } }
45d8ad41e78ac0e0ae8cc5944628bb14df47a03a
2021-02-22 22:21:20
Rebecca Taft
opt: improve extraction of constant values from constraints
false
improve extraction of constant values from constraints
opt
diff --git a/pkg/sql/opt/constraint/constraint.go b/pkg/sql/opt/constraint/constraint.go index b2a56ca9cb08..ebab73ef38c8 100644 --- a/pkg/sql/opt/constraint/constraint.go +++ b/pkg/sql/opt/constraint/constraint.go @@ -551,6 +551,10 @@ func (c *Constraint) ConstrainedColumns(evalCtx *tree.EvalContext) int { // /a/b/c: [/1/2/3 - /1/2/3] [/1/2/5 - /1/3/8] -> ExactPrefix = 1, Prefix = 1 // /a/b/c: [/1/2/3 - /1/2/3] [/1/3/3 - /1/3/3] -> ExactPrefix = 1, Prefix = 3 func (c *Constraint) Prefix(evalCtx *tree.EvalContext) int { + if c.IsContradiction() { + return 0 + } + prefix := 0 for ; prefix < c.Columns.Count(); prefix++ { for i := 0; i < c.Spans.Count(); i++ { @@ -569,12 +573,42 @@ func (c *Constraint) Prefix(evalCtx *tree.EvalContext) int { // ExtractConstCols returns a set of columns which are restricted to be // constant by the constraint. +// +// For example, in this constraint, columns a and c are constant: +// /a/b/c: [/1/1/1 - /1/1/1] [/1/4/1 - /1/4/1] +// +// However, none of the columns in this constraint are constant: +// /a/b: [/1/1 - /2/1] [/3/1 - /3/1] +// Even though column b might appear to be constant, the first span allows +// column b to take on any value. For example, a=1 and b=100 is contained in +// the first span. +// +// This function returns all columns which have the same value for all spans, +// and are within the constraint prefix (see Constraint.Prefix() for details). func (c *Constraint) ExtractConstCols(evalCtx *tree.EvalContext) opt.ColSet { var res opt.ColSet - pre := c.ExactPrefix(evalCtx) - for i := 0; i < pre; i++ { - res.Add(c.Columns.Get(i).ID()) + prefix := c.Prefix(evalCtx) + for col := 0; col < prefix; col++ { + // Check if all spans have the same value for this column. + var val tree.Datum + allMatch := true + for i := 0; i < c.Spans.Count(); i++ { + sp := c.Spans.Get(i) + // We only need to check the start value, since we know the end value is + // the same as the start value for all columns within the prefix. + startVal := sp.start.Value(col) + if i == 0 { + val = startVal + } else if startVal.Compare(evalCtx, val) != 0 { + allMatch = false + break + } + } + if allMatch { + res.Add(c.Columns.Get(col).ID()) + } } + return res } diff --git a/pkg/sql/opt/constraint/constraint_set.go b/pkg/sql/opt/constraint/constraint_set.go index 991cd44e8ad4..b7bd3d7595d4 100644 --- a/pkg/sql/opt/constraint/constraint_set.go +++ b/pkg/sql/opt/constraint/constraint_set.go @@ -290,7 +290,7 @@ func (s *Set) ExtractConstCols(evalCtx *tree.EvalContext) opt.ColSet { } // ExtractValueForConstCol extracts the value for a constant column returned -// by ExtractConstCols. +// by ExtractConstCols. If the given column is not constant, nil is returned. func (s *Set) ExtractValueForConstCol(evalCtx *tree.EvalContext, col opt.ColumnID) tree.Datum { if s == Unconstrained || s == Contradiction { return nil @@ -304,8 +304,7 @@ func (s *Set) ExtractValueForConstCol(evalCtx *tree.EvalContext, col opt.ColumnI break } } - // The column must be part of the constraint's "exact prefix". - if colOrd != -1 && c.ExactPrefix(evalCtx) > colOrd { + if colOrd != -1 && s.ExtractConstCols(evalCtx).Contains(col) { return c.Spans.Get(0).StartKey().Value(colOrd) } } diff --git a/pkg/sql/opt/constraint/constraint_set_test.go b/pkg/sql/opt/constraint/constraint_set_test.go index 7a06ccc58eb6..6aa0d3fc69d6 100644 --- a/pkg/sql/opt/constraint/constraint_set_test.go +++ b/pkg/sql/opt/constraint/constraint_set_test.go @@ -270,7 +270,7 @@ func TestExtractCols(t *testing.T) { } } -func TestExtractConstCols(t *testing.T) { +func TestExtractConstColsForSet(t *testing.T) { type vals map[opt.ColumnID]string type testCase struct { constraints []string @@ -304,12 +304,11 @@ func TestExtractConstCols(t *testing.T) { vals{2: "4"}, }, {[]string{`/1: [/10 - /11)`}, vals{}}, - // TODO(justin): column 1 here is constant but we don't infer it as such. { []string{ `/2/1: [/900/4 - /900/4] [/1000/4 - /1000/4] [/1100/4 - /1100/4] [/1400/4 - /1400/4] [/1500/4 - /1500/4]`, }, - vals{}, + vals{1: "4"}, }, { []string{ @@ -335,6 +334,16 @@ func TestExtractConstCols(t *testing.T) { if !expCols.Equals(cols) { t.Errorf("%s: expected constant columns be %s, was %s", cs, expCols, cols) } + // Ensure that no value is returned for the columns that are not constant. + cs.ExtractCols().ForEach(func(col opt.ColumnID) { + if !cols.Contains(col) { + val := cs.ExtractValueForConstCol(evalCtx, col) + if val != nil { + t.Errorf("%s: const value should not have been found for column %d", cs, col) + } + } + }) + // Ensure that the expected value is returned for the columns that are constant. cols.ForEach(func(col opt.ColumnID) { val := cs.ExtractValueForConstCol(evalCtx, col) if val == nil { diff --git a/pkg/sql/opt/constraint/constraint_test.go b/pkg/sql/opt/constraint/constraint_test.go index 799edbe04b6c..0ad04850c800 100644 --- a/pkg/sql/opt/constraint/constraint_test.go +++ b/pkg/sql/opt/constraint/constraint_test.go @@ -482,7 +482,11 @@ func TestExactPrefix(t *testing.T) { e int }{ { - s: "", + s: "contradiction", + e: 0, + }, + { + s: "unconstrained", e: 0, }, { @@ -532,6 +536,71 @@ func TestExactPrefix(t *testing.T) { } } +func TestPrefix(t *testing.T) { + defer leaktest.AfterTest(t)() + st := cluster.MakeTestingClusterSettings() + evalCtx := tree.MakeTestingEvalContext(st) + + testData := []struct { + s string + // expected value + e int + }{ + { + s: "contradiction", + e: 0, + }, + { + s: "unconstrained", + e: 0, + }, + { + s: "[/1 - /1]", + e: 1, + }, + { + s: "[/1 - /2]", + e: 0, + }, + { + s: "[/1/2/3 - /1/2/3]", + e: 3, + }, + { + s: "[/1/2/3 - /1/2/3] [/1/2/5 - /1/2/8]", + e: 2, + }, + { + s: "[/1/2/3 - /1/2/3] [/1/2/5 - /1/3/8]", + e: 1, + }, + { + s: "[/1/2/3 - /1/2/3] [/1/3/3 - /1/3/3]", + e: 3, + }, + { + s: "[/1/2/3 - /1/2/3] [/3 - /4]", + e: 0, + }, + { + s: "[/1/2/1 - /1/2/1] [/1/3/1 - /1/4/1]", + e: 1, + }, + } + + kc := testKeyContext(1, 2, 3) + for i, tc := range testData { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + spans := parseSpans(&evalCtx, tc.s) + var c Constraint + c.Init(kc, &spans) + if res := c.Prefix(kc.EvalCtx); res != tc.e { + t.Errorf("expected %d got %d", tc.e, res) + } + }) + } +} + type constraintTestData struct { cLt10 Constraint // [ - /10) cGt20 Constraint // (/20 - ] @@ -612,12 +681,95 @@ func newConstraintTestData(evalCtx *tree.EvalContext) *constraintTestData { return data } +func TestExtractConstCols(t *testing.T) { + st := cluster.MakeTestingClusterSettings() + evalCtx := tree.MakeTestingEvalContext(st) + + testData := []struct { + c string + // expected value + e []opt.ColumnID + }{ + { // 0 + c: "/1: contradiction", + e: []opt.ColumnID{}, + }, + { // 1 + c: "/1: [ - /2]", + e: []opt.ColumnID{}, + }, + { // 2 + c: "/1: [/3 - /4]", + e: []opt.ColumnID{}, + }, + { // 3 + c: "/1: [/4 - /4]", + e: []opt.ColumnID{1}, + }, + { // 4 + c: "/-1: [ - /2]", + e: []opt.ColumnID{}, + }, + { // 5 + c: "/-1: [/4 - /4]", + e: []opt.ColumnID{1}, + }, + { // 6 + c: "/1/2/3: [/1/1/NULL - /1/1/2] [/3/3/3 - /3/3/4]", + e: []opt.ColumnID{}, + }, + { // 7 + c: "/1/2/3: [/1/1/1 - /1/1/1] [/4/1 - /4/1]", + e: []opt.ColumnID{2}, + }, + { // 8 + c: "/1/2/3: [/1/1/1 - /1/1/2] [/1/1/3 - /1/3/4]", + e: []opt.ColumnID{1}, + }, + { // 9 + c: "/1/2/3/4: [/1/1/1/1 - /1/1/2/1] [/3/1/3/1 - /3/1/4/1]", + e: []opt.ColumnID{2}, + }, + { // 10 + c: "/1/2/3/4: [/1/1/2/1 - /1/1/2/1] [/3/1/3/1 - /3/1/3/1]", + e: []opt.ColumnID{2, 4}, + }, + { // 11 + c: "/1/-2/-3: [/1/1/2 - /1/1] [/3/3/4 - /3/3/3]", + e: []opt.ColumnID{}, + }, + { // 12 + c: "/1/2/3: [/1/1/1 - /1/1/2] [/1/3/3 - /1/3/4] [/1/4 - /1/4/1]", + e: []opt.ColumnID{1}, + }, + { // 13 + c: "/1/2/3: [/1/1/NULL - /1/1/NULL] [/3/3/NULL - /3/3/NULL]", + e: []opt.ColumnID{3}, + }, + { // 14 + c: "/1/2/3: [/1/1/1 - /1/1/1] [/4/1 - /5/1]", + e: []opt.ColumnID{}, + }, + } + + for i, tc := range testData { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + c := ParseConstraint(&evalCtx, tc.c) + cols := c.ExtractConstCols(&evalCtx) + if exp := opt.MakeColSet(tc.e...); !cols.Equals(exp) { + t.Errorf("expected %s; got %s", exp, cols) + } + }) + } +} + func TestExtractNotNullCols(t *testing.T) { st := cluster.MakeTestingClusterSettings() evalCtx := tree.MakeTestingEvalContext(st) testData := []struct { c string + // expected value e []opt.ColumnID }{ { // 0 @@ -676,7 +828,7 @@ func TestExtractNotNullCols(t *testing.T) { c: "/1/2/3: [/1/1/NULL - /1/1/2] [/3/3/3 - /3/3/4]", e: []opt.ColumnID{1, 2}, }, - { // 13 + { // 14 c: "/1/2/3: [/1/1/1 - /1/1/1] [/2/NULL/2 - /2/NULL/3]", e: []opt.ColumnID{1, 3}, },
86189a031fef1e8b0872421240c173f169a1d97d
2024-10-17 01:32:29
Ricky Stewart
build: Revert "build: upgrade to Go 1.23.2"
false
Revert "build: upgrade to Go 1.23.2"
build
diff --git a/.bazelrc b/.bazelrc index ca16579d6fc4..9fcff95a6b0a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -26,16 +26,18 @@ build --flag_alias=cross=//build/toolchains:cross_flag build --flag_alias=dev=//build/toolchains:dev_flag build --flag_alias=force_build_cdeps=//build/toolchains:force_build_cdeps_flag build --flag_alias=heavy=//build/toolchains:heavy_flag +build --flag_alias=lintonbuild=//build/toolchains:nogo_flag +build --flag_alias=nolintonbuild=//build/toolchains:nonogo_explicit_flag build:crdb_test_off --crdb_test_off build:cross --cross build:dev --dev build:force_build_cdeps --force_build_cdeps build:heavy --heavy -build:lintonbuild --run_validations -build:nolintonbuild --norun_validations +build:lintonbuild --lintonbuild +build:nolintonbuild --nolintonbuild # Note: nonogo is classically the name of the nolintonbuild configuration. -build:nonogo --config nolintonbuild +build:nonogo --nolintonbuild build:test --crdb_test # Basic settings. @@ -63,7 +65,7 @@ test:race --heavy # CI uses a custom timeout for enormous targets. test:use_ci_timeouts --test_timeout=60,300,900,900 # CI should always run with `--config=ci`. -build:cibase --config=lintonbuild +build:cibase --lintonbuild # Set `-test.v` in Go tests. # Ref: https://github.com/bazelbuild/rules_go/pull/2456 test:cibase --test_env=GO_TEST_WRAP_TESTV=1 @@ -89,7 +91,7 @@ build:crosslinuxfips '--workspace_status_command=./build/bazelutil/stamp.sh x86_ build:crosslinuxfips --config=crosslinuxfipsbase build:crosslinuxfipsbase --platforms=//build/toolchains:cross_linux build:crosslinuxfipsbase --config=cross -build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.23.2fips +build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.22.5fips build:crosswindows '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32' build:crosswindows --config=crosswindowsbase build:crosswindowsbase --platforms=//build/toolchains:cross_windows diff --git a/BUILD.bazel b/BUILD.bazel index 740e5c47396f..77a27fe5ad00 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -152,58 +152,61 @@ nogo( name = "crdb_nogo", config = "//build/bazelutil:nogo_config.json", visibility = ["//visibility:public"], - deps = [ - "@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library", - "@org_golang_x_tools//go/analysis/passes/assign:go_default_library", - "@org_golang_x_tools//go/analysis/passes/atomic:go_default_library", - "@org_golang_x_tools//go/analysis/passes/atomicalign:go_default_library", - "@org_golang_x_tools//go/analysis/passes/bools:go_default_library", - "@org_golang_x_tools//go/analysis/passes/buildssa:go_default_library", - "@org_golang_x_tools//go/analysis/passes/buildtag:go_default_library", - # TODO(rules_go#2396): pass raw cgo sources to cgocall and re-enable. - # "@org_golang_x_tools//go/analysis/passes/cgocall:go_default_library", - "@org_golang_x_tools//go/analysis/passes/composite:go_default_library", - "@org_golang_x_tools//go/analysis/passes/copylock:go_default_library", - "@org_golang_x_tools//go/analysis/passes/ctrlflow:go_default_library", - "@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library", - "@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library", - "@org_golang_x_tools//go/analysis/passes/findcall:go_default_library", - "@org_golang_x_tools//go/analysis/passes/httpresponse:go_default_library", - "@org_golang_x_tools//go/analysis/passes/ifaceassert:go_default_library", - "@org_golang_x_tools//go/analysis/passes/inspect:go_default_library", - "@org_golang_x_tools//go/analysis/passes/lostcancel:go_default_library", - "@org_golang_x_tools//go/analysis/passes/nilfunc:go_default_library", - "@org_golang_x_tools//go/analysis/passes/nilness:go_default_library", - "@org_golang_x_tools//go/analysis/passes/pkgfact:go_default_library", - "@org_golang_x_tools//go/analysis/passes/printf:go_default_library", - "@org_golang_x_tools//go/analysis/passes/shift:go_default_library", - "@org_golang_x_tools//go/analysis/passes/sortslice:go_default_library", - "@org_golang_x_tools//go/analysis/passes/stdmethods:go_default_library", - "@org_golang_x_tools//go/analysis/passes/stringintconv:go_default_library", - "@org_golang_x_tools//go/analysis/passes/structtag:go_default_library", - "@org_golang_x_tools//go/analysis/passes/testinggoroutine:go_default_library", - "@org_golang_x_tools//go/analysis/passes/tests:go_default_library", - "@org_golang_x_tools//go/analysis/passes/unmarshal:go_default_library", - "@org_golang_x_tools//go/analysis/passes/unreachable:go_default_library", - "@org_golang_x_tools//go/analysis/passes/unsafeptr:go_default_library", - "@org_golang_x_tools//go/analysis/passes/unusedresult:go_default_library", - "//pkg/testutils/lint/passes/deferunlockcheck", - "//pkg/testutils/lint/passes/descriptormarshal", - "//pkg/testutils/lint/passes/errcheck", - "//pkg/testutils/lint/passes/errcmp", - "//pkg/testutils/lint/passes/errwrap", - "//pkg/testutils/lint/passes/fmtsafe", - "//pkg/testutils/lint/passes/grpcclientconnclose", - "//pkg/testutils/lint/passes/grpcstatuswithdetails", - "//pkg/testutils/lint/passes/hash", - "//pkg/testutils/lint/passes/leaktestcall", - "//pkg/testutils/lint/passes/nilness", - "//pkg/testutils/lint/passes/nocopy", - "//pkg/testutils/lint/passes/redactcheck", - "//pkg/testutils/lint/passes/returncheck", - "//pkg/testutils/lint/passes/returnerrcheck", - "//pkg/testutils/lint/passes/shadow", - "//pkg/testutils/lint/passes/timer", - "//pkg/testutils/lint/passes/unconvert", - ] + STATICCHECK_CHECKS, + deps = select({ + "//build/toolchains:nogo": [ + "@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library", + "@org_golang_x_tools//go/analysis/passes/assign:go_default_library", + "@org_golang_x_tools//go/analysis/passes/atomic:go_default_library", + "@org_golang_x_tools//go/analysis/passes/atomicalign:go_default_library", + "@org_golang_x_tools//go/analysis/passes/bools:go_default_library", + "@org_golang_x_tools//go/analysis/passes/buildssa:go_default_library", + "@org_golang_x_tools//go/analysis/passes/buildtag:go_default_library", + # TODO(rules_go#2396): pass raw cgo sources to cgocall and re-enable. + # "@org_golang_x_tools//go/analysis/passes/cgocall:go_default_library", + "@org_golang_x_tools//go/analysis/passes/composite:go_default_library", + "@org_golang_x_tools//go/analysis/passes/copylock:go_default_library", + "@org_golang_x_tools//go/analysis/passes/ctrlflow:go_default_library", + "@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library", + "@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library", + "@org_golang_x_tools//go/analysis/passes/findcall:go_default_library", + "@org_golang_x_tools//go/analysis/passes/httpresponse:go_default_library", + "@org_golang_x_tools//go/analysis/passes/ifaceassert:go_default_library", + "@org_golang_x_tools//go/analysis/passes/inspect:go_default_library", + "@org_golang_x_tools//go/analysis/passes/lostcancel:go_default_library", + "@org_golang_x_tools//go/analysis/passes/nilfunc:go_default_library", + "@org_golang_x_tools//go/analysis/passes/nilness:go_default_library", + "@org_golang_x_tools//go/analysis/passes/pkgfact:go_default_library", + "@org_golang_x_tools//go/analysis/passes/printf:go_default_library", + "@org_golang_x_tools//go/analysis/passes/shift:go_default_library", + "@org_golang_x_tools//go/analysis/passes/sortslice:go_default_library", + "@org_golang_x_tools//go/analysis/passes/stdmethods:go_default_library", + "@org_golang_x_tools//go/analysis/passes/stringintconv:go_default_library", + "@org_golang_x_tools//go/analysis/passes/structtag:go_default_library", + "@org_golang_x_tools//go/analysis/passes/testinggoroutine:go_default_library", + "@org_golang_x_tools//go/analysis/passes/tests:go_default_library", + "@org_golang_x_tools//go/analysis/passes/unmarshal:go_default_library", + "@org_golang_x_tools//go/analysis/passes/unreachable:go_default_library", + "@org_golang_x_tools//go/analysis/passes/unsafeptr:go_default_library", + "@org_golang_x_tools//go/analysis/passes/unusedresult:go_default_library", + "//pkg/testutils/lint/passes/deferunlockcheck", + "//pkg/testutils/lint/passes/descriptormarshal", + "//pkg/testutils/lint/passes/errcheck", + "//pkg/testutils/lint/passes/errcmp", + "//pkg/testutils/lint/passes/errwrap", + "//pkg/testutils/lint/passes/fmtsafe", + "//pkg/testutils/lint/passes/grpcclientconnclose", + "//pkg/testutils/lint/passes/grpcstatuswithdetails", + "//pkg/testutils/lint/passes/hash", + "//pkg/testutils/lint/passes/leaktestcall", + "//pkg/testutils/lint/passes/nilness", + "//pkg/testutils/lint/passes/nocopy", + "//pkg/testutils/lint/passes/redactcheck", + "//pkg/testutils/lint/passes/returncheck", + "//pkg/testutils/lint/passes/returnerrcheck", + "//pkg/testutils/lint/passes/shadow", + "//pkg/testutils/lint/passes/timer", + "//pkg/testutils/lint/passes/unconvert", + ] + STATICCHECK_CHECKS, + "//conditions:default": [], + }), ) diff --git a/DEPS.bzl b/DEPS.bzl index c38e958cc8d3..aff902429ee2 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -33,10 +33,10 @@ def go_deps(): patches = [ "@com_github_cockroachdb_cockroach//build/patches:co_honnef_go_tools.patch", ], - sha256 = "d728ff392fc5b6f676a30c36e9d0a5b85f6f2e06b4ebbb121c27d965cbdffa11", - strip_prefix = "honnef.co/go/[email protected]", + sha256 = "3f7c266a830f3a0727ac0b85cd7cd74a765c05d337d73af20906219f1a4ec4c3", + strip_prefix = "honnef.co/go/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.5.1.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.4.5.zip", ], ) go_repository( @@ -53,10 +53,10 @@ def go_deps(): name = "com_github_99designs_keyring", build_file_proto_mode = "disable_global", importpath = "github.com/99designs/keyring", - sha256 = "7204ea1194e7835a02d9f8f3cf1ba30dce143dd9a3353ead71a46ffcd418d7be", - strip_prefix = "github.com/99designs/[email protected]", + sha256 = "bbcbf31d7ccc1fb3b2b8dd4295add4cbe116ee89bb08a5a204202fae72a333b8", + strip_prefix = "github.com/99designs/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/99designs/keyring/com_github_99designs_keyring-v1.2.2.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/99designs/keyring/com_github_99designs_keyring-v1.2.1.zip", ], ) go_repository( @@ -139,34 +139,14 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajg/form/com_github_ajg_form-v1.5.1.zip", ], ) - go_repository( - name = "com_github_ajstarks_deck", - build_file_proto_mode = "disable_global", - importpath = "github.com/ajstarks/deck", - sha256 = "68bad2e38bf5b01e6bbd7b9bbdba35da94dac72bc4ba41f8ea5fe92aa836a3c3", - strip_prefix = "github.com/ajstarks/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/deck/com_github_ajstarks_deck-v0.0.0-20200831202436-30c9fc6549a9.zip", - ], - ) - go_repository( - name = "com_github_ajstarks_deck_generate", - build_file_proto_mode = "disable_global", - importpath = "github.com/ajstarks/deck/generate", - sha256 = "dce1cbc4cb42ac26512dd0bccf997baeea99fb4595cd419a28e8566d2d7c7ba8", - strip_prefix = "github.com/ajstarks/deck/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/deck/generate/com_github_ajstarks_deck_generate-v0.0.0-20210309230005-c3f852c02e19.zip", - ], - ) go_repository( name = "com_github_ajstarks_svgo", build_file_proto_mode = "disable_global", importpath = "github.com/ajstarks/svgo", - sha256 = "e25b5dbb6cc86d2a0b5db08aad757c534681c2cecb30d84746e09c661cbd7c6f", - strip_prefix = "github.com/ajstarks/[email protected]", + sha256 = "d58dcf4f11896cb22cec4db53ca17df342c6da4cc3a084c270f2da9e1eb351a7", + strip_prefix = "github.com/ajstarks/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/svgo/com_github_ajstarks_svgo-v0.0.0-20211024235047-1546f124cd8b.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/svgo/com_github_ajstarks_svgo-v0.0.0-20210923152817-c3b6e2f0c527.zip", ], ) go_repository( @@ -339,16 +319,6 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/arrow/go/v11/com_github_apache_arrow_go_v11-v11.0.0.zip", ], ) - go_repository( - name = "com_github_apache_arrow_go_v12", - build_file_proto_mode = "disable_global", - importpath = "github.com/apache/arrow/go/v12", - sha256 = "5eb05ed9c2c5e164503b00912b7b2456400578de29e7e8a8956a41acd861ab5b", - strip_prefix = "github.com/apache/arrow/go/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/arrow/go/v12/com_github_apache_arrow_go_v12-v12.0.1.zip", - ], - ) go_repository( name = "com_github_apache_pulsar_client_go", build_file_proto_mode = "disable_global", @@ -841,10 +811,10 @@ def go_deps(): name = "com_github_azure_azure_sdk_for_go_sdk_azcore", build_file_proto_mode = "disable_global", importpath = "github.com/Azure/azure-sdk-for-go/sdk/azcore", - sha256 = "42e10b1530d4f4d5864421ee44faabc84885a3957ce969ee33db96fb5229f284", - strip_prefix = "github.com/Azure/azure-sdk-for-go/sdk/[email protected]", + sha256 = "cf80995c85451a7990c4d68dfbfd7de89536d319df9502ba9dfd38eb84501810", + strip_prefix = "github.com/Azure/azure-sdk-for-go/sdk/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/azcore/com_github_azure_azure_sdk_for_go_sdk_azcore-v1.4.0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/azcore/com_github_azure_azure_sdk_for_go_sdk_azcore-v1.3.0.zip", ], ) go_repository( @@ -861,10 +831,10 @@ def go_deps(): name = "com_github_azure_azure_sdk_for_go_sdk_internal", build_file_proto_mode = "disable_global", importpath = "github.com/Azure/azure-sdk-for-go/sdk/internal", - sha256 = "88dc36a09083cfdf3db0dbc47e12a867b30c57f099f05381c35b4703dcac7810", - strip_prefix = "github.com/Azure/azure-sdk-for-go/sdk/[email protected]", + sha256 = "10f2a543b9e000a988722c8210d30d377c2306b042e5de1bfea4b3ec730d0319", + strip_prefix = "github.com/Azure/azure-sdk-for-go/sdk/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/internal/com_github_azure_azure_sdk_for_go_sdk_internal-v1.1.2.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/internal/com_github_azure_azure_sdk_for_go_sdk_internal-v1.1.1.zip", ], ) go_repository( @@ -931,10 +901,10 @@ def go_deps(): name = "com_github_azure_azure_sdk_for_go_sdk_storage_azblob", build_file_proto_mode = "disable_global", importpath = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob", - sha256 = "9bb69aea32f1d59711701f9562d66432c9c0374205e5009d1d1a62f03fb4fdad", - strip_prefix = "github.com/Azure/azure-sdk-for-go/sdk/storage/[email protected]", + sha256 = "c2539d189b22bdb6eb67c4682ded4e070d6cf0f52c8bd6899f7eb1408045783f", + strip_prefix = "github.com/Azure/azure-sdk-for-go/sdk/storage/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/com_github_azure_azure_sdk_for_go_sdk_storage_azblob-v1.0.0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/com_github_azure_azure_sdk_for_go_sdk_storage_azblob-v0.6.1.zip", ], ) go_repository( @@ -1405,10 +1375,10 @@ def go_deps(): name = "com_github_burntsushi_toml", build_file_proto_mode = "disable_global", importpath = "github.com/BurntSushi/toml", - sha256 = "f15f0ca7a3c5a4275d3d560236f178e9d735a084534bf3b685ec5f676806230a", - strip_prefix = "github.com/BurntSushi/[email protected]", + sha256 = "6fb658e8262179ffd34d57eaef6b076b25c77e8b2129659b66697cded29a7121", + strip_prefix = "github.com/BurntSushi/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v1.4.1-0.20240526193622-a339e1f7089c.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v1.2.1.zip", ], ) go_repository( @@ -2758,10 +2728,10 @@ def go_deps(): name = "com_github_dustin_go_humanize", build_file_proto_mode = "disable_global", importpath = "github.com/dustin/go-humanize", - sha256 = "319404ea84c8a4e2d3d83f30988b006e7dd04976de3e1a1a90484ad94679fa46", - strip_prefix = "github.com/dustin/[email protected]", + sha256 = "e01916e082a6646ea12d7800d77af43045c27284ff2a0a77e3484509989cc107", + strip_prefix = "github.com/dustin/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/dustin/go-humanize/com_github_dustin_go_humanize-v1.0.1.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/dustin/go-humanize/com_github_dustin_go_humanize-v1.0.0.zip", ], ) go_repository( @@ -3019,10 +2989,10 @@ def go_deps(): name = "com_github_form3tech_oss_jwt_go", build_file_proto_mode = "disable_global", importpath = "github.com/form3tech-oss/jwt-go", - sha256 = "30cf0ef9aa63aea696e40df8912d41fbce69dd02986a5b99af7c5b75f277690c", - strip_prefix = "github.com/form3tech-oss/[email protected]+incompatible", + sha256 = "6780fef32d854a318af431efd0c680a1cb4ddc50d36d6b4c239baf381004efae", + strip_prefix = "github.com/form3tech-oss/[email protected]+incompatible", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/form3tech-oss/jwt-go/com_github_form3tech_oss_jwt_go-v3.2.5+incompatible.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/form3tech-oss/jwt-go/com_github_form3tech_oss_jwt_go-v3.2.3+incompatible.zip", ], ) go_repository( @@ -3095,16 +3065,6 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/fullsailor/pkcs7/com_github_fullsailor_pkcs7-v0.0.0-20190404230743-d7302db945fa.zip", ], ) - go_repository( - name = "com_github_gabriel_vasile_mimetype", - build_file_proto_mode = "disable_global", - importpath = "github.com/gabriel-vasile/mimetype", - sha256 = "959e9da19ac23353e711c80f768cb3344ba0fb2d2fefeb4b21f4165811327327", - strip_prefix = "github.com/gabriel-vasile/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/gabriel-vasile/mimetype/com_github_gabriel_vasile_mimetype-v1.4.2.zip", - ], - ) go_repository( name = "com_github_garyburd_redigo", build_file_proto_mode = "disable_global", @@ -3549,10 +3509,10 @@ def go_deps(): name = "com_github_go_pdf_fpdf", build_file_proto_mode = "disable_global", importpath = "github.com/go-pdf/fpdf", - sha256 = "03a6909fc346ac972b008b77585ac3954d76b416c33b4b64dc22c5f35f0e1edb", - strip_prefix = "github.com/go-pdf/[email protected]", + sha256 = "9ab17b11279de24333e3f39475478bd5c7f3294b0b512b79c34fb8c77ce7f613", + strip_prefix = "github.com/go-pdf/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-pdf/fpdf/com_github_go_pdf_fpdf-v0.6.0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-pdf/fpdf/com_github_go_pdf_fpdf-v0.5.0.zip", ], ) go_repository( @@ -3963,6 +3923,10 @@ def go_deps(): name = "com_github_golang_protobuf", build_file_proto_mode = "disable_global", importpath = "github.com/golang/protobuf", + patch_args = ["-p1"], + patches = [ + "@com_github_cockroachdb_cockroach//build/patches:com_github_golang_protobuf.patch", + ], sha256 = "93bda6e88d4a0a493a98b481de67a10000a755d15f16a800b49a6b96d1bd6f81", strip_prefix = "github.com/golang/[email protected]", urls = [ @@ -4073,10 +4037,10 @@ def go_deps(): name = "com_github_google_flatbuffers", build_file_proto_mode = "disable_global", importpath = "github.com/google/flatbuffers", - sha256 = "2b66a7cfcf2feb5ead4a9399782e4665a02475b66077ab50d299bbd6eafbf526", - strip_prefix = "github.com/google/[email protected]+incompatible", + sha256 = "0c0a4aab1c6029141d655bc7fdc07e22dd06f3f64ebbf7a2250b870ef7aac7ee", + strip_prefix = "github.com/google/[email protected]+incompatible", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/flatbuffers/com_github_google_flatbuffers-v23.1.21+incompatible.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/flatbuffers/com_github_google_flatbuffers-v2.0.8+incompatible.zip", ], ) go_repository( @@ -5652,10 +5616,10 @@ def go_deps(): patches = [ "@com_github_cockroachdb_cockroach//build/patches:com_github_kisielk_errcheck.patch", ], - sha256 = "4087fa0fa06f3e91e4d49f23ce5d602c63779906da0c7303c1e37ff51c718968", - strip_prefix = "github.com/kisielk/[email protected]", + sha256 = "f394d1df1f2332387ce142d98734c5c44fb94e9a8a2af2a9b75aa4ec4a64b963", + strip_prefix = "github.com/kisielk/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kisielk/errcheck/com_github_kisielk_errcheck-v1.7.1-0.20240702033320-b832de3f3c5a.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kisielk/errcheck/com_github_kisielk_errcheck-v1.7.0.zip", ], ) go_repository( @@ -5702,10 +5666,10 @@ def go_deps(): name = "com_github_klauspost_cpuid_v2", build_file_proto_mode = "disable_global", importpath = "github.com/klauspost/cpuid/v2", - sha256 = "f68ff82caa807940fee615b4898d428365761eeb36861959ca8b91a034bd0e7e", - strip_prefix = "github.com/klauspost/cpuid/[email protected]", + sha256 = "52c716413296dce2b1698c6cdbc4c53927ce4aee2a60980daf9672e6b6a3b4cb", + strip_prefix = "github.com/klauspost/cpuid/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/cpuid/v2/com_github_klauspost_cpuid_v2-v2.2.3.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/cpuid/v2/com_github_klauspost_cpuid_v2-v2.0.9.zip", ], ) go_repository( @@ -6312,10 +6276,10 @@ def go_deps(): name = "com_github_mattn_go_sqlite3", build_file_proto_mode = "disable_global", importpath = "github.com/mattn/go-sqlite3", - sha256 = "0114d2df439ddeb03eef49a4bf2cc8fb69665c0d76494463cafa7d189a16e0f9", - strip_prefix = "github.com/mattn/[email protected]", + sha256 = "e948fca1fe3a3e614017dff9a30478d16b320babe834e326349cdd3d6750a3d9", + strip_prefix = "github.com/mattn/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-sqlite3/com_github_mattn_go_sqlite3-v1.14.15.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-sqlite3/com_github_mattn_go_sqlite3-v1.14.5.zip", ], ) go_repository( @@ -7462,10 +7426,10 @@ def go_deps(): name = "com_github_petermattis_goid", build_file_proto_mode = "disable_global", importpath = "github.com/petermattis/goid", - sha256 = "3f47ab8e5713c36ec5b4295956a5ef012a192bc19198ae1b6591408c061e97ab", - strip_prefix = "github.com/petermattis/[email protected]", + sha256 = "9f536c5d39d6a3c851670ec585e1c876fe31f3402556d215ebbaffcecbacb30a", + strip_prefix = "github.com/petermattis/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/petermattis/goid/com_github_petermattis_goid-v0.0.0-20240813172612-4fcff4a6cae7.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/petermattis/goid/com_github_petermattis_goid-v0.0.0-20211229010228-4d14c490ee36.zip", ], ) go_repository( @@ -7562,10 +7526,10 @@ def go_deps(): name = "com_github_pkg_browser", build_file_proto_mode = "disable_global", importpath = "github.com/pkg/browser", - sha256 = "415b8b7d7e47074cf3f6c2269d8712efa8a8433cba7bfce7eed22ca7f0b447a4", - strip_prefix = "github.com/pkg/[email protected]", + sha256 = "84db38d8db553ccc34c75f867396126eac07774b979c470f97a20854d3a3af6d", + strip_prefix = "github.com/pkg/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/browser/com_github_pkg_browser-v0.0.0-20210911075715-681adbf594b8.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/browser/com_github_pkg_browser-v0.0.0-20210115035449-ce105d075bb4.zip", ], ) go_repository( @@ -7839,10 +7803,10 @@ def go_deps(): name = "com_github_remyoudompheng_bigfft", build_file_proto_mode = "disable_global", importpath = "github.com/remyoudompheng/bigfft", - sha256 = "9be16c32c384d55d0f7bd7b03f1ff1e9a4e4b91b000f0aa87a567a01b9b82398", - strip_prefix = "github.com/remyoudompheng/[email protected]", + sha256 = "60c422375fac36ea169eb6065af6c1b4895d8608bbd3fda9cddf98dee02e5d6a", + strip_prefix = "github.com/remyoudompheng/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/remyoudompheng/bigfft/com_github_remyoudompheng_bigfft-v0.0.0-20230129092748-24d4a6f8daec.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/remyoudompheng/bigfft/com_github_remyoudompheng_bigfft-v0.0.0-20200410134404-eec4a21b6bb0.zip", ], ) go_repository( @@ -8299,10 +8263,10 @@ def go_deps(): name = "com_github_snowflakedb_gosnowflake", build_file_proto_mode = "disable_global", importpath = "github.com/snowflakedb/gosnowflake", - sha256 = "4e6da06c9cbe5188ce9749d5d79b36a54d007a3eb3cdf6031b2f0dc5f9f880df", - strip_prefix = "github.com/cockroachdb/[email protected]", + sha256 = "a39ab3850d25f162e2ed4bf920c0fba1559e1c5ec41e1ca35f44600a2e9a971d", + strip_prefix = "github.com/snowflakedb/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gosnowflake/com_github_cockroachdb_gosnowflake-v1.6.25.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/snowflakedb/gosnowflake/com_github_snowflakedb_gosnowflake-v1.3.4.zip", ], ) go_repository( @@ -10565,16 +10529,6 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/sourcegraph.com/sourcegraph/appdash/com_sourcegraph_sourcegraph_appdash-v0.0.0-20190731080439-ebfcffb1b5c0.zip", ], ) - go_repository( - name = "ht_sr_git_~sbinet_gg", - build_file_proto_mode = "disable_global", - importpath = "git.sr.ht/~sbinet/gg", - sha256 = "435103529c4f24aecf7e4550bc816db2482dda4ee0123d337daba99971a8c498", - strip_prefix = "git.sr.ht/~sbinet/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/git.sr.ht/~sbinet/gg/ht_sr_git_~sbinet_gg-v0.3.1.zip", - ], - ) go_repository( name = "in_gopkg_airbrake_gobrake_v2", build_file_proto_mode = "disable_global", @@ -11482,30 +11436,30 @@ def go_deps(): name = "org_golang_x_exp", build_file_proto_mode = "disable_global", importpath = "golang.org/x/exp", - sha256 = "3e3717f5151e8c2ebf267b4d53698b97847c0de144683c51b74ab7edf5039fa8", - strip_prefix = "golang.org/x/[email protected]", + sha256 = "af32025a065aa599a3e5b01048602a53e2b6e3938b12d33fa2a5f057be9759fa", + strip_prefix = "golang.org/x/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/org_golang_x_exp-v0.0.0-20231110203233-9a3e6036ecaa.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/org_golang_x_exp-v0.0.0-20230626212559-97b1e661b5df.zip", ], ) go_repository( name = "org_golang_x_exp_typeparams", build_file_proto_mode = "disable_global", importpath = "golang.org/x/exp/typeparams", - sha256 = "22c0e082f62b39c8ddaec18a9f2888158199e597adc8780e918e8976cd9fbbb0", - strip_prefix = "golang.org/x/exp/[email protected]", + sha256 = "9bd73f186851c6229484f486981f608d16e2b86acbbef6f4f7cc0480a508a4a4", + strip_prefix = "golang.org/x/exp/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/typeparams/org_golang_x_exp_typeparams-v0.0.0-20231108232855-2478ac86f678.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/typeparams/org_golang_x_exp_typeparams-v0.0.0-20221208152030-732eee02a75a.zip", ], ) go_repository( name = "org_golang_x_image", build_file_proto_mode = "disable_global", importpath = "golang.org/x/image", - sha256 = "56176a4d4d47910d61df9a77aa66a8469ae79fa18b7f5821c43bef1ef212116d", - strip_prefix = "golang.org/x/[email protected]", + sha256 = "70cf423fad9be160a88fbf01bc1897efd888f915a6d7ba0dd41ca7085f75e06e", + strip_prefix = "golang.org/x/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/image/org_golang_x_image-v0.0.0-20220302094943-723b81ca9867.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/image/org_golang_x_image-v0.0.0-20210628002857-a66eb6448b8d.zip", ], ) go_repository( @@ -11638,16 +11592,6 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/org_golang_x_tools-v0.24.0.zip", ], ) - go_repository( - name = "org_golang_x_tools_go_vcs", - build_file_proto_mode = "disable_global", - importpath = "golang.org/x/tools/go/vcs", - sha256 = "ab155d94f90a98a5112967b89bfcd26b5825c1cd6875a5246c7905a568387260", - strip_prefix = "golang.org/x/tools/go/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/go/vcs/org_golang_x_tools_go_vcs-v0.1.0-deprecated.zip", - ], - ) go_repository( name = "org_golang_x_xerrors", build_file_proto_mode = "disable_global", @@ -11682,10 +11626,10 @@ def go_deps(): name = "org_gonum_v1_plot", build_file_proto_mode = "disable_global", importpath = "gonum.org/v1/plot", - sha256 = "eaa47ad966b3b67325c1f3ae704d566332c573b7cca79016cb4ffe82155aab39", - strip_prefix = "gonum.org/v1/[email protected]", + sha256 = "5bf2f98775d5eceafba12cf1196b97e92e93f6f824599f02c0ba4bfe15bae1b2", + strip_prefix = "gonum.org/v1/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/gonum.org/v1/plot/org_gonum_v1_plot-v0.10.1.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/gonum.org/v1/plot/org_gonum_v1_plot-v0.10.0.zip", ], ) go_repository( @@ -11702,30 +11646,20 @@ def go_deps(): name = "org_modernc_cc_v3", build_file_proto_mode = "disable_global", importpath = "modernc.org/cc/v3", - sha256 = "fe3aeb761e55ce77a95b297321a122b4273aeffe1c08f48fc99310e065211f74", - strip_prefix = "modernc.org/cc/[email protected]", + sha256 = "1fd51331be5f9b845282642e78f0bff09fbf551583c4555012520eed3215b2e0", + strip_prefix = "modernc.org/cc/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/cc/v3/org_modernc_cc_v3-v3.40.0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/cc/v3/org_modernc_cc_v3-v3.36.3.zip", ], ) go_repository( name = "org_modernc_ccgo_v3", build_file_proto_mode = "disable_global", importpath = "modernc.org/ccgo/v3", - sha256 = "bfc293300cd1ce656ba0ce0cee1f508afec2518bc4214a6b10ccfad6e8e6046e", - strip_prefix = "modernc.org/ccgo/[email protected]", + sha256 = "5e19b5f5dd197c25d38d7ea9521465ff579294990bd969b2158eafeb7334a6e9", + strip_prefix = "modernc.org/ccgo/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/ccgo/v3/org_modernc_ccgo_v3-v3.16.13.zip", - ], - ) - go_repository( - name = "org_modernc_ccorpus", - build_file_proto_mode = "disable_global", - importpath = "modernc.org/ccorpus", - sha256 = "3831b62a73a379b81ac927e17e3e9ffe2d44ad07c934505e1ae24eea8a26a6d3", - strip_prefix = "modernc.org/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/ccorpus/org_modernc_ccorpus-v1.11.6.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/ccgo/v3/org_modernc_ccgo_v3-v3.16.9.zip", ], ) go_repository( @@ -11738,24 +11672,14 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/golex/org_modernc_golex-v1.0.0.zip", ], ) - go_repository( - name = "org_modernc_httpfs", - build_file_proto_mode = "disable_global", - importpath = "modernc.org/httpfs", - sha256 = "0b5314649c1327a199397eb6fd52b3ce41c9d3bc6dd2a4dea565b5fb87c13f41", - strip_prefix = "modernc.org/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/httpfs/org_modernc_httpfs-v1.0.6.zip", - ], - ) go_repository( name = "org_modernc_libc", build_file_proto_mode = "disable_global", importpath = "modernc.org/libc", - sha256 = "5f98bedf9f0663b3b87555904ee41b82fe9d8e9ac5c47c9fac9a42a7fe232313", - strip_prefix = "modernc.org/[email protected]", + sha256 = "82b6d3a79ffe291d8f6ecbcaf6aba579ff37d1bea9049e600d85a388a4c15948", + strip_prefix = "modernc.org/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/libc/org_modernc_libc-v1.22.2.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/libc/org_modernc_libc-v1.17.1.zip", ], ) go_repository( @@ -11772,10 +11696,10 @@ def go_deps(): name = "org_modernc_memory", build_file_proto_mode = "disable_global", importpath = "modernc.org/memory", - sha256 = "f79e8ada14c36d08817ee2bf6b2103f65c1a61a91b042b59016465869624043c", - strip_prefix = "modernc.org/[email protected]", + sha256 = "2eb0b17569e7f822cbd0176213e1dbc04e4c692bccdd59cda50cc157644547ee", + strip_prefix = "modernc.org/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/memory/org_modernc_memory-v1.5.0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/memory/org_modernc_memory-v1.2.1.zip", ], ) go_repository( @@ -11792,10 +11716,10 @@ def go_deps(): name = "org_modernc_sqlite", build_file_proto_mode = "disable_global", importpath = "modernc.org/sqlite", - sha256 = "be0501f87458962a00c8fb07d1f131af010a534cd6ffb654c570be35b9b608d5", - strip_prefix = "modernc.org/[email protected]", + sha256 = "5c484a0d7aeab465beff2460b0b5e63284155dad8b8fef52b9b30827bc77263c", + strip_prefix = "modernc.org/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/sqlite/org_modernc_sqlite-v1.18.2.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/sqlite/org_modernc_sqlite-v1.18.1.zip", ], ) go_repository( @@ -11808,24 +11732,14 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/strutil/org_modernc_strutil-v1.1.3.zip", ], ) - go_repository( - name = "org_modernc_tcl", - build_file_proto_mode = "disable_global", - importpath = "modernc.org/tcl", - sha256 = "f966db0dd1ccbc7f8d5ac2e752b64c3be343aa3f92215ed98b6f2a51b7abbb64", - strip_prefix = "modernc.org/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/tcl/org_modernc_tcl-v1.13.2.zip", - ], - ) go_repository( name = "org_modernc_token", build_file_proto_mode = "disable_global", importpath = "modernc.org/token", - sha256 = "3efaa49e9fb10569da9e09e785fa230cd5c0f50fcf605f3b5439dfcd61577c58", - strip_prefix = "modernc.org/[email protected]", + sha256 = "081d969b97ccec2892c6dc9dd50b001a54ac0c6615534e9623be99b5b2d1fc34", + strip_prefix = "modernc.org/[email protected]", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/token/org_modernc_token-v1.1.0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/token/org_modernc_token-v1.0.0.zip", ], ) go_repository( @@ -11838,16 +11752,6 @@ def go_deps(): "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/xc/org_modernc_xc-v1.0.0.zip", ], ) - go_repository( - name = "org_modernc_z", - build_file_proto_mode = "disable_global", - importpath = "modernc.org/z", - sha256 = "5be23ef96669963e52d25b787d71028fff4fe1c468dec20aac59c9512caa2eb7", - strip_prefix = "modernc.org/[email protected]", - urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/z/org_modernc_z-v1.5.1.zip", - ], - ) go_repository( name = "org_mongodb_go_mongo_driver", build_file_proto_mode = "disable_global", diff --git a/WORKSPACE b/WORKSPACE index 480258d32c2d..474eec5eb9cf 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,12 +8,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Load go bazel tools. This gives us access to the go bazel SDK/toolchains. http_archive( name = "io_bazel_rules_go", - sha256 = "2443be6856928dab6f92f5e8581bb410159b4ea20033c4fb3432ee282b26efb4", - strip_prefix = "cockroachdb-rules_go-7c2d69e", + sha256 = "ada68324bc20ffd1b557bab4cf8dba9b742570a46a505b0bc99c1fde5132cce5", + strip_prefix = "cockroachdb-rules_go-734c37d", urls = [ - # cockroachdb/rules_go as of 7c2d69efcb8b6fd548629dfa31463989e58fff2a - # (upstream release-0.50 plus a few patches). - "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-530-g7c2d69e.tar.gz", + # cockroachdb/rules_go as of 734c37d6e2e6570f420d27fd97424b2fe2b402af + # (upstream release-0.46 plus a few patches). + "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-459-g734c37d.tar.gz", ], ) @@ -44,9 +44,10 @@ http_archive( # repo. http_archive( name = "bazel_gazelle", - sha256 = "b760f7fe75173886007f7c2e616a21241208f3d90e8657dc65d36a771e916b6a", + sha256 = "22140e6a7a28df5ec7477f12b286f24dedf8dbef0a12ffbbac10ae80441aa093", + strip_prefix = "bazelbuild-bazel-gazelle-061cc37", urls = [ - "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-gazelle-v0.39.1.tar.gz", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazelbuild-bazel-gazelle-v0.33.0-0-g061cc37.zip", ], ) @@ -90,9 +91,9 @@ go_deps() http_archive( name = "platforms", - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", + sha256 = "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", urls = [ - "https://storage.googleapis.com/public-bazel-artifacts/bazel/platforms-0.0.10.tar.gz", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/platforms-0.0.4.tar.gz", ], ) @@ -107,7 +108,6 @@ http_archive( # org_golang_x_sys handled in DEPS.bzl. # org_golang_x_tools handled in DEPS.bzl. -# org_golang_x_tools_go_vcs handled in DEPS.bzl. # org_golang_x_xerrors handled in DEPS.bzl. http_archive( @@ -119,12 +119,11 @@ http_archive( ], ) +# org_golang_google_protobuf handled in DEPS.bzl. # com_github_golang_protobuf handled in DEPS.bzl. # com_github_mwitkow_go_proto_validators handled in DEPS.bzl. # com_github_gogo_protobuf handled in DEPS.bzl. # org_golang_google_genproto handled in DEPS.bzl. -# org_golang_google_grpc_cmd_protoc_gen_go_grpc handled in DEPS.bzl. -# org_golang_google_protobuf handled in DEPS.bzl. http_archive( name = "go_googleapis", @@ -157,7 +156,6 @@ load( "go_download_sdk", "go_host_sdk", "go_local_sdk", - "go_register_nogo", "go_register_toolchains", "go_rules_dependencies", ) @@ -167,14 +165,14 @@ load( go_download_sdk( name = "go_sdk", sdks = { - "darwin_amd64": ("go1.23.2.darwin-amd64.tar.gz", "51e8aaf8055cef63982dc02fa153544e4238f57d12ac0592f8270136b1838522"), - "darwin_arm64": ("go1.23.2.darwin-arm64.tar.gz", "c58858973397585303b24830247257116cd7087a4dcf223f389e6294f36cf6bd"), - "linux_amd64": ("go1.23.2.linux-amd64.tar.gz", "5a80932e83b683188495096be732260bbbf5a9b41ac7410d8d330783a19d084d"), - "linux_arm64": ("go1.23.2.linux-arm64.tar.gz", "b222875b75adb05f04dca09d3ff5f92919bd17c3b52c4124988fc6a769592922"), - "windows_amd64": ("go1.23.2.windows-amd64.tar.gz", "55cc36160f61a9662f95752fae9d80c9a3bd013861fad46f1fa0c8f0d3598c5a"), + "darwin_amd64": ("go1.22.5.darwin-amd64.tar.gz", "0eca73b33e9fc3b8eae28c4873b979f5ebd4b7dc8771b9b13ba2d70517309a4d"), + "darwin_arm64": ("go1.22.5.darwin-arm64.tar.gz", "2d72a9301bf73f5429cbc40ba08b6602b1af91a5d5eed302fef2b92ae53b0b56"), + "linux_amd64": ("go1.22.5.linux-amd64.tar.gz", "477ec7b6f76e6c38d83fbd808af0729299b40a8e99796ac3b2fec50d62e20938"), + "linux_arm64": ("go1.22.5.linux-arm64.tar.gz", "fbaf48b411d434aad694fddc8a036ce7374f2d8459518a25fec4f58f3bca0c20"), + "windows_amd64": ("go1.22.5.windows-amd64.tar.gz", "8fc3ccf439e93521faa0411702ef4e598c80ded514bada5fedc11846c284d3d2"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/{}"], - version = "1.23.2", + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/{}"], + version = "1.22.5", ) # To point to a local SDK path, use the following instead. We'll call the @@ -194,8 +192,7 @@ go_download_sdk( go_rules_dependencies() -go_register_toolchains() -go_register_nogo(nogo = "@com_github_cockroachdb_cockroach//:crdb_nogo") +go_register_toolchains(nogo = "@com_github_cockroachdb_cockroach//:crdb_nogo") ############################### # end rules_go dependencies # @@ -325,14 +322,7 @@ load( # Ref: https://github.com/bazelbuild/bazel-gazelle/blob/master/deps.bzl # bazel_skylib handled above. - -http_archive( - name = "rules_license", - urls = [ - "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_license-1.0.0.tar.gz", - ], - sha256 = "26d4021f6898e23b82ef953078389dd49ac2b5618ac564ade4ef87cced147b38", -) +# co_honnef_go_tools handled in DEPS.bzl. # keep go_repository( @@ -358,13 +348,27 @@ go_repository( ], ) +# com_github_burntsushi_toml handled in DEPS.bzl. +# com_github_census_instrumentation_opencensus_proto handled in DEPS.bzl. +# com_github_chzyer_logex handled in DEPS.bzl. +# com_github_chzyer_readline handled in DEPS.bzl. +# com_github_chzyer_test handled in DEPS.bzl. +# com_github_client9_misspell handled in DEPS.bzl. +# com_github_davecgh_go_spew handled in DEPS.bzl. +# com_github_envoyproxy_go_control_plane handled in DEPS.bzl. +# com_github_envoyproxy_protoc_gen_validate handled in DEPS.bzl. # com_github_fsnotify_fsnotify handled in DEPS.bzl. -# com_github_gogo_protobuf handled in DEPS.bzl. +# com_github_golang_glog handled in DEPS.bzl. # com_github_golang_mock handled in DEPS.bzl. # com_github_golang_protobuf handled in DEPS.bzl. # com_github_google_go_cmp handled in DEPS.bzl. # com_github_pelletier_go_toml handled in DEPS.bzl. # com_github_pmezard_go_difflib handled in DEPS.bzl. +# com_github_prometheus_client_model handled in DEPS.bzl. +# com_github_yuin_goldmark handled in DEPS.bzl. +# com_google_cloud_go handled in DEPS.bzl. +# in_gopkg_check_v1 handled in DEPS.bzl. +# in_gopkg_yaml_v2 handled in DEPS.bzl. # keep go_repository( @@ -379,15 +383,18 @@ go_repository( # org_golang_google_genproto handled in DEPS.bzl. # org_golang_google_grpc handled in DEPS.bzl. -# org_golang_google_grpc_cmd_protoc_gen_go_grpc handled in DEPS.bzl. # org_golang_google_protobuf handled in DEPS.bzl. +# org_golang_x_crypto handled in DEPS.bzl. +# org_golang_x_exp handled in DEPS.bzl. +# org_golang_x_lint handled in DEPS.bzl. # org_golang_x_mod handled in DEPS.bzl. # org_golang_x_net handled in DEPS.bzl. +# org_golang_x_oauth2 handled in DEPS.bzl. # org_golang_x_sync handled in DEPS.bzl. # org_golang_x_sys handled in DEPS.bzl. # org_golang_x_text handled in DEPS.bzl. # org_golang_x_tools handled in DEPS.bzl. -# org_golang_x_tools_go_vcs handled in DEPS.bzl. +# org_golang_x_xerrors handled in DEPS.bzl. gazelle_dependencies() @@ -450,9 +457,11 @@ http_archive( http_archive( name = "rules_proto", - sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", - strip_prefix = "rules_proto-6.0.2", - url = "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_proto-6.0.2.tar.gz", + sha256 = "88b0a90433866b44bb4450d4c30bc5738b8c4f9c9ba14e9661deb123f56a833d", + strip_prefix = "rules_proto-b0cc14be5da05168b01db282fe93bdf17aa2b9f4", + urls = [ + "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_proto-b0cc14be5da05168b01db282fe93bdf17aa2b9f4.tar.gz", + ], ) load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") @@ -525,7 +534,13 @@ http_archive( urls = ["https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_python-0.1.0.tar.gz"], ) -# rules_license handled above. +http_archive( + name = "rules_license", + sha256 = "4865059254da674e3d18ab242e21c17f7e3e8c6b1f1421fffa4c5070f82e98b5", + urls = [ + "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_license-0.0.1.tar.gz", + ], +) load("@rules_pkg//pkg:deps.bzl", "rules_pkg_dependencies") @@ -654,8 +669,8 @@ go_download_sdk( # able to provide additional diagnostic information such as the expected version of OpenSSL. experiments = ["boringcrypto"], sdks = { - "linux_amd64": ("go1.23.2fips.linux-amd64.tar.gz", "523271b256d5ae315600653968b83af1f4a321f3cf54995b115232d4f1911750"), + "linux_amd64": ("go1.22.5fips.linux-amd64.tar.gz", "d2a40c2e78e2cf1560cafa304593e194e094c3e4dbd404666dda9cf5cc12b7f1"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/{}"], - version = "1.23.2fips", + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/{}"], + version = "1.22.5fips", ) diff --git a/build/bazelutil/BUILD.bazel b/build/bazelutil/BUILD.bazel index 49798091826a..a04b0dafee40 100644 --- a/build/bazelutil/BUILD.bazel +++ b/build/bazelutil/BUILD.bazel @@ -3,6 +3,17 @@ exports_files(["nogo_config.json"]) load("@bazel_skylib//rules:analysis_test.bzl", "analysis_test") load("@io_bazel_rules_go//go:def.bzl", "go_library") +analysis_test( + name = "test_nogo_configured", + targets = select( + { + "//build/toolchains:nogo": [], + "//build/toolchains:nonogo_explicit": [], + }, + no_match_error = "must use exactly one of `--config lintonbuild` or `--config nolintonbuild` explicitly", + ), +) + # The output file will be empty unless we're using the force_build_cdeps config. genrule( name = "test_force_build_cdeps", diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index 5d4af47c43e4..a5e821a06a09 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -130,24 +130,23 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/contrib.go.opencensus.io/exporter/prometheus/io_opencensus_go_contrib_exporter_prometheus-v0.4.0.zip": "e5dc381a98aad09e887f5232b00147308ff806e9189fbf901736ccded75a3357", "https://storage.googleapis.com/cockroach-godeps/gomod/dmitri.shuralyov.com/gpu/mtl/com_shuralyov_dmitri_gpu_mtl-v0.0.0-20190408044501-666a987793e9.zip": "ca5330901fcda83d09553ac362576d196c531157bc9c502e76b237cca262b400", "https://storage.googleapis.com/cockroach-godeps/gomod/gioui.org/org_gioui-v0.0.0-20210308172011-57750fc8a0a6.zip": "fcbab2a0ea09ff775c1ff4fa99299d95b94aad496b1ac329e3c7389119168fc0", - "https://storage.googleapis.com/cockroach-godeps/gomod/git.sr.ht/~sbinet/gg/ht_sr_git_~sbinet_gg-v0.3.1.zip": "435103529c4f24aecf7e4550bc816db2482dda4ee0123d337daba99971a8c498", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/99designs/go-keychain/com_github_99designs_go_keychain-v0.0.0-20191008050251-8e49817e8af4.zip": "ddff1e1a0e673de7d7f40be100b3a4e9b059e290500f17120969f26822a62c64", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/99designs/keyring/com_github_99designs_keyring-v1.2.2.zip": "7204ea1194e7835a02d9f8f3cf1ba30dce143dd9a3353ead71a46ffcd418d7be", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/99designs/keyring/com_github_99designs_keyring-v1.2.1.zip": "bbcbf31d7ccc1fb3b2b8dd4295add4cbe116ee89bb08a5a204202fae72a333b8", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/AdaLogics/go-fuzz-headers/com_github_adalogics_go_fuzz_headers-v0.0.0-20210715213245-6c3934b029d8.zip": "b969c84628be06be91fe874426fd3bbcb8635f93714ee3bae788bdc57e78b992", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/AndreasBriese/bbloom/com_github_andreasbriese_bbloom-v0.0.0-20190825152654-46b345b51c96.zip": "8b8c016e041592d4ca8cbd2a8c68e0dd0ba1b7a8f96fab7422c8e373b1835a2d", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/AthenZ/athenz/com_github_athenz_athenz-v1.10.39.zip": "790df98e01ad2c83e33f9760e478432a4d379e7de2b79158742a8fcfd9610dcf", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-pipeline-go/com_github_azure_azure_pipeline_go-v0.2.1.zip": "83822bc4aca977af31cdb1c46012e64c819d2b9ed53885dd0f8dca5566993a5f", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/com_github_azure_azure_sdk_for_go-v68.0.0+incompatible.zip": "c40d67ce49f8e2bbf4ca4091cbfc05bd3d50117f21d789e32cfa19bdb11ec50c", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/azcore/com_github_azure_azure_sdk_for_go_sdk_azcore-v1.4.0.zip": "42e10b1530d4f4d5864421ee44faabc84885a3957ce969ee33db96fb5229f284", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/azcore/com_github_azure_azure_sdk_for_go_sdk_azcore-v1.3.0.zip": "cf80995c85451a7990c4d68dfbfd7de89536d319df9502ba9dfd38eb84501810", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/azidentity/com_github_azure_azure_sdk_for_go_sdk_azidentity-v1.1.0.zip": "27947f13cb64475fd59e5d9f8b9c042b3d1e8603f49c54fc42820001c33d5f78", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/internal/com_github_azure_azure_sdk_for_go_sdk_internal-v1.1.2.zip": "88dc36a09083cfdf3db0dbc47e12a867b30c57f099f05381c35b4703dcac7810", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/internal/com_github_azure_azure_sdk_for_go_sdk_internal-v1.1.1.zip": "10f2a543b9e000a988722c8210d30d377c2306b042e5de1bfea4b3ec730d0319", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/com_github_azure_azure_sdk_for_go_sdk_keyvault_azkeys-v0.9.0.zip": "8f29c576ee07c3b8f7ca821927ceec97573479c882285ca71c2a13d92d4b9927", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal/com_github_azure_azure_sdk_for_go_sdk_keyvault_internal-v0.7.0.zip": "a3a79250f250d01abd0b402649ce9baf7eeebbbad186dc602eb011692fdbec24", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/com_github_azure_azure_sdk_for_go_sdk_resourcemanager_compute_armcompute-v1.0.0.zip": "7f0b10080e81a23d259a4449509485c58d862c4ff4757f7c2a234bbf6e9ac6c4", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/com_github_azure_azure_sdk_for_go_sdk_resourcemanager_internal-v1.0.0.zip": "e5a50bbc42b4be222b7bafd509316a14388ccc190947545df1abfbdd3727e54c", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/com_github_azure_azure_sdk_for_go_sdk_resourcemanager_network_armnetwork-v1.0.0.zip": "e09bacbe7fe4532f9887151a51e092ac89a143034da0fb1729126422f9e1212b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/com_github_azure_azure_sdk_for_go_sdk_resourcemanager_resources_armresources-v1.0.0.zip": "09d235afd45048829677351d042fba2c57754df4ae4dde8b25168e39e903db07", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/com_github_azure_azure_sdk_for_go_sdk_storage_azblob-v1.0.0.zip": "9bb69aea32f1d59711701f9562d66432c9c0374205e5009d1d1a62f03fb4fdad", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/com_github_azure_azure_sdk_for_go_sdk_storage_azblob-v0.6.1.zip": "c2539d189b22bdb6eb67c4682ded4e070d6cf0f52c8bd6899f7eb1408045783f", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/azure-storage-blob-go/com_github_azure_azure_storage_blob_go-v0.8.0.zip": "3b02b720c25bbb6cdaf77f45a29a21e374e087081dedfeac2700aed6147b4b35", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/go-ansiterm/com_github_azure_go_ansiterm-v0.0.0-20210617225240-d185dfc1b5a1.zip": "631ff4b167a4360e10911e475933ecb3bd327c58974c17877d0d4cf6fbef6c96", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/go-autorest/autorest/adal/com_github_azure_go_autorest_autorest_adal-v0.9.15.zip": "791f1d559e2c4d99f4d29465fd71f5589e368e2087701b78970ad8dcc7be6299", @@ -163,7 +162,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/go-autorest/tracing/com_github_azure_go_autorest_tracing-v0.6.0.zip": "b7296ba64ecae67c83ae1c89da47c6f65c2ff0807027e301daccab32673914b3", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/Azure/go-ntlmssp/com_github_azure_go_ntlmssp-v0.0.0-20221128193559-754e69321358.zip": "cc6d4e9caf938a71c9217f3aa8bdbb1c072faff3444bb680a2759c947da2085c", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/AzureAD/microsoft-authentication-library-for-go/com_github_azuread_microsoft_authentication_library_for_go-v0.5.1.zip": "303670915e2c0de9e6ed4658360ce5ae07320714c9a8228f0f2d69a12b8ddf5d", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v1.4.1-0.20240526193622-a339e1f7089c.zip": "f15f0ca7a3c5a4275d3d560236f178e9d735a084534bf3b685ec5f676806230a", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v1.2.1.zip": "6fb658e8262179ffd34d57eaef6b076b25c77e8b2129659b66697cded29a7121", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/xgb/com_github_burntsushi_xgb-v0.0.0-20160522181843-27f122750802.zip": "f52962c7fbeca81ea8a777d1f8b1f1d25803dc437fbb490f253344232884328e", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/xgbutil/com_github_burntsushi_xgbutil-v0.0.0-20160919175755-f7c97cef3b4e.zip": "680bb03650f0f43760cab53ec7b3b159ea489f04f379bbba25b5a8d77a2de2e0", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/CloudyKit/fastprinter/com_github_cloudykit_fastprinter-v0.0.0-20200109182630-33d98a066a53.zip": "7e6015de3e986e5de8bf7310887bb0d8c1c33d66c5aacbd706aeec524dfda765", @@ -216,9 +215,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/afex/hystrix-go/com_github_afex_hystrix_go-v0.0.0-20180502004556-fa1af6a1f4f5.zip": "c0e0ea63b57e95784eeeb18ab8988ac2c3d3a17dc729d557c963f391f372301c", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/agnivade/levenshtein/com_github_agnivade_levenshtein-v1.0.1.zip": "cb0e7f070ba2b6a10e1c600d71f06508404801ff45046853001b83be6ebedac3", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajg/form/com_github_ajg_form-v1.5.1.zip": "b063b07639670ce9b6a0065b4dc35ef9e4cebc0c601be27f5494a3e6a87eb78b", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/deck/com_github_ajstarks_deck-v0.0.0-20200831202436-30c9fc6549a9.zip": "68bad2e38bf5b01e6bbd7b9bbdba35da94dac72bc4ba41f8ea5fe92aa836a3c3", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/deck/generate/com_github_ajstarks_deck_generate-v0.0.0-20210309230005-c3f852c02e19.zip": "dce1cbc4cb42ac26512dd0bccf997baeea99fb4595cd419a28e8566d2d7c7ba8", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/svgo/com_github_ajstarks_svgo-v0.0.0-20211024235047-1546f124cd8b.zip": "e25b5dbb6cc86d2a0b5db08aad757c534681c2cecb30d84746e09c661cbd7c6f", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ajstarks/svgo/com_github_ajstarks_svgo-v0.0.0-20210923152817-c3b6e2f0c527.zip": "d58dcf4f11896cb22cec4db53ca17df342c6da4cc3a084c270f2da9e1eb351a7", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/akavel/rsrc/com_github_akavel_rsrc-v0.8.0.zip": "13954a09edc3a680d633c5ea7b4be902df3a70ca1720b349faadca44dc0c7ecc", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/alecthomas/kingpin/v2/com_github_alecthomas_kingpin_v2-v2.3.1.zip": "2a322681d79461dd793c1e8a98adf062f6ef554abcd3ab06981eef94d79c136b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/alecthomas/template/com_github_alecthomas_template-v0.0.0-20190718012654-fb15b899a751.zip": "25e3be7192932d130d0af31ce5bcddae887647ba4afcfb32009c3b9b79dbbdb3", @@ -235,7 +232,6 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/aokoli/goutils/com_github_aokoli_goutils-v1.0.1.zip": "96ee68caaf3f4e673e27c97659b4ea10a4fd81dbf24fabd2dc01e187a772355c", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/arrow/go/arrow/com_github_apache_arrow_go_arrow-v0.0.0-20200923215132-ac86123a3f01.zip": "5018a8784061fd3a5e52069fb321ebe2d96181d4a6f2d594cb60ff3787998580", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/arrow/go/v11/com_github_apache_arrow_go_v11-v11.0.0.zip": "d5275ec213d31234d54ca13fff78d07ba1837d78664c13b76363d2f75718ae4f", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/arrow/go/v12/com_github_apache_arrow_go_v12-v12.0.1.zip": "5eb05ed9c2c5e164503b00912b7b2456400578de29e7e8a8956a41acd861ab5b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/pulsar-client-go/com_github_apache_pulsar_client_go-v0.12.0.zip": "ed1ce957cfa2e98950a8c2ae319a4b6d17bafc2e18d06d65bb68901dd627502b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/apache/thrift/com_github_apache_thrift-v0.16.0.zip": "50d5c610df30fa2a6039394d5142382b7d9938870dfb12ef46bddfa3da250893", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/ardielle/ardielle-go/com_github_ardielle_ardielle_go-v1.5.2.zip": "08d285f8f99362c2fef82849912244a23a667d78cd97c1f3196371ae74b8f229", @@ -346,7 +342,6 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/errors/com_github_cockroachdb_errors-v1.11.3.zip": "d11ed59d96afef2d1f0ce56892839c62ff5c0cbca8dff0aaefeaef7eb190e73c", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/fifo/com_github_cockroachdb_fifo-v0.0.0-20240606204812-0bbfbd93a7ce.zip": "41e682b393cc82891ab5fcefbd28cc6173f16887702ab8760bcbc66d122e5900", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/go-test-teamcity/com_github_cockroachdb_go_test_teamcity-v0.0.0-20191211140407-cff980ad0a55.zip": "bac30148e525b79d004da84d16453ddd2d5cd20528e9187f1d7dac708335674b", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gosnowflake/com_github_cockroachdb_gosnowflake-v1.6.25.zip": "4e6da06c9cbe5188ce9749d5d79b36a54d007a3eb3cdf6031b2f0dc5f9f880df", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20230118201751-21c54148d20b.zip": "ca7776f47e5fecb4c495490a679036bfc29d95bd7625290cfdb9abb0baf97476", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/metamorphic/com_github_cockroachdb_metamorphic-v0.0.0-20231108215700-4ba948b56895.zip": "28c8cf42192951b69378cf537be5a9a43f2aeb35542908cc4fe5f689505853ea", @@ -438,7 +433,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/docker/libtrust/com_github_docker_libtrust-v0.0.0-20150114040149-fa567046d9b1.zip": "7f7a72aae4276536e665d8dfdab7219231fbb402dec16ba79ccdb633a4692482", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/docker/spdystream/com_github_docker_spdystream-v0.0.0-20160310174837-449fdfce4d96.zip": "70964f9eef29843634539b8d6e09c8b51ed6aa96b5deda28b7a44613327a22f2", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/docopt/docopt-go/com_github_docopt_docopt_go-v0.0.0-20180111231733-ee0de3bc6815.zip": "00aad861d150c62598ca4fb01cfbe15c2eefb5186df7e5d4a59286dcf09556c8", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/dustin/go-humanize/com_github_dustin_go_humanize-v1.0.1.zip": "319404ea84c8a4e2d3d83f30988b006e7dd04976de3e1a1a90484ad94679fa46", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/dustin/go-humanize/com_github_dustin_go_humanize-v1.0.0.zip": "e01916e082a6646ea12d7800d77af43045c27284ff2a0a77e3484509989cc107", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/dvsekhvalnov/jose2go/com_github_dvsekhvalnov_jose2go-v1.6.0.zip": "f4827d6c8116cc0d32e822acb4f33283db8013b850e1009c47bb70361e90e312", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/dvyukov/go-fuzz/com_github_dvyukov_go_fuzz-v0.0.0-20210103155950-6a8e9d1f2415.zip": "0a4c4bc0a550c729115d74f6a636e5802894b33bc50aa8af99c4a70196d5990b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/eapache/go-resiliency/com_github_eapache_go_resiliency-v1.4.0.zip": "d9bf171efc34a8906488dde76b1f80e8c9ff6eb8ab5f7d7ebc56812882b2b77e", @@ -464,7 +459,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/fatih/structs/com_github_fatih_structs-v1.1.0.zip": "a361ecc95ad12000c66ee143d26b2aa0a4e5de3b045fd5d18a52564622a59148", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/flosch/pongo2/v4/com_github_flosch_pongo2_v4-v4.0.2.zip": "88e92416c43e05ab51f36bef211fcd03bb25428e2d2bebeed8a1877b8ad43281", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/fogleman/gg/com_github_fogleman_gg-v1.3.0.zip": "792f7a3ea9eea31b7947dabaf9d5a307389245069078e4bf435d76cb0505439c", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/form3tech-oss/jwt-go/com_github_form3tech_oss_jwt_go-v3.2.5+incompatible.zip": "30cf0ef9aa63aea696e40df8912d41fbce69dd02986a5b99af7c5b75f277690c", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/form3tech-oss/jwt-go/com_github_form3tech_oss_jwt_go-v3.2.3+incompatible.zip": "6780fef32d854a318af431efd0c680a1cb4ddc50d36d6b4c239baf381004efae", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/fortytw2/leaktest/com_github_fortytw2_leaktest-v1.3.0.zip": "867e6d131510751ba6055c51e7746b0056a6b3dcb1a1b2dfdc694251cd7eb8b3", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/foxcpp/go-mockdns/com_github_foxcpp_go_mockdns-v0.0.0-20201212160233-ede2f9158d15.zip": "981c5e71776a97a6de21552728fd2ff04ab9f2057836f133a33cc06c13cbb724", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/franela/goblin/com_github_franela_goblin-v0.0.0-20200105215937-c9ffbefa60db.zip": "e4ef81939ecb582e5716af6ae8b20ecf899f1351b7c53cb6799edf2a29a43714", @@ -472,7 +467,6 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/frankban/quicktest/com_github_frankban_quicktest-v1.11.3.zip": "28d4b3dc3a66f7c838f7667370df1cd88cc330eac227c55c3c2cd2ecd666c4c5", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/fsnotify/fsnotify/com_github_fsnotify_fsnotify-v1.5.1.zip": "f38d7e395bc45f08a34e9591c9c4900031f81c1ddc7d761a785cbbb9aaee0db0", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/fullsailor/pkcs7/com_github_fullsailor_pkcs7-v0.0.0-20190404230743-d7302db945fa.zip": "ba36a8fc855d6eecef329d26f8e82132e38d45d06f79f88d3b0bde6d718c8fb2", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/gabriel-vasile/mimetype/com_github_gabriel_vasile_mimetype-v1.4.2.zip": "959e9da19ac23353e711c80f768cb3344ba0fb2d2fefeb4b21f4165811327327", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/garyburd/redigo/com_github_garyburd_redigo-v0.0.0-20150301180006-535138d7bcd7.zip": "7ed5f8194388955d2f086c170960cb096ee28d421b32bd12328d5f2a2b0ad488", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/gavv/httpexpect/com_github_gavv_httpexpect-v2.0.0+incompatible.zip": "3db05c59a5c70d11b9452727c529be6934ddf8b42f4bfdc3138441055f1529b1", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/getkin/kin-openapi/com_github_getkin_kin_openapi-v0.53.0.zip": "e3a00cb5828f8922087a0a74aad06c6177fa2eab44763a19aeec38f7fab7834b", @@ -515,7 +509,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-openapi/strfmt/com_github_go_openapi_strfmt-v0.22.0.zip": "37f512d6ac447bc026276a87eeb89d3c0ec243740c69e79743f8d9761d29aafe", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-openapi/swag/com_github_go_openapi_swag-v0.22.9.zip": "6c4f1b2d69670d4cc560783f66d7faf3baaac7ad6fa258331e207a855d24693e", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-openapi/validate/com_github_go_openapi_validate-v0.23.0.zip": "1bb740012b9b47084438b67c0688235ba7e5227d915d29eedc273dd6a3aadf1a", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-pdf/fpdf/com_github_go_pdf_fpdf-v0.6.0.zip": "03a6909fc346ac972b008b77585ac3954d76b416c33b4b64dc22c5f35f0e1edb", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-pdf/fpdf/com_github_go_pdf_fpdf-v0.5.0.zip": "9ab17b11279de24333e3f39475478bd5c7f3294b0b512b79c34fb8c77ce7f613", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-playground/assert/v2/com_github_go_playground_assert_v2-v2.0.1.zip": "46db6b505ff9818c50f924c6aec007dbbc4d86267fdf2d470ef4be12a40fd4cb", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-playground/locales/com_github_go_playground_locales-v0.14.0.zip": "e103ae2c635cde62d2b75ff021be20443ab8d227aebfed5f043846575ea1fa43", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-playground/universal-translator/com_github_go_playground_universal_translator-v0.18.0.zip": "15f3241347dfcfe7d668595727629bcf54ff028ebc4b7c955b9c2bdeb253a110", @@ -567,7 +561,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/gonum/lapack/com_github_gonum_lapack-v0.0.0-20181123203213-e4cdc5a0bff9.zip": "f38b72e072728121b9acf5ae26d947aacc0024dddc09d19e382bacd8669f5997", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/gonum/matrix/com_github_gonum_matrix-v0.0.0-20181209220409-c518dec07be9.zip": "9cea355e35e3f5718b2c69f65712b2c08a1bec13b3cfadf168d98b41b043dd63", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/btree/com_github_google_btree-v1.0.1.zip": "9b9f66ca4eb36bb1867b5ff9134fb2eb9fe9717d44e28836f2e977f9c03b4128", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/flatbuffers/com_github_google_flatbuffers-v23.1.21+incompatible.zip": "2b66a7cfcf2feb5ead4a9399782e4665a02475b66077ab50d299bbd6eafbf526", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/flatbuffers/com_github_google_flatbuffers-v2.0.8+incompatible.zip": "0c0a4aab1c6029141d655bc7fdc07e22dd06f3f64ebbf7a2250b870ef7aac7ee", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/go-cmp/com_github_google_go_cmp-v0.6.0.zip": "4b4e9bf6c48211080651b491dfb48d68b736c66a305bcf94605606e1ba2eaa4a", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/go-github/com_github_google_go_github-v17.0.0+incompatible.zip": "9831222a466bec73a21627e0c3525da9cadd969468e31d10ecae8580b0568d0e", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/google/go-github/v27/com_github_google_go_github_v27-v27.0.4.zip": "c0bb2e2b9d8b610fd1d4b9fa8a3636a5337f19aecec33e76aecbf32ae4e192bb", @@ -717,12 +711,12 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kataras/tunnel/com_github_kataras_tunnel-v0.0.4.zip": "1ae8dcc9a6ca3f47c5f8b57767a08b0acd916eceef49c48aa9859547316db8e2", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kballard/go-shellquote/com_github_kballard_go_shellquote-v0.0.0-20180428030007-95032a82bc51.zip": "ae4cb7b097dc4eb0c248dff00ed3bbf0f36984c4162ad1d615266084e58bd6cc", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kevinburke/go-bindata/com_github_kevinburke_go_bindata-v3.13.0+incompatible.zip": "f087b3a77624a113883bac519ebd1a4de07b70ab2ebe73e61e52325ac30777e0", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kisielk/errcheck/com_github_kisielk_errcheck-v1.7.1-0.20240702033320-b832de3f3c5a.zip": "4087fa0fa06f3e91e4d49f23ce5d602c63779906da0c7303c1e37ff51c718968", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kisielk/errcheck/com_github_kisielk_errcheck-v1.7.0.zip": "f394d1df1f2332387ce142d98734c5c44fb94e9a8a2af2a9b75aa4ec4a64b963", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/kisielk/gotool/com_github_kisielk_gotool-v1.0.0.zip": "089dbba6e3aa09944fdb40d72acc86694e8bdde01cfc0f40fe0248309eb80a3f", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/asmfmt/com_github_klauspost_asmfmt-v1.3.2.zip": "fa6a350a8677a77e0dbf3664c6baf23aab5c0b60a64b8f3c00299da5d279021f", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.8.zip": "648bbc7813dec448eec1a5a467750696bc7e41e1ac0a00b76a967c589826afb6", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/cpuid/com_github_klauspost_cpuid-v1.3.1.zip": "f61266e43d5c247fdb55d843e2d93974717c1052cba9f331b181f60c4cf687d9", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/cpuid/v2/com_github_klauspost_cpuid_v2-v2.2.3.zip": "f68ff82caa807940fee615b4898d428365761eeb36861959ca8b91a034bd0e7e", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/cpuid/v2/com_github_klauspost_cpuid_v2-v2.0.9.zip": "52c716413296dce2b1698c6cdbc4c53927ce4aee2a60980daf9672e6b6a3b4cb", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/crc32/com_github_klauspost_crc32-v0.0.0-20161016154125-cb6bfca970f6.zip": "6b632853a19f039138f251f94dbbdfdb72809adc3a02da08e4301d3d48275b06", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/klauspost/pgzip/com_github_klauspost_pgzip-v1.2.5.zip": "1143b6417d4bb46d26dc8e6223407b84b6cd5f32e5d705cd4a9fb142220ce4ba", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/knz/bubbline/com_github_knz_bubbline-v0.0.0-20230422210153-e176cdfe1c43.zip": "b9699be473d5dc3c1254f0e9a26f77a06cc0455135b72c2b82d85146bcfe5863", @@ -776,7 +770,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-localereader/com_github_mattn_go_localereader-v0.0.1.zip": "aa67306797b071ce93188fe2834f63ffd7963faf623d49229d891ef52e595b35", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-runewidth/com_github_mattn_go_runewidth-v0.0.14.zip": "364ef5ed31f6571dad56730305b5c2288a53da06d9832680ade5e21d97a748e7", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-shellwords/com_github_mattn_go_shellwords-v1.0.3.zip": "d9b59db554053d4a244f9ca5c233773f7cf512778d95919c78dc47234eacceee", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-sqlite3/com_github_mattn_go_sqlite3-v1.14.15.zip": "0114d2df439ddeb03eef49a4bf2cc8fb69665c0d76494463cafa7d189a16e0f9", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-sqlite3/com_github_mattn_go_sqlite3-v1.14.5.zip": "e948fca1fe3a3e614017dff9a30478d16b320babe834e326349cdd3d6750a3d9", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-tty/com_github_mattn_go_tty-v0.0.0-20180907095812-13ff1204f104.zip": "e7384ae06bb54cc8f615d86e6397b11849be12c270d66460856f3fc6ad72aacb", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/go-zglob/com_github_mattn_go_zglob-v0.0.3.zip": "8ef2dfc44aa352edd72e50287b7ac836c4c48fa439ca2648d8c1a4067f49e504", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mattn/goveralls/com_github_mattn_goveralls-v0.0.2.zip": "3df5b7ebfb61edd9a098895aae7009a927a2fe91f73f38f48467a7b9e6c006f7", @@ -884,7 +878,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/performancecopilot/speed/com_github_performancecopilot_speed-v3.0.0+incompatible.zip": "44150a760ccfe232d3ce6bf40e537342d01f78ddac18b795f623d004257c00b0", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/peterbourgon/diskv/com_github_peterbourgon_diskv-v2.0.1+incompatible.zip": "1eeff260bd1ad71cd1611078995db99e1c7eba28628e7d6f24c79039536ea1cb", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/peterh/liner/com_github_peterh_liner-v1.0.1-0.20180619022028-8c1271fcf47f.zip": "0d96c450f9c55a8102f4ae7fd8a583ebfaeba23e3939d6b6284306a82a21430f", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/petermattis/goid/com_github_petermattis_goid-v0.0.0-20240813172612-4fcff4a6cae7.zip": "3f47ab8e5713c36ec5b4295956a5ef012a192bc19198ae1b6591408c061e97ab", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/petermattis/goid/com_github_petermattis_goid-v0.0.0-20211229010228-4d14c490ee36.zip": "9f536c5d39d6a3c851670ec585e1c876fe31f3402556d215ebbaffcecbacb30a", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/philhofer/fwd/com_github_philhofer_fwd-v1.0.0.zip": "b4e79b1f5fdfe8c44bf6dae3dd593c62862930114411a30968f304084de1d0b3", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/phpdave11/gofpdf/com_github_phpdave11_gofpdf-v1.4.2.zip": "4db05258f281b40d8a17392fd71648779ea758a9aa506a8d1346ded737ede43f", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/phpdave11/gofpdi/com_github_phpdave11_gofpdi-v1.0.13.zip": "09b728136cf290f4ee87aa47b60f2f9df2b3f4f64119ff10f12319bc3438b58d", @@ -894,7 +888,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pierrre/geohash/com_github_pierrre_geohash-v1.0.0.zip": "8c94a7e1f93170b53cf6e9d615967c24ff5342d5182d510f4829b3f39e249b4d", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.4.zip": "df62e548162429501a88d936a3e8330f2379ddfcd4d23c22b78bc1b157e05b97", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pires/go-proxyproto/com_github_pires_go_proxyproto-v0.7.0.zip": "5ba5921ebf2f5d1186268740ebf6e594e4512fcbb503f2974b1038781a5920f8", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/browser/com_github_pkg_browser-v0.0.0-20210911075715-681adbf594b8.zip": "415b8b7d7e47074cf3f6c2269d8712efa8a8433cba7bfce7eed22ca7f0b447a4", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/browser/com_github_pkg_browser-v0.0.0-20210115035449-ce105d075bb4.zip": "84db38d8db553ccc34c75f867396126eac07774b979c470f97a20854d3a3af6d", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/diff/com_github_pkg_diff-v0.0.0-20210226163009-20ebb0f2a09e.zip": "f35b23fdd2b9522ddd46cc5c0161b4f0765c514475d5d4ca2a86aca31388c8bd", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/errors/com_github_pkg_errors-v0.9.1.zip": "d4c36b8bcd0616290a3913215e0f53b931bd6e00670596f2960df1b44af2bd07", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pkg/profile/com_github_pkg_profile-v1.6.0.zip": "a31530cc1be940d949f8c3ae285cf877858c9e71b0a4da457787a4fee80711b9", @@ -918,7 +912,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pseudomuto/protoc-gen-doc/com_github_pseudomuto_protoc_gen_doc-v1.3.2.zip": "ecf627d6f5b4e55d4844dda45612cbd152f0bc4dbe2ba182c7bc3ad1dc63ce5f", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/pseudomuto/protokit/com_github_pseudomuto_protokit-v0.2.0.zip": "16d5fe0f6ac5bebbf9f2f05fde72f28bbf05bb18baef045b9ae79c2585f4e127", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/rcrowley/go-metrics/com_github_rcrowley_go_metrics-v0.0.0-20201227073835-cf1acfcdf475.zip": "e4dbd20c185cb05019fd7d4a361266bd5d182938f49fd9577df4d12c16dc81c3", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/remyoudompheng/bigfft/com_github_remyoudompheng_bigfft-v0.0.0-20230129092748-24d4a6f8daec.zip": "9be16c32c384d55d0f7bd7b03f1ff1e9a4e4b91b000f0aa87a567a01b9b82398", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/remyoudompheng/bigfft/com_github_remyoudompheng_bigfft-v0.0.0-20200410134404-eec4a21b6bb0.zip": "60c422375fac36ea169eb6065af6c1b4895d8608bbd3fda9cddf98dee02e5d6a", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/retailnext/hllpp/com_github_retailnext_hllpp-v1.0.1-0.20180308014038-101a6d2f8b52.zip": "7863938cb01dfe9d4495df3c6608bedceec2d1195da05612f3c1b0e27d37729d", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/rivo/uniseg/com_github_rivo_uniseg-v0.2.0.zip": "3199d94be50284142220662ca3b00e19ddd1debe4e80ddc745ff4203ecb601c0", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/robertkrimen/godocdown/com_github_robertkrimen_godocdown-v0.0.0-20130622164427-0bfa04905481.zip": "789ed4a63a797e0dbac7c358eafa8fec4c9885f67ee61da941af4bad2d8c3b55", @@ -959,6 +953,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/slok/go-http-metrics/com_github_slok_go_http_metrics-v0.10.0.zip": "bf2e2b626e4fbd9735165494c574f2474f400786d8bd96b6b4648eba352c817b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/smartystreets/assertions/com_github_smartystreets_assertions-v0.0.0-20190116191733-b6c0e53d7304.zip": "bf12bc33290d3e1e6f4cfe89aad0ad40c0acbfb378ce11e8157569aaf1526c04", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/smartystreets/goconvey/com_github_smartystreets_goconvey-v1.6.4.zip": "a931413713a303a958a9c3ac31305498905fb91465e725552472462130396dda", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/snowflakedb/gosnowflake/com_github_snowflakedb_gosnowflake-v1.3.4.zip": "a39ab3850d25f162e2ed4bf920c0fba1559e1c5ec41e1ca35f44600a2e9a971d", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/soheilhy/cmux/com_github_soheilhy_cmux-v0.1.4.zip": "6d6cadade0e186f84b5f8e7ddf8f4256601b21e49b0ca49fd003a7e570ae1885", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/sony/gobreaker/com_github_sony_gobreaker-v0.4.1.zip": "eab9bf8f98b16b051d7d13c4f5c70d6d1039347e380e0a12cb9ff6e33200d784", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/spaolacci/murmur3/com_github_spaolacci_murmur3-v1.1.0.zip": "60bd43ada88cc70823b31fd678a8b906d48631b47145300544d45219ee6a17bc", @@ -1083,9 +1078,9 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/goji.io/io_goji-v2.0.2+incompatible.zip": "1ea69b28e356cb91381ce2339004fcf144ad1b268c9e3497c9ef304751ae0bb3", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/arch/org_golang_x_arch-v0.0.0-20180920145803-b19384d3c130.zip": "9f67b677a3fefc503111d9aa7df8bacd2677411b0fcb982eb1654aa6d14cc3f8", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/crypto/org_golang_x_crypto-v0.26.0.zip": "ec96acfe28be3ff2fb14201c5f51132f0e24c7d0d6f3201a8aa69c84f989d014", - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/org_golang_x_exp-v0.0.0-20231110203233-9a3e6036ecaa.zip": "3e3717f5151e8c2ebf267b4d53698b97847c0de144683c51b74ab7edf5039fa8", - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/typeparams/org_golang_x_exp_typeparams-v0.0.0-20231108232855-2478ac86f678.zip": "22c0e082f62b39c8ddaec18a9f2888158199e597adc8780e918e8976cd9fbbb0", - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/image/org_golang_x_image-v0.0.0-20220302094943-723b81ca9867.zip": "56176a4d4d47910d61df9a77aa66a8469ae79fa18b7f5821c43bef1ef212116d", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/org_golang_x_exp-v0.0.0-20230626212559-97b1e661b5df.zip": "af32025a065aa599a3e5b01048602a53e2b6e3938b12d33fa2a5f057be9759fa", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/typeparams/org_golang_x_exp_typeparams-v0.0.0-20221208152030-732eee02a75a.zip": "9bd73f186851c6229484f486981f608d16e2b86acbbef6f4f7cc0480a508a4a4", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/image/org_golang_x_image-v0.0.0-20210628002857-a66eb6448b8d.zip": "70cf423fad9be160a88fbf01bc1897efd888f915a6d7ba0dd41ca7085f75e06e", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/lint/org_golang_x_lint-v0.0.0-20210508222113-6edffad5e616.zip": "0a4a5ebd2b1d79e7f480cbf5a54b45a257ae1ec9d11f01688efc5c35268d4603", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/mobile/org_golang_x_mobile-v0.0.0-20190719004257-d2bd2a29d028.zip": "6b946c7da47acf3b6195336fd071bfc73d543cefab73f2d27528c5dc1dc829ec", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/mod/org_golang_x_mod-v0.20.0.zip": "3c3528c39639b7cd699c121c100ddb71ab49f94bff257a4a3935e3ae9e8571fc", @@ -1097,12 +1092,11 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/telemetry/org_golang_x_telemetry-v0.0.0-20240521205824-bda55230c457.zip": "8e8649337973d064cc44fa858787db7d0eb90f0806807349766d180ed6889f5c", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/term/org_golang_x_term-v0.23.0.zip": "2597a62b487b952c11c89b2001551af1fe1d29c484388ec1c3f5e3be7ff58ba5", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/text/org_golang_x_text-v0.17.0.zip": "48464f2ab2f988ca8b7b0a9d098e3664224c3b128629b5a9cc08025ee4a7e4ec", - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/go/vcs/org_golang_x_tools_go_vcs-v0.1.0-deprecated.zip": "ab155d94f90a98a5112967b89bfcd26b5825c1cd6875a5246c7905a568387260", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/org_golang_x_tools-v0.24.0.zip": "92607be1cacf4647fd31b19ee64b1a7c198178f1005c75371e38e7b08fb138e7", "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/xerrors/org_golang_x_xerrors-v0.0.0-20220907171357-04be3eba64a2.zip": "b9c481db33c4b682ba8ba348018ddbd2155bd227cc38ff9f6b4cb2b74bbc3c14", "https://storage.googleapis.com/cockroach-godeps/gomod/gonum.org/v1/gonum/org_gonum_v1_gonum-v0.11.0.zip": "abdfee15ce7c9d2cd96b66468d3ae28d6054add4efbfc1b15fadfe3613f3d362", "https://storage.googleapis.com/cockroach-godeps/gomod/gonum.org/v1/netlib/org_gonum_v1_netlib-v0.0.0-20190331212654-76723241ea4e.zip": "ed4dca5026c9ab5410d23bbe21c089433ca58a19bd2902311c6a91791142a687", - "https://storage.googleapis.com/cockroach-godeps/gomod/gonum.org/v1/plot/org_gonum_v1_plot-v0.10.1.zip": "eaa47ad966b3b67325c1f3ae704d566332c573b7cca79016cb4ffe82155aab39", + "https://storage.googleapis.com/cockroach-godeps/gomod/gonum.org/v1/plot/org_gonum_v1_plot-v0.10.0.zip": "5bf2f98775d5eceafba12cf1196b97e92e93f6f824599f02c0ba4bfe15bae1b2", "https://storage.googleapis.com/cockroach-godeps/gomod/google.golang.org/api/org_golang_google_api-v0.114.0.zip": "42c62aaba1d76efede08c70d8aef7889c5c8ee9c9c4f1e7c455b07838cabb785", "https://storage.googleapis.com/cockroach-godeps/gomod/google.golang.org/appengine/org_golang_google_appengine-v1.6.7.zip": "79f80dfac18681788f1414e21a4a7734eff4cdf992070be9163103eb8d9f92cd", "https://storage.googleapis.com/cockroach-godeps/gomod/google.golang.org/cloud/org_golang_google_cloud-v0.0.0-20151119220103-975617b05ea8.zip": "b1d5595a11b88273665d35d4316edbd4545731c979d046c82844fafef2039c2a", @@ -1146,7 +1140,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/gorm.io/gorm/io_gorm_gorm-v1.23.5.zip": "34219a6d2ac9b9c340f811e5863a98b150db6d1fd5b8f02777299863c1628e0f", "https://storage.googleapis.com/cockroach-godeps/gomod/gotest.tools/tools_gotest-v2.2.0+incompatible.zip": "55fab831b2660201183b54d742602563d4e17e7125ee75788a309a4f6cb7285e", "https://storage.googleapis.com/cockroach-godeps/gomod/gotest.tools/v3/tools_gotest_v3-v3.2.0.zip": "fe238394013ebf35c313b7de60c5df5b6271f7c5f982eb8eecefe324531a0f5f", - "https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.5.1.zip": "d728ff392fc5b6f676a30c36e9d0a5b85f6f2e06b4ebbb121c27d965cbdffa11", + "https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.4.5.zip": "3f7c266a830f3a0727ac0b85cd7cd74a765c05d337d73af20906219f1a4ec4c3", "https://storage.googleapis.com/cockroach-godeps/gomod/k8s.io/api/io_k8s_api-v0.22.5.zip": "18d095a1d1344a7ed43ccae0c5b77d2586e134ea9489b1821402d72f980f3564", "https://storage.googleapis.com/cockroach-godeps/gomod/k8s.io/apiextensions-apiserver/io_k8s_apiextensions_apiserver-v0.17.3.zip": "f3be44b21eaea21dbc2655f207f838a94e4ed63b24e5ce4f1d688c329b53c9ff", "https://storage.googleapis.com/cockroach-godeps/gomod/k8s.io/apimachinery/io_k8s_apimachinery-v0.22.5.zip": "1d624555825fb81d8bdae0c92a0aad07b3edea62dceedd49bc93a2024ed46467", @@ -1163,21 +1157,17 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/k8s.io/utils/io_k8s_utils-v0.0.0-20210930125809-cb0fa318a74b.zip": "36d8bf6bcf31ef7d701db07d0f78642015b811146da81f09e5f182247196c857", "https://storage.googleapis.com/cockroach-godeps/gomod/lukechampine.com/uint128/com_lukechampine_uint128-v1.2.0.zip": "9ff6e9ad553a69fdb961ab2d92f92cda183ef616a6709c15972c2d4bedf33de5", "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/cc/org_modernc_cc-v1.0.0.zip": "24711e9b28b0d79dd32438eeb7debd86b850350f5f7749b7af640422ecf6b93b", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/cc/v3/org_modernc_cc_v3-v3.40.0.zip": "fe3aeb761e55ce77a95b297321a122b4273aeffe1c08f48fc99310e065211f74", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/ccgo/v3/org_modernc_ccgo_v3-v3.16.13.zip": "bfc293300cd1ce656ba0ce0cee1f508afec2518bc4214a6b10ccfad6e8e6046e", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/ccorpus/org_modernc_ccorpus-v1.11.6.zip": "3831b62a73a379b81ac927e17e3e9ffe2d44ad07c934505e1ae24eea8a26a6d3", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/cc/v3/org_modernc_cc_v3-v3.36.3.zip": "1fd51331be5f9b845282642e78f0bff09fbf551583c4555012520eed3215b2e0", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/ccgo/v3/org_modernc_ccgo_v3-v3.16.9.zip": "5e19b5f5dd197c25d38d7ea9521465ff579294990bd969b2158eafeb7334a6e9", "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/golex/org_modernc_golex-v1.0.0.zip": "335133038991d7feaba5349ac2385db7b49601bba0904abf680803ee2d3c99df", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/httpfs/org_modernc_httpfs-v1.0.6.zip": "0b5314649c1327a199397eb6fd52b3ce41c9d3bc6dd2a4dea565b5fb87c13f41", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/libc/org_modernc_libc-v1.22.2.zip": "5f98bedf9f0663b3b87555904ee41b82fe9d8e9ac5c47c9fac9a42a7fe232313", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/libc/org_modernc_libc-v1.17.1.zip": "82b6d3a79ffe291d8f6ecbcaf6aba579ff37d1bea9049e600d85a388a4c15948", "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/mathutil/org_modernc_mathutil-v1.5.0.zip": "c17a767eaa5eb62d9bb105b8ece7f249186dd52b9b533301bec140b3d5fd260f", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/memory/org_modernc_memory-v1.5.0.zip": "f79e8ada14c36d08817ee2bf6b2103f65c1a61a91b042b59016465869624043c", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/memory/org_modernc_memory-v1.2.1.zip": "2eb0b17569e7f822cbd0176213e1dbc04e4c692bccdd59cda50cc157644547ee", "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/opt/org_modernc_opt-v0.1.3.zip": "294b1b80137cb86292c8893481d545eee90b17b84b6ad1dcb2e6c9bb523a2d9e", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/sqlite/org_modernc_sqlite-v1.18.2.zip": "be0501f87458962a00c8fb07d1f131af010a534cd6ffb654c570be35b9b608d5", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/sqlite/org_modernc_sqlite-v1.18.1.zip": "5c484a0d7aeab465beff2460b0b5e63284155dad8b8fef52b9b30827bc77263c", "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/strutil/org_modernc_strutil-v1.1.3.zip": "2e59915393fa6a75021a97a41c60fac71c662bb9d1dc2d06e2c4ed77ea5da8cc", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/tcl/org_modernc_tcl-v1.13.2.zip": "f966db0dd1ccbc7f8d5ac2e752b64c3be343aa3f92215ed98b6f2a51b7abbb64", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/token/org_modernc_token-v1.1.0.zip": "3efaa49e9fb10569da9e09e785fa230cd5c0f50fcf605f3b5439dfcd61577c58", + "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/token/org_modernc_token-v1.0.0.zip": "081d969b97ccec2892c6dc9dd50b001a54ac0c6615534e9623be99b5b2d1fc34", "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/xc/org_modernc_xc-v1.0.0.zip": "ef80e60acacc023cd294eef2555bd348f74c1bcd22c8cfbbd2472cb91e35900d", - "https://storage.googleapis.com/cockroach-godeps/gomod/modernc.org/z/org_modernc_z-v1.5.1.zip": "5be23ef96669963e52d25b787d71028fff4fe1c468dec20aac59c9512caa2eb7", "https://storage.googleapis.com/cockroach-godeps/gomod/rsc.io/binaryregexp/io_rsc_binaryregexp-v0.2.0.zip": "b3e706aa278fa7f880d32fa1cc40ef8282d1fc7d6e00356579ed0db88f3b0047", "https://storage.googleapis.com/cockroach-godeps/gomod/rsc.io/pdf/io_rsc_pdf-v0.1.1.zip": "79bf310e399cf0e2d8aa61536750d2a6999c5ca884e7a27faf88d3701cd5ba8f", "https://storage.googleapis.com/cockroach-godeps/gomod/rsc.io/quote/v3/io_rsc_quote_v3-v3.1.0.zip": "b434cbbfc32c17b5228d0b0eddeaea89bef4ec9bd90b5c8fc55b64f8ce13eeb9", @@ -1189,24 +1179,24 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/sigs.k8s.io/yaml/io_k8s_sigs_yaml-v1.2.0.zip": "55ed08c5df448a033bf7e2c2912d4daa85b856a05c854b0c87ccc85c7f3fbfc7", "https://storage.googleapis.com/cockroach-godeps/gomod/sourcegraph.com/sourcegraph/appdash/com_sourcegraph_sourcegraph_appdash-v0.0.0-20190731080439-ebfcffb1b5c0.zip": "bd2492d9db05362c2fecd0b3d0f6002c89a6d90d678fb93b4158298ab883736f", "https://storage.googleapis.com/public-bazel-artifacts/bazel/88ef31b429631b787ceb5e4556d773b20ad797c8.zip": "92a89a2bbe6c6db2a8b87da4ce723aff6253656e8417f37e50d362817c39b98b", - "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-gazelle-v0.39.1.tar.gz": "b760f7fe75173886007f7c2e616a21241208f3d90e8657dc65d36a771e916b6a", "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-lib-v1.42.3.tar.gz": "d0529773764ac61184eb3ad3c687fb835df5bee01afedf07f0cf1a45515c96bc", "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel_features-v0.2.0.tar.gz": "1aabce613b3ed83847b47efa69eb5dc9aa3ae02539309792a60e705ca4ab92a5", "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel_gomock-fde78c91cf1783cc1e33ba278922ba67a6ee2a84.tar.gz": "692421b0c5e04ae4bc0bfff42fb1ce8671fe68daee2b8d8ea94657bb1fcddc0a", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazelbuild-bazel-gazelle-v0.33.0-0-g061cc37.zip": "22140e6a7a28df5ec7477f12b286f24dedf8dbef0a12ffbbac10ae80441aa093", "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazelbuild-bazel-skylib-1.3.0-0-g6a17363.tar.gz": "4ede85dfaa97c5662c3fb2042a7ac322d5f029fdc7a6b9daa9423b746e8e8fc0", "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazelbuild-buildtools-v6.3.3-0-gb163fcf.tar.gz": "7929c8fc174f8ab03361796f1417eb0eb5ae4b2a12707238694bec2954145ce4", "https://storage.googleapis.com/public-bazel-artifacts/bazel/bmatcuk-doublestar-v4.0.1-0-gf7a8118.tar.gz": "d11c3b3a45574f89d6a6b2f50e53feea50df60407b35f36193bf5815d32c79d1", "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-protobuf-3f5d91f.tar.gz": "6d4e7fe1cbd958dee69ce9becbf8892d567f082b6782d3973a118d0aa00807a8", "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_foreign_cc-8d34d77.tar.gz": "03afebfc3f173666a3820a29512265c710c3a08d0082ba77469779d3e3af5a11", - "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-530-g7c2d69e.tar.gz": "2443be6856928dab6f92f5e8581bb410159b4ea20033c4fb3432ee282b26efb4", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-459-g734c37d.tar.gz": "ada68324bc20ffd1b557bab4cf8dba9b742570a46a505b0bc99c1fde5132cce5", "https://storage.googleapis.com/public-bazel-artifacts/bazel/google-starlark-go-e043a3d.tar.gz": "a35c6468e0e0921833a63290161ff903295eaaf5915200bbce272cbc8dfd1c1c", "https://storage.googleapis.com/public-bazel-artifacts/bazel/googleapis-83c3605afb5a39952bf0a0809875d41cf2a558ca.zip": "ba694861340e792fd31cb77274eacaf6e4ca8bda97707898f41d8bebfd8a4984", - "https://storage.googleapis.com/public-bazel-artifacts/bazel/platforms-0.0.10.tar.gz": "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/platforms-0.0.4.tar.gz": "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_java-981f06c3d2bd10225e85209904090eb7b5fb26bd.tar.gz": "f5a3e477e579231fca27bf202bb0e8fbe4fc6339d63b38ccb87c2760b533d1c3", - "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_license-1.0.0.tar.gz": "26d4021f6898e23b82ef953078389dd49ac2b5618ac564ade4ef87cced147b38", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_license-0.0.1.tar.gz": "4865059254da674e3d18ab242e21c17f7e3e8c6b1f1421fffa4c5070f82e98b5", "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_oci-v1.4.0.tar.gz": "21a7d14f6ddfcb8ca7c5fc9ffa667c937ce4622c7d2b3e17aea1ffbc90c96bed", "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_pkg-0.7.0.tar.gz": "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", - "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_proto-6.0.2.tar.gz": "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_proto-b0cc14be5da05168b01db282fe93bdf17aa2b9f4.tar.gz": "88b0a90433866b44bb4450d4c30bc5738b8c4f9c9ba14e9661deb123f56a833d", "https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_python-0.1.0.tar.gz": "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0", "https://storage.googleapis.com/public-bazel-artifacts/bazel/sqllogictest-96138842571462ed9a697bff590828d8f6356a2f.tar.gz": "f7e0d659fbefb65f32d4c5d146cba4c73c43e0e96f9b217a756c82be17451f97", "https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libgeos_foreign.linux.20240419-195217.tar.gz": "3c5ffe12ea3e1b92f80f98e509c206b66a780b175c9aba2b085f1c39377c982f", @@ -1225,12 +1215,12 @@ DISTDIR_FILES = { "https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libproj_foreign.macos.20240419-195217.tar.gz": "4b4dadf30e225693723612ede7fc5138eb1ad1b863db744c52099535dbdc3c00", "https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libproj_foreign.macosarm.20240419-195217.tar.gz": "3e3220bd83009de29185772be26022ae219cb006eae1d8dba87292206ce9f4ea", "https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libproj_foreign.windows.20240419-195217.tar.gz": "8284b57f832ab3c5353860ad715e8844c93bf6822b01cb5108b5b494ea90a2dc", - "https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/go1.23.2.darwin-amd64.tar.gz": "51e8aaf8055cef63982dc02fa153544e4238f57d12ac0592f8270136b1838522", - "https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/go1.23.2.darwin-arm64.tar.gz": "c58858973397585303b24830247257116cd7087a4dcf223f389e6294f36cf6bd", - "https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/go1.23.2.linux-amd64.tar.gz": "5a80932e83b683188495096be732260bbbf5a9b41ac7410d8d330783a19d084d", - "https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/go1.23.2.linux-arm64.tar.gz": "b222875b75adb05f04dca09d3ff5f92919bd17c3b52c4124988fc6a769592922", - "https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/go1.23.2.windows-amd64.tar.gz": "55cc36160f61a9662f95752fae9d80c9a3bd013861fad46f1fa0c8f0d3598c5a", - "https://storage.googleapis.com/public-bazel-artifacts/go/20241014-231526/go1.23.2fips.linux-amd64.tar.gz": "523271b256d5ae315600653968b83af1f4a321f3cf54995b115232d4f1911750", + "https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.darwin-amd64.tar.gz": "0eca73b33e9fc3b8eae28c4873b979f5ebd4b7dc8771b9b13ba2d70517309a4d", + "https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.darwin-arm64.tar.gz": "2d72a9301bf73f5429cbc40ba08b6602b1af91a5d5eed302fef2b92ae53b0b56", + "https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.linux-amd64.tar.gz": "477ec7b6f76e6c38d83fbd808af0729299b40a8e99796ac3b2fec50d62e20938", + "https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.linux-arm64.tar.gz": "fbaf48b411d434aad694fddc8a036ce7374f2d8459518a25fec4f58f3bca0c20", + "https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.windows-amd64.tar.gz": "8fc3ccf439e93521faa0411702ef4e598c80ded514bada5fedc11846c284d3d2", + "https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5fips.linux-amd64.tar.gz": "d2a40c2e78e2cf1560cafa304593e194e094c3e4dbd404666dda9cf5cc12b7f1", "https://storage.googleapis.com/public-bazel-artifacts/java/railroad/rr-1.63-java8.zip": "d2791cd7a44ea5be862f33f5a9b3d40aaad9858455828ebade7007ad7113fb41", "https://storage.googleapis.com/public-bazel-artifacts/js/rules_jest-v0.18.4.tar.gz": "d3bb833f74b8ad054e6bff5e41606ff10a62880cc99e4d480f4bdfa70add1ba7", "https://storage.googleapis.com/public-bazel-artifacts/js/rules_js-v1.42.3.tar.gz": "2cfb3875e1231cefd3fada6774f2c0c5a99db0070e0e48ea398acbff7c6c765b", diff --git a/build/bazelutil/staticcheckanalyzers/def.bzl b/build/bazelutil/staticcheckanalyzers/def.bzl index 764c1c37c208..3efba703dbe7 100644 --- a/build/bazelutil/staticcheckanalyzers/def.bzl +++ b/build/bazelutil/staticcheckanalyzers/def.bzl @@ -65,8 +65,6 @@ STATICCHECK_CHECKS = [ "//build/bazelutil/staticcheckanalyzers/sa1028", "//build/bazelutil/staticcheckanalyzers/sa1029", "//build/bazelutil/staticcheckanalyzers/sa1030", - "//build/bazelutil/staticcheckanalyzers/sa1031", - "//build/bazelutil/staticcheckanalyzers/sa1032", "//build/bazelutil/staticcheckanalyzers/sa2000", "//build/bazelutil/staticcheckanalyzers/sa2001", "//build/bazelutil/staticcheckanalyzers/sa2002", @@ -103,7 +101,6 @@ STATICCHECK_CHECKS = [ "//build/bazelutil/staticcheckanalyzers/sa4029", "//build/bazelutil/staticcheckanalyzers/sa4030", "//build/bazelutil/staticcheckanalyzers/sa4031", - "//build/bazelutil/staticcheckanalyzers/sa4032", "//build/bazelutil/staticcheckanalyzers/sa5000", "//build/bazelutil/staticcheckanalyzers/sa5001", "//build/bazelutil/staticcheckanalyzers/sa5002", @@ -121,7 +118,6 @@ STATICCHECK_CHECKS = [ "//build/bazelutil/staticcheckanalyzers/sa6002", "//build/bazelutil/staticcheckanalyzers/sa6003", "//build/bazelutil/staticcheckanalyzers/sa6005", - "//build/bazelutil/staticcheckanalyzers/sa6006", "//build/bazelutil/staticcheckanalyzers/sa9001", "//build/bazelutil/staticcheckanalyzers/sa9002", "//build/bazelutil/staticcheckanalyzers/sa9003", @@ -130,7 +126,6 @@ STATICCHECK_CHECKS = [ "//build/bazelutil/staticcheckanalyzers/sa9006", "//build/bazelutil/staticcheckanalyzers/sa9007", "//build/bazelutil/staticcheckanalyzers/sa9008", - "//build/bazelutil/staticcheckanalyzers/sa9009", "//build/bazelutil/staticcheckanalyzers/st1000", "//build/bazelutil/staticcheckanalyzers/st1001", "//build/bazelutil/staticcheckanalyzers/st1003", diff --git a/build/bazelutil/staticcheckanalyzers/sa1031/BUILD.bazel b/build/bazelutil/staticcheckanalyzers/sa1031/BUILD.bazel deleted file mode 100644 index 3ae753fa84e3..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa1031/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Code generated by generate-staticcheck; DO NOT EDIT. - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "sa1031", - srcs = ["analyzer.go"], - importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa1031", - visibility = ["//visibility:public"], - deps = [ - "//pkg/testutils/lint/passes/staticcheck", - "@co_honnef_go_tools//staticcheck", - "@org_golang_x_tools//go/analysis", - ], -) diff --git a/build/bazelutil/staticcheckanalyzers/sa1031/analyzer.go b/build/bazelutil/staticcheckanalyzers/sa1031/analyzer.go deleted file mode 100644 index 3b96aeb49fbf..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa1031/analyzer.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// Code generated by generate-staticcheck; DO NOT EDIT. -// -//go:build bazel -// +build bazel - -package sa1031 - -import ( - util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/staticcheck" - "golang.org/x/tools/go/analysis" - "honnef.co/go/tools/staticcheck" -) - -var Analyzer *analysis.Analyzer - -func init() { - for _, analyzer := range staticcheck.Analyzers { - if analyzer.Analyzer.Name == "SA1031" { - Analyzer = analyzer.Analyzer - break - } - } - util.MungeAnalyzer(Analyzer) -} diff --git a/build/bazelutil/staticcheckanalyzers/sa1032/BUILD.bazel b/build/bazelutil/staticcheckanalyzers/sa1032/BUILD.bazel deleted file mode 100644 index bd80c7245478..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa1032/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Code generated by generate-staticcheck; DO NOT EDIT. - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "sa1032", - srcs = ["analyzer.go"], - importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa1032", - visibility = ["//visibility:public"], - deps = [ - "//pkg/testutils/lint/passes/staticcheck", - "@co_honnef_go_tools//staticcheck", - "@org_golang_x_tools//go/analysis", - ], -) diff --git a/build/bazelutil/staticcheckanalyzers/sa1032/analyzer.go b/build/bazelutil/staticcheckanalyzers/sa1032/analyzer.go deleted file mode 100644 index be073267a451..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa1032/analyzer.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// Code generated by generate-staticcheck; DO NOT EDIT. -// -//go:build bazel -// +build bazel - -package sa1032 - -import ( - util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/staticcheck" - "golang.org/x/tools/go/analysis" - "honnef.co/go/tools/staticcheck" -) - -var Analyzer *analysis.Analyzer - -func init() { - for _, analyzer := range staticcheck.Analyzers { - if analyzer.Analyzer.Name == "SA1032" { - Analyzer = analyzer.Analyzer - break - } - } - util.MungeAnalyzer(Analyzer) -} diff --git a/build/bazelutil/staticcheckanalyzers/sa4032/BUILD.bazel b/build/bazelutil/staticcheckanalyzers/sa4032/BUILD.bazel deleted file mode 100644 index 0c670c4a4731..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa4032/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Code generated by generate-staticcheck; DO NOT EDIT. - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "sa4032", - srcs = ["analyzer.go"], - importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa4032", - visibility = ["//visibility:public"], - deps = [ - "//pkg/testutils/lint/passes/staticcheck", - "@co_honnef_go_tools//staticcheck", - "@org_golang_x_tools//go/analysis", - ], -) diff --git a/build/bazelutil/staticcheckanalyzers/sa4032/analyzer.go b/build/bazelutil/staticcheckanalyzers/sa4032/analyzer.go deleted file mode 100644 index 76db076a0893..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa4032/analyzer.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// Code generated by generate-staticcheck; DO NOT EDIT. -// -//go:build bazel -// +build bazel - -package sa4032 - -import ( - util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/staticcheck" - "golang.org/x/tools/go/analysis" - "honnef.co/go/tools/staticcheck" -) - -var Analyzer *analysis.Analyzer - -func init() { - for _, analyzer := range staticcheck.Analyzers { - if analyzer.Analyzer.Name == "SA4032" { - Analyzer = analyzer.Analyzer - break - } - } - util.MungeAnalyzer(Analyzer) -} diff --git a/build/bazelutil/staticcheckanalyzers/sa6006/BUILD.bazel b/build/bazelutil/staticcheckanalyzers/sa6006/BUILD.bazel deleted file mode 100644 index 80dc14f5607e..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa6006/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Code generated by generate-staticcheck; DO NOT EDIT. - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "sa6006", - srcs = ["analyzer.go"], - importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa6006", - visibility = ["//visibility:public"], - deps = [ - "//pkg/testutils/lint/passes/staticcheck", - "@co_honnef_go_tools//staticcheck", - "@org_golang_x_tools//go/analysis", - ], -) diff --git a/build/bazelutil/staticcheckanalyzers/sa6006/analyzer.go b/build/bazelutil/staticcheckanalyzers/sa6006/analyzer.go deleted file mode 100644 index e21e79ff8c48..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa6006/analyzer.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// Code generated by generate-staticcheck; DO NOT EDIT. -// -//go:build bazel -// +build bazel - -package sa6006 - -import ( - util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/staticcheck" - "golang.org/x/tools/go/analysis" - "honnef.co/go/tools/staticcheck" -) - -var Analyzer *analysis.Analyzer - -func init() { - for _, analyzer := range staticcheck.Analyzers { - if analyzer.Analyzer.Name == "SA6006" { - Analyzer = analyzer.Analyzer - break - } - } - util.MungeAnalyzer(Analyzer) -} diff --git a/build/bazelutil/staticcheckanalyzers/sa9009/BUILD.bazel b/build/bazelutil/staticcheckanalyzers/sa9009/BUILD.bazel deleted file mode 100644 index 8e8457842a17..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa9009/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Code generated by generate-staticcheck; DO NOT EDIT. - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "sa9009", - srcs = ["analyzer.go"], - importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa9009", - visibility = ["//visibility:public"], - deps = [ - "//pkg/testutils/lint/passes/staticcheck", - "@co_honnef_go_tools//staticcheck", - "@org_golang_x_tools//go/analysis", - ], -) diff --git a/build/bazelutil/staticcheckanalyzers/sa9009/analyzer.go b/build/bazelutil/staticcheckanalyzers/sa9009/analyzer.go deleted file mode 100644 index 211af2f1fe47..000000000000 --- a/build/bazelutil/staticcheckanalyzers/sa9009/analyzer.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// Code generated by generate-staticcheck; DO NOT EDIT. -// -//go:build bazel -// +build bazel - -package sa9009 - -import ( - util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/staticcheck" - "golang.org/x/tools/go/analysis" - "honnef.co/go/tools/staticcheck" -) - -var Analyzer *analysis.Analyzer - -func init() { - for _, analyzer := range staticcheck.Analyzers { - if analyzer.Analyzer.Name == "SA9009" { - Analyzer = analyzer.Analyzer - break - } - } - util.MungeAnalyzer(Analyzer) -} diff --git a/build/bootstrap/bootstrap-debian.sh b/build/bootstrap/bootstrap-debian.sh index 4bc13fb9cf7d..15a12d2d9b4f 100755 --- a/build/bootstrap/bootstrap-debian.sh +++ b/build/bootstrap/bootstrap-debian.sh @@ -49,9 +49,9 @@ sudo tar -C /usr --strip-components=1 -zxf /tmp/cmake.tgz && rm /tmp/cmake.tgz # Install Go. trap 'rm -f /tmp/go.tgz' EXIT -curl -fsSL https://dl.google.com/go/go1.23.2.linux-amd64.tar.gz >/tmp/go.tgz +curl -fsSL https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz >/tmp/go.tgz sha256sum -c - <<EOF -542d3c1705f1c6a1c5a80d5dc62e2e45171af291e755d591c5e6531ef63b454e /tmp/go.tgz +904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0 /tmp/go.tgz EOF sudo tar -C /usr/local -zxf /tmp/go.tgz && rm /tmp/go.tgz diff --git a/build/patches/co_honnef_go_tools.patch b/build/patches/co_honnef_go_tools.patch index d32bbdd5b45f..8dee2b6bb8cf 100644 --- a/build/patches/co_honnef_go_tools.patch +++ b/build/patches/co_honnef_go_tools.patch @@ -1,53 +1,50 @@ -diff --git a/staticcheck/sa1019/sa1019.go b/staticcheck/sa1019/sa1019.go -index 50a40066..c5f9de8b 100644 ---- a/staticcheck/sa1019/sa1019.go -+++ b/staticcheck/sa1019/sa1019.go -@@ -56,6 +56,10 @@ func run(pass *analysis.Pass) (interface{}, error) { +diff --git a/staticcheck/lint.go b/staticcheck/lint.go +index 85bcb21..9fb4cc0 100644 +--- a/staticcheck/lint.go ++++ b/staticcheck/lint.go +@@ -3080,6 +3080,9 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) { } handleDeprecation := func(depr *deprecated.IsDeprecated, node ast.Node, deprecatedObjName string, pkgPath string, tfn types.Object) { + if depr == nil && !isStdlibPath(pkgPath) { + panic(`Cannot pass nil "depr" object if the deprecated object is not from the standard library`) + } -+ - std, ok := knowledge.StdlibDeprecations[deprecatedObjName] - if !ok && isStdlibPath(pkgPath) { - // Deprecated object in the standard library, but we don't know the details of the deprecation. -@@ -98,16 +102,16 @@ func run(pass *analysis.Pass) (interface{}, error) { + // Note: gopls doesn't correctly run analyzers on + // dependencies, so we'll never be able to find deprecated + // objects in imported code. We've experimented with +@@ -3136,16 +3139,16 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) { switch std.AlternativeAvailableSince { case knowledge.DeprecatedNeverUse: report.Report(pass, node, -- fmt.Sprintf("%s has been deprecated since %s because it shouldn't be used: %s", -- report.Render(pass, node), formatGoVersion(std.DeprecatedSince), depr.Msg)) -+ fmt.Sprintf("%s has been deprecated since %s because it shouldn't be used", -+ report.Render(pass, node), formatGoVersion(std.DeprecatedSince))) +- fmt.Sprintf("%s has been deprecated since Go 1.%d because it shouldn't be used: %s", +- report.Render(pass, node), std.DeprecatedSince, depr.Msg)) ++ fmt.Sprintf("%s has been deprecated since Go 1.%d because it shouldn't be used", ++ report.Render(pass, node), std.DeprecatedSince)) case std.DeprecatedSince, knowledge.DeprecatedUseNoLonger: report.Report(pass, node, -- fmt.Sprintf("%s has been deprecated since %s: %s", -- report.Render(pass, node), formatGoVersion(std.DeprecatedSince), depr.Msg)) -+ fmt.Sprintf("%s has been deprecated since %s", -+ report.Render(pass, node), formatGoVersion(std.DeprecatedSince))) +- fmt.Sprintf("%s has been deprecated since Go 1.%d: %s", +- report.Render(pass, node), std.DeprecatedSince, depr.Msg)) ++ fmt.Sprintf("%s has been deprecated since Go 1.%d", ++ report.Render(pass, node), std.DeprecatedSince)) default: report.Report(pass, node, -- fmt.Sprintf("%s has been deprecated since %s and an alternative has been available since %s: %s", -- report.Render(pass, node), formatGoVersion(std.DeprecatedSince), formatGoVersion(std.AlternativeAvailableSince), depr.Msg)) -+ fmt.Sprintf("%s has been deprecated since %s and an alternative has been available since %s", -+ report.Render(pass, node), formatGoVersion(std.DeprecatedSince), formatGoVersion(std.AlternativeAvailableSince))) +- fmt.Sprintf("%s has been deprecated since Go 1.%d and an alternative has been available since Go 1.%d: %s", +- report.Render(pass, node), std.DeprecatedSince, std.AlternativeAvailableSince, depr.Msg)) ++ fmt.Sprintf("%s has been deprecated since Go 1.%d and an alternative has been available since Go 1.%d", ++ report.Render(pass, node), std.DeprecatedSince, std.AlternativeAvailableSince)) } } else { report.Report(pass, node, fmt.Sprintf("%s is deprecated: %s", report.Render(pass, node), depr.Msg)) -@@ -167,7 +171,10 @@ func run(pass *analysis.Pass) (interface{}, error) { +@@ -3185,6 +3188,8 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) { if depr, ok := deprs.Objects[obj]; ok { handleDeprecation(depr, sel, code.SelectorName(pass, sel), obj.Pkg().Path(), tfn) + } else if _, ok := knowledge.StdlibDeprecations[code.SelectorName(pass, sel)]; ok { + handleDeprecation(nil, sel, code.SelectorName(pass, sel), obj.Pkg().Path(), tfn) } -+ return true } - -@@ -204,6 +211,8 @@ func run(pass *analysis.Pass) (interface{}, error) { +@@ -3209,6 +3214,8 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) { } handleDeprecation(depr, spec.Path, path, path, nil) diff --git a/build/patches/com_github_golang_protobuf.patch b/build/patches/com_github_golang_protobuf.patch new file mode 100644 index 000000000000..41f0137881a6 --- /dev/null +++ b/build/patches/com_github_golang_protobuf.patch @@ -0,0 +1,12 @@ +diff -urN a/descriptor/BUILD.bazel b/descriptor/BUILD.bazel +--- a/descriptor/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500 ++++ b/descriptor/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -21,7 +21,7 @@ + visibility = ["//visibility:public"], + deps = [ + "//proto:go_default_library", +- "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", ++ "@com_github_golang_protobuf//protoc-gen-go/descriptor:go_default_library", + "@org_golang_google_protobuf//reflect/protodesc:go_default_library", + "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", + "@org_golang_google_protobuf//runtime/protoimpl:go_default_library", diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch b/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch index e8f54350d609..2ddc6f4ec378 100644 --- a/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch +++ b/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch @@ -1,24 +1,8 @@ diff --git a/src/context/context.go b/src/context/context.go -index 763d4f777f..73739bc90e 100644 +index 80e1787..9dbf2a5 100644 --- a/src/context/context.go +++ b/src/context/context.go -@@ -59,6 +59,7 @@ import ( - "sync" - "sync/atomic" - "time" -+ _ "unsafe" // for go:linkname - ) - - // A Context carries a deadline, a cancellation signal, and other values across -@@ -361,6 +362,7 @@ type stopCtx struct { - var goroutines atomic.Int32 - - // &cancelCtxKey is the key that a cancelCtx returns itself for. -+//go:linkname cancelCtxKey - var cancelCtxKey int - - // parentCancelCtx returns the underlying *cancelCtx for parent. -@@ -477,17 +479,7 @@ func (c *cancelCtx) propagateCancel(parent Context, child canceler) { +@@ -477,17 +477,7 @@ func (c *cancelCtx) propagateCancel(parent Context, child canceler) { if p, ok := parentCancelCtx(parent); ok { // parent is a *cancelCtx, or derives from one. @@ -37,7 +21,7 @@ index 763d4f777f..73739bc90e 100644 return } -@@ -515,6 +507,22 @@ func (c *cancelCtx) propagateCancel(parent Context, child canceler) { +@@ -515,6 +505,22 @@ func (c *cancelCtx) propagateCancel(parent Context, child canceler) { }() } @@ -60,7 +44,7 @@ index 763d4f777f..73739bc90e 100644 type stringer interface { String() string } -@@ -790,3 +798,33 @@ func value(c Context, key any) any { +@@ -788,3 +794,33 @@ func value(c Context, key any) any { } } } @@ -95,7 +79,7 @@ index 763d4f777f..73739bc90e 100644 + return true +} diff --git a/src/crypto/md5/md5.go b/src/crypto/md5/md5.go -index 843678702b..979b453322 100644 +index 83e9e4c..c7a80ea 100644 --- a/src/crypto/md5/md5.go +++ b/src/crypto/md5/md5.go @@ -27,6 +27,10 @@ const Size = 16 @@ -122,10 +106,10 @@ index 843678702b..979b453322 100644 } else { blockGeneric(d, p[:n]) diff --git a/src/crypto/md5/md5_test.go b/src/crypto/md5/md5_test.go -index a5b661126d..5285a13724 100644 +index 851e7fb..e120be3 100644 --- a/src/crypto/md5/md5_test.go +++ b/src/crypto/md5/md5_test.go -@@ -121,10 +121,11 @@ func TestGoldenMarshal(t *testing.T) { +@@ -120,10 +120,11 @@ func TestGoldenMarshal(t *testing.T) { func TestLarge(t *testing.T) { const N = 10000 @@ -139,7 +123,7 @@ index a5b661126d..5285a13724 100644 for i := 0; i < N; i++ { block[offset+i] = '0' + byte(i%10) } -@@ -143,6 +144,32 @@ func TestLarge(t *testing.T) { +@@ -142,6 +143,31 @@ func TestLarge(t *testing.T) { } } @@ -167,13 +151,12 @@ index a5b661126d..5285a13724 100644 + } + } +} -+ + // Tests that blockGeneric (pure Go) and block (in assembly for amd64, 386, arm) match. func TestBlockGeneric(t *testing.T) { gen, asm := New().(*digest), New().(*digest) diff --git a/src/crypto/sha256/sha256.go b/src/crypto/sha256/sha256.go -index 68244fd63b..a2f669fa9c 100644 +index 0cc7fca..a315bbe 100644 --- a/src/crypto/sha256/sha256.go +++ b/src/crypto/sha256/sha256.go @@ -28,6 +28,10 @@ const Size224 = 28 @@ -187,7 +170,7 @@ index 68244fd63b..a2f669fa9c 100644 const ( chunk = 64 init0 = 0x6A09E667 -@@ -186,6 +190,11 @@ func (d *digest) Write(p []byte) (nn int, err error) { +@@ -191,6 +195,11 @@ func (d *digest) Write(p []byte) (nn int, err error) { } if len(p) >= chunk { n := len(p) &^ (chunk - 1) @@ -200,15 +183,13 @@ index 68244fd63b..a2f669fa9c 100644 p = p[n:] } diff --git a/src/crypto/sha256/sha256_test.go b/src/crypto/sha256/sha256_test.go -index d91f01e9ba..f5dd4025d2 100644 +index 7304678..4d5e8bc 100644 --- a/src/crypto/sha256/sha256_test.go +++ b/src/crypto/sha256/sha256_test.go -@@ -184,6 +184,58 @@ func TestGoldenMarshal(t *testing.T) { +@@ -183,6 +183,56 @@ func TestGoldenMarshal(t *testing.T) { } } -+ -+ +func TestLarge(t *testing.T) { + const N = 10000 + const offsets = 4 @@ -263,10 +244,10 @@ index d91f01e9ba..f5dd4025d2 100644 h1 := New() h2 := New224() diff --git a/src/runtime/extern.go b/src/runtime/extern.go -index 2019be4dde..fce67adb7d 100644 +index e42122f..cb019fd 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go -@@ -89,6 +89,10 @@ It is a comma-separated list of name=val pairs setting these named variables: +@@ -92,6 +92,10 @@ It is a comma-separated list of name=val pairs setting these named variables: making every garbage collection a stop-the-world event. Setting gcstoptheworld=2 also disables concurrent sweeping after the garbage collection finishes. @@ -277,91 +258,11 @@ index 2019be4dde..fce67adb7d 100644 gctrace: setting gctrace=1 causes the garbage collector to emit a single line to standard error at each collection, summarizing the amount of memory collected and the length of the pause. The format of this line is subject to change. Included in -diff --git a/src/runtime/lock_futex.go b/src/runtime/lock_futex.go -index 58690e45e4..4aafc3e44d 100644 ---- a/src/runtime/lock_futex.go -+++ b/src/runtime/lock_futex.go -@@ -48,6 +48,7 @@ func mutexContended(l *mutex) bool { - return atomic.Load(key32(&l.key)) > mutex_locked - } - -+//go:linkname lock - func lock(l *mutex) { - lockWithRank(l, getLockRank(l)) - } -@@ -117,6 +118,7 @@ func lock2(l *mutex) { - } - } - -+//go:linkname unlock - func unlock(l *mutex) { - unlockWithRank(l) - } -diff --git a/src/runtime/lock_js.go b/src/runtime/lock_js.go -index b6ee5ec7af..5ca1e3d561 100644 ---- a/src/runtime/lock_js.go -+++ b/src/runtime/lock_js.go -@@ -27,6 +27,7 @@ func mutexContended(l *mutex) bool { - return false - } - -+//go:linkname lock - func lock(l *mutex) { - lockWithRank(l, getLockRank(l)) - } -@@ -45,6 +46,7 @@ func lock2(l *mutex) { - l.key = mutex_locked - } - -+//go:linkname unlock - func unlock(l *mutex) { - unlockWithRank(l) - } -diff --git a/src/runtime/lock_sema.go b/src/runtime/lock_sema.go -index 32d2235ad3..20a0243655 100644 ---- a/src/runtime/lock_sema.go -+++ b/src/runtime/lock_sema.go -@@ -35,6 +35,7 @@ func mutexContended(l *mutex) bool { - return atomic.Loaduintptr(&l.key) > locked - } - -+//go:linkname lock - func lock(l *mutex) { - lockWithRank(l, getLockRank(l)) - } -@@ -99,6 +100,7 @@ Loop: - } - } - -+//go:linkname unlock - func unlock(l *mutex) { - unlockWithRank(l) - } -diff --git a/src/runtime/lock_wasip1.go b/src/runtime/lock_wasip1.go -index acfc62acb4..2c5bd3c590 100644 ---- a/src/runtime/lock_wasip1.go -+++ b/src/runtime/lock_wasip1.go -@@ -23,6 +23,7 @@ func mutexContended(l *mutex) bool { - return false - } - -+//go:linkname lock - func lock(l *mutex) { - lockWithRank(l, getLockRank(l)) - } -@@ -41,6 +42,7 @@ func lock2(l *mutex) { - l.key = mutex_locked - } - -+//go:linkname unlock - func unlock(l *mutex) { - unlockWithRank(l) - } diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go -index b92a213245..112fd876d0 100644 +index e2cb2e4..75bb0b1 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go -@@ -1332,7 +1332,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { +@@ -1336,7 +1336,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { // Returns the G for which the assist credit was accounted. func deductAssistCredit(size uintptr) *g { var assistG *g @@ -371,10 +272,10 @@ index b92a213245..112fd876d0 100644 assistG = getg() if assistG.m.curg != nil { diff --git a/src/runtime/proc.go b/src/runtime/proc.go -index 76c8b71ab9..a96d5a6abc 100644 +index 0616731..88950ff 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go -@@ -1137,6 +1137,11 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) { +@@ -1067,6 +1067,11 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) { dumpgstatus(gp) throw("casfrom_Gscanstatus: gp->status is not in scan state") } @@ -383,13 +284,13 @@ index 76c8b71ab9..a96d5a6abc 100644 + if newval == _Grunning { + gp.lastsched = nanotime() + } - releaseLockRankAndM(lockRankGscan) + releaseLockRank(lockRankGscan) } -@@ -1152,6 +1157,11 @@ func castogscanstatus(gp *g, oldval, newval uint32) bool { +@@ -1082,6 +1087,11 @@ func castogscanstatus(gp *g, oldval, newval uint32) bool { r := gp.atomicstatus.CompareAndSwap(oldval, newval) if r { - acquireLockRankAndM(lockRankGscan) + acquireLockRank(lockRankGscan) + // We're transitioning out of running, record how long we were in the + // state. + if oldval == _Grunning { @@ -398,7 +299,7 @@ index 76c8b71ab9..a96d5a6abc 100644 } return r -@@ -1211,7 +1221,18 @@ func casgstatus(gp *g, oldval, newval uint32) { +@@ -1136,7 +1146,18 @@ func casgstatus(gp *g, oldval, newval uint32) { } } @@ -417,7 +318,7 @@ index 76c8b71ab9..a96d5a6abc 100644 // Track every gTrackingPeriod time a goroutine transitions out of running. if casgstatusAlwaysTrack || gp.trackingSeq%gTrackingPeriod == 0 { gp.tracking = true -@@ -1232,7 +1253,6 @@ func casgstatus(gp *g, oldval, newval uint32) { +@@ -1157,7 +1178,6 @@ func casgstatus(gp *g, oldval, newval uint32) { // We transitioned out of runnable, so measure how much // time we spent in this state and add it to // runnableTime. @@ -425,7 +326,7 @@ index 76c8b71ab9..a96d5a6abc 100644 gp.runnableTime += now - gp.trackingStamp gp.trackingStamp = 0 case _Gwaiting: -@@ -1245,7 +1265,6 @@ func casgstatus(gp *g, oldval, newval uint32) { +@@ -1170,7 +1190,6 @@ func casgstatus(gp *g, oldval, newval uint32) { // a more representative estimate of the absolute value. // gTrackingPeriod also represents an accurate sampling period // because we can only enter this state from _Grunning. @@ -433,7 +334,7 @@ index 76c8b71ab9..a96d5a6abc 100644 sched.totalMutexWaitTime.Add((now - gp.trackingStamp) * gTrackingPeriod) gp.trackingStamp = 0 } -@@ -1256,12 +1275,10 @@ func casgstatus(gp *g, oldval, newval uint32) { +@@ -1181,12 +1200,10 @@ func casgstatus(gp *g, oldval, newval uint32) { break } // Blocking on a lock. Write down the timestamp. @@ -446,8 +347,8 @@ index 76c8b71ab9..a96d5a6abc 100644 gp.trackingStamp = now case _Grunning: // We're transitioning into running, so turn off -@@ -1323,6 +1340,9 @@ func casGToPreemptScan(gp *g, old, new uint32) { - acquireLockRankAndM(lockRankGscan) +@@ -1237,6 +1254,9 @@ func casGToPreemptScan(gp *g, old, new uint32) { + acquireLockRank(lockRankGscan) for !gp.atomicstatus.CompareAndSwap(_Grunning, _Gscan|_Gpreempted) { } + // We're transitioning out of running, record how long we were in the @@ -456,22 +357,22 @@ index 76c8b71ab9..a96d5a6abc 100644 } // casGFromPreempted attempts to transition gp from _Gpreempted to -@@ -4059,6 +4079,14 @@ func dropg() { +@@ -3932,6 +3952,14 @@ func dropg() { setGNoWB(&gp.m.curg, nil) } -+// Grunningnanos returns the wall time spent by current g in the running state. ++// grunningnanos returns the wall time spent by current g in the running state. +// A goroutine may be running on an OS thread that's descheduled by the OS +// scheduler, this time still counts towards the metric. -+func Grunningnanos() int64 { ++func grunningnanos() int64 { + gp := getg() + return gp.runningnanos + nanotime() - gp.lastsched +} + - func parkunlock_c(gp *g, lock unsafe.Pointer) bool { - unlock((*mutex)(lock)) - return true -@@ -4290,6 +4318,8 @@ func gdestroy(gp *g) { + // checkTimers runs any timers for the P that are ready. + // If now is not 0 it is the current time. + // It returns the passed time or the current time if now was passed as 0. +@@ -4203,6 +4231,8 @@ func gdestroy(gp *g) { gp.param = nil gp.labels = nil gp.timer = nil @@ -481,30 +382,30 @@ index 76c8b71ab9..a96d5a6abc 100644 if gcBlackenEnabled != 0 && gp.gcAssistBytes > 0 { // Flush assist credit to the global pool. This gives diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go -index 03ef74b8dc..cb45504fbf 100644 +index afe1bdd..1070b6b 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -316,6 +316,7 @@ var debug struct { - gcpacertrace int32 - gcshrinkstackoff int32 - gcstoptheworld int32 -+ gcnoassist int32 - gctrace int32 - invalidptr int32 - madvdontneed int32 // for Linux; issue 28466 -@@ -374,6 +375,7 @@ var dbgvars = []*dbgVar{ + gcpacertrace int32 + gcshrinkstackoff int32 + gcstoptheworld int32 ++ gcnoassist int32 + gctrace int32 + invalidptr int32 + madvdontneed int32 // for Linux; issue 28466 +@@ -352,6 +353,7 @@ var dbgvars = []*dbgVar{ {name: "gcpacertrace", value: &debug.gcpacertrace}, {name: "gcshrinkstackoff", value: &debug.gcshrinkstackoff}, {name: "gcstoptheworld", value: &debug.gcstoptheworld}, + {name: "gcnoassist", value: &debug.gcnoassist}, {name: "gctrace", value: &debug.gctrace}, - {name: "harddecommit", value: &debug.harddecommit}, - {name: "inittrace", value: &debug.inittrace}, + {name: "invalidptr", value: &debug.invalidptr}, + {name: "madvdontneed", value: &debug.madvdontneed}, diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go -index 4a78963961..da1db551d5 100644 +index 63320d4..6569dc3 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go -@@ -493,7 +493,6 @@ type g struct { +@@ -492,7 +492,6 @@ type g struct { trackingStamp int64 // timestamp of when the G last started being tracked runnableTime int64 // the amount of time spent runnable, cleared when running, only used when tracking lockedm muintptr @@ -512,160 +413,26 @@ index 4a78963961..da1db551d5 100644 writebuf []byte sigcode0 uintptr sigcode1 uintptr -@@ -509,6 +508,10 @@ type g struct { +@@ -507,6 +506,9 @@ type g struct { + labels unsafe.Pointer // profiler labels timer *timer // cached timer for time.Sleep - sleepWhen int64 // when to sleep until selectDone atomic.Uint32 // are we participating in a select and did someone win the race? + sig uint32 + lastsched int64 // timestamp when the G last started running + runningnanos int64 // wall time spent in the running state -+ - // goroutineProfiled indicates the status of this goroutine's stack for the - // current in-progress goroutine profile -@@ -1189,6 +1192,7 @@ var ( + coroarg *coro // argument during coroutine transfers - // len(allp) == gomaxprocs; may change at safe points, otherwise - // immutable. -+ //go:linkname allp - allp []*p - - // Bitmask of Ps in _Pidle list, one bit per P. Reads and writes must diff --git a/src/runtime/sizeof_test.go b/src/runtime/sizeof_test.go -index 43aba98dce..a076c93b8e 100644 +index aa8caaa..7916bde 100644 --- a/src/runtime/sizeof_test.go +++ b/src/runtime/sizeof_test.go -@@ -20,7 +20,7 @@ func TestSizeof(t *testing.T) { +@@ -27,7 +27,7 @@ func TestSizeof(t *testing.T) { _32bit uintptr // size on 32bit platforms _64bit uintptr // size on 64bit platforms }{ -- {runtime.G{}, 272, 432}, // g, but exported for testing -+ {runtime.G{}, 272, 448}, // g, but exported for testing - {runtime.Sudog{}, 56, 88}, // sudog, but exported for testing +- {runtime.G{}, g32bit, 424}, // g, but exported for testing ++ {runtime.G{}, g32bit, 432}, // g, but exported for testing + {runtime.Sudog{}, 56, 88}, // sudog, but exported for testing } -diff --git a/src/runtime/time.go b/src/runtime/time.go -index 6d47eba..3353502 100644 ---- a/src/runtime/time.go -+++ b/src/runtime/time.go -@@ -1114,6 +1114,11 @@ - // started to send the value. That lets them correctly return - // true meaning that no value was sent. - lock(&t.sendLock) -+ -+ // We are committed to possibly sending a value based on seq, -+ // so no need to keep telling stop/modify that we are sending. -+ t.isSending.And(^isSendingClear) -+ - if t.seq != seq { - f = func(any, uintptr, int64) {} - } -@@ -1122,9 +1127,6 @@ - f(arg, seq, delay) - - if !async && t.isChan { -- // We are no longer sending a value. -- t.isSending.And(^isSendingClear) -- - unlock(&t.sendLock) - } - -diff --git a/src/runtime/time.go b/src/runtime/time.go -index 7abd15e..19b4ac9 100644 ---- a/src/runtime/time.go -+++ b/src/runtime/time.go -@@ -33,6 +33,7 @@ - // isSending is used to handle races between running a - // channel timer and stopping or resetting the timer. - // It is used only for channel timers (t.isChan == true). -+ // It is not used for tickers. - // The lowest zero bit is set when about to send a value on the channel, - // and cleared after sending the value. - // The stop/reset code uses this to detect whether it -@@ -467,7 +468,7 @@ - // send from actually happening. That means - // that we should return true: the timer was - // stopped, even though t.when may be zero. -- if t.isSending.Load() > 0 { -+ if t.period == 0 && t.isSending.Load() > 0 { - pending = true - } - } -@@ -529,6 +530,7 @@ - t.maybeRunAsync() - } - t.trace("modify") -+ oldPeriod := t.period - t.period = period - if f != nil { - t.f = f -@@ -570,7 +572,7 @@ - // send from actually happening. That means - // that we should return true: the timer was - // stopped, even though t.when may be zero. -- if t.isSending.Load() > 0 { -+ if oldPeriod == 0 && t.isSending.Load() > 0 { - pending = true - } - } -@@ -1064,7 +1066,7 @@ - - async := debug.asynctimerchan.Load() != 0 - var isSendingClear uint8 -- if !async && t.isChan { -+ if !async && t.isChan && t.period == 0 { - // Tell Stop/Reset that we are sending a value. - // Set the lowest zero bit. - // We do this awkward step because atomic.Uint8 -@@ -1115,9 +1117,12 @@ - // true meaning that no value was sent. - lock(&t.sendLock) - -- // We are committed to possibly sending a value based on seq, -- // so no need to keep telling stop/modify that we are sending. -- t.isSending.And(^isSendingClear) -+ if t.period == 0 { -+ // We are committed to possibly sending a value -+ // based on seq, so no need to keep telling -+ // stop/modify that we are sending. -+ t.isSending.And(^isSendingClear) -+ } - - if t.seq != seq { - f = func(any, uintptr, int64) {} -diff --git a/src/time/sleep_test.go b/src/time/sleep_test.go -index 5357ed2..520ff95 100644 ---- a/src/time/sleep_test.go -+++ b/src/time/sleep_test.go -@@ -847,6 +847,31 @@ - wg.Wait() - } - -+// Test having a large number of goroutines wake up a timer simultaneously. -+// This used to trigger a crash when run under x/tools/cmd/stress. -+func TestMultiWakeup(t *testing.T) { -+ if testing.Short() { -+ t.Skip("-short") -+ } -+ -+ goroutines := runtime.GOMAXPROCS(0) -+ timer := NewTicker(Microsecond) -+ var wg sync.WaitGroup -+ wg.Add(goroutines) -+ for range goroutines { -+ go func() { -+ defer wg.Done() -+ for range 100000 { -+ select { -+ case <-timer.C: -+ case <-After(Millisecond): -+ } -+ } -+ }() -+ } -+ wg.Wait() -+} -+ - // Benchmark timer latency when the thread that creates the timer is busy with - // other work and the timers must be serviced by other threads. - // https://golang.org/issue/38860 diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh b/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh index 42c8999843c1..122536a4be2f 100755 --- a/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh +++ b/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh @@ -9,8 +9,8 @@ set -xeuo pipefail GO_FIPS_REPO=https://github.com/golang-fips/go -GO_FIPS_COMMIT=e982fa08164dabdefde5fd38b35ee3122ee0bb20 -GO_VERSION=1.23.2 +GO_FIPS_COMMIT=8092b8157908b59e5930a1247b6f41842a25f89e +GO_VERSION=1.22.5 # Install build dependencies yum install git golang golang-bin openssl openssl-devel -y @@ -25,11 +25,6 @@ cd /workspace git clone $GO_FIPS_REPO go cd go git checkout $GO_FIPS_COMMIT -# Delete a patch that we don't want. This shouldn't be necessary when we upgrade -# to Ubuntu 24.04. Without this removal, attempting to run the binary on our -# current build infrastructure results in the following error: -# version `GLIBC_2.32' not found (required by external/go_sdk_fips/bin/go) -rm ./patches/017-fix-linkage.patch # Lower the requirements in case we need to bootstrap with an older Go version sed -i "s/go mod tidy/go mod tidy -go=1.16/g" scripts/create-secondary-patch.sh ./scripts/full-initialize-repo.sh "go$GO_VERSION" diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh b/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh index ea486b3dca62..6baff311e1ef 100755 --- a/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh +++ b/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh @@ -9,13 +9,13 @@ set -xeuo pipefail # When updating to a new Go version, update all of these variables. -GOVERS=1.23.2 +GOVERS=1.22.5 GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz -SRCSHASUM=36930162a93df417d90bd22c6e14daff4705baac2b02418edda671cdfa9cd07f +SRCSHASUM=ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6 # We use this for bootstrapping (this is NOT re-published). Note the version # matches the version we're publishing, although it doesn't technically have to. GOLINUXLINK=https://go.dev/dl/go$GOVERS.linux-amd64.tar.gz -LINUXSHASUM=542d3c1705f1c6a1c5a80d5dc62e2e45171af291e755d591c5e6531ef63b454e +LINUXSHASUM=904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0 apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ diff --git a/build/toolchains/BUILD.bazel b/build/toolchains/BUILD.bazel index 96f808d061af..43befebfceee 100644 --- a/build/toolchains/BUILD.bazel +++ b/build/toolchains/BUILD.bazel @@ -413,6 +413,46 @@ config_setting( }, ) +bool_flag( + name = "nogo_flag", + build_setting_default = False, + visibility = ["//visibility:public"], +) + +config_setting( + name = "nogo", + flag_values = { + ":nogo_flag": "true", + ":nogo_disable_flag": "false", + }, +) + +# Note: the flag nonogo_flag and config_setting nonogo_explicit aren't meant +# to be directly used in select()'s. Not using nogo is the default behavior. +# The flag and config_setting are here solely so that they can be used by `dev` +# to check whether an option is configured. +bool_flag( + name = "nonogo_explicit_flag", + build_setting_default = False, + visibility = ["//visibility:public"], +) + +config_setting( + name = "nonogo_explicit", + flag_values = { + ":nonogo_explicit_flag": "true", + }, + visibility = ["//build/bazelutil:__pkg__"], +) + +# Note: nogo_disable can be set to force nogo checks off even if +# `build --config lintonbuild` is set in .bazelrc. +bool_flag( + name = "nogo_disable_flag", + build_setting_default = False, + visibility = ["//visibility:public"], +) + bool_flag( name = "force_build_cdeps_flag", build_setting_default = False, diff --git a/dev b/dev index 044ebfcfd8ea..6ce500f01e3e 100755 --- a/dev +++ b/dev @@ -8,7 +8,7 @@ fi set -euo pipefail # Bump this counter to force rebuilding `dev` on all machines. -DEV_VERSION=101 +DEV_VERSION=102 THIS_DIR=$(cd "$(dirname "$0")" && pwd) BINARY_DIR=$THIS_DIR/bin/dev-versions @@ -21,8 +21,8 @@ fi if [[ ! -f "$BINARY_PATH" ]]; then echo "$BINARY_PATH not found, building..." mkdir -p $BINARY_DIR - bazel build //pkg/cmd/dev --norun_validations --remote_cache= - cp $(bazel info bazel-bin --norun_validations)/pkg/cmd/dev/dev_/dev $BINARY_PATH + bazel build //pkg/cmd/dev --//build/toolchains:nogo_disable_flag --remote_cache= + cp $(bazel info bazel-bin --//build/toolchains:nogo_disable_flag)/pkg/cmd/dev/dev_/dev $BINARY_PATH # The Bazel-built binary won't have write permissions. chmod a+w $BINARY_PATH fi diff --git a/go.mod b/go.mod index 803ac9f37796..df8af80421e1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cockroachdb/cockroach -go 1.23.2 +go 1.22.5 // golang.org/x/* packages are maintained and curated by the go project, just // without the backwards compatibility promises the standard library, and thus @@ -11,8 +11,8 @@ go 1.23.2 // for behavior changes, just like we would after a go upgrade. require ( golang.org/x/crypto v0.26.0 - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa - golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df + golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.28.0 golang.org/x/oauth2 v0.7.0 @@ -87,13 +87,13 @@ require ( ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1 github.com/Azure/go-autorest/autorest/adal v0.9.15 - github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c + github.com/BurntSushi/toml v1.2.1 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/DataDog/datadog-api-client-go/v2 v2.15.0 github.com/DataExMachina-dev/side-eye-go v0.0.0-20240528211710-5eb9c7a69e1d @@ -149,7 +149,7 @@ require ( github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v24.0.6+incompatible github.com/docker/go-connections v0.4.0 - github.com/dustin/go-humanize v1.0.1 + github.com/dustin/go-humanize v1.0.0 github.com/edsrzf/mmap-go v1.0.0 github.com/elastic/gosigar v0.14.3 github.com/emicklei/dot v0.15.0 @@ -161,7 +161,7 @@ require ( github.com/go-openapi/strfmt v0.22.0 github.com/go-sql-driver/mysql v1.6.0 github.com/gogo/status v1.1.0 - github.com/google/flatbuffers v23.1.21+incompatible + github.com/google/flatbuffers v2.0.8+incompatible github.com/google/go-cmp v0.6.0 github.com/google/go-github v17.0.0+incompatible github.com/google/go-github/v42 v42.0.0 @@ -181,7 +181,7 @@ require ( github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible github.com/jordanlewis/gcassert v0.0.0-20240401195008-3141cbd028c0 github.com/kevinburke/go-bindata v3.13.0+incompatible - github.com/kisielk/errcheck v1.7.1-0.20240702033320-b832de3f3c5a + github.com/kisielk/errcheck v1.7.0 github.com/kisielk/gotool v1.0.0 github.com/klauspost/compress v1.17.8 github.com/klauspost/pgzip v1.2.5 @@ -209,11 +209,11 @@ require ( github.com/olekukonko/tablewriter v0.0.5-0.20200416053754-163badb3bac6 github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 github.com/otan/gopgkrb5 v1.0.3 - github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 + github.com/petermattis/goid v0.0.0-20211229010228-4d14c490ee36 github.com/pierrec/lz4/v4 v4.1.21 github.com/pierrre/geohash v1.0.0 github.com/pires/go-proxyproto v0.7.0 - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.0 github.com/prometheus/client_golang v1.16.0 @@ -227,7 +227,7 @@ require ( github.com/sasha-s/go-deadlock v0.3.1 github.com/shirou/gopsutil/v3 v3.21.12 github.com/slack-go/slack v0.9.5 - github.com/snowflakedb/gosnowflake v1.6.25 + github.com/snowflakedb/gosnowflake v1.3.4 github.com/spf13/afero v1.9.2 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 @@ -249,10 +249,9 @@ require ( go.opentelemetry.io/proto/otlp v0.11.0 golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5 golang.org/x/term v0.23.0 - golang.org/x/tools/go/vcs v0.1.0-deprecated gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - honnef.co/go/tools v0.5.1 + honnef.co/go/tools v0.4.5 vitess.io/vitess v0.0.0-00010101000000-000000000000 ) @@ -262,11 +261,10 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/longrunning v0.4.1 // indirect - git.sr.ht/~sbinet/gg v0.3.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.2 // indirect + github.com/99designs/keyring v1.2.1 // indirect github.com/AthenZ/athenz v1.10.39 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect @@ -284,10 +282,9 @@ require ( github.com/Microsoft/go-winio v0.5.2 // indirect github.com/abbot/go-http-auth v0.4.1-0.20181019201920-860ed7f246ff // indirect github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 // indirect - github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect + github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 // indirect github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 // indirect github.com/andybalholm/brotli v1.0.5 // indirect - github.com/apache/arrow/go/v12 v12.0.1 // indirect github.com/apache/thrift v0.16.0 // indirect github.com/ardielle/ardielle-go v1.5.2 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect @@ -311,6 +308,7 @@ require ( github.com/danieljoos/wincred v1.1.2 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/deepmap/oapi-codegen v1.6.0 // indirect + github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/djherbis/atime v1.1.0 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect @@ -320,8 +318,7 @@ require ( github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/fogleman/gg v1.3.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect github.com/go-fonts/liberation v0.2.0 // indirect @@ -340,7 +337,7 @@ require ( github.com/go-openapi/spec v0.20.14 // indirect github.com/go-openapi/swag v0.22.9 // indirect github.com/go-openapi/validate v0.23.0 // indirect - github.com/go-pdf/fpdf v0.6.0 // indirect + github.com/go-pdf/fpdf v0.5.0 // indirect github.com/goccy/go-json v0.10.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect @@ -374,7 +371,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/asmfmt v1.3.2 // indirect - github.com/klauspost/cpuid/v2 v2.2.3 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc v1.0.6 // indirect @@ -442,9 +439,9 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.19.0 // indirect - golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect + golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - gonum.org/v1/plot v0.10.1 // indirect + gonum.org/v1/plot v0.10.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/square/go-jose.v2 v2.5.1 // indirect ) @@ -485,6 +482,3 @@ replace github.com/docker/docker => github.com/moby/moby v24.0.6+incompatible replace golang.org/x/time => github.com/cockroachdb/x-time v0.3.1-0.20230525123634-71747adb5d5c replace google.golang.org/protobuf => google.golang.org/protobuf v1.29.1 - -// Can be removed when we upgrade past v1.7.1. (see https://github.com/snowflakedb/gosnowflake/issues/970) -replace github.com/snowflakedb/gosnowflake => github.com/cockroachdb/gosnowflake v1.6.25 diff --git a/go.sum b/go.sum index 8bb5c7a8473b..ac397019f0cd 100644 --- a/go.sum +++ b/go.sum @@ -72,12 +72,10 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik= -git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= -github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= +github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= +github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AthenZ/athenz v1.10.39 h1:mtwHTF/v62ewY2Z5KWhuZgVXftBej1/Tn80zx4DcawY= @@ -88,16 +86,12 @@ github.com/Azure/azure-sdk-for-go v41.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v57.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 h1:VuHAcMq8pU1IWNT/m5yRaGqbK0BiQKHT8X4DTp9CHdI= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0/go.mod h1:tZoQYdDZNOiIjdSn0dVWVfl0NEPGOJqVLzSrcFk4Is0= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.1 h1:Oj853U9kG+RLTCQXpjvOnrv0WaZHxgmZz1TlLywgOPY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.1/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 h1:TOFrNxfjslms5nLLIMjW7N0+zSALX4KiGsptmpb16AA= github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI= github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 h1:Lg6BW0VPmCwcMlvOviL3ruHFO+H9tZNqscK0AeuFjGM= @@ -110,8 +104,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.0.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 h1:u/LLAOFgsMv7HmNL4Qufg58y+qElGOt5qv0z1mURkRY= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0/go.mod h1:2e8rMJtl2+2j+HXbTBwnyGpm5Nou7KhvSfxOq8JpTag= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1 h1:YvQv9Mz6T8oR5ypQOL6erY0Z5t71ak1uHV4QFokCOZk= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1/go.mod h1:c6WvOhtmjNUWbLfOG1qxM/q0SPvQNSVJvolm+C52dIU= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= @@ -175,8 +169,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzS github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= @@ -277,12 +271,9 @@ github.com/aclements/go-perfevent v0.0.0-20240301234650-f7843625020f/go.mod h1:t github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= -github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c= github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw= -github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -300,7 +291,6 @@ github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:C github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andy-kimball/arenaskl v0.0.0-20200617143215-f701008588b9 h1:vCvyXiLsgAs7qgclk56iBTJQ+gdfiVuzfe5T6sVBL+w= github.com/andy-kimball/arenaskl v0.0.0-20200617143215-f701008588b9/go.mod h1:V2fyPx0Gm2VBNpGPq4z0bjNRaBPR+kC3aSqIuiWCdg4= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= @@ -316,8 +306,6 @@ github.com/apache/arrow/go/arrow v0.0.0-20200923215132-ac86123a3f01 h1:FSqtT0UCk github.com/apache/arrow/go/arrow v0.0.0-20200923215132-ac86123a3f01/go.mod h1:QNYViu/X0HXDHw7m3KXzWSVXIbfUvJqBFe6Gj8/pYA0= github.com/apache/arrow/go/v11 v11.0.0 h1:hqauxvFQxww+0mEU/2XHG6LT7eZternCZq+A5Yly2uM= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= -github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= -github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/pulsar-client-go v0.12.0 h1:rrMlwpr6IgLRPXLRRh2vSlcw5tGV2PUSjZwmqgh2B2I= github.com/apache/pulsar-client-go v0.12.0/go.mod h1:dkutuH4oS2pXiGm+Ti7fQZ4MRjrMPZ8IJeEGAWMeckk= github.com/apache/thrift v0.0.0-20151001171628-53dd39833a08/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -362,36 +350,26 @@ github.com/aws/aws-sdk-go v1.40.37 h1:I+Q6cLctkFyMMrKukcDnj+i2kjrQ37LGiOM6xmsxC4 github.com/aws/aws-sdk-go v1.40.37/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.16.2/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU= -github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.31.0 h1:3V05LbxTSItI5kUqNwhJrrrY1BAXxXt0sN0l72QmG5U= github.com/aws/aws-sdk-go-v2 v1.31.0/go.mod h1:ztolYtaEUtdpf9Wftr31CJfLVjOnD/CVRkKOOYgF8hA= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 h1:70PVAiL15/aBMh5LThwgXdSQorVr91L127ttckI9QQU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4/go.mod h1:/MQxMqci8tlqDH+pjmoLu1i0tbWCUP1hhyMRuFxpQCw= -github.com/aws/aws-sdk-go-v2/config v1.18.19/go.mod h1:XvTmGMY8d52ougvakOv1RpiTLPz9dlG/OQHsKU/cMmY= github.com/aws/aws-sdk-go-v2/config v1.27.31 h1:kxBoRsjhT3pq0cKthgj6RU6bXTm/2SgdoUMyrVw0rAI= github.com/aws/aws-sdk-go-v2/config v1.27.31/go.mod h1:z04nZdSWFPaDwK3DdJOG2r+scLQzMYuJeW0CujEm9FM= -github.com/aws/aws-sdk-go-v2/credentials v1.13.18/go.mod h1:vnwlwjIe+3XJPBYKu1et30ZPABG3VaXJYr8ryohpIyM= github.com/aws/aws-sdk-go-v2/credentials v1.17.30 h1:aau/oYFtibVovr2rDt8FHlU17BTicFEMAi29V1U+L5Q= github.com/aws/aws-sdk-go-v2/credentials v1.17.30/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1/go.mod h1:lfUx8puBRdM5lVVMQlwt2v+ofiG/X6Ms+dy0UkG/kXw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59/go.mod h1:1M4PLSBUVfBI0aP+C9XI7SM6kZPCGYyI6izWz0TGprE= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.16 h1:1FWqcOnvnO0lRsv0kLACwwQquoZIoS5tD0MtfoNdnkk= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.16/go.mod h1:+E8OuB446P/5Swajo40TqenLMzm6aYDEEz6FZDn/u1E= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.9/go.mod h1:AnVH5pvai0pAF4lXRq0bmhbes1u9R8wTE+g+183bZNM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 h1:kYQ3H1u0ANr9KEKlGs/jTLrBFPo8P8NaH/w7A01NeeM= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18/go.mod h1:r506HmK5JDUh9+Mw4CfGJGSSoqIiLCndAuqXuhbv67Y= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.3/go.mod h1:ssOhaLpRlh88H3UmEcsBoVKq309quMvm3Ds8e9d4eJM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 h1:Z7IdFUONvTcvS7YuhtVxN99v2cCoHRXOS4mTr0B/pUc= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18/go.mod h1:DkKMmksZVVyat+Y+r1dEOgJEfUeA7UngIHWeKsi0yNc= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32/go.mod h1:XGhIBZDEgfqmFIugclZ6FU7v75nHhBDtzuB4xB/tEi4= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.23/go.mod h1:uIiFgURZbACBEQJfqTZPb/jxO7R+9LeoHUFudtIdeQI= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.16 h1:mimdLQkIX1zr8GIPY1ZtALdBQGxcASiBd2MOp8m/dMc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.16/go.mod h1:YHk6owoSwrIsok+cAH9PENCOGoH5PU2EllX4vLtSrsY= github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.41.0 h1:+ghQ6Xxpak71do0LvJzNT7MW4XnrqZpsH0j3N3QS4MQ= @@ -400,17 +378,13 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.34.0 h1:dfWleW7/a3+TR6qJynYZsaovCESt github.com/aws/aws-sdk-go-v2/service/ec2 v1.34.0/go.mod h1:37MWOQMGyj8lcranOwo716OHvJgeFJUOaWu6vk1pWNE= github.com/aws/aws-sdk-go-v2/service/iam v1.18.3 h1:wllKL2fLtvfaNAVbXKMRmM/mD1oDNw0hXmDn8mE/6Us= github.com/aws/aws-sdk-go-v2/service/iam v1.18.3/go.mod h1:51xGfEjd1HXnTzw2mAp++qkRo+NyGYblZkuGTsb49yw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 h1:QFASJGfT8wMXtuP3D5CRmMjARHv9ZmzFUMJznHDOY3w= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5/go.mod h1:QdZ3OmoIjSX+8D1OPAzPxDfjXASbBMDsz9qvtyIhtik= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.26/go.mod h1:2UqAAwMUXKeRkAHIlDJqvMVgOWkUi/AUXPk/YIe+Dg4= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.18 h1:GckUnpm4EJOAio1c8o25a+b3lVfwVzC9gnSBqiiNmZM= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.18/go.mod h1:Br6+bxfG33Dk3ynmkhsW2Z/t9D4+lRqdLDNCKi85w0U= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3/go.mod h1:wlY6SVjuwvh3TVRpTqdy4I1JpBFLX4UGeKZdWntaocw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25/go.mod h1:/95IA+0lMnzW6XzqYJRpjjsAbKEORVeO0anQqjd2CNU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 h1:Xbwbmk44URTiHNx6PNo0ujDE6ERlsCKJD3u1zfnzAPg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20/go.mod h1:oAfOFzUB14ltPZj1rWwRc3d/6OgD76R8KlvU3EqM9Fg= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0/go.mod h1:bh2E0CXKZsQN+faiKVqC40vfNMAWheoULBCnEgO9K+8= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.16 h1:jg16PhLPUiHIj8zYIW6bqzeQSuHVEiWnGA0Brz5Xv2I= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.16/go.mod h1:Uyk1zE1VVdsHSU7096h/rwnXDzOzYQVl+FNPhPw7ShY= github.com/aws/aws-sdk-go-v2/service/kafka v1.37.1 h1:ilFPZJMg+zoMEtETfcB2clSMfzDHYt1wGOp9y/KVToc= @@ -419,22 +393,17 @@ github.com/aws/aws-sdk-go-v2/service/kms v1.35.5 h1:XUomV7SiclZl1QuXORdGcfFqHxEH github.com/aws/aws-sdk-go-v2/service/kms v1.35.5/go.mod h1:A5CS0VRmxxj2YKYLCY08l/Zzbd01m6JZn0WzxgT1OCA= github.com/aws/aws-sdk-go-v2/service/rds v1.84.0 h1:y7CROMOdAjkkijg+ClGBa2KnhL7oeOP0mmBFJMSCWPc= github.com/aws/aws-sdk-go-v2/service/rds v1.84.0/go.mod h1:lhiPj6RvoJHWG2STp+k5az55YqGgFLBzkKYdYHgUh9g= -github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0/go.mod h1:ncltU6n4Nof5uJttDtcNQ537uNuwYqsZZQcpkd2/GUQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.61.0 h1:Wb544Wh+xfSXqJ/j3R4aX9wrKUoZsJNmilBYZb3mKQ4= github.com/aws/aws-sdk-go-v2/service/s3 v1.61.0/go.mod h1:BSPI0EfnYUuNHPS0uqIo5VrRwzie+Fp+YhQOUs16sKI= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.33.0 h1:r+37fBAonXAmRx2MX0naWDKZpAaP2AOQ22cf9Cg71GA= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.33.0/go.mod h1:WyLS5qwXHtjKAONYZq/4ewdd+hcVsa3LBu77Ow5uj3k= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.6/go.mod h1:Y1VOmit/Fn6Tz1uFAeCO6Q7M2fmfXSCLeL5INVYsLuY= github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6/go.mod h1:Lh/bc9XUf8CfOY6Jp5aIkQtN+j1mc+nExc+KXj9jx2s= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= -github.com/aws/aws-sdk-go-v2/service/sts v1.18.7/go.mod h1:JuTnSoeePXmMVe9G8NcjjwgOKEfZ4cOjMuT2IBT/2eI= github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wINh+4UK+k/0Yo/q8= github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= -github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.21.0 h1:H7L8dtDRk0P1Qm6y0ji7MCYMQObJ5R9CRpyPhRUkLYA= github.com/aws/smithy-go v1.21.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/axiomhq/hyperloglog v0.0.0-20181223111420-4b99d0c2c99e h1:190ugM9MsyFauTkR/UqcHG/mn5nmFe6SvHJqEHIrtrA= @@ -534,7 +503,6 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -561,8 +529,6 @@ github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/e github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55 h1:YqzBA7tf8Gv8Oz0BbBsPenqkyjiohS7EUIwi7p1QJCU= github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55/go.mod h1:QqVqNIiRhLqJXif5C9wbM4JydBhrAF2WDMxkv5xkyxQ= -github.com/cockroachdb/gosnowflake v1.6.25 h1:hIBSZTKgXseLbibyoPi5pgDRC/7MhMla2Pk/MUFx96U= -github.com/cockroachdb/gosnowflake v1.6.25/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= github.com/cockroachdb/gostdlib v1.19.0 h1:cSISxkVnTlWhTkyple/T6NXzOi5659FkhxvUgZv+Eb0= github.com/cockroachdb/gostdlib v1.19.0/go.mod h1:+dqqpARXbE/gRDEhCak6dm0l14AaTymPZUKMfURjBtY= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= @@ -750,6 +716,7 @@ github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8l github.com/dgraph-io/badger v1.5.3/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= @@ -770,7 +737,6 @@ github.com/djherbis/atime v1.0.0/go.mod h1:5W+KBIuTwVGcqjIfaTwt+KSYX1o6uep8dteve github.com/djherbis/atime v1.1.0 h1:rgwVbP/5by8BvvjBNrbh64Qz33idKT3pSnMSJsxhi0g= github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -793,10 +759,8 @@ github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNE github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/dvyukov/go-fuzz v0.0.0-20210103155950-6a8e9d1f2415/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= @@ -833,7 +797,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.9/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.1/go.mod h1:txg5va2Qkip90uYoSKH+nkAAmXrb2j3iq4FLwdrCbXQ= @@ -853,11 +816,10 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8= -github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15/go.mod h1:tPg4cp4nseejPd+UKxtCVQ2hUxNTZ7qQZJa7CLriIeo= @@ -872,8 +834,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -1060,9 +1020,8 @@ github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE github.com/go-openapi/validate v0.20.2/go.mod h1:e7OJoKNgd0twXZwIn0A43tHbvIcr/rZIVCbJBpTUoY0= github.com/go-openapi/validate v0.23.0 h1:2l7PJLzCis4YUGEoW6eoQw3WhyM65WSIcjX6SQnlfDw= github.com/go-openapi/validate v0.23.0/go.mod h1:EeiAZ5bmpSIOJV1WLfyYF9qp/B1ZgSaEpHTJHtN5cbE= +github.com/go-pdf/fpdf v0.5.0 h1:GHpcYsiDV2hdo77VTOuTF9k1sN8F8IY7NjnCo9x+NPY= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-pdf/fpdf v0.6.0 h1:MlgtGIfsdMEEQJr2le6b/HNr1ZlQwxyWr77r2aj2U/8= -github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= @@ -1106,8 +1065,6 @@ github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY9 github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gocql/gocql v0.0.0-20200228163523-cd4b606dd2fb/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= @@ -1211,9 +1168,8 @@ github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v23.1.21+incompatible h1:bUqzx/MXCDxuS0hRJL2EfjyZL3uQrPbMocUa8zGqsTA= -github.com/google/flatbuffers v23.1.21+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -1227,8 +1183,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= @@ -1282,7 +1236,6 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -1587,14 +1540,13 @@ github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYb github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/go-bindata v3.13.0+incompatible h1:hThDhUBH4KjTyhfXfOgacEPfFBNjltnzl/xzfLfrPoQ= github.com/kevinburke/go-bindata v3.13.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.7.1-0.20240702033320-b832de3f3c5a h1:cCXlZJ+36Cs8X74e/iNNSDmoGWBm4sMYzsjjMjcAhOE= -github.com/kisielk/errcheck v1.7.1-0.20240702033320-b832de3f3c5a/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= +github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= +github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= @@ -1609,8 +1561,6 @@ github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdY github.com/klauspost/compress v1.13.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -1620,9 +1570,8 @@ github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= -github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -1761,7 +1710,6 @@ github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= -github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/mattn/go-zglob v0.0.2-0.20191112051448-a8912a37f9e7/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/mattn/go-zglob v0.0.3 h1:6Ry4EYsScDyt5di4OI6xw1bYhOqfE5S33Z1OPy+d+To= @@ -2005,8 +1953,8 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9 github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= -github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20211229010228-4d14c490ee36 h1:64bxqeTEN0/xoEqhKGowgihNuzISS9rEG6YUMU4bzJo= +github.com/petermattis/goid v0.0.0-20211229010228-4d14c490ee36/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= @@ -2017,8 +1965,6 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrre/compare v1.0.2 h1:k4IUsHgh+dbcAOIWCfxVa/7G6STjADH2qmhomv+1quc= @@ -2031,9 +1977,8 @@ github.com/pires/go-proxyproto v0.0.0-20191211124218-517ecdf5bb2b/go.mod h1:Odh9 github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs= github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -2134,8 +2079,6 @@ github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= @@ -2226,6 +2169,8 @@ github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1 github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/snowflakedb/gosnowflake v1.3.4 h1:Gyoi6g4lMHsilEwW9+KV+bgYkJTgf5pVfvL7Utus920= +github.com/snowflakedb/gosnowflake v1.3.4/go.mod h1:NsRq2QeiMUuoNUJhp5Q6xGC4uBrsS9g6LwZVEkTWgsE= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -2270,7 +2215,6 @@ github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= @@ -2403,7 +2347,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= @@ -2568,11 +2511,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= @@ -2592,12 +2532,10 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= -golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= -golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE= +golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -2608,10 +2546,8 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs= golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20220302094943-723b81ca9867 h1:TcHcE0vrmgzNH1v3ppjcMGbhG5+9fMuvOmUYwNEF4q4= -golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -2635,9 +2571,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= @@ -2695,7 +2629,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -2714,14 +2647,10 @@ golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210907225631-ff17edfbf26d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= @@ -2882,7 +2811,6 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2894,24 +2822,18 @@ golang.org/x/sys v0.0.0-20210908143011-c212e7322662/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -2922,10 +2844,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= @@ -2942,9 +2861,7 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= @@ -3035,7 +2952,6 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -3047,23 +2963,18 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= -golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4= -golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= @@ -3079,9 +2990,8 @@ gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6d gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.0 h1:ymLukg4XJlQnYUJCp+coQq5M7BsUJFk6XQE4HPflwdw= gonum.org/v1/plot v0.10.0/go.mod h1:JWIHJ7U20drSQb/aDpTetJzfC1KlAPldJLpkSy88dvQ= -gonum.org/v1/plot v0.10.1 h1:dnifSs43YJuNMDzB7v8wV64O4ABBHReuAVAoBxqBqS4= -gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20170206182103-3d017632ea10/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= @@ -3238,7 +3148,6 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0-dev.0.20210907181116-2f3355d2244e/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -3318,9 +3227,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= -honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= +honnef.co/go/tools v0.4.5 h1:YGD4H+SuIOOqsyoLOpZDWcieM28W47/zRO7f+9V3nvo= +honnef.co/go/tools v0.4.5/go.mod h1:GUV+uIBCLpdf0/v6UhHHG/yzI/z6qPskBeQCjcNB96k= k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= k8s.io/api v0.17.5/go.mod h1:0zV5/ungglgy2Rlm3QK8fbxkXVs+BSJWpJP/+8gUVLY= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= @@ -3372,57 +3280,11 @@ k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20200414100711-2df71ebbae66/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= -modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= -modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= -modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA= -modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0= -modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= -modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= -modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.18.2/go.mod h1:kvrTLEWgxUcHa2GfHBQtanR1H9ht3hTJNtKpzH9k1u0= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.13.2/go.mod h1:7CLiGIPo1M8Rv1Mitpv5akc2+8fxUd2y2UzC/MfMzy0= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/pkg/acceptance/compose/gss/psql/Dockerfile b/pkg/acceptance/compose/gss/psql/Dockerfile index b4d1728a2cac..e44e298460dd 100644 --- a/pkg/acceptance/compose/gss/psql/Dockerfile +++ b/pkg/acceptance/compose/gss/psql/Dockerfile @@ -1,5 +1,5 @@ # Build the test binary in a multistage build. -FROM golang:1.23 AS builder +FROM golang:1.22 AS builder WORKDIR /workspace COPY . . RUN go test -v -c -tags gss_compose -o gss.test diff --git a/pkg/build/engflow/BUILD.bazel b/pkg/build/engflow/BUILD.bazel index e800bb021259..df4d5a509283 100644 --- a/pkg/build/engflow/BUILD.bazel +++ b/pkg/build/engflow/BUILD.bazel @@ -11,7 +11,7 @@ go_library( "//pkg/build/util", "//pkg/cmd/bazci/githubpost", "//pkg/cmd/bazci/githubpost/issues", - "@com_github_golang_protobuf//proto", + "@com_github_golang_protobuf//proto:go_default_library", "@org_golang_x_net//http2", ], ) diff --git a/pkg/ccl/changefeedccl/BUILD.bazel b/pkg/ccl/changefeedccl/BUILD.bazel index 98367b131975..25daac9561b6 100644 --- a/pkg/ccl/changefeedccl/BUILD.bazel +++ b/pkg/ccl/changefeedccl/BUILD.bazel @@ -193,7 +193,7 @@ go_library( "@com_google_cloud_go_pubsub//apiv1/pubsubpb", "@org_golang_google_api//impersonate", "@org_golang_google_api//option", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//credentials/insecure", "@org_golang_google_grpc//status", @@ -375,7 +375,7 @@ go_test( "@com_google_cloud_go_pubsub//apiv1/pubsubpb", "@com_google_cloud_go_pubsub//pstest", "@org_golang_google_api//option", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//credentials/insecure", "@org_golang_x_text//collate", ], diff --git a/pkg/ccl/multiregionccl/BUILD.bazel b/pkg/ccl/multiregionccl/BUILD.bazel index 6d387ee2290f..d50d8fc4e5bd 100644 --- a/pkg/ccl/multiregionccl/BUILD.bazel +++ b/pkg/ccl/multiregionccl/BUILD.bazel @@ -117,6 +117,6 @@ go_test( "@com_github_jackc_pgx_v4//:pgx", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/ccl/sqlproxyccl/BUILD.bazel b/pkg/ccl/sqlproxyccl/BUILD.bazel index d6b7c8819a71..884ab5a6a99f 100644 --- a/pkg/ccl/sqlproxyccl/BUILD.bazel +++ b/pkg/ccl/sqlproxyccl/BUILD.bazel @@ -51,7 +51,7 @@ go_library( "@com_github_jackc_pgproto3_v2//:pgproto3", "@com_github_pires_go_proxyproto//:go-proxyproto", "@com_github_prometheus_common//expfmt", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//credentials/insecure", "@org_golang_google_grpc//status", diff --git a/pkg/ccl/sqlproxyccl/tenant/BUILD.bazel b/pkg/ccl/sqlproxyccl/tenant/BUILD.bazel index 3a5bf1d5be30..420b7b5abe3b 100644 --- a/pkg/ccl/sqlproxyccl/tenant/BUILD.bazel +++ b/pkg/ccl/sqlproxyccl/tenant/BUILD.bazel @@ -73,7 +73,7 @@ go_test( "//pkg/util/timeutil", "@com_github_cockroachdb_errors//:errors", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", ], diff --git a/pkg/ccl/sqlproxyccl/tenantdirsvr/BUILD.bazel b/pkg/ccl/sqlproxyccl/tenantdirsvr/BUILD.bazel index 264369fb0547..9b2d991a4891 100644 --- a/pkg/ccl/sqlproxyccl/tenantdirsvr/BUILD.bazel +++ b/pkg/ccl/sqlproxyccl/tenantdirsvr/BUILD.bazel @@ -24,7 +24,7 @@ go_library( "@com_github_cockroachdb_logtags//:logtags", "@com_github_gogo_status//:status", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//credentials/insecure", "@org_golang_google_grpc//status", diff --git a/pkg/cli/BUILD.bazel b/pkg/cli/BUILD.bazel index aacd740013b6..45d44298c1dc 100644 --- a/pkg/cli/BUILD.bazel +++ b/pkg/cli/BUILD.bazel @@ -266,7 +266,7 @@ go_library( "@com_google_cloud_go_storage//:storage", "@in_gopkg_yaml_v2//:yaml_v2", "@org_golang_google_api//option", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_x_oauth2//google", @@ -305,15 +305,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@org_golang_x_sys//unix", ], diff --git a/pkg/cmd/bazci/BUILD.bazel b/pkg/cmd/bazci/BUILD.bazel index e7f9fd4bb9de..d8dcc425f578 100644 --- a/pkg/cmd/bazci/BUILD.bazel +++ b/pkg/cmd/bazci/BUILD.bazel @@ -18,7 +18,7 @@ go_library( "@com_github_gogo_protobuf//types", "@com_github_spf13_cobra//:cobra", "@org_golang_google_genproto//googleapis/devtools/build/v1:build", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_protobuf//types/known/emptypb", ], ) diff --git a/pkg/cmd/dev/build.go b/pkg/cmd/dev/build.go index ced2cd8eb281..429ec7fb98e9 100644 --- a/pkg/cmd/dev/build.go +++ b/pkg/cmd/dev/build.go @@ -27,7 +27,7 @@ const ( crossFlag = "cross" cockroachTargetOss = "//pkg/cmd/cockroach-oss:cockroach-oss" cockroachTarget = "//pkg/cmd/cockroach:cockroach" - nogoDisableFlag = "--norun_validations" + nogoDisableFlag = "--//build/toolchains:nogo_disable_flag" geosTarget = "//c-deps:libgeos" devTarget = "//pkg/cmd/dev:dev" ) diff --git a/pkg/cmd/dev/doctor.go b/pkg/cmd/dev/doctor.go index f2f8756f45f0..a7f022cdae0b 100644 --- a/pkg/cmd/dev/doctor.go +++ b/pkg/cmd/dev/doctor.go @@ -291,15 +291,14 @@ Make sure one of the following lines is in the file %s/.bazelrc.user: { name: "nogo_configured", check: func(d *dev, ctx context.Context, cfg doctorConfig) string { - configured := d.checkUsingConfig(cfg.workspace, "lintonbuild") || - d.checkUsingConfig(cfg.workspace, "nolintonbuild") - if !configured { + err := d.exec.CommandContextInheritingStdStreams(ctx, "bazel", "build", "//build/bazelutil:test_nogo_configured") + if err != nil { return "Failed to run `bazel build //build/bazelutil:test_nogo_configured. " + ` This may be because you haven't configured whether to run lints during builds. Put EXACTLY ONE of the following lines in your .bazelrc.user: - build --config=lintonbuild + build --config lintonbuild OR - build --config=nolintonbuild + build --config nolintonbuild The former will run lint checks while you build. This will make incremental builds slightly slower and introduce a noticeable delay in first-time build setup.` } diff --git a/pkg/cmd/dev/lint.go b/pkg/cmd/dev/lint.go index 5f54d44bd5ab..b493c8cc4def 100644 --- a/pkg/cmd/dev/lint.go +++ b/pkg/cmd/dev/lint.go @@ -119,7 +119,7 @@ func (d *dev) lint(cmd *cobra.Command, commandLine []string) error { } if pkg != "" && filter == "" { toLint := strings.TrimPrefix(pkg, "./") - args := []string{"build", toLint, "--run_validations"} + args := []string{"build", toLint, "--//build/toolchains:nogo_flag"} if numCPUs != 0 { args = append(args, fmt.Sprintf("--local_cpu_resources=%d", numCPUs)) } @@ -132,7 +132,7 @@ func (d *dev) lint(cmd *cobra.Command, commandLine []string) error { "//pkg/cmd/dev", "//pkg/cmd/roachprod", "//pkg/cmd/roachtest", - "--run_validations", + "--//build/toolchains:nogo_flag", } if numCPUs != 0 { args = append(args, fmt.Sprintf("--local_cpu_resources=%d", numCPUs)) diff --git a/pkg/cmd/dev/testdata/recorderdriven/lint b/pkg/cmd/dev/testdata/recorderdriven/lint index dc43180b30b7..f8cda1754059 100644 --- a/pkg/cmd/dev/testdata/recorderdriven/lint +++ b/pkg/cmd/dev/testdata/recorderdriven/lint @@ -8,4 +8,4 @@ bazel info workspace --color=no bazel run //pkg/cmd/generate-cgo:generate-cgo '--run_under=cd crdb-checkout && ' which cc bazel test //pkg/testutils/lint:lint_test --nocache_test_results --test_arg -test.v --test_env=COCKROACH_WORKSPACE=crdb-checkout --test_env=HOME=/home/user --sandbox_writable_path=/home/user --test_output streamed --test_env=GO_SDK=/path/to/go/sdk --test_env=CC=/usr/bin/cc --test_env=CXX=/usr/bin/cc -bazel build //pkg/cmd/cockroach-short //pkg/cmd/dev //pkg/cmd/roachprod //pkg/cmd/roachtest --run_validations +bazel build //pkg/cmd/cockroach-short //pkg/cmd/dev //pkg/cmd/roachprod //pkg/cmd/roachtest --//build/toolchains:nogo_flag diff --git a/pkg/cmd/dev/testdata/recorderdriven/lint.rec b/pkg/cmd/dev/testdata/recorderdriven/lint.rec index 96641f0258c2..65aa7f05c362 100644 --- a/pkg/cmd/dev/testdata/recorderdriven/lint.rec +++ b/pkg/cmd/dev/testdata/recorderdriven/lint.rec @@ -19,5 +19,5 @@ which cc bazel test //pkg/testutils/lint:lint_test --nocache_test_results --test_arg -test.v --test_env=COCKROACH_WORKSPACE=crdb-checkout --test_env=HOME=/home/user --sandbox_writable_path=/home/user --test_output streamed --test_env=GO_SDK=/path/to/go/sdk --test_env=CC=/usr/bin/cc --test_env=CXX=/usr/bin/cc ---- -bazel build //pkg/cmd/cockroach-short //pkg/cmd/dev //pkg/cmd/roachprod //pkg/cmd/roachtest --run_validations +bazel build //pkg/cmd/cockroach-short //pkg/cmd/dev //pkg/cmd/roachprod //pkg/cmd/roachtest --//build/toolchains:nogo_flag ---- diff --git a/pkg/cmd/import-tools/main.go b/pkg/cmd/import-tools/main.go index 30c16812b936..9911e69156d6 100644 --- a/pkg/cmd/import-tools/main.go +++ b/pkg/cmd/import-tools/main.go @@ -37,7 +37,6 @@ import ( _ "golang.org/x/perf/cmd/benchstat" _ "golang.org/x/tools/cmd/goyacc" _ "golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow" - _ "golang.org/x/tools/go/vcs" _ "honnef.co/go/tools/cmd/staticcheck" ) diff --git a/pkg/cmd/roachprod/docker/Dockerfile b/pkg/cmd/roachprod/docker/Dockerfile index 286a30e4aefe..a7e63a59d45d 100644 --- a/pkg/cmd/roachprod/docker/Dockerfile +++ b/pkg/cmd/roachprod/docker/Dockerfile @@ -12,7 +12,7 @@ RUN bazel build --config=crosslinux //pkg/cmd/roachprod:roachprod # Copy the roachprod binary to a stable location RUN cp $(bazel info bazel-bin --config=crosslinux)/pkg/cmd/roachprod/roachprod_/roachprod ./ -FROM golang:1.23 +FROM golang:1.22 COPY entrypoint.sh build.sh /build/ RUN ["/build/build.sh"] COPY --from=builder /build/roachprod /usr/local/bin/roachprod diff --git a/pkg/cmd/roachtest/tests/cdc.go b/pkg/cmd/roachtest/tests/cdc.go index c703c8d17445..d1e61346a550 100644 --- a/pkg/cmd/roachtest/tests/cdc.go +++ b/pkg/cmd/roachtest/tests/cdc.go @@ -3766,7 +3766,7 @@ const createMSKTopicBinPath = "/tmp/create-msk-topic" var setupMskTopicScript = fmt.Sprintf(` #!/bin/bash set -e -o pipefail -wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz -O /tmp/go.tar.gz +wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz -O /tmp/go.tar.gz sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf /tmp/go.tar.gz echo export PATH=$PATH:/usr/local/go/bin >> ~/.profile diff --git a/pkg/geo/geos/BUILD.bazel b/pkg/geo/geos/BUILD.bazel index cea737e1e7c6..dc7b13351fff 100644 --- a/pkg/geo/geos/BUILD.bazel +++ b/pkg/geo/geos/BUILD.bazel @@ -42,15 +42,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "-ldl -lm", ], - "@io_bazel_rules_go//go/platform:osx": [ - "-ldl -lm", - ], "@io_bazel_rules_go//go/platform:plan9": [ "-ldl -lm", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "-ldl -lm", - ], "@io_bazel_rules_go//go/platform:solaris": [ "-ldl -lm", ], diff --git a/pkg/gossip/BUILD.bazel b/pkg/gossip/BUILD.bazel index 608dd414443c..572048dd8805 100644 --- a/pkg/gossip/BUILD.bazel +++ b/pkg/gossip/BUILD.bazel @@ -86,7 +86,7 @@ go_test( "//pkg/util/uuid", "@com_github_cockroachdb_errors//:errors", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/gossip/simulation/BUILD.bazel b/pkg/gossip/simulation/BUILD.bazel index 9a84c2ce9214..76c75e8adf3e 100644 --- a/pkg/gossip/simulation/BUILD.bazel +++ b/pkg/gossip/simulation/BUILD.bazel @@ -17,6 +17,6 @@ go_library( "//pkg/util/netutil", "//pkg/util/stop", "//pkg/util/uuid", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/kv/kvclient/kvcoord/BUILD.bazel b/pkg/kv/kvclient/kvcoord/BUILD.bazel index 5cb3ba3d42a5..54ec02522033 100644 --- a/pkg/kv/kvclient/kvcoord/BUILD.bazel +++ b/pkg/kv/kvclient/kvcoord/BUILD.bazel @@ -239,7 +239,7 @@ go_test( "@com_github_sasha_s_go_deadlock//:go-deadlock", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_x_sync//errgroup", diff --git a/pkg/kv/kvclient/kvtenant/BUILD.bazel b/pkg/kv/kvclient/kvtenant/BUILD.bazel index 61e106e08204..96bed8c6b5fc 100644 --- a/pkg/kv/kvclient/kvtenant/BUILD.bazel +++ b/pkg/kv/kvclient/kvtenant/BUILD.bazel @@ -46,7 +46,7 @@ go_library( "//pkg/util/uuid", "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_errors//errorspb", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", ], diff --git a/pkg/kv/kvpb/BUILD.bazel b/pkg/kv/kvpb/BUILD.bazel index 6be0090e411f..07c52028fc66 100644 --- a/pkg/kv/kvpb/BUILD.bazel +++ b/pkg/kv/kvpb/BUILD.bazel @@ -81,7 +81,7 @@ go_test( "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_redact//:redact", "@com_github_gogo_protobuf//proto", - "@com_github_golang_protobuf//proto", + "@com_github_golang_protobuf//proto:go_default_library", "@com_github_kr_pretty//:pretty", "@com_github_stretchr_testify//require", "@org_golang_google_grpc//codes", diff --git a/pkg/kv/kvserver/BUILD.bazel b/pkg/kv/kvserver/BUILD.bazel index 61f2bda93ca7..7b0aefce0c94 100644 --- a/pkg/kv/kvserver/BUILD.bazel +++ b/pkg/kv/kvserver/BUILD.bazel @@ -249,7 +249,7 @@ go_library( "@com_github_prometheus_client_golang//prometheus", "@com_github_prometheus_client_model//go", "@io_opentelemetry_go_otel//attribute", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_x_time//rate", ], ) @@ -550,7 +550,7 @@ go_test( "@com_github_prometheus_common//expfmt", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata", "@org_golang_x_sync//errgroup", "@org_golang_x_sync//syncmap", diff --git a/pkg/kv/kvserver/closedts/sidetransport/BUILD.bazel b/pkg/kv/kvserver/closedts/sidetransport/BUILD.bazel index 7e891ce47049..e94e7fcfe24f 100644 --- a/pkg/kv/kvserver/closedts/sidetransport/BUILD.bazel +++ b/pkg/kv/kvserver/closedts/sidetransport/BUILD.bazel @@ -28,7 +28,7 @@ go_library( "//pkg/util/syncutil", "//pkg/util/timeutil", "@com_github_cockroachdb_errors//:errors", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) @@ -55,7 +55,7 @@ go_test( "//pkg/util/syncutil", "@com_github_cockroachdb_errors//:errors", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/kv/kvserver/loqrecovery/BUILD.bazel b/pkg/kv/kvserver/loqrecovery/BUILD.bazel index b381ad7875c4..83e91343a339 100644 --- a/pkg/kv/kvserver/loqrecovery/BUILD.bazel +++ b/pkg/kv/kvserver/loqrecovery/BUILD.bazel @@ -51,7 +51,7 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_pebble//vfs", "@com_github_cockroachdb_redact//:redact", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_x_sync//errgroup", ], ) diff --git a/pkg/kv/kvserver/replica_application_result_test.go b/pkg/kv/kvserver/replica_application_result_test.go index dbc8cb530684..c5f2dfc996b4 100644 --- a/pkg/kv/kvserver/replica_application_result_test.go +++ b/pkg/kv/kvserver/replica_application_result_test.go @@ -38,7 +38,7 @@ func makeProposalData() *ProposalData { } return &ProposalData{ - ctx: context.WithValue(context.Background(), &contextKeyPtr, "nonempty-ctx"), + ctx: context.WithValue(context.Background(), struct{}{}, "nonempty-ctx"), sp: &tracing.Span{}, idKey: "deadbeef", proposedAtTicks: 1, @@ -119,7 +119,3 @@ func TestReplicaMakeReproposalChaininig(t *testing.T) { _, _ = reproposal, onSuccess // No onSuccess call, assume the proposal failed. verify() } - -type contextKey struct{} - -var contextKeyPtr contextKey diff --git a/pkg/kv/kvserver/storeliveness/BUILD.bazel b/pkg/kv/kvserver/storeliveness/BUILD.bazel index 1f1d044157d1..85569d64e197 100644 --- a/pkg/kv/kvserver/storeliveness/BUILD.bazel +++ b/pkg/kv/kvserver/storeliveness/BUILD.bazel @@ -32,7 +32,7 @@ go_library( "//pkg/util/syncutil", "//pkg/util/timeutil", "@com_github_cockroachdb_errors//:errors", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_x_exp//maps", ], ) diff --git a/pkg/rpc/BUILD.bazel b/pkg/rpc/BUILD.bazel index 9e4fc352c5a0..720d91a88167 100644 --- a/pkg/rpc/BUILD.bazel +++ b/pkg/rpc/BUILD.bazel @@ -67,12 +67,12 @@ go_library( "@com_github_cockroachdb_logtags//:logtags", "@com_github_cockroachdb_redact//:redact", "@com_github_gogo_protobuf//proto", - "@com_github_golang_protobuf//proto", + "@com_github_golang_protobuf//proto:go_default_library", "@com_github_golang_snappy//:snappy", "@com_github_montanaflynn_stats//:stats", "@com_github_vividcortex_ewma//:ewma", "@io_opentelemetry_go_otel//attribute", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//backoff", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//connectivity", @@ -166,7 +166,7 @@ go_test( "@com_github_prometheus_client_model//go", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//credentials", "@org_golang_google_grpc//health/grpc_health_v1", diff --git a/pkg/rpc/auth_test.go b/pkg/rpc/auth_test.go index bebbbf720e65..7352b2f3d495 100644 --- a/pkg/rpc/auth_test.go +++ b/pkg/rpc/auth_test.go @@ -60,7 +60,7 @@ func (s *mockServerStream) RecvMsg(m interface{}) error { func TestWrappedServerStream(t *testing.T) { defer leaktest.AfterTest(t)() ss := mockServerStream{1, 2, 3} - ctx := context.WithValue(context.Background(), &contextKeyPtr, "v") + ctx := context.WithValue(context.Background(), struct{}{}, "v") var recv int wrappedI := rpc.TestingNewWrappedServerStream(ctx, &ss, func(m interface{}) error { @@ -1162,7 +1162,3 @@ func (m mockAuthorizer) HasNodelocalStorageCapability( func (m mockAuthorizer) IsExemptFromRateLimiting(context.Context, roachpb.TenantID) bool { return m.hasExemptFromRateLimiterCapability } - -type contextKey struct{} - -var contextKeyPtr contextKey diff --git a/pkg/rpc/nodedialer/BUILD.bazel b/pkg/rpc/nodedialer/BUILD.bazel index 192eb71c9512..06920cf87620 100644 --- a/pkg/rpc/nodedialer/BUILD.bazel +++ b/pkg/rpc/nodedialer/BUILD.bazel @@ -16,7 +16,7 @@ go_library( "//pkg/util/stop", "//pkg/util/tracing", "@com_github_cockroachdb_errors//:errors", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) @@ -43,7 +43,7 @@ go_test( "@com_github_cockroachdb_errors//:errors", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", ], ) diff --git a/pkg/security/BUILD.bazel b/pkg/security/BUILD.bazel index c539cdde3c52..63180074edaa 100644 --- a/pkg/security/BUILD.bazel +++ b/pkg/security/BUILD.bazel @@ -165,21 +165,11 @@ go_test( "@com_github_prometheus_client_model//go", "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "//pkg/util/log/eventpb", - "@com_github_prometheus_client_model//go", - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "//pkg/util/log/eventpb", "@com_github_prometheus_client_model//go", "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "//pkg/util/log/eventpb", - "@com_github_prometheus_client_model//go", - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "//pkg/util/log/eventpb", "@com_github_prometheus_client_model//go", diff --git a/pkg/server/BUILD.bazel b/pkg/server/BUILD.bazel index d56edb16b426..d98c78705fb7 100644 --- a/pkg/server/BUILD.bazel +++ b/pkg/server/BUILD.bazel @@ -364,7 +364,7 @@ go_library( "@com_github_pires_go_proxyproto//:go-proxyproto", "@com_github_prometheus_common//expfmt", "@in_gopkg_yaml_v2//:yaml_v2", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//metadata", "@org_golang_google_grpc//status", @@ -402,15 +402,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@org_golang_x_sys//unix", ], @@ -594,7 +588,7 @@ go_test( "@com_github_stretchr_testify//require", "@in_gopkg_yaml_v2//:yaml_v2", "@io_opentelemetry_go_otel//attribute", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//metadata", "@org_golang_google_grpc//status", diff --git a/pkg/server/authserver/BUILD.bazel b/pkg/server/authserver/BUILD.bazel index 9819cec8133e..4ea101ccffa8 100644 --- a/pkg/server/authserver/BUILD.bazel +++ b/pkg/server/authserver/BUILD.bazel @@ -43,7 +43,7 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_logtags//:logtags", "@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//metadata", "@org_golang_google_grpc//status", @@ -93,7 +93,7 @@ go_test( "@com_github_gogo_protobuf//jsonpb", "@com_github_lib_pq//:pq", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//credentials", "@org_golang_x_crypto//bcrypt", ], diff --git a/pkg/server/server.go b/pkg/server/server.go index 9e12620b7ab4..15680cc6a608 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -589,11 +589,9 @@ func NewServer(cfg Config, stopper *stop.Stopper) (serverctl.ServerStartupInterf db.SQLKVResponseAdmissionQ = gcoords.Regular.GetWorkQueue(admission.SQLKVResponseWork) db.AdmissionPacerFactory = gcoords.Elastic cbID := goschedstats.RegisterRunnableCountCallback(gcoords.Regular.CPULoad) - if cbID >= 0 { - stopper.AddCloser(stop.CloserFn(func() { - goschedstats.UnregisterRunnableCountCallback(cbID) - })) - } + stopper.AddCloser(stop.CloserFn(func() { + goschedstats.UnregisterRunnableCountCallback(cbID) + })) stopper.AddCloser(gcoords) var admissionControl struct { diff --git a/pkg/server/serverpb/BUILD.bazel b/pkg/server/serverpb/BUILD.bazel index dec568961239..31386ec18d2e 100644 --- a/pkg/server/serverpb/BUILD.bazel +++ b/pkg/server/serverpb/BUILD.bazel @@ -112,7 +112,7 @@ go_library( "//pkg/util/errorutil", "//pkg/util/metric", "@com_github_prometheus_client_model//go", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/server/status/BUILD.bazel b/pkg/server/status/BUILD.bazel index 0adb5c00f88e..a09827dcb031 100644 --- a/pkg/server/status/BUILD.bazel +++ b/pkg/server/status/BUILD.bazel @@ -112,15 +112,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@com_github_shirou_gopsutil_v3//disk", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@com_github_shirou_gopsutil_v3//disk", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@com_github_shirou_gopsutil_v3//disk", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@com_github_shirou_gopsutil_v3//disk", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@com_github_shirou_gopsutil_v3//disk", ], diff --git a/pkg/server/tcp_keepalive_manager.go b/pkg/server/tcp_keepalive_manager.go index b318e0d552d8..a77e5869b5b7 100644 --- a/pkg/server/tcp_keepalive_manager.go +++ b/pkg/server/tcp_keepalive_manager.go @@ -15,6 +15,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/util/log" + "github.com/cockroachdb/cockroach/pkg/util/sysutil" ) var KeepAliveProbeCount = settings.RegisterIntSetting( @@ -61,21 +62,27 @@ func (k *tcpKeepAliveManager) configure(ctx context.Context, conn net.Conn) { // Only log success/failure once. doLog := atomic.CompareAndSwapInt32(&k.loggedKeepAliveStatus, 0, 1) + if err := tcpConn.SetKeepAlive(true); err != nil { + if doLog { + log.Ops.Warningf(ctx, "failed to enable TCP keep-alive for pgwire: %v", err) + } + return + + } // Based on the maximum connection life span and probe interval, pick a maximum // probe count. probeCount := KeepAliveProbeCount.Get(&k.settings.SV) probeFrequency := KeepAliveProbeFrequency.Get(&k.settings.SV) - err := tcpConn.SetKeepAliveConfig(net.KeepAliveConfig{ - Enable: true, - Idle: probeFrequency, - Interval: probeFrequency, - Count: int(probeCount), - }) + if err := sysutil.SetKeepAliveCount(tcpConn, int(probeCount)); err != nil { + if doLog { + log.Ops.Warningf(ctx, "failed to set TCP keep-alive probe count for pgwire: %v", err) + } + } - if err != nil { + if err := tcpConn.SetKeepAlivePeriod(probeFrequency); err != nil { if doLog { - log.Ops.Warningf(ctx, "failed to configure TCP keep-alive for pgwire: %v", err) + log.Ops.Warningf(ctx, "failed to set TCP keep-alive duration for pgwire: %v", err) } return } diff --git a/pkg/sql/colflow/colrpc/BUILD.bazel b/pkg/sql/colflow/colrpc/BUILD.bazel index 5675052a381f..0df705aac5a6 100644 --- a/pkg/sql/colflow/colrpc/BUILD.bazel +++ b/pkg/sql/colflow/colrpc/BUILD.bazel @@ -75,6 +75,6 @@ go_test( "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_logtags//:logtags", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/sql/descriptor_mutation_test.go b/pkg/sql/descriptor_mutation_test.go index 4d49c31e2146..bb226e67d164 100644 --- a/pkg/sql/descriptor_mutation_test.go +++ b/pkg/sql/descriptor_mutation_test.go @@ -65,7 +65,7 @@ func (mt mutationTest) checkTableSize(e int) { // and write the updated table descriptor to the DB. func (mt mutationTest) makeMutationsActive(ctx context.Context) { // Remove mutation to check real values in DB using SQL - if len(mt.tableDesc.Mutations) == 0 { + if mt.tableDesc.Mutations == nil || len(mt.tableDesc.Mutations) == 0 { mt.Fatal("No mutations to make active") } for _, m := range mt.tableDesc.Mutations { diff --git a/pkg/sql/drop_sequence.go b/pkg/sql/drop_sequence.go index b87f6268b60f..9ed8f391dbb3 100644 --- a/pkg/sql/drop_sequence.go +++ b/pkg/sql/drop_sequence.go @@ -260,7 +260,7 @@ func dropDependentOnSequence(ctx context.Context, p *planner, seqDesc *tabledesc continue } - if len(dependent.ColumnIDs) > 0 { + if dependent.ColumnIDs != nil && len(dependent.ColumnIDs) > 0 { // If we reach here, it means this sequence is depended on by a column in `t` // in its default expression. Remove that column's default expression. err = dropDefaultExprInDepColsOnSeq(ctx, p, t, seqDesc.Name, dependent.ColumnIDs) diff --git a/pkg/sql/execinfra/BUILD.bazel b/pkg/sql/execinfra/BUILD.bazel index 91e40c9c244b..9dade23dac90 100644 --- a/pkg/sql/execinfra/BUILD.bazel +++ b/pkg/sql/execinfra/BUILD.bazel @@ -79,7 +79,7 @@ go_library( "@com_github_cockroachdb_redact//:redact", "@com_github_marusama_semaphore//:semaphore", "@io_opentelemetry_go_otel//attribute", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/sql/flowinfra/BUILD.bazel b/pkg/sql/flowinfra/BUILD.bazel index 7238e5471e43..4b35f4e6dfd7 100644 --- a/pkg/sql/flowinfra/BUILD.bazel +++ b/pkg/sql/flowinfra/BUILD.bazel @@ -57,7 +57,7 @@ go_library( "@com_github_cockroachdb_redact//:redact", "@com_github_gogo_protobuf//proto", "@io_opentelemetry_go_otel//attribute", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/sql/pgwire/identmap/ident_map.go b/pkg/sql/pgwire/identmap/ident_map.go index 0be06a558165..f3f298c70ee3 100644 --- a/pkg/sql/pgwire/identmap/ident_map.go +++ b/pkg/sql/pgwire/identmap/ident_map.go @@ -120,7 +120,7 @@ func From(r io.Reader) (*Conf, error) { // Empty returns true if no mappings have been defined. func (c *Conf) Empty() bool { - return len(c.data) == 0 + return c.data == nil || len(c.data) == 0 } // Map returns the database usernames that a system identity maps to diff --git a/pkg/sql/rowexec/processors_test.go b/pkg/sql/rowexec/processors_test.go index 2cad0f11b64a..a0d27345cc2e 100644 --- a/pkg/sql/rowexec/processors_test.go +++ b/pkg/sql/rowexec/processors_test.go @@ -317,7 +317,7 @@ func TestProcessorBaseContext(t *testing.T) { defer log.Scope(t).Close(t) // Use a custom context to distinguish it from the background one. - ctx := context.WithValue(context.Background(), &contextKeyPtr, struct{}{}) + ctx := context.WithValue(context.Background(), struct{}{}, struct{}{}) st := cluster.MakeTestingClusterSettings() runTest := func(t *testing.T, f func(noop *noopProcessor)) { @@ -933,7 +933,3 @@ func testReaderProcessorDrain( } }) } - -type contextKey struct{} - -var contextKeyPtr contextKey diff --git a/pkg/sql/schemachanger/rel/query_data.go b/pkg/sql/schemachanger/rel/query_data.go index 42ff9f4dccb3..f652f8ef8d9f 100644 --- a/pkg/sql/schemachanger/rel/query_data.go +++ b/pkg/sql/schemachanger/rel/query_data.go @@ -63,7 +63,7 @@ func (tv typedValue) toValue() reflect.Value { } return reflect.ValueOf(tv.value).Convert(tv.typ) } - return reflect.ValueOf(tv.value).Convert(reflect.PointerTo(tv.typ)).Elem() + return reflect.ValueOf(tv.value).Convert(reflect.PtrTo(tv.typ)).Elem() } func (tv typedValue) toInterface() interface{} { diff --git a/pkg/sql/schemachanger/rel/schema.go b/pkg/sql/schemachanger/rel/schema.go index 198df15e91d7..bd51a7e6e15f 100644 --- a/pkg/sql/schemachanger/rel/schema.go +++ b/pkg/sql/schemachanger/rel/schema.go @@ -426,7 +426,7 @@ func (sb *schemaBuilder) addTypeAttrMapping( } else if !f.isSlice() { compType := getComparableType(typ) if f.isPtr() && f.isScalar() { - compType = reflect.PointerTo(compType) + compType = reflect.PtrTo(compType) } vg := makeValueGetter(compType, offset) if f.isPtr() && f.isScalar() { @@ -521,5 +521,5 @@ func makeSliceMemberType(srcType, sliceType reflect.Type, valueFieldName string) Name: valueFieldName, Type: sliceType.Elem(), }, } - return reflect.PointerTo(reflect.StructOf(fields[:])) + return reflect.PtrTo(reflect.StructOf(fields[:])) } diff --git a/pkg/sql/schemachanger/rel/schema_value.go b/pkg/sql/schemachanger/rel/schema_value.go index a9dfce9bfe22..346a54660924 100644 --- a/pkg/sql/schemachanger/rel/schema_value.go +++ b/pkg/sql/schemachanger/rel/schema_value.go @@ -36,7 +36,7 @@ func makeComparableValue(val interface{}) (typedValue, error) { vvNew.Elem().Set(vv) return typedValue{ typ: vv.Type(), - value: vvNew.Convert(reflect.PointerTo(compType)).Interface(), + value: vvNew.Convert(reflect.PtrTo(compType)).Interface(), }, nil case typ.Kind() == reflect.Ptr: switch { @@ -44,7 +44,7 @@ func makeComparableValue(val interface{}) (typedValue, error) { compType := getComparableType(typ.Elem()) return typedValue{ typ: vv.Type().Elem(), - value: vv.Convert(reflect.PointerTo(compType)).Interface(), + value: vv.Convert(reflect.PtrTo(compType)).Interface(), }, nil case typ.Elem().Kind() == reflect.Struct: return typedValue{ diff --git a/pkg/testutils/lint/passes/errcmp/errcmp.go b/pkg/testutils/lint/passes/errcmp/errcmp.go index e548287294dc..2855dc1fcbfd 100644 --- a/pkg/testutils/lint/passes/errcmp/errcmp.go +++ b/pkg/testutils/lint/passes/errcmp/errcmp.go @@ -102,7 +102,6 @@ Alternatives: func isEOFError(e ast.Expr) bool { if s, ok := e.(*ast.SelectorExpr); ok { - //lint:ignore SA1019 Need to replace use of ast.Object (#132181) if io, ok := s.X.(*ast.Ident); ok && io.Name == "io" && io.Obj == (*ast.Object)(nil) { if s.Sel.Name == "EOF" || s.Sel.Name == "ErrUnexpectedEOF" { return true diff --git a/pkg/testutils/serverutils/BUILD.bazel b/pkg/testutils/serverutils/BUILD.bazel index 1358e0f66545..ef96f0939e41 100644 --- a/pkg/testutils/serverutils/BUILD.bazel +++ b/pkg/testutils/serverutils/BUILD.bazel @@ -50,7 +50,7 @@ go_library( "//pkg/util/tracing", "//pkg/util/uuid", "@com_github_cockroachdb_errors//:errors", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/ts/BUILD.bazel b/pkg/ts/BUILD.bazel index 90782afeb68e..323c2f43948f 100644 --- a/pkg/ts/BUILD.bazel +++ b/pkg/ts/BUILD.bazel @@ -42,7 +42,7 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_redact//:redact", "@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", ], diff --git a/pkg/upgrade/upgradecluster/BUILD.bazel b/pkg/upgrade/upgradecluster/BUILD.bazel index ad8fb9e5f149..677b86158d08 100644 --- a/pkg/upgrade/upgradecluster/BUILD.bazel +++ b/pkg/upgrade/upgradecluster/BUILD.bazel @@ -26,7 +26,7 @@ go_library( "//pkg/util/retry", "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_redact//:redact", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) @@ -53,6 +53,6 @@ go_test( "//pkg/util/leaktest", "//pkg/util/retry", "//pkg/util/syncutil", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/util/ctxutil/BUILD.bazel b/pkg/util/ctxutil/BUILD.bazel index 07cb0158bd08..339a42d3079a 100644 --- a/pkg/util/ctxutil/BUILD.bazel +++ b/pkg/util/ctxutil/BUILD.bazel @@ -6,7 +6,6 @@ go_library( "canceler_1_20.go", "canceler_1_21_bazel.go", "context.go", - "context_linkname.go", "doc.go", ], importpath = "github.com/cockroachdb/cockroach/pkg/util/ctxutil", @@ -20,10 +19,7 @@ go_library( go_test( name = "ctxutil_test", - srcs = [ - "context_linkname_test.go", - "context_test.go", - ], + srcs = ["context_test.go"], embed = [":ctxutil"], deps = [ "//pkg/util/leaktest", diff --git a/pkg/util/ctxutil/context.go b/pkg/util/ctxutil/context.go index 3461c957b038..63eaf3a2daf7 100644 --- a/pkg/util/ctxutil/context.go +++ b/pkg/util/ctxutil/context.go @@ -5,5 +5,75 @@ package ctxutil +import ( + "context" + _ "unsafe" // Must import unsafe to enable linkname. + + "github.com/cockroachdb/cockroach/pkg/util/buildutil" + "github.com/cockroachdb/cockroach/pkg/util/log" +) + // WhenDoneFunc is the callback invoked by context when it becomes done. type WhenDoneFunc func() + +// WhenDone arranges for the specified function to be invoked when +// parent context becomes done and returns true. +// If the context is non-cancellable (i.e. `Done() == nil`), returns false and +// never calls the function. +// If the parent context is derived from context.WithCancel or +// context.WithTimeout/Deadline, then no additional goroutines are created. +// Otherwise, a goroutine is spun up by context.Context to detect +// parent cancellation. +// +// Please be careful when using this function on the parent context +// that may already be done. In particular, be mindful of the dangers of +// the done function acquiring locks: +// +// func bad(ctx context.Context) { +// var l syncutil.Mutex +// l.Lock() +// defer l.Unlock() +// ctxutil.WhenDone(ctx, func() { +// l.Lock() // <-- Deadlock if ctx is already done. +// }) +// return +// } +func WhenDone(parent context.Context, done WhenDoneFunc) bool { + if parent.Done() == nil { + return false + } + + // All contexts that complete (ctx.Done() != nil) used in cockroach should + // support direct cancellation detection, since they should be derived from + // one of the standard context.Context. + // But, be safe and loudly fail tests in case somebody introduces strange + // context implementation. + if buildutil.CrdbTestBuild && !CanDirectlyDetectCancellation(parent) { + log.Fatalf(parent, "expected context that supports direct cancellation detection, found %T", parent) + } + + propagateCancel(parent, done) + return true +} + +// CanDirectlyDetectCancellation checks to make sure that the parent +// context can be used to detect parent cancellation without the need +// to spin up goroutine. +// That would mean that the parent context is derived from +// context.WithCancel or context.WithTimeout/Deadline. +// Even if parent is not derived from one of the above contexts (i.e. it +// is a custom implementation), WhenDone function can still be used; it just +// means that there will be an additional goroutine spun up. As such, +// this function is meant to be used in test environment only. +func CanDirectlyDetectCancellation(parent context.Context) bool { + // context.parentCancelCtx would have been preferred mechanism to check + // if the cancellation can be propagated; alas, this function returns + // an unexported *cancelCtx, which we do not have access to. + // So, instead try to do what that method essentially does by + // getting access to internal cancelCtxKey. + cancellable, ok := parent.Value(&context_cancelCtxKey).(context.Context) + return ok && cancellable.Done() == parent.Done() +} + +//go:linkname context_cancelCtxKey context.cancelCtxKey +var context_cancelCtxKey int diff --git a/pkg/util/ctxutil/context_linkname.go b/pkg/util/ctxutil/context_linkname.go deleted file mode 100644 index c17fbff1d5dc..000000000000 --- a/pkg/util/ctxutil/context_linkname.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2023 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// This file includes an implementation of WhenDone for builds using our Go -// fork, or versions of Go prior to 1.23. These Go versions will permit the use -// of go:linkname on the object context.cancelCtxKey. -// -//go:build bazel || (gc && !go1.23) - -package ctxutil - -import ( - "context" - _ "unsafe" // Must import unsafe to enable linkname. - - "github.com/cockroachdb/cockroach/pkg/util/buildutil" - "github.com/cockroachdb/cockroach/pkg/util/log" -) - -// WhenDone arranges for the specified function to be invoked when -// parent context becomes done and returns true. -// If the context is non-cancellable (i.e. `Done() == nil`), returns false and -// never calls the function. -// If the parent context is derived from context.WithCancel or -// context.WithTimeout/Deadline, then no additional goroutines are created. -// Otherwise, a goroutine is spun up by context.Context to detect -// parent cancellation. -// -// Please be careful when using this function on the parent context -// that may already be done. In particular, be mindful of the dangers of -// the done function acquiring locks: -// -// func bad(ctx context.Context) { -// var l syncutil.Mutex -// l.Lock() -// defer l.Unlock() -// ctxutil.WhenDone(ctx, func() { -// l.Lock() // <-- Deadlock if ctx is already done. -// }) -// return -// } -func WhenDone(parent context.Context, done WhenDoneFunc) bool { - if parent.Done() == nil { - return false - } - - // All contexts that complete (ctx.Done() != nil) used in cockroach should - // support direct cancellation detection, since they should be derived from - // one of the standard context.Context. - // But, be safe and loudly fail tests in case somebody introduces strange - // context implementation. - if buildutil.CrdbTestBuild && !canDirectlyDetectCancellation(parent) { - log.Fatalf(parent, "expected context that supports direct cancellation detection, found %T", parent) - } - - propagateCancel(parent, done) - return true -} - -// canDirectlyDetectCancellation checks to make sure that the parent -// context can be used to detect parent cancellation without the need -// to spin up goroutine. -// That would mean that the parent context is derived from -// context.WithCancel or context.WithTimeout/Deadline. -// Even if parent is not derived from one of the above contexts (i.e. it -// is a custom implementation), WhenDone function can still be used; it just -// means that there will be an additional goroutine spun up. As such, -// this function is meant to be used in test environment only. -func canDirectlyDetectCancellation(parent context.Context) bool { - // context.parentCancelCtx would have been preferred mechanism to check - // if the cancellation can be propagated; alas, this function returns - // an unexported *cancelCtx, which we do not have access to. - // So, instead try to do what that method essentially does by - // getting access to internal cancelCtxKey. - cancellable, ok := parent.Value(&context_cancelCtxKey).(context.Context) - return ok && cancellable.Done() == parent.Done() -} - -//go:linkname context_cancelCtxKey context.cancelCtxKey -var context_cancelCtxKey int diff --git a/pkg/util/ctxutil/context_linkname_test.go b/pkg/util/ctxutil/context_linkname_test.go deleted file mode 100644 index ff16aef391ee..000000000000 --- a/pkg/util/ctxutil/context_linkname_test.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2023 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -//go:build bazel || (gc && !go1.23) - -package ctxutil - -import ( - "context" - "testing" - "time" - - "github.com/cockroachdb/cockroach/pkg/util/leaktest" - "github.com/stretchr/testify/require" -) - -func TestCanPropagateCancellation(t *testing.T) { - defer leaktest.AfterTest(t)() - - t.Run("withCancel", func(t *testing.T) { - parent, cancelParent := context.WithCancel(context.Background()) - defer cancelParent() - require.True(t, canDirectlyDetectCancellation(parent)) - }) - - t.Run("withCancelEmbed", func(t *testing.T) { - parent, cancelParent := context.WithCancel(context.Background()) - defer cancelParent() - ctx := &myCtx{parent} - require.True(t, canDirectlyDetectCancellation(ctx)) - }) - - t.Run("nested", func(t *testing.T) { - parent, cancelParent := context.WithCancel(context.Background()) - defer cancelParent() - timeoutCtx, cancelTimeout := context.WithTimeout(parent, time.Hour) - defer cancelTimeout() - ctx := &myCtx{timeoutCtx} - require.True(t, canDirectlyDetectCancellation(ctx)) - }) - - t.Run("nonCancellable", func(t *testing.T) { - require.False(t, canDirectlyDetectCancellation(context.Background())) - }) - - t.Run("nonCancellableCustom", func(t *testing.T) { - require.False(t, canDirectlyDetectCancellation(&noOpCtx{})) - }) - - t.Run("nonCancellableCustomEmbed", func(t *testing.T) { - require.False(t, canDirectlyDetectCancellation(&myCtx{&noOpCtx{}})) - }) -} - -type myCtx struct { - context.Context -} - -type noOpCtx struct{} - -var _ context.Context = (*noOpCtx)(nil) - -func (n *noOpCtx) Deadline() (deadline time.Time, ok bool) { - return time.Time{}, false -} - -func (n *noOpCtx) Done() <-chan struct{} { - return nil -} - -func (n *noOpCtx) Err() error { - return nil -} - -func (n *noOpCtx) Value(key any) any { - return nil -} diff --git a/pkg/util/ctxutil/context_no_linkname.go b/pkg/util/ctxutil/context_no_linkname.go deleted file mode 100644 index 90721904fa54..000000000000 --- a/pkg/util/ctxutil/context_no_linkname.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// This file includes an implementation of WhenDone for builds after Go 1.23 -// that do not use our Go fork. -// -//go:build !bazel && gc && go1.23 - -package ctxutil - -import "context" - -// WhenDone arranges for the specified function to be invoked when -// parent context becomes done and returns true. -// See context_bazel.go for the full documentation on this function. -// This version does the same but is missing an assertion that requires the -// patched Go runtime to work properly. -func WhenDone(parent context.Context, done WhenDoneFunc) bool { - if parent.Done() == nil { - return false - } - - propagateCancel(parent, done) - return true -} diff --git a/pkg/util/ctxutil/context_test.go b/pkg/util/ctxutil/context_test.go index f34a07be0f32..c842cbb3a764 100644 --- a/pkg/util/ctxutil/context_test.go +++ b/pkg/util/ctxutil/context_test.go @@ -44,3 +44,65 @@ func TestWhenDone(t *testing.T) { waitDone() }) } + +func TestCanPropagateCancellation(t *testing.T) { + defer leaktest.AfterTest(t)() + + t.Run("withCancel", func(t *testing.T) { + parent, cancelParent := context.WithCancel(context.Background()) + defer cancelParent() + require.True(t, CanDirectlyDetectCancellation(parent)) + }) + + t.Run("withCancelEmbed", func(t *testing.T) { + parent, cancelParent := context.WithCancel(context.Background()) + defer cancelParent() + ctx := &myCtx{parent} + require.True(t, CanDirectlyDetectCancellation(ctx)) + }) + + t.Run("nested", func(t *testing.T) { + parent, cancelParent := context.WithCancel(context.Background()) + defer cancelParent() + timeoutCtx, cancelTimeout := context.WithTimeout(parent, time.Hour) + defer cancelTimeout() + ctx := &myCtx{timeoutCtx} + require.True(t, CanDirectlyDetectCancellation(ctx)) + }) + + t.Run("nonCancellable", func(t *testing.T) { + require.False(t, CanDirectlyDetectCancellation(context.Background())) + }) + + t.Run("nonCancellableCustom", func(t *testing.T) { + require.False(t, CanDirectlyDetectCancellation(&noOpCtx{})) + }) + + t.Run("nonCancellableCustomEmbed", func(t *testing.T) { + require.False(t, CanDirectlyDetectCancellation(&myCtx{&noOpCtx{}})) + }) +} + +type myCtx struct { + context.Context +} + +type noOpCtx struct{} + +var _ context.Context = (*noOpCtx)(nil) + +func (n *noOpCtx) Deadline() (deadline time.Time, ok bool) { + return time.Time{}, false +} + +func (n *noOpCtx) Done() <-chan struct{} { + return nil +} + +func (n *noOpCtx) Err() error { + return nil +} + +func (n *noOpCtx) Value(key any) any { + return nil +} diff --git a/pkg/util/goschedstats/BUILD.bazel b/pkg/util/goschedstats/BUILD.bazel index 8228dceddabc..b31ce88bef1f 100644 --- a/pkg/util/goschedstats/BUILD.bazel +++ b/pkg/util/goschedstats/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "goschedstats", srcs = [ "runnable.go", - "runnable_common.go", "runtime_go1.19.go", "runtime_go1.20_21_22.go", "runtime_go1.23.go", diff --git a/pkg/util/goschedstats/runnable.go b/pkg/util/goschedstats/runnable.go index ec464ee7ed89..9d9395c25496 100644 --- a/pkg/util/goschedstats/runnable.go +++ b/pkg/util/goschedstats/runnable.go @@ -2,13 +2,6 @@ // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. -// -// This file contains the proper logic of the public functions in the -// goschedstats package. We only have access to the internal logic if we are -// using a version of Go prior to 1.23, or are using our fork that has more -// permissive logic for go:linkname. -// -//go:build bazel || (gc && !go1.23) package goschedstats @@ -35,6 +28,20 @@ func CumulativeNormalizedRunnableGoroutines() float64 { return float64(atomic.LoadUint64(&total)) * fromFixedPoint } +// RecentNormalizedRunnableGoroutines returns a recent average of the number of +// runnable goroutines per GOMAXPROC. +// +// Runnable goroutines are goroutines which are ready to run but are waiting for +// an available process. Sustained high numbers of waiting goroutines are a +// potential indicator of high CPU saturation (overload). +// +// The number of runnable goroutines is sampled frequently, and an average is +// calculated once per second. This function returns an exponentially weighted +// moving average of these values. +func RecentNormalizedRunnableGoroutines() float64 { + return float64(atomic.LoadUint64(&ewma)) * fromFixedPoint +} + // If you get a compilation error here, the Go version you are using is not // supported by this package. Cross-check the structures in runtime_go1.18.go // against those in the new Go's runtime, and if they are still accurate adjust @@ -86,6 +93,10 @@ var total uint64 // The EWMA coefficient is 0.5. var ewma uint64 +// RunnableCountCallback is provided the current value of runnable goroutines, +// GOMAXPROCS, and the current sampling period. +type RunnableCountCallback func(numRunnable int, numProcs int, samplePeriod time.Duration) + type callbackWithID struct { RunnableCountCallback id int64 @@ -111,12 +122,6 @@ var callbackInfo struct { // quickly to large drops in runnable due to blocking on IO, so that we don't // waste cpu -- a workload that fluctuates rapidly between being IO bound and // cpu bound could stress the usage of a smoothed signal). -// -// This function returns a unique ID for this callback which can be un-registered -// by passing the ID to UnregisterRunnableCountCallback. Notably, this function -// may return a negative number if we have no access to the internal Goroutine -// machinery (i.e. if we running a recent upstream version of Go; *not* our -// internal fork). In this case, the callback has not been registered. func RegisterRunnableCountCallback(cb RunnableCountCallback) (id int64) { callbackInfo.mu.Lock() defer callbackInfo.mu.Unlock() @@ -237,3 +242,5 @@ func (s *schedStatsTicker) getStatsOnTick( s.sum += uint64(runnable) * toFixedPoint / uint64(numProcs) s.numSamples++ } + +var _ = RecentNormalizedRunnableGoroutines diff --git a/pkg/util/goschedstats/runnable_common.go b/pkg/util/goschedstats/runnable_common.go deleted file mode 100644 index 76a44e2ef668..000000000000 --- a/pkg/util/goschedstats/runnable_common.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2024 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. - -package goschedstats - -import "time" - -// RunnableCountCallback is provided the current value of runnable goroutines, -// GOMAXPROCS, and the current sampling period. -type RunnableCountCallback func(numRunnable int, numProcs int, samplePeriod time.Duration) diff --git a/pkg/util/goschedstats/runnable_disabled.go b/pkg/util/goschedstats/runnable_disabled.go deleted file mode 100644 index 114508d49735..000000000000 --- a/pkg/util/goschedstats/runnable_disabled.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. -// -// This file contains stub definitions in the event that we do not have access -// to the internal goroutine machinery. This would be because we are using an -// upstream Go (not our fork) and are running a version after 1.23. -// -//go:build !bazel && gc && go1.23 - -package goschedstats - -// CumulativeNormalizedRunnableGoroutines returns 0.0. -func CumulativeNormalizedRunnableGoroutines() float64 { - return 0.0 -} - -// RegisterRunnableCountCallback does nothing and returns -1. -func RegisterRunnableCountCallback(cb RunnableCountCallback) (id int64) { - return -1 -} - -// UnregisterRunnableCountCallback is a no-op. -func UnregisterRunnableCountCallback(id int64) {} diff --git a/pkg/util/goschedstats/runnable_test.go b/pkg/util/goschedstats/runnable_test.go index ed6172edf950..07e28e2dd57f 100644 --- a/pkg/util/goschedstats/runnable_test.go +++ b/pkg/util/goschedstats/runnable_test.go @@ -3,8 +3,6 @@ // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. -//go:build bazel || untested_go_version || (gc && go1.19 && !go1.23) - package goschedstats import ( diff --git a/pkg/util/goschedstats/runtime_go1.23.go b/pkg/util/goschedstats/runtime_go1.23.go index 61151852adbb..848496eec18a 100644 --- a/pkg/util/goschedstats/runtime_go1.23.go +++ b/pkg/util/goschedstats/runtime_go1.23.go @@ -15,14 +15,7 @@ // // The untested_go_version flag enables building on any go version, intended to // ease testing against Go at tip. -// -// This code will not build with the upstream Go version as we need to use `go:linkname` -// on internal runtime symbols, which as of Go 1.23 is forbidden [2]. -// We use build tags to only use this logic if we are using our forked Go runtime. -// -// [2] https://tip.golang.org/doc/go1.23#linker -// -//go:build (bazel && gc && go1.23 && !go1.24) || untested_go_version +//go:build (gc && go1.23 && !go1.24) || untested_go_version package goschedstats diff --git a/pkg/util/grunning/enabled.go b/pkg/util/grunning/enabled.go index 73be5cfbda88..f0c1eca75508 100644 --- a/pkg/util/grunning/enabled.go +++ b/pkg/util/grunning/enabled.go @@ -10,11 +10,12 @@ package grunning -import "runtime" +import _ "unsafe" // for go:linkname -// grunningnanos returns the running time observed by the current goroutine. -func grunningnanos() int64 { - return runtime.Grunningnanos() -} +// grunningnanos returns the running time observed by the current goroutine by +// linking to a private symbol in the (patched) runtime package. +// +//go:linkname grunningnanos runtime.grunningnanos +func grunningnanos() int64 func supported() bool { return true } diff --git a/pkg/util/log/BUILD.bazel b/pkg/util/log/BUILD.bazel index 9441abc33058..32291c81a367 100644 --- a/pkg/util/log/BUILD.bazel +++ b/pkg/util/log/BUILD.bazel @@ -118,15 +118,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@org_golang_x_sys//unix", ], diff --git a/pkg/util/log/logcrash/BUILD.bazel b/pkg/util/log/logcrash/BUILD.bazel index f6c8c1b69441..b8b5ec29e571 100644 --- a/pkg/util/log/logcrash/BUILD.bazel +++ b/pkg/util/log/logcrash/BUILD.bazel @@ -85,15 +85,9 @@ go_test( "@io_bazel_rules_go//go/platform:openbsd": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@org_golang_x_sys//unix", ], diff --git a/pkg/util/netutil/BUILD.bazel b/pkg/util/netutil/BUILD.bazel index ff7285431107..77c2c80afafd 100644 --- a/pkg/util/netutil/BUILD.bazel +++ b/pkg/util/netutil/BUILD.bazel @@ -18,7 +18,7 @@ go_library( "//pkg/util/syncutil", "@com_github_cockroachdb_cmux//:cmux", "@com_github_cockroachdb_errors//:errors", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_x_net//http2", ], ) @@ -36,6 +36,6 @@ go_test( "@com_github_cockroachdb_errors//:errors", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/util/sdnotify/BUILD.bazel b/pkg/util/sdnotify/BUILD.bazel index 71daca8b2b3b..8b3e70b27be8 100644 --- a/pkg/util/sdnotify/BUILD.bazel +++ b/pkg/util/sdnotify/BUILD.bazel @@ -67,18 +67,10 @@ go_test( "//pkg/util/log", "@com_github_stretchr_testify//require", ], - "@io_bazel_rules_go//go/platform:osx": [ - "//pkg/util/log", - "@com_github_stretchr_testify//require", - ], "@io_bazel_rules_go//go/platform:plan9": [ "//pkg/util/log", "@com_github_stretchr_testify//require", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "//pkg/util/log", - "@com_github_stretchr_testify//require", - ], "@io_bazel_rules_go//go/platform:solaris": [ "//pkg/util/log", "@com_github_stretchr_testify//require", diff --git a/pkg/util/sysutil/BUILD.bazel b/pkg/util/sysutil/BUILD.bazel index 8de705d9941c..7bc0bf8a2bbc 100644 --- a/pkg/util/sysutil/BUILD.bazel +++ b/pkg/util/sysutil/BUILD.bazel @@ -55,15 +55,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@org_golang_x_sys//unix", ], @@ -129,17 +123,9 @@ go_test( "@com_github_stretchr_testify//assert", "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@com_github_stretchr_testify//assert", - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@com_github_stretchr_testify//assert", - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@com_github_stretchr_testify//assert", "@org_golang_x_sys//unix", diff --git a/pkg/util/sysutil/socket.go b/pkg/util/sysutil/socket.go index ff4274b8671c..b4b024b1eb8e 100644 --- a/pkg/util/sysutil/socket.go +++ b/pkg/util/sysutil/socket.go @@ -14,6 +14,22 @@ import ( "github.com/cockroachdb/errors" ) +// SetKeepAliveCount sets the keep alive probe count on a TCP +// connection. +func SetKeepAliveCount(conn *net.TCPConn, probeCount int) (err error) { + syscallConn, err := conn.SyscallConn() + if err != nil { + return err + } + outerErr := syscallConn.Control(func(fd uintptr) { + err = syscall.SetsockoptInt(SocketFd(fd), syscall.IPPROTO_TCP, syscall.TCP_KEEPCNT, probeCount) + }) + if err != nil || outerErr != nil { + return errors.WithSecondaryError(err, outerErr) + } + return nil +} + // GetKeepAliveSettings gets the keep alive socket connections // set on a TCP connection. func GetKeepAliveSettings( diff --git a/pkg/util/sysutil/socket_stub.go b/pkg/util/sysutil/socket_stub.go index fd436ed07eb1..a13ececa569d 100644 --- a/pkg/util/sysutil/socket_stub.go +++ b/pkg/util/sysutil/socket_stub.go @@ -11,6 +11,12 @@ import ( "time" ) +// SetKeepAliveCount sets the keep alive probe count on a TCP +// connection. +func SetKeepAliveCount(conn *net.TCPConn, probeCount int) error { + return nil +} + // GetKeepAliveSettings gets the keep alive socket connections // set on a TCP connection. func GetKeepAliveSettings( diff --git a/pkg/util/timeutil/ptp/BUILD.bazel b/pkg/util/timeutil/ptp/BUILD.bazel index 5e98d806796d..7ac21b2d3ffd 100644 --- a/pkg/util/timeutil/ptp/BUILD.bazel +++ b/pkg/util/timeutil/ptp/BUILD.bazel @@ -47,15 +47,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@com_github_cockroachdb_errors//:errors", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@com_github_cockroachdb_errors//:errors", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@com_github_cockroachdb_errors//:errors", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@com_github_cockroachdb_errors//:errors", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@com_github_cockroachdb_errors//:errors", ], diff --git a/pkg/util/tracing/grpcinterceptor/BUILD.bazel b/pkg/util/tracing/grpcinterceptor/BUILD.bazel index f7dbdcad4767..100e72ec5cc1 100644 --- a/pkg/util/tracing/grpcinterceptor/BUILD.bazel +++ b/pkg/util/tracing/grpcinterceptor/BUILD.bazel @@ -12,7 +12,7 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@io_opentelemetry_go_otel//attribute", "@io_opentelemetry_go_otel//codes", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata", "@org_golang_google_grpc//status", ], @@ -33,6 +33,6 @@ go_test( "@com_github_cockroachdb_errors//:errors", "@com_github_gogo_protobuf//types", "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/workload/cli/BUILD.bazel b/pkg/workload/cli/BUILD.bazel index d820a43e570d..5395d12b817c 100644 --- a/pkg/workload/cli/BUILD.bazel +++ b/pkg/workload/cli/BUILD.bazel @@ -67,15 +67,9 @@ go_library( "@io_bazel_rules_go//go/platform:openbsd": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:osx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:plan9": [ "@org_golang_x_sys//unix", ], - "@io_bazel_rules_go//go/platform:qnx": [ - "@org_golang_x_sys//unix", - ], "@io_bazel_rules_go//go/platform:solaris": [ "@org_golang_x_sys//unix", ],
4fecf021a6edd54911385d045bf12aa2fa45b6ad
2023-03-14 21:08:42
Jayant Shrivastava
cdc: show all changefeed jobs in `SHOW CHANGEFEED JOBS`
false
show all changefeed jobs in `SHOW CHANGEFEED JOBS`
cdc
diff --git a/pkg/sql/delegate/show_changefeed_jobs.go b/pkg/sql/delegate/show_changefeed_jobs.go index 748d12738bf1..be2d3da5c7e4 100644 --- a/pkg/sql/delegate/show_changefeed_jobs.go +++ b/pkg/sql/delegate/show_changefeed_jobs.go @@ -74,8 +74,7 @@ FROM // The query intends to present: // - first all the running jobs sorted in order of start time, // - then all completed jobs sorted in order of completion time. - whereClause = - `WHERE (finished IS NULL OR finished > now() - '12h':::interval)` + // // The "ORDER BY" clause below exploits the fact that all // running jobs have finished = NULL. orderbyClause = `ORDER BY COALESCE(finished, now()) DESC, started DESC`
7a7efe11215e18e84e7911327a9b6ba4c2e108ee
2019-06-17 22:57:04
Solon Gordon
exec: fix TestSortRandomized flakes
false
fix TestSortRandomized flakes
exec
diff --git a/pkg/sql/exec/sort_test.go b/pkg/sql/exec/sort_test.go index 398fd44f3f7f..dac704e0b4bc 100644 --- a/pkg/sql/exec/sort_test.go +++ b/pkg/sql/exec/sort_test.go @@ -156,6 +156,9 @@ func TestSortRandomized(t *testing.T) { // Small range so we can test partitioning tups[i][j] = rng.Int63() % 2048 } + // Enforce that the last ordering column is always unique. Otherwise + // there would be multiple valid sort orders. + tups[i][ordCols[nOrderingCols-1].ColIdx] = int64(i) } expected := make(tuples, nTups)
2966da348e8a9b4b4d1be289d04331afe67df11c
2016-04-27 21:27:05
Vivek Menezes
sql: tests for default current_timestamp and transaction_timestamp()
false
tests for default current_timestamp and transaction_timestamp()
sql
diff --git a/sql/testdata/alter_table b/sql/testdata/alter_table index feabd3efc2d7..c4771659b197 100644 --- a/sql/testdata/alter_table +++ b/sql/testdata/alter_table @@ -231,6 +231,41 @@ SELECT * from add_default WHERE a=5 ---- 5 NULL +# Add a column with a default current_timestamp() +statement ok +ALTER TABLE add_default ADD COLUMN c TIMESTAMP DEFAULT current_timestamp() + +query II +SELECT a,b FROM add_default WHERE current_timestamp > c AND current_timestamp() - c < interval '10s' +---- +2 42 +3 10 +5 NULL + +# Add a column with a default transaction_timestamp() +statement ok +ALTER TABLE add_default ADD COLUMN d TIMESTAMP DEFAULT transaction_timestamp() + +query II +SELECT a,b FROM add_default WHERE d > c AND d - c < interval '10s' +---- +2 42 +3 10 +5 NULL + +# Add a column with a default statement_timestamp() +statement ok +ALTER TABLE add_default ADD COLUMN e TIMESTAMP DEFAULT statement_timestamp() + +query II +SELECT a,b FROM add_default WHERE e > d AND e - d < interval '10s' +---- +2 42 +3 10 +5 NULL + +# Test privileges. + statement ok CREATE TABLE privs (a INT PRIMARY KEY, b INT)
f3a2434f2f2c8e5dc1f8fe903426e796d7775a3d
2018-03-06 23:37:15
Nathan VanBenschoten
build: add warning to builder/Dockerfile about bumping Go version
false
add warning to builder/Dockerfile about bumping Go version
build
diff --git a/build/builder/Dockerfile b/build/builder/Dockerfile index 06c138054316..deef5a23dd6e 100644 --- a/build/builder/Dockerfile +++ b/build/builder/Dockerfile @@ -126,8 +126,12 @@ RUN git clone --depth 1 https://github.com/tpoechtrager/osxcross.git \ && mv osxcross/target /x-tools/x86_64-apple-darwin13 \ && rm -rf osxcross -# Compile Go from source so that CC defaults to clang instead of gcc. -# This requires a Go toolchain to bootstrap. +# Compile Go from source so that CC defaults to clang instead of gcc. This +# requires a Go toolchain to bootstrap. +# +# NB: care needs to be taken when updating this version because earlier +# releases of Go will no longer be run in CI once it is changed. Consider +# bumping the minimum allowed version of Go in /build/go-version-chech.sh. RUN apt-get install -y --no-install-recommends golang \ && curl -fsSL https://storage.googleapis.com/golang/go1.10.src.tar.gz -o golang.tar.gz \ && echo 'f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4fa000c7f24 golang.tar.gz' | sha256sum -c - \
5c8457c32db1c8c79c483c3f69874a6553fc4310
2021-02-04 03:24:49
Yahor Yuzefovich
flowinfra: deflake a test
false
deflake a test
flowinfra
diff --git a/pkg/sql/flowinfra/BUILD.bazel b/pkg/sql/flowinfra/BUILD.bazel index 61031acd07c4..ed973575b077 100644 --- a/pkg/sql/flowinfra/BUILD.bazel +++ b/pkg/sql/flowinfra/BUILD.bazel @@ -84,7 +84,6 @@ go_test( "//pkg/testutils/buildutil", "//pkg/testutils/distsqlutils", "//pkg/testutils/serverutils", - "//pkg/testutils/skip", "//pkg/testutils/sqlutils", "//pkg/testutils/testcluster", "//pkg/util/cancelchecker", diff --git a/pkg/sql/flowinfra/cluster_test.go b/pkg/sql/flowinfra/cluster_test.go index 0408974d97d3..6abfdc867167 100644 --- a/pkg/sql/flowinfra/cluster_test.go +++ b/pkg/sql/flowinfra/cluster_test.go @@ -34,7 +34,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" - "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" "github.com/cockroachdb/cockroach/pkg/util/encoding" "github.com/cockroachdb/cockroach/pkg/util/leaktest" @@ -652,14 +651,16 @@ func TestEvalCtxTxnOnRemoteNodes(t *testing.T) { 1, /* numRows */ sqlutils.ToRowFn(sqlutils.RowIdxFn)) - // Relocate the table to a remote node. - _, err := db.Exec("ALTER TABLE t EXPERIMENTAL_RELOCATE VALUES (ARRAY[2], 1)") - require.NoError(t, err) + // Relocate the table to a remote node. We use SucceedsSoon since in very + // rare circumstances the relocation query can result in an error (e.g. + // "cannot up-replicate to s2; missing gossiped StoreDescriptor") which + // shouldn't fail the test. + testutils.SucceedsSoon(t, func() error { + _, err := db.Exec("ALTER TABLE t EXPERIMENTAL_RELOCATE VALUES (ARRAY[2], 1)") + return err + }) testutils.RunTrueAndFalse(t, "vectorize", func(t *testing.T, vectorize bool) { - if vectorize { - skip.IgnoreLint(t, "skipped because we can't yet vectorize queries using DECIMALs") - } // We're going to use the first node as the gateway and expect everything to // be planned remotely. db := tc.ServerConn(0)
cdc0b555326b29365b27244bb585be0963428605
2021-01-13 13:18:19
Aayush Shah
kvnemesis: fix and unskip TestKVNemesisMultiNode
false
fix and unskip TestKVNemesisMultiNode
kvnemesis
diff --git a/pkg/kv/kvnemesis/kvnemesis_test.go b/pkg/kv/kvnemesis/kvnemesis_test.go index 3188cdfa9e3a..5c8fd5c9dcc0 100644 --- a/pkg/kv/kvnemesis/kvnemesis_test.go +++ b/pkg/kv/kvnemesis/kvnemesis_test.go @@ -55,7 +55,6 @@ func TestKVNemesisSingleNode(t *testing.T) { func TestKVNemesisMultiNode(t *testing.T) { defer leaktest.AfterTest(t)() - skip.WithIssue(t, 58624, "flaky test") skip.UnderRace(t) defer log.Scope(t).Close(t) diff --git a/pkg/kv/kvnemesis/validator.go b/pkg/kv/kvnemesis/validator.go index 0407c7b9971b..0c824e75dc5a 100644 --- a/pkg/kv/kvnemesis/validator.go +++ b/pkg/kv/kvnemesis/validator.go @@ -310,7 +310,8 @@ func (v *validator) processOp(txnID *string, op Operation) { // However, I think the right thing to do is sniff this inside the // AdminMerge code and retry so the client never sees it. In the meantime, // no-op. #44377 - } else if resultIsError(t.Result, `merge failed: cannot merge range with non-voter replicas`) { + } else if resultIsError(t.Result, + `merge failed: cannot merge ranges when (rhs)|(lhs) is in a joint state or has learners`) { // This operation executed concurrently with one that was changing // replicas. } else if resultIsError(t.Result, `merge failed: ranges not collocated`) {
1e7f357019173cee72fe247cfe4af1b9c2cb6d70
2017-09-26 09:27:19
Raphael 'kena' Poss
sql: avoid a panic on SHOW CLUSTER [ QUERIES | SESSIONS ] when a node is down
false
avoid a panic on SHOW CLUSTER [ QUERIES | SESSIONS ] when a node is down
sql
diff --git a/pkg/sql/crdb_internal.go b/pkg/sql/crdb_internal.go index 0669e891dec5..ce89fee1aa92 100644 --- a/pkg/sql/crdb_internal.go +++ b/pkg/sql/crdb_internal.go @@ -818,6 +818,7 @@ func populateSessionsTable( parser.DNull, parser.DNull, parser.DNull, + parser.DNull, ); err != nil { return err }
661fbbc8dac653d6bc2ef40a57266adafc8fd6e8
2020-04-23 02:26:58
Oliver Tan
sql: gate Geospatial features under version gate
false
gate Geospatial features under version gate
sql
diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index 590abda945ca..bad480b7258f 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -68,6 +68,6 @@ <tr><td><code>trace.debug.enable</code></td><td>boolean</td><td><code>false</code></td><td>if set, traces for recent requests can be seen in the /debug page</td></tr> <tr><td><code>trace.lightstep.token</code></td><td>string</td><td><code></code></td><td>if set, traces go to Lightstep using this token</td></tr> <tr><td><code>trace.zipkin.collector</code></td><td>string</td><td><code></code></td><td>if set, traces go to the given Zipkin instance (example: '127.0.0.1:9411'); ignored if trace.lightstep.token is set</td></tr> -<tr><td><code>version</code></td><td>custom validation</td><td><code>20.1-1</code></td><td>set the active cluster version in the format '<major>.<minor>'</td></tr> +<tr><td><code>version</code></td><td>custom validation</td><td><code>20.1-2</code></td><td>set the active cluster version in the format '<major>.<minor>'</td></tr> </tbody> </table> diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index ba9600d67b1c..f180519ce01a 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -61,6 +61,7 @@ const ( VersionTimePrecision Version20_1 VersionStart20_2 + VersionGeospatialType // Add new versions here (step one of two). ) @@ -468,6 +469,11 @@ var versionsSingleton = keyedVersions([]keyedVersion{ Key: VersionStart20_2, Version: roachpb.Version{Major: 20, Minor: 1, Unstable: 1}, }, + { + // VersionGeospatialType enables the use of Geospatial features. + Key: VersionGeospatialType, + Version: roachpb.Version{Major: 20, Minor: 1, Unstable: 2}, + }, // Add new versions here (step two of two). diff --git a/pkg/clusterversion/versionkey_string.go b/pkg/clusterversion/versionkey_string.go index dfe3a3c217d1..7aad1eff9a2d 100644 --- a/pkg/clusterversion/versionkey_string.go +++ b/pkg/clusterversion/versionkey_string.go @@ -37,11 +37,12 @@ func _() { _ = x[VersionTimePrecision-26] _ = x[Version20_1-27] _ = x[VersionStart20_2-28] + _ = x[VersionGeospatialType-29] } -const _VersionKey_name = "Version19_1VersionStart19_2VersionLearnerReplicasVersionTopLevelForeignKeysVersionAtomicChangeReplicasTriggerVersionAtomicChangeReplicasVersionTableDescModificationTimeFromMVCCVersionPartitionedBackupVersion19_2VersionStart20_1VersionContainsEstimatesCounterVersionChangeReplicasDemotionVersionSecondaryIndexColumnFamiliesVersionNamespaceTableWithSchemasVersionProtectedTimestampsVersionPrimaryKeyChangesVersionAuthLocalAndTrustRejectMethodsVersionPrimaryKeyColumnsOutOfFamilyZeroVersionRootPasswordVersionNoExplicitForeignKeyIndexIDsVersionHashShardedIndexesVersionCreateRolePrivilegeVersionStatementDiagnosticsSystemTablesVersionSchemaChangeJobVersionSavepointsVersionTimeTZTypeVersionTimePrecisionVersion20_1VersionStart20_2" +const _VersionKey_name = "Version19_1VersionStart19_2VersionLearnerReplicasVersionTopLevelForeignKeysVersionAtomicChangeReplicasTriggerVersionAtomicChangeReplicasVersionTableDescModificationTimeFromMVCCVersionPartitionedBackupVersion19_2VersionStart20_1VersionContainsEstimatesCounterVersionChangeReplicasDemotionVersionSecondaryIndexColumnFamiliesVersionNamespaceTableWithSchemasVersionProtectedTimestampsVersionPrimaryKeyChangesVersionAuthLocalAndTrustRejectMethodsVersionPrimaryKeyColumnsOutOfFamilyZeroVersionRootPasswordVersionNoExplicitForeignKeyIndexIDsVersionHashShardedIndexesVersionCreateRolePrivilegeVersionStatementDiagnosticsSystemTablesVersionSchemaChangeJobVersionSavepointsVersionTimeTZTypeVersionTimePrecisionVersion20_1VersionStart20_2VersionGeospatialType" -var _VersionKey_index = [...]uint16{0, 11, 27, 49, 75, 109, 136, 176, 200, 211, 227, 258, 287, 322, 354, 380, 404, 441, 480, 499, 534, 559, 585, 624, 646, 663, 680, 700, 711, 727} +var _VersionKey_index = [...]uint16{0, 11, 27, 49, 75, 109, 136, 176, 200, 211, 227, 258, 287, 322, 354, 380, 404, 441, 480, 499, 534, 559, 585, 624, 646, 663, 680, 700, 711, 727, 748} func (i VersionKey) String() string { if i < 0 || i >= VersionKey(len(_VersionKey_index)-1) { diff --git a/pkg/sql/create_table.go b/pkg/sql/create_table.go index fe18d85ba675..1f0aa92db0fb 100644 --- a/pkg/sql/create_table.go +++ b/pkg/sql/create_table.go @@ -115,7 +115,9 @@ var storageParamExpectedTypes = map[string]storageParamType{ // minimumTypeUsageVersions defines the minimum version needed for a new // data type. var minimumTypeUsageVersions = map[types.Family]clusterversion.VersionKey{ - types.TimeTZFamily: clusterversion.VersionTimeTZType, + types.TimeTZFamily: clusterversion.VersionTimeTZType, + types.GeographyFamily: clusterversion.VersionGeospatialType, + types.GeometryFamily: clusterversion.VersionGeospatialType, } // isTypeSupportedInVersion returns whether a given type is supported in the given version. diff --git a/pkg/sql/logictest/testdata/logic_test/alter_table_mixed_19.2_20.1 b/pkg/sql/logictest/testdata/logic_test/alter_table_mixed_19.2_20.1 index c880184a4b18..15fd1f9324cf 100644 --- a/pkg/sql/logictest/testdata/logic_test/alter_table_mixed_19.2_20.1 +++ b/pkg/sql/logictest/testdata/logic_test/alter_table_mixed_19.2_20.1 @@ -204,3 +204,16 @@ CREATE TABLE regression_47110_not_ok(interval_not_ok INTERVAL(3)) statement error type INTERVAL DAY is not supported until version upgrade is finalized CREATE TABLE regression_47110_not_ok(interval_not_ok INTERVAL DAY) + +# TODO(otan): move this to mixed 20.1-20.2 tests when available. +statement error type GEOMETRY is not supported until version upgrade is finalized +CREATE TABLE geo_test(a GEOMETRY) + +statement error type GEOGRAPHY.* is not supported until version upgrade is finalized +CREATE TABLE geo_test(a GEOGRAPHY) + +statement error type GEOMETRY is not supported until version upgrade is finalized +ALTER TABLE t ADD COLUMN geo GEOMETRY + +statement error type GEOGRAPHY.* is not supported until version upgrade is finalized +ALTER TABLE t ADD COLUMN geo GEOGRAPHY
f49b60612d5347ad7db0a3abb79827257a9b1bf0
2016-03-02 03:16:57
Tamir Duberstein
roachpb: unexport Combinable
false
unexport Combinable
roachpb
diff --git a/roachpb/api.go b/roachpb/api.go index b2a5f06f1de3..c6e07de5b9ca 100644 --- a/roachpb/api.go +++ b/roachpb/api.go @@ -121,17 +121,17 @@ type Response interface { Verify(req Request) error } -// Combinable is implemented by response types whose corresponding +// combinable is implemented by response types whose corresponding // requests may cross range boundaries, such as Scan or DeleteRange. -// Combine() allows responses from individual ranges to be aggregated +// combine() allows responses from individual ranges to be aggregated // into a single one. -type Combinable interface { - Combine(Response) error +type combinable interface { + combine(combinable) error } -// Combine is used by range-spanning Response types (e.g. Scan or DeleteRange) +// combine is used by range-spanning Response types (e.g. Scan or DeleteRange) // to merge their headers. -func (rh *ResponseHeader) Combine(otherRH *ResponseHeader) error { +func (rh *ResponseHeader) combine(otherRH *ResponseHeader) error { if rh != nil && otherRH != nil { if ts := otherRH.Timestamp; rh.Timestamp.Less(ts) { rh.Timestamp = ts @@ -143,47 +143,47 @@ func (rh *ResponseHeader) Combine(otherRH *ResponseHeader) error { return nil } -// Combine implements the Combinable interface. -func (sr *ScanResponse) Combine(c Response) error { +// combine implements the combinable interface. +func (sr *ScanResponse) combine(c combinable) error { otherSR := c.(*ScanResponse) if sr != nil { sr.Rows = append(sr.Rows, otherSR.Rows...) - if err := sr.Header().Combine(otherSR.Header()); err != nil { + if err := sr.Header().combine(otherSR.Header()); err != nil { return err } } return nil } -// Combine implements the Combinable interface. -func (sr *ReverseScanResponse) Combine(c Response) error { +// combine implements the combinable interface. +func (sr *ReverseScanResponse) combine(c combinable) error { otherSR := c.(*ReverseScanResponse) if sr != nil { sr.Rows = append(sr.Rows, otherSR.Rows...) - if err := sr.Header().Combine(otherSR.Header()); err != nil { + if err := sr.Header().combine(otherSR.Header()); err != nil { return err } } return nil } -// Combine implements the Combinable interface. -func (dr *DeleteRangeResponse) Combine(c Response) error { +// combine implements the combinable interface. +func (dr *DeleteRangeResponse) combine(c combinable) error { otherDR := c.(*DeleteRangeResponse) if dr != nil { dr.Keys = append(dr.Keys, otherDR.Keys...) - if err := dr.Header().Combine(otherDR.Header()); err != nil { + if err := dr.Header().combine(otherDR.Header()); err != nil { return err } } return nil } -// Combine implements the Combinable interface. -func (rr *ResolveIntentRangeResponse) Combine(c Response) error { +// combine implements the combinable interface. +func (rr *ResolveIntentRangeResponse) combine(c combinable) error { otherRR := c.(*ResolveIntentRangeResponse) if rr != nil { - if err := rr.Header().Combine(otherRR.Header()); err != nil { + if err := rr.Header().combine(otherRR.Header()); err != nil { return err } } diff --git a/roachpb/api_test.go b/roachpb/api_test.go index 4e08a289a6bf..69fcebfa1c11 100644 --- a/roachpb/api_test.go +++ b/roachpb/api_test.go @@ -22,12 +22,12 @@ import ( ) // TestCombinable tests the correct behaviour of some types that implement -// the Combinable interface, notably {Scan,DeleteRange}Response and +// the combinable interface, notably {Scan,DeleteRange}Response and // ResponseHeader. func TestCombinable(t *testing.T) { - // Test that GetResponse doesn't have anything to do with Combinable. - if _, ok := interface{}(&GetResponse{}).(Combinable); ok { - t.Fatalf("GetResponse implements Combinable, so presumably all Response types will") + // Test that GetResponse doesn't have anything to do with combinable. + if _, ok := interface{}(&GetResponse{}).(combinable); ok { + t.Fatalf("GetResponse implements combinable, so presumably all Response types will") } // Test that {Scan,DeleteRange}Response properly implement it. sr1 := &ScanResponse{ @@ -37,8 +37,8 @@ func TestCombinable(t *testing.T) { }, } - if _, ok := interface{}(sr1).(Combinable); !ok { - t.Fatalf("ScanResponse does not implement Combinable") + if _, ok := interface{}(sr1).(combinable); !ok { + t.Fatalf("ScanResponse does not implement combinable") } sr2 := &ScanResponse{ @@ -54,10 +54,10 @@ func TestCombinable(t *testing.T) { Rows: append(append([]KeyValue(nil), sr1.Rows...), sr2.Rows...), } - if err := sr1.Combine(sr2); err != nil { + if err := sr1.combine(sr2); err != nil { t.Fatal(err) } - if err := sr1.Combine(&ScanResponse{}); err != nil { + if err := sr1.combine(&ScanResponse{}); err != nil { t.Fatal(err) } @@ -69,8 +69,8 @@ func TestCombinable(t *testing.T) { ResponseHeader: ResponseHeader{Timestamp: Timestamp{Logical: 100}}, Keys: []Key{[]byte("1")}, } - if _, ok := interface{}(dr1).(Combinable); !ok { - t.Fatalf("DeleteRangeResponse does not implement Combinable") + if _, ok := interface{}(dr1).(combinable); !ok { + t.Fatalf("DeleteRangeResponse does not implement combinable") } dr2 := &DeleteRangeResponse{ ResponseHeader: ResponseHeader{Timestamp: Timestamp{Logical: 1}}, @@ -84,10 +84,10 @@ func TestCombinable(t *testing.T) { ResponseHeader: ResponseHeader{Timestamp: Timestamp{Logical: 111}}, Keys: []Key{[]byte("1"), []byte("2")}, } - if err := dr2.Combine(dr3); err != nil { + if err := dr2.combine(dr3); err != nil { t.Fatal(err) } - if err := dr1.Combine(dr2); err != nil { + if err := dr1.combine(dr2); err != nil { t.Fatal(err) } diff --git a/roachpb/batch.go b/roachpb/batch.go index 83104a6233cf..471255752880 100644 --- a/roachpb/batch.go +++ b/roachpb/batch.go @@ -141,10 +141,10 @@ func (br *BatchResponse) Combine(otherBatch *BatchResponse) error { for i, l := 0, len(br.Responses); i < l; i++ { valLeft := br.Responses[i].GetInner() valRight := otherBatch.Responses[i].GetInner() - args, lOK := valLeft.(Combinable) - reply, rOK := valRight.(Combinable) + cValLeft, lOK := valLeft.(combinable) + cValRight, rOK := valRight.(combinable) if lOK && rOK { - if err := args.Combine(reply.(Response)); err != nil { + if err := cValLeft.combine(cValRight); err != nil { return err } continue
b1f2955b231eca31b6571020c3e5be826413526d
2018-09-20 03:16:59
Daniel Harrison
roachtest: fix tpcc-1000 cdc test
false
fix tpcc-1000 cdc test
roachtest
diff --git a/pkg/ccl/changefeedccl/changefeed.go b/pkg/ccl/changefeedccl/changefeed.go index 0a2883f2210a..1cc47c326b3f 100644 --- a/pkg/ccl/changefeedccl/changefeed.go +++ b/pkg/ccl/changefeedccl/changefeed.go @@ -278,7 +278,11 @@ func emitResolvedTimestamp( // before emitting the resolved timestamp to the sink. if jobProgressedFn != nil { progressedClosure := func(ctx context.Context, d jobspb.ProgressDetails) hlc.Timestamp { - d.(*jobspb.Progress_Changefeed).Changefeed.ResolvedSpans = resolvedSpans + // TODO(dan): This was making enormous jobs rows, especially in + // combination with how many mvcc versions there are. Cut down on + // the amount of data used here dramatically and re-enable. + // + // d.(*jobspb.Progress_Changefeed).Changefeed.ResolvedSpans = resolvedSpans return resolved } if err := jobProgressedFn(ctx, progressedClosure); err != nil { diff --git a/pkg/cmd/roachtest/cdc.go b/pkg/cmd/roachtest/cdc.go index 2e7960e86467..a68753fccf6c 100644 --- a/pkg/cmd/roachtest/cdc.go +++ b/pkg/cmd/roachtest/cdc.go @@ -23,6 +23,8 @@ import ( "strings" "time" + "github.com/cockroachdb/cockroach/pkg/jobs/jobspb" + "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/cockroach/pkg/util/timeutil" "github.com/pkg/errors" ) @@ -37,7 +39,7 @@ func installKafka(ctx context.Context, c *cluster, kafkaNode nodeListOption) { func startKafka(ctx context.Context, c *cluster, kafkaNode nodeListOption) { // This isn't necessary for the nightly tests, but it's nice for iteration. c.Run(ctx, kafkaNode, `CONFLUENT_CURRENT=/mnt/data1/confluent ./confluent-4.0.0/bin/confluent destroy | true`) - c.Run(ctx, kafkaNode, `CONFLUENT_CURRENT=/mnt/data1/confluent ./confluent-4.0.0/bin/confluent start`) + c.Run(ctx, kafkaNode, `CONFLUENT_CURRENT=/mnt/data1/confluent ./confluent-4.0.0/bin/confluent start kafka`) } func stopKafka(ctx context.Context, c *cluster, kafkaNode nodeListOption) { @@ -91,6 +93,7 @@ func cdcBasicTest(ctx context.Context, t *test, c *cluster, args cdcTestArgs) { duration = `120m` } + c.RemountNoBarrier(ctx) crdbNodes := c.Range(1, c.nodes-1) workloadNode := c.Node(c.nodes) kafkaNode := c.Node(c.nodes) @@ -133,12 +136,6 @@ func cdcBasicTest(ctx context.Context, t *test, c *cluster, args cdcTestArgs) { return err } - var cursor string - if err := db.QueryRow(`SELECT cluster_logical_timestamp()`).Scan(&cursor); err != nil { - c.t.Fatal(err) - } - c.l.Printf("starting cursor at %s\n", cursor) - var jobID int createStmt := `CREATE CHANGEFEED FOR tpcc.warehouse, tpcc.district, tpcc.customer, tpcc.history, @@ -148,12 +145,25 @@ func cdcBasicTest(ctx context.Context, t *test, c *cluster, args cdcTestArgs) { extraArgs := []interface{}{`kafka://` + c.InternalIP(ctx, kafkaNode)[0] + `:9092`} if !args.initialScan { createStmt += `, cursor=$2` - extraArgs = append(extraArgs, cursor) + extraArgs = append(extraArgs, timeutil.Now().UnixNano()) } if err = db.QueryRow(createStmt, extraArgs...).Scan(&jobID); err != nil { return err } + var payloadBytes []byte + if err = db.QueryRow( + `SELECT payload FROM system.jobs WHERE id = $1`, jobID, + ).Scan(&payloadBytes); err != nil { + return err + } + var payload jobspb.Payload + if err := protoutil.Unmarshal(payloadBytes, &payload); err != nil { + return err + } + statementTime := payload.GetChangefeed().StatementTime.GoTime() + l.Printf("starting changefeed at (%d) %s\n", statementTime.UnixNano(), statementTime) + t.Status("watching changefeed") for { select { @@ -175,38 +185,44 @@ func cdcBasicTest(ctx context.Context, t *test, c *cluster, args cdcTestArgs) { if status != `running` { return errors.Errorf(`unexpected status: %s`, status) } - if hwRaw.Valid { + var highWaterTime time.Time + if len(hwRaw.String) > 0 { // Intentionally not using tree.DecimalToHLC to avoid the dep. - hwWallTime, err := strconv.ParseInt( + highWaterNanos, err := strconv.ParseInt( hwRaw.String[:strings.IndexRune(hwRaw.String, '.')], 10, 64) if err != nil { return errors.Wrapf(err, "parsing [%s]", hwRaw.String) } - if initialScanLatency == 0 { - initialScanLatency = timeutil.Since(timeutil.Unix(0, hwWallTime)) - l.Printf("initial scan latency %s\n", initialScanLatency) - t.Status("finished initial scan") - continue - } - latency := timeutil.Since(timeutil.Unix(0, hwWallTime)) - if latency < maxLatencyAllowed { - latencyDroppedBelowMaxAllowed = true - } - if !latencyDroppedBelowMaxAllowed { - // Before we have RangeFeed, the polls just get - // progressively smaller after the initial one. Start - // tracking the max latency once we seen a latency - // that's less than the max allowed. Verify at the end - // of the test that this happens at some point. - l.Printf("end-to-end latency %s not yet below max allowed %s\n", - latency, maxLatencyAllowed) - continue - } - if latency > maxSeenLatency { - maxSeenLatency = latency - } - l.Printf("end-to-end latency %s max so far %s\n", latency, maxSeenLatency) + highWaterTime = timeutil.Unix(0, highWaterNanos) + } + + if highWaterTime.Before(statementTime) { + continue + } else if initialScanLatency == 0 { + initialScanLatency = timeutil.Since(statementTime) + l.Printf("initial scan latency %s\n", initialScanLatency) + t.Status("finished initial scan") + continue + } + + latency := timeutil.Since(highWaterTime) + if latency < maxLatencyAllowed/2 { + latencyDroppedBelowMaxAllowed = true + } + if !latencyDroppedBelowMaxAllowed { + // Before we have RangeFeed, the polls just get + // progressively smaller after the initial one. Start + // tracking the max latency once we seen a latency + // that's less than the max allowed. Verify at the end + // of the test that this happens at some point. + l.Printf("end-to-end latency %s not yet below max allowed %s\n", + latency, maxLatencyAllowed) + continue + } + if latency > maxSeenLatency { + maxSeenLatency = latency } + l.Printf("end-to-end latency %s max so far %s\n", latency, maxSeenLatency) } }) if args.kafkaChaos { @@ -283,7 +299,6 @@ func registerCDC(r *registry) { }, }) r.Add(testSpec{ - Skip: "https://github.com/cockroachdb/cockroach/issues/29196", Name: "cdc/w=100/nodes=3/init=false/chaos=true", MinVersion: "2.1.0", Nodes: nodes(4, cpu(16)),
62a08f75bcf52e764a569384a57095048009d012
2019-02-06 20:30:41
Justin Jaffray
opt: fix zero-column groups in joins colliding
false
fix zero-column groups in joins colliding
opt
diff --git a/pkg/sql/opt/xform/rules/join.opt b/pkg/sql/opt/xform/rules/join.opt index 917e8ecbb2dc..c7d38c087b58 100644 --- a/pkg/sql/opt/xform/rules/join.opt +++ b/pkg/sql/opt/xform/rules/join.opt @@ -2,14 +2,32 @@ # join.opt contains exploration rules for the Join operator. # ============================================================================= +# We don't allow any of the logical join -> logical join rules (CommuteJoin, +# CommuteLeftJoin, CommuteRightJoin, AssociateJoin) to operate on inputs with +# no columns. This is because zero-column groups can occur multiple times in +# the same normalized tree, and exploration can cause group collisions: +# +# Let A be the 0-column values node with two rows `VALUES (), ()`, +# and B be the 0-column values node with three rows `VALUES (), (), ()`. +# +# Then consider the following query: +# +# (A JOIN B) UNION (B JOIN A) +# +# During build, we add `A JOIN B` and `B JOIN A` to *separate memo groups*. +# Then, during exploration, we apply the `CommuteJoin` rule to transform `A +# JOIN B` to `B JOIN A`. This attempts to get interned into the same group, but +# the interner finds that `B JOIN A` already exists in a different group, and +# panics. +# TODO(justin): find a more long-term solution to this problem. # CommuteJoin creates a Join with the left and right inputs swapped. This is # useful for other rules that convert joins to other operators (like merge # join). [CommuteJoin, Explore] (InnerJoin | FullJoin - $left:* - $right:* + $left:* & ^(HasNoCols $left) + $right:* & ^(HasNoCols $right) $on:* ) => @@ -18,8 +36,8 @@ # CommuteLeftJoin creates a Join with the left and right inputs swapped. [CommuteLeftJoin, Explore] (LeftJoin - $left:* - $right:* + $left:* & ^(HasNoCols $left) + $right:* & ^(HasNoCols $left) $on:* ) => @@ -28,8 +46,8 @@ # CommuteRightJoin creates a Join with the left and right inputs swapped. [CommuteRightJoin, Explore] (RightJoin - $left:* - $right:* + $left:* & ^(HasNoCols $left) + $right:* & ^(HasNoCols $left) $on:* ) => @@ -104,11 +122,11 @@ [AssociateJoin, Explore] (InnerJoin $left:(InnerJoin - $innerLeft:* - $innerRight:* + $innerLeft:* & ^(HasNoCols $innerLeft) + $innerRight:* & ^(HasNoCols $innerRight) $innerOn:* ) - $right:* & (ShouldReorderJoins $left $right) + $right:* & (ShouldReorderJoins $left $right) & ^(HasNoCols $right) $on:* ) => diff --git a/pkg/sql/opt/xform/testdata/rules/join b/pkg/sql/opt/xform/testdata/rules/join index 19ec30876eb8..cc3b8be7ddc4 100644 --- a/pkg/sql/opt/xform/testdata/rules/join +++ b/pkg/sql/opt/xform/testdata/rules/join @@ -1806,3 +1806,235 @@ inner-join (lookup t5) │ └── filters (true) └── filters └── b @> '{"a": [{"b": "c", "d": 3}, 5]}' [type=bool, outer=(2)] + +# Regression test for issue where zero-column expressions could exist multiple +# times in the tree, causing collisions. +opt +SELECT 1 FROM (VALUES (1), (1)) JOIN (VALUES (1), (1), (1)) ON true +UNION ALL +SELECT 1 FROM (VALUES (1), (1), (1)) JOIN (VALUES (1), (1)) ON true +---- +union-all + ├── columns: "?column?":7(int!null) + ├── left columns: "?column?":3(int) + ├── right columns: "?column?":6(int) + ├── cardinality: [12 - 12] + ├── project + │ ├── columns: "?column?":3(int!null) + │ ├── cardinality: [6 - 6] + │ ├── fd: ()-->(3) + │ ├── inner-join + │ │ ├── cardinality: [6 - 6] + │ │ ├── values + │ │ │ ├── cardinality: [2 - 2] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ ├── values + │ │ │ ├── cardinality: [3 - 3] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ └── filters (true) + │ └── projections + │ └── const: 1 [type=int] + └── project + ├── columns: "?column?":6(int!null) + ├── cardinality: [6 - 6] + ├── fd: ()-->(6) + ├── inner-join + │ ├── cardinality: [6 - 6] + │ ├── values + │ │ ├── cardinality: [3 - 3] + │ │ ├── tuple [type=tuple{}] + │ │ ├── tuple [type=tuple{}] + │ │ └── tuple [type=tuple{}] + │ ├── values + │ │ ├── cardinality: [2 - 2] + │ │ ├── tuple [type=tuple{}] + │ │ └── tuple [type=tuple{}] + │ └── filters (true) + └── projections + └── const: 1 [type=int] + +opt join-limit=3 +SELECT + false +FROM + abc AS x JOIN [INSERT INTO abc (a) SELECT 1 FROM abc RETURNING 1] JOIN abc AS y ON true ON false +---- +project + ├── columns: bool:21(bool!null) + ├── cardinality: [0 - 0] + ├── side-effects, mutations + ├── fd: ()-->(21) + ├── inner-join + │ ├── cardinality: [0 - 0] + │ ├── side-effects, mutations + │ ├── values + │ │ ├── cardinality: [0 - 0] + │ │ └── key: () + │ ├── inner-join + │ │ ├── cardinality: [0 - 0] + │ │ ├── side-effects, mutations + │ │ ├── project + │ │ │ ├── cardinality: [0 - 0] + │ │ │ ├── side-effects, mutations + │ │ │ └── select + │ │ │ ├── columns: abc.a:5(int!null) abc.b:6(int) abc.c:7(int) abc.rowid:8(int!null) + │ │ │ ├── cardinality: [0 - 0] + │ │ │ ├── side-effects, mutations + │ │ │ ├── fd: ()-->(5-7) + │ │ │ ├── insert abc + │ │ │ │ ├── columns: abc.a:5(int!null) abc.b:6(int) abc.c:7(int) abc.rowid:8(int!null) + │ │ │ │ ├── insert-mapping: + │ │ │ │ │ ├── "?column?":13 => abc.a:5 + │ │ │ │ │ ├── column14:14 => abc.b:6 + │ │ │ │ │ ├── column14:14 => abc.c:7 + │ │ │ │ │ └── column15:15 => abc.rowid:8 + │ │ │ │ ├── side-effects, mutations + │ │ │ │ ├── fd: ()-->(5-7) + │ │ │ │ └── project + │ │ │ │ ├── columns: column14:14(int) column15:15(int) "?column?":13(int!null) + │ │ │ │ ├── side-effects + │ │ │ │ ├── fd: ()-->(13,14) + │ │ │ │ ├── scan abc + │ │ │ │ └── projections + │ │ │ │ ├── null [type=int] + │ │ │ │ ├── unique_rowid() [type=int, side-effects] + │ │ │ │ └── const: 1 [type=int] + │ │ │ └── filters + │ │ │ └── false [type=bool] + │ │ ├── values + │ │ │ ├── cardinality: [0 - 0] + │ │ │ └── key: () + │ │ └── filters (true) + │ └── filters (true) + └── projections + └── false [type=bool] + +opt join-limit=3 +SELECT 1 FROM ((VALUES (1), (1)) JOIN ((VALUES (1), (1), (1)) JOIN (VALUES (1), (1), (1), (1)) ON true) ON true) +UNION ALL +SELECT 1 FROM ((VALUES (1), (1)) JOIN (VALUES (1), (1), (1)) ON true) JOIN (VALUES (1), (1), (1), (1)) ON true +---- +union-all + ├── columns: "?column?":9(int!null) + ├── left columns: "?column?":4(int) + ├── right columns: "?column?":8(int) + ├── cardinality: [48 - 48] + ├── project + │ ├── columns: "?column?":4(int!null) + │ ├── cardinality: [24 - 24] + │ ├── fd: ()-->(4) + │ ├── inner-join + │ │ ├── cardinality: [24 - 24] + │ │ ├── values + │ │ │ ├── cardinality: [2 - 2] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ ├── inner-join + │ │ │ ├── cardinality: [12 - 12] + │ │ │ ├── values + │ │ │ │ ├── cardinality: [3 - 3] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ └── tuple [type=tuple{}] + │ │ │ ├── values + │ │ │ │ ├── cardinality: [4 - 4] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ └── tuple [type=tuple{}] + │ │ │ └── filters (true) + │ │ └── filters (true) + │ └── projections + │ └── const: 1 [type=int] + └── project + ├── columns: "?column?":8(int!null) + ├── cardinality: [24 - 24] + ├── fd: ()-->(8) + ├── inner-join + │ ├── cardinality: [24 - 24] + │ ├── inner-join + │ │ ├── cardinality: [6 - 6] + │ │ ├── values + │ │ │ ├── cardinality: [2 - 2] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ ├── values + │ │ │ ├── cardinality: [3 - 3] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ └── filters (true) + │ ├── values + │ │ ├── cardinality: [4 - 4] + │ │ ├── tuple [type=tuple{}] + │ │ ├── tuple [type=tuple{}] + │ │ ├── tuple [type=tuple{}] + │ │ └── tuple [type=tuple{}] + │ └── filters (true) + └── projections + └── const: 1 [type=int] + +opt +SELECT 1 FROM (VALUES (1), (1)) LEFT JOIN (VALUES (1), (1), (1)) ON random() = 0 +UNION ALL +SELECT 1 FROM (VALUES (1), (1), (1)) RIGHT JOIN (VALUES (1), (1)) ON random() = 0 +---- +union-all + ├── columns: "?column?":7(int!null) + ├── left columns: "?column?":3(int) + ├── right columns: "?column?":6(int) + ├── cardinality: [4 - 12] + ├── side-effects + ├── project + │ ├── columns: "?column?":3(int!null) + │ ├── cardinality: [2 - 6] + │ ├── side-effects + │ ├── fd: ()-->(3) + │ ├── left-join + │ │ ├── cardinality: [2 - 6] + │ │ ├── side-effects + │ │ ├── values + │ │ │ ├── cardinality: [2 - 2] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ ├── select + │ │ │ ├── cardinality: [0 - 3] + │ │ │ ├── side-effects + │ │ │ ├── values + │ │ │ │ ├── cardinality: [3 - 3] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ ├── tuple [type=tuple{}] + │ │ │ │ └── tuple [type=tuple{}] + │ │ │ └── filters + │ │ │ └── random() = 0.0 [type=bool, side-effects] + │ │ └── filters (true) + │ └── projections + │ └── const: 1 [type=int] + └── project + ├── columns: "?column?":6(int!null) + ├── cardinality: [2 - 6] + ├── side-effects + ├── fd: ()-->(6) + ├── right-join + │ ├── cardinality: [2 - 6] + │ ├── side-effects + │ ├── select + │ │ ├── cardinality: [0 - 3] + │ │ ├── side-effects + │ │ ├── values + │ │ │ ├── cardinality: [3 - 3] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ ├── tuple [type=tuple{}] + │ │ │ └── tuple [type=tuple{}] + │ │ └── filters + │ │ └── random() = 0.0 [type=bool, side-effects] + │ ├── values + │ │ ├── cardinality: [2 - 2] + │ │ ├── tuple [type=tuple{}] + │ │ └── tuple [type=tuple{}] + │ └── filters (true) + └── projections + └── const: 1 [type=int]
e9f112c25e8b7b5dfe1a86f596d0c760112122d5
2021-06-22 21:15:20
Marcus Gartner
sql: add inaccessible columns
false
add inaccessible columns
sql
diff --git a/pkg/cli/testdata/doctor/test_recreate_zipdir b/pkg/cli/testdata/doctor/test_recreate_zipdir index 3509e94d5d43..390916a16a33 100644 --- a/pkg/cli/testdata/doctor/test_recreate_zipdir +++ b/pkg/cli/testdata/doctor/test_recreate_zipdir @@ -11,16 +11,16 @@ SELECT crdb_internal.unsafe_upsert_descriptor(50, decode('12340a0964656661756c74 SELECT crdb_internal.unsafe_upsert_namespace_entry(0, 0, 'defaultdb', 50, true); SELECT crdb_internal.unsafe_upsert_descriptor(51, decode('12330a08706f73746772657310331a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f7418012200280140004a00', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(0, 0, 'postgres', 51, true); -SELECT crdb_internal.unsafe_upsert_descriptor(53, decode('0ac6040a0575736572731835203428013a0042220a02696410011a0d080e10001800300050861760002000300068007000780080010042240a046369747910021a0d080710001800300750930860002000300068007000780080010042240a046e616d6510031a0d080710001800300750930860002001300068007000780080010042270a076164647265737310041a0d0807100018003007509308600020013000680070007800800100422b0a0b6372656469745f6361726410051a0d0807100018003007509308600020013000680070007800800100480652570a077072696d617279100118012204636974792202696430023001400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800101880103980100b2013d0a077072696d61727910001a0269641a04636974791a046e616d651a07616464726573731a0b6372656469745f63617264200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200aa02270836100210041802180120352a11666b5f636974795f7265665f75736572733002380040004800aa02270837100210041802180120352a11666b5f636974795f7265665f75736572733002380040004800aa0227083a100110021802180120352a11666b5f636974795f7265665f75736572733002380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); +SELECT crdb_internal.unsafe_upsert_descriptor(53, decode('0ad5040a0575736572731835203428013a0042250a02696410011a0d080e10001800300050861760002000300068007000780080010088010042270a046369747910021a0d080710001800300750930860002000300068007000780080010088010042270a046e616d6510031a0d0807100018003007509308600020013000680070007800800100880100422a0a076164647265737310041a0d0807100018003007509308600020013000680070007800800100880100422e0a0b6372656469745f6361726410051a0d0807100018003007509308600020013000680070007800800100880100480652570a077072696d617279100118012204636974792202696430023001400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800101880103980100b2013d0a077072696d61727910001a0269641a04636974791a046e616d651a07616464726573731a0b6372656469745f63617264200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200aa02270836100210041802180120352a11666b5f636974795f7265665f75736572733002380040004800aa02270837100210041802180120352a11666b5f636974795f7265665f75736572733002380040004800aa0227083a100110021802180120352a11666b5f636974795f7265665f75736572733002380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(52, 29, 'users', 53, true); -SELECT crdb_internal.unsafe_upsert_descriptor(54, decode('0ad3060a0876656869636c65731836203428013a0042220a02696410011a0d080e10001800300050861760002000300068007000780080010042240a046369747910021a0d080710001800300750930860002000300068007000780080010042240a047479706510031a0d080710001800300750930860002001300068007000780080010042280a086f776e65725f696410041a0d080e100018003000508617600020013000680070007800800100422d0a0d6372656174696f6e5f74696d6510051a0d080510001800300050da0860002001300068007000780080010042260a0673746174757310061a0d080710001800300750930860002001300068007000780080010042300a1063757272656e745f6c6f636174696f6e10071a0d080710001800300750930860002001300068007000780080010042230a0365787410081a0d081210001800300050da1d600020013000680070007800800100480952570a077072696d617279100118012204636974792202696430023001400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba01005a7d0a2576656869636c65735f6175746f5f696e6465785f666b5f636974795f7265665f75736572731002180022046369747922086f776e65725f6964300230043801400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060036a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800102880103980100b201650a077072696d61727910001a0269641a04636974791a04747970651a086f776e65725f69641a0d6372656174696f6e5f74696d651a067374617475731a1063757272656e745f6c6f636174696f6e1a03657874200120022003200420052006200720082800b80101c20100e80100f2010408001200f801008002009202009a0200a202270836100210041802180120352a11666b5f636974795f7265665f75736572733000380040004800aa02320837100310051802180120362a1c666b5f76656869636c655f636974795f7265665f76656869636c65733002380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); +SELECT crdb_internal.unsafe_upsert_descriptor(54, decode('0aeb060a0876656869636c65731836203428013a0042250a02696410011a0d080e10001800300050861760002000300068007000780080010088010042270a046369747910021a0d080710001800300750930860002000300068007000780080010088010042270a047479706510031a0d0807100018003007509308600020013000680070007800800100880100422b0a086f776e65725f696410041a0d080e10001800300050861760002001300068007000780080010088010042300a0d6372656174696f6e5f74696d6510051a0d080510001800300050da0860002001300068007000780080010088010042290a0673746174757310061a0d080710001800300750930860002001300068007000780080010088010042330a1063757272656e745f6c6f636174696f6e10071a0d080710001800300750930860002001300068007000780080010088010042260a0365787410081a0d081210001800300050da1d600020013000680070007800800100880100480952570a077072696d617279100118012204636974792202696430023001400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba01005a7d0a2576656869636c65735f6175746f5f696e6465785f666b5f636974795f7265665f75736572731002180022046369747922086f776e65725f6964300230043801400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060036a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800102880103980100b201650a077072696d61727910001a0269641a04636974791a04747970651a086f776e65725f69641a0d6372656174696f6e5f74696d651a067374617475731a1063757272656e745f6c6f636174696f6e1a03657874200120022003200420052006200720082800b80101c20100e80100f2010408001200f801008002009202009a0200a202270836100210041802180120352a11666b5f636974795f7265665f75736572733000380040004800aa02320837100310051802180120362a1c666b5f76656869636c655f636974795f7265665f76656869636c65733002380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(52, 29, 'vehicles', 54, true); -SELECT crdb_internal.unsafe_upsert_descriptor(55, decode('0acd090a0572696465731837203428013a0042220a02696410011a0d080e10001800300050861760002000300068007000780080010042240a046369747910021a0d0807100018003007509308600020003000680070007800800100422c0a0c76656869636c655f6369747910031a0d080710001800300750930860002001300068007000780080010042280a0872696465725f696410041a0d080e100018003000508617600020013000680070007800800100422a0a0a76656869636c655f696410051a0d080e100018003000508617600020013000680070007800800100422d0a0d73746172745f6164647265737310061a0d0807100018003007509308600020013000680070007800800100422b0a0b656e645f6164647265737310071a0d0807100018003007509308600020013000680070007800800100422a0a0a73746172745f74696d6510081a0d080510001800300050da0860002001300068007000780080010042280a08656e645f74696d6510091a0d080510001800300050da0860002001300068007000780080010042270a07726576656e7565100a1a0d08031002180a300050a40d600020013000680070007800800100480b52570a077072696d617279100118012204636974792202696430023001400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba01005a7a0a2272696465735f6175746f5f696e6465785f666b5f636974795f7265665f757365727310021800220463697479220872696465725f6964300230043801400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba01005a91010a2d72696465735f6175746f5f696e6465785f666b5f76656869636c655f636974795f7265665f76656869636c657310031800220c76656869636c655f63697479220a76656869636c655f69643003300538023801400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060046a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800103880103980100a201380a1376656869636c655f63697479203d20636974791217636865636b5f76656869636c655f636974795f6369747918002802280330003800b2018a010a077072696d61727910001a0269641a04636974791a0c76656869636c655f636974791a0872696465725f69641a0a76656869636c655f69641a0d73746172745f616464726573731a0b656e645f616464726573731a0a73746172745f74696d651a08656e645f74696d651a07726576656e7565200120022003200420052006200720082009200a2800b80101c20100e80100f2010408001200f801008002009202009a0200a202270837100210041802180120352a11666b5f636974795f7265665f75736572733000380040004800a202320837100310051802180120362a1c666b5f76656869636c655f636974795f7265665f76656869636c65733000380040004800aa02270838100110021802180120372a11666b5f636974795f7265665f72696465733002380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); +SELECT crdb_internal.unsafe_upsert_descriptor(55, decode('0aeb090a0572696465731837203428013a0042250a02696410011a0d080e10001800300050861760002000300068007000780080010088010042270a046369747910021a0d0807100018003007509308600020003000680070007800800100880100422f0a0c76656869636c655f6369747910031a0d0807100018003007509308600020013000680070007800800100880100422b0a0872696465725f696410041a0d080e100018003000508617600020013000680070007800800100880100422d0a0a76656869636c655f696410051a0d080e10001800300050861760002001300068007000780080010088010042300a0d73746172745f6164647265737310061a0d0807100018003007509308600020013000680070007800800100880100422e0a0b656e645f6164647265737310071a0d0807100018003007509308600020013000680070007800800100880100422d0a0a73746172745f74696d6510081a0d080510001800300050da08600020013000680070007800800100880100422b0a08656e645f74696d6510091a0d080510001800300050da08600020013000680070007800800100880100422a0a07726576656e7565100a1a0d08031002180a300050a40d600020013000680070007800800100880100480b52570a077072696d617279100118012204636974792202696430023001400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba01005a7a0a2272696465735f6175746f5f696e6465785f666b5f636974795f7265665f757365727310021800220463697479220872696465725f6964300230043801400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba01005a91010a2d72696465735f6175746f5f696e6465785f666b5f76656869636c655f636974795f7265665f76656869636c657310031800220c76656869636c655f63697479220a76656869636c655f69643003300538023801400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060046a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800103880103980100a201380a1376656869636c655f63697479203d20636974791217636865636b5f76656869636c655f636974795f6369747918002802280330003800b2018a010a077072696d61727910001a0269641a04636974791a0c76656869636c655f636974791a0872696465725f69641a0a76656869636c655f69641a0d73746172745f616464726573731a0b656e645f616464726573731a0a73746172745f74696d651a08656e645f74696d651a07726576656e7565200120022003200420052006200720082009200a2800b80101c20100e80100f2010408001200f801008002009202009a0200a202270837100210041802180120352a11666b5f636974795f7265665f75736572733000380040004800a202320837100310051802180120362a1c666b5f76656869636c655f636974795f7265665f76656869636c65733000380040004800aa02270838100110021802180120372a11666b5f636974795f7265665f72696465733002380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(52, 29, 'rides', 55, true); -SELECT crdb_internal.unsafe_upsert_descriptor(56, decode('0a99040a1a76656869636c655f6c6f636174696f6e5f686973746f726965731838203428013a0042240a046369747910011a0d080710001800300750930860002000300068007000780080010042270a07726964655f696410021a0d080e10001800300050861760002000300068007000780080010042290a0974696d657374616d7010031a0d080510001800300050da0860002000300068007000780080010042230a036c617410041a0d080210401800300050bd0560002001300068007000780080010042240a046c6f6e6710051a0d080210401800300050bd056000200130006800700078008001004806526b0a077072696d617279100118012204636974792207726964655f6964220974696d657374616d703001300230034000400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800102880103980100b2013c0a077072696d61727910001a04636974791a07726964655f69641a0974696d657374616d701a036c61741a046c6f6e67200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200a202270838100110021802180120372a11666b5f636974795f7265665f72696465733000380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); +SELECT crdb_internal.unsafe_upsert_descriptor(56, decode('0aa8040a1a76656869636c655f6c6f636174696f6e5f686973746f726965731838203428013a0042270a046369747910011a0d0807100018003007509308600020003000680070007800800100880100422a0a07726964655f696410021a0d080e100018003000508617600020003000680070007800800100880100422c0a0974696d657374616d7010031a0d080510001800300050da0860002000300068007000780080010088010042260a036c617410041a0d080210401800300050bd0560002001300068007000780080010088010042270a046c6f6e6710051a0d080210401800300050bd056000200130006800700078008001008801004806526b0a077072696d617279100118012204636974792207726964655f6964220974696d657374616d703001300230034000400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800102880103980100b2013c0a077072696d61727910001a04636974791a07726964655f69641a0974696d657374616d701a036c61741a046c6f6e67200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200a202270838100110021802180120372a11666b5f636974795f7265665f72696465733000380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(52, 29, 'vehicle_location_histories', 56, true); -SELECT crdb_internal.unsafe_upsert_descriptor(57, decode('0aee030a0b70726f6d6f5f636f6465731839203428013a0042240a04636f646510011a0d0807100018003007509308600020003000680070007800800100422b0a0b6465736372697074696f6e10021a0d0807100018003007509308600020013000680070007800800100422d0a0d6372656174696f6e5f74696d6510031a0d080510001800300050da08600020013000680070007800800100422f0a0f65787069726174696f6e5f74696d6510041a0d080510001800300050da0860002001300068007000780080010042250a0572756c657310051a0d081210001800300050da1d6000200130006800700078008001004806524f0a077072696d617279100118012204636f6465300140004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800101880103980100b201510a077072696d61727910001a04636f64651a0b6465736372697074696f6e1a0d6372656174696f6e5f74696d651a0f65787069726174696f6e5f74696d651a0572756c6573200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200f00200', 'hex'), true); +SELECT crdb_internal.unsafe_upsert_descriptor(57, decode('0afd030a0b70726f6d6f5f636f6465731839203428013a0042270a04636f646510011a0d0807100018003007509308600020003000680070007800800100880100422e0a0b6465736372697074696f6e10021a0d080710001800300750930860002001300068007000780080010088010042300a0d6372656174696f6e5f74696d6510031a0d080510001800300050da0860002001300068007000780080010088010042320a0f65787069726174696f6e5f74696d6510041a0d080510001800300050da0860002001300068007000780080010088010042280a0572756c657310051a0d081210001800300050da1d6000200130006800700078008001008801004806524f0a077072696d617279100118012204636f6465300140004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800101880103980100b201510a077072696d61727910001a04636f64651a0b6465736372697074696f6e1a0d6372656174696f6e5f74696d651a0f65787069726174696f6e5f74696d651a0572756c6573200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200f00200', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(52, 29, 'promo_codes', 57, true); -SELECT crdb_internal.unsafe_upsert_descriptor(58, decode('0a99040a10757365725f70726f6d6f5f636f646573183a203428013a0042240a046369747910011a0d080710001800300750930860002000300068007000780080010042270a07757365725f696410021a0d080e10001800300050861760002000300068007000780080010042240a04636f646510031a0d080710001800300750930860002000300068007000780080010042290a0974696d657374616d7010041a0d080510001800300050da08600020013000680070007800800100422a0a0b75736167655f636f756e7410051a0c08011040180030005014600020013000680070007800800100480652660a077072696d617279100118012204636974792207757365725f69642204636f64653001300230034000400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800102880103980100b201440a077072696d61727910001a04636974791a07757365725f69641a04636f64651a0974696d657374616d701a0b75736167655f636f756e74200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200a20227083a100110021802180120352a11666b5f636974795f7265665f75736572733000380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); +SELECT crdb_internal.unsafe_upsert_descriptor(58, decode('0aa8040a10757365725f70726f6d6f5f636f646573183a203428013a0042270a046369747910011a0d0807100018003007509308600020003000680070007800800100880100422a0a07757365725f696410021a0d080e10001800300050861760002000300068007000780080010088010042270a04636f646510031a0d0807100018003007509308600020003000680070007800800100880100422c0a0974696d657374616d7010041a0d080510001800300050da08600020013000680070007800800100880100422d0a0b75736167655f636f756e7410051a0c08011040180030005014600020013000680070007800800100880100480652660a077072696d617279100118012204636974792207757365725f69642204636f64653001300230034000400040004a10080010001a00200028003000380040005a007a0408002000800100880100900101980100a20106080012001800a80100b20100ba010060026a1d0a090a0561646d696e10020a080a04726f6f7410021204726f6f741801800102880103980100b201440a077072696d61727910001a04636974791a07757365725f69641a04636f64651a0974696d657374616d701a0b75736167655f636f756e74200120022003200420052800b80101c20100e80100f2010408001200f801008002009202009a0200a20227083a100110021802180120352a11666b5f636974795f7265665f75736572733000380040004800b20200b80200c0021dc80200e00200f00200', 'hex'), true); SELECT crdb_internal.unsafe_upsert_namespace_entry(52, 29, 'user_promo_codes', 58, true); COMMIT; diff --git a/pkg/sql/catalog/descpb/structured.pb.go b/pkg/sql/catalog/descpb/structured.pb.go index dd6c1e8b0eb0..a1c188832c25 100644 --- a/pkg/sql/catalog/descpb/structured.pb.go +++ b/pkg/sql/catalog/descpb/structured.pb.go @@ -905,7 +905,15 @@ type ColumnDescriptor struct { // have been serialized in a internal format. Instead, use one of the // schemaexpr.FormatExpr* functions. DefaultExpr *string `protobuf:"bytes,5,opt,name=default_expr,json=defaultExpr" json:"default_expr,omitempty"` - Hidden bool `protobuf:"varint,6,opt,name=hidden" json:"hidden"` + // A hidden column does not appear in star expansion, but can be referenced in + // queries and can be viewed when inspecting a table via SHOW CREATE TABLE. A + // column cannot be both hidden and inaccessible. + Hidden bool `protobuf:"varint,6,opt,name=hidden" json:"hidden"` + // An inaccessible column does not appear in star expansion and cannot be + // referenced in queries. It cannot be viewed when inspecting a table via SHOW + // CREATE TABLE and is not shown as an attribute of its table in + // pg_catalog.pg_attribute. A column cannot be both hidden and inaccessible. + Inaccessible bool `protobuf:"varint,17,opt,name=inaccessible" json:"inaccessible"` // Ids of sequences used in this column's DEFAULT expression, in calls to nextval(). UsesSequenceIds []ID `protobuf:"varint,10,rep,name=uses_sequence_ids,json=usesSequenceIds,casttype=ID" json:"uses_sequence_ids,omitempty"` // Ids of sequences that the column owns. @@ -3746,345 +3754,346 @@ func init() { } var fileDescriptor_12dcc21c3bcc9571 = []byte{ - // 5406 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x7c, 0xdb, 0x6f, 0x23, 0xd7, - 0x79, 0xb8, 0x78, 0x27, 0x3f, 0xde, 0x46, 0x67, 0xb5, 0xbb, 0xb4, 0xb2, 0x96, 0xb4, 0x5c, 0xaf, - 0x2d, 0xaf, 0x63, 0xed, 0x5a, 0x76, 0x92, 0xb5, 0x9d, 0xe4, 0x67, 0x52, 0xa4, 0x56, 0xdc, 0x95, - 0xc8, 0xf5, 0x88, 0xda, 0x75, 0x92, 0x5f, 0x33, 0x19, 0x71, 0x0e, 0xa9, 0xb1, 0x86, 0x33, 0xf4, - 0xcc, 0x70, 0xb5, 0x0c, 0xfa, 0x50, 0xe4, 0xa9, 0x4f, 0xbd, 0x00, 0x7d, 0x2b, 0x82, 0x06, 0x45, - 0x80, 0xe6, 0x2d, 0x08, 0x0a, 0xb4, 0x40, 0x1f, 0xfa, 0xda, 0x3c, 0xa6, 0x08, 0x10, 0xe4, 0x49, - 0x68, 0x95, 0x87, 0xf6, 0x0f, 0xe8, 0x93, 0x9f, 0x8a, 0x73, 0x9b, 0x0b, 0x2f, 0x32, 0x25, 0x6d, - 0xf3, 0x60, 0x43, 0xf3, 0x9d, 0xef, 0xfb, 0xce, 0x77, 0xce, 0xf9, 0xee, 0xe7, 0x70, 0xe1, 0x8e, - 0xf3, 0x85, 0x71, 0xbf, 0xa3, 0xba, 0xaa, 0x61, 0xf5, 0xee, 0x6b, 0xd8, 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0xdd, 0xbe, 0x3c, 0x83, 0x64, - 0xcf, 0xb0, 0x0e, 0x55, 0x83, 0x77, 0xad, 0xbf, 0x7d, 0xa9, 0x50, 0xb6, 0xf1, 0x88, 0xf2, 0xd8, - 0x59, 0x90, 0x39, 0x37, 0xe4, 0xc0, 0x62, 0xf0, 0x9a, 0x85, 0xfd, 0x66, 0x86, 0xed, 0x6c, 0xfd, - 0x72, 0x53, 0xf8, 0xf7, 0x30, 0x14, 0x71, 0x67, 0x41, 0x2e, 0xda, 0x61, 0x10, 0xea, 0x43, 0x71, - 0xec, 0x6e, 0x87, 0x5f, 0x09, 0x6c, 0x5d, 0x75, 0x4a, 0xd9, 0x3a, 0xd9, 0xa1, 0x79, 0x6f, 0x00, - 0xb0, 0xfc, 0xff, 0xa0, 0x38, 0x26, 0x14, 0x39, 0x0f, 0x86, 0xc3, 0xa3, 0x5a, 0x81, 0xf8, 0x30, - 0x86, 0xd4, 0x54, 0xfb, 0x58, 0xe6, 0xa3, 0xfc, 0x3c, 0xee, 0x42, 0x3e, 0x34, 0x05, 0x2a, 0x40, - 0x54, 0x65, 0x4f, 0x08, 0x33, 0x72, 0x54, 0xe5, 0x8f, 0x0f, 0x97, 0x0b, 0x90, 0x64, 0xfb, 0x1b, - 0xd4, 0xef, 0x2a, 0x40, 0x5a, 0xe4, 0x0f, 0xe5, 0x75, 0xc8, 0x78, 0x89, 0x34, 0xca, 0x41, 0xba, - 0xd6, 0xd8, 0xaf, 0x54, 0x77, 0xeb, 0x35, 0x69, 0x01, 0xe5, 0x21, 0x23, 0xd7, 0x2b, 0x35, 0xda, - 0x73, 0x95, 0x22, 0x1f, 0xa5, 0xff, 0xfc, 0x67, 0xab, 0x11, 0x1e, 0x64, 0x92, 0x52, 0xea, 0x71, - 0x3c, 0x8d, 0xa4, 0x6b, 0xe5, 0xdf, 0xa6, 0x01, 0xd5, 0x54, 0x57, 0x25, 0x9b, 0x72, 0x81, 0xce, - 0x64, 0xf4, 0x1c, 0x6b, 0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0xf8, 0xb8, 0x6e, 0xf6, 0xa4, - 0x28, 0x2d, 0x38, 0x49, 0x7a, 0x4d, 0xbe, 0x62, 0xf7, 0xbe, 0x03, 0xd2, 0xf8, 0x4f, 0x4e, 0x03, - 0x3e, 0x66, 0x11, 0xf2, 0x7b, 0xcf, 0xb6, 0xb6, 0xda, 0x8d, 0xbd, 0xfa, 0x7e, 0xbb, 0xb2, 0xf7, - 0x94, 0xbd, 0x5f, 0x6e, 0x93, 0x6a, 0xb5, 0xd5, 0xa8, 0x49, 0xd1, 0x7b, 0xdf, 0x81, 0xe2, 0x98, - 0x99, 0x11, 0x77, 0xf4, 0xf4, 0xa0, 0xba, 0xdb, 0xd8, 0x9a, 0xfa, 0x2e, 0x08, 0x65, 0x21, 0xd5, - 0xda, 0xde, 0xde, 0x6d, 0x34, 0xeb, 0x52, 0xec, 0xde, 0x07, 0x90, 0x0b, 0xa6, 0xca, 0x48, 0x82, - 0xdc, 0xf7, 0x5b, 0xcd, 0xba, 0xb2, 0x5d, 0x69, 0xec, 0x1e, 0xc8, 0x44, 0x02, 0x04, 0x05, 0xee, - 0x57, 0x04, 0x2c, 0x52, 0x5d, 0xff, 0xf5, 0x7f, 0xae, 0x2c, 0xfc, 0xfa, 0x6c, 0x25, 0xf2, 0x9b, - 0xb3, 0x95, 0xc8, 0xef, 0xcf, 0x56, 0x22, 0xff, 0x71, 0xb6, 0x12, 0xf9, 0xab, 0x3f, 0xac, 0x2c, - 0xfc, 0xe6, 0x0f, 0x2b, 0x0b, 0xbf, 0xff, 0xc3, 0xca, 0xc2, 0xf7, 0x93, 0xec, 0xdf, 0x1b, 0xf9, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x12, 0x22, 0x09, 0xda, 0x44, 0x00, 0x00, + // 5421 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x7c, 0xdd, 0x6f, 0x23, 0x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09, 0x16, 0x1c, 0x86, + 0xd6, 0x21, 0xa7, 0x9b, 0x6a, 0xa7, 0x83, 0x1d, 0x47, 0x27, 0xd3, 0x2c, 0x06, 0x70, 0x42, 0x23, + 0x68, 0x13, 0x16, 0x87, 0x0e, 0x76, 0x14, 0x07, 0x7f, 0x31, 0x24, 0x3a, 0x47, 0x4f, 0x19, 0xe8, + 0x29, 0x27, 0xb9, 0x2a, 0x14, 0x09, 0xc2, 0x3e, 0x1f, 0x27, 0x07, 0xbb, 0x09, 0x8b, 0xd6, 0x89, + 0x39, 0x46, 0x93, 0x0b, 0xd3, 0x10, 0x84, 0x20, 0xcd, 0x6d, 0xc8, 0x75, 0xac, 0xfe, 0x60, 0xe8, + 0x62, 0xb6, 0xa4, 0x2c, 0x5b, 0x12, 0x87, 0xd1, 0x25, 0xad, 0x40, 0xea, 0x85, 0x6e, 0xbb, 0x43, + 0xd5, 0x28, 0x49, 0x01, 0x79, 0x05, 0x10, 0x7d, 0x02, 0xd2, 0xa0, 0xa7, 0xa8, 0xae, 0x6b, 0xeb, + 0x87, 0x84, 0x8f, 0x39, 0xec, 0x97, 0xf2, 0xa1, 0xd3, 0x29, 0x3c, 0x7d, 0x54, 0x11, 0xc3, 0xcd, + 0x61, 0x5f, 0x2e, 0x0c, 0x7a, 0xc1, 0x6f, 0xb4, 0x0d, 0xaf, 0xab, 0x86, 0x8b, 0x6d, 0xe1, 0x42, + 0xc9, 0x71, 0x28, 0xba, 0xa9, 0x0c, 0x6c, 0xab, 0x67, 0x63, 0xc7, 0x29, 0x15, 0x02, 0xf3, 0xbe, + 0x46, 0x51, 0xd9, 0x49, 0xb7, 0x47, 0x03, 0xdc, 0x30, 0x9f, 0x72, 0x34, 0xf4, 0x03, 0x40, 0xce, + 0xc8, 0x71, 0x71, 0x5f, 0x30, 0x3a, 0xd6, 0x4d, 0xad, 0x54, 0xa4, 0x9a, 0xfc, 0xd6, 0x0c, 0x4d, + 0xde, 0xa7, 0x04, 0x8c, 0xdd,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x9e, 0xd4, 0xbf, 0xc7, 0x3a, + 0x97, 0xcd, 0x96, 0xd7, 0xb9, 0x2c, 0xc1, 0xd2, 0x41, 0xb3, 0xf1, 0xe9, 0x41, 0x5d, 0x79, 0xde, + 0x68, 0xef, 0xb4, 0x0e, 0xda, 0x4a, 0xa3, 0x59, 0xab, 0x7f, 0x26, 0xc5, 0xbc, 0xfa, 0x2e, 0x21, + 0x25, 0xcb, 0xbf, 0x4d, 0x42, 0xe1, 0xa9, 0xad, 0xf7, 0x55, 0x7b, 0x44, 0xa2, 0xda, 0x89, 0x3a, + 0x40, 0x9f, 0xc0, 0x92, 0x65, 0x90, 0x4c, 0x9f, 0x42, 0x15, 0xaf, 0x5e, 0x88, 0x4f, 0x6f, 0x78, + 0x2f, 0x5a, 0x86, 0xc6, 0x39, 0x34, 0x78, 0xb9, 0xf0, 0x09, 0x2c, 0x99, 0xf8, 0x64, 0x92, 0x43, + 0x64, 0x06, 0x07, 0x13, 0x9f, 0x8c, 0x71, 0xf8, 0x3a, 0x64, 0x89, 0x0c, 0x94, 0x12, 0x8b, 0xa6, + 0x4f, 0x36, 0x48, 0x04, 0x96, 0xa1, 0x35, 0xd8, 0x30, 0xc1, 0x26, 0xf3, 0x09, 0xec, 0xd8, 0x14, + 0x6c, 0x13, 0x9f, 0x08, 0xec, 0x0f, 0xe1, 0xc6, 0xa4, 0x74, 0x13, 0x3d, 0xc3, 0x6b, 0x63, 0x42, + 0x91, 0x0c, 0x03, 0x7d, 0x0e, 0x4b, 0x86, 0xd5, 0x51, 0x0d, 0xdd, 0x1d, 0x71, 0x2f, 0xa2, 0x38, + 0x27, 0xea, 0x80, 0x6a, 0x54, 0x76, 0xa6, 0xf1, 0x85, 0xf7, 0x77, 0x63, 0x97, 0x73, 0x60, 0xfe, + 0x84, 0x80, 0x64, 0x64, 0x4c, 0xc0, 0x96, 0xff, 0x21, 0x06, 0x68, 0x12, 0x15, 0x1d, 0xc3, 0x35, + 0xb2, 0x33, 0x63, 0x62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, 0xf3, 0x65, 0x1d, 0xa2, 0x34, + 0x1b, 0xb3, 0x29, 0xb4, 0x17, 0x36, 0x5c, 0x56, 0xda, 0x5e, 0x8c, 0x67, 0xd0, 0xb2, 0x1f, 0x42, + 0x42, 0x75, 0x14, 0xab, 0xcb, 0x63, 0xd2, 0xeb, 0x01, 0x46, 0x43, 0x57, 0x37, 0x36, 0x8e, 0x8c, + 0xce, 0x46, 0x5b, 0xdc, 0x3a, 0x8a, 0x68, 0xa6, 0x3a, 0xad, 0x2e, 0x7a, 0x17, 0x8a, 0xce, 0x91, + 0x35, 0x34, 0x34, 0xe5, 0x50, 0xed, 0x1c, 0x77, 0x75, 0xc3, 0x08, 0x35, 0x46, 0x0b, 0x6c, 0xb0, + 0xca, 0xc7, 0xf8, 0x9e, 0xfd, 0x65, 0x0a, 0x90, 0x2f, 0xcf, 0xde, 0xd0, 0x55, 0x69, 0xbc, 0xaf, + 0x40, 0x92, 0x07, 0x1a, 0xb6, 0x47, 0x6f, 0xcd, 0x8c, 0xc9, 0xe1, 0x46, 0xf0, 0xce, 0x82, 0xcc, + 0x09, 0xd1, 0x77, 0x83, 0x97, 0x8c, 0x73, 0xef, 0xc8, 0xce, 0x82, 0xb8, 0x7d, 0x7c, 0x02, 0x10, + 0x08, 0x52, 0x69, 0xca, 0xe4, 0xed, 0xb9, 0x53, 0x83, 0x9d, 0x05, 0x39, 0x40, 0x8e, 0x5a, 0x50, + 0x18, 0x84, 0x3c, 0x18, 0xaf, 0x0e, 0xee, 0xce, 0xe5, 0xee, 0x76, 0x16, 0xe4, 0x31, 0x72, 0xf4, + 0x03, 0x40, 0x9d, 0x09, 0xe3, 0x28, 0xc1, 0x57, 0x48, 0x39, 0x4e, 0xb0, 0xb3, 0x20, 0x4f, 0x61, + 0x83, 0x3e, 0x87, 0x9b, 0xfd, 0xe9, 0x7a, 0xcc, 0xeb, 0x84, 0x8d, 0x19, 0x33, 0xcc, 0xd0, 0xfe, + 0x9d, 0x05, 0x79, 0x16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0x7e, + 0x19, 0xbc, 0x95, 0xc8, 0x84, 0xcc, 0x33, 0xd7, 0xc4, 0x2f, 0xa7, 0x5f, 0x49, 0xe4, 0x4c, 0x7f, + 0x44, 0x43, 0x2d, 0x48, 0x77, 0xd5, 0xbe, 0x6e, 0xe8, 0xd8, 0x29, 0xdd, 0xa0, 0x12, 0xbd, 0x7b, + 0xae, 0x44, 0xe3, 0x17, 0x38, 0xc2, 0x9e, 0x05, 0x13, 0x4f, 0x30, 0x0a, 0x18, 0x11, 0xc1, 0x6e, + 0x4e, 0x0a, 0x26, 0x2e, 0x70, 0x42, 0x97, 0x39, 0x54, 0x30, 0xfe, 0xa5, 0xa1, 0x4f, 0x21, 0x1f, + 0xce, 0x1b, 0xe0, 0x12, 0x79, 0x43, 0x6e, 0x10, 0x4c, 0x1a, 0xb6, 0x21, 0x25, 0x12, 0x86, 0xec, + 0x25, 0x12, 0x06, 0x41, 0x8c, 0xaa, 0x24, 0x1b, 0x7b, 0xe9, 0xfa, 0xe5, 0x49, 0xce, 0xef, 0x95, + 0x9e, 0x9d, 0xae, 0x66, 0xc9, 0x0a, 0xa7, 0x5c, 0x8a, 0x64, 0x4d, 0x0f, 0xae, 0xa1, 0xc7, 0x00, + 0xde, 0x13, 0x25, 0x87, 0xde, 0x05, 0xce, 0xee, 0x18, 0x3d, 0x15, 0x88, 0xbe, 0x48, 0x72, 0x80, + 0x1a, 0xed, 0x41, 0x46, 0xb8, 0x5c, 0xd6, 0x1b, 0x9c, 0x1d, 0x0d, 0x27, 0x03, 0x80, 0x70, 0xfb, + 0x1e, 0x07, 0x52, 0xa0, 0x1b, 0x58, 0x75, 0x30, 0x6f, 0x38, 0x3d, 0x9c, 0x33, 0x5b, 0x67, 0x3a, + 0xbe, 0x75, 0xa4, 0x9a, 0x3d, 0xbc, 0x4b, 0xe8, 0xab, 0xd1, 0x52, 0x44, 0x66, 0xac, 0x50, 0x13, + 0x24, 0xba, 0x65, 0xc1, 0x78, 0x22, 0xd1, 0x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0x29, 0x7a, 0xef, 0x3b, 0x50, 0x1c, 0x33, + 0x33, 0xe2, 0x8e, 0x9e, 0x1e, 0x54, 0x77, 0x1b, 0x5b, 0x53, 0xdf, 0x05, 0xa1, 0x2c, 0xa4, 0x5a, + 0xdb, 0xdb, 0xbb, 0x8d, 0x66, 0x5d, 0x8a, 0xdd, 0xfb, 0x00, 0x72, 0xc1, 0x54, 0x19, 0x49, 0x90, + 0xfb, 0x7e, 0xab, 0x59, 0x57, 0xb6, 0x2b, 0x8d, 0xdd, 0x03, 0x99, 0x48, 0x80, 0xa0, 0xc0, 0xfd, + 0x8a, 0x80, 0x45, 0xaa, 0xeb, 0xbf, 0xfe, 0xcf, 0x95, 0x85, 0x5f, 0x9f, 0xad, 0x44, 0x7e, 0x73, + 0xb6, 0x12, 0xf9, 0xfd, 0xd9, 0x4a, 0xe4, 0x3f, 0xce, 0x56, 0x22, 0x7f, 0xf5, 0x87, 0x95, 0x85, + 0xdf, 0xfc, 0x61, 0x65, 0xe1, 0xf7, 0x7f, 0x58, 0x59, 0xf8, 0x7e, 0x92, 0xfd, 0xcb, 0x24, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x2e, 0x44, 0x14, 0x04, 0x45, 0x00, 0x00, } func (this *ForeignKeyReference) Equal(that interface{}) bool { @@ -4274,6 +4283,9 @@ func (this *ColumnDescriptor) Equal(that interface{}) bool { if this.Hidden != that1.Hidden { return false } + if this.Inaccessible != that1.Inaccessible { + return false + } if len(this.UsesSequenceIds) != len(that1.UsesSequenceIds) { return false } @@ -6397,6 +6409,16 @@ func (m *ColumnDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l i-- + if m.Inaccessible { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + i-- if m.Virtual { dAtA[i] = 1 } else { @@ -9137,6 +9159,7 @@ func (m *ColumnDescriptor) Size() (n int) { n += 2 n += 1 + sovStructured(uint64(m.SystemColumnKind)) n += 3 + n += 3 return n } @@ -11368,6 +11391,26 @@ func (m *ColumnDescriptor) Unmarshal(dAtA []byte) error { } } m.Virtual = bool(v != 0) + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Inaccessible", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStructured + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Inaccessible = bool(v != 0) default: iNdEx = preIndex skippy, err := skipStructured(dAtA[iNdEx:]) diff --git a/pkg/sql/catalog/descpb/structured.proto b/pkg/sql/catalog/descpb/structured.proto index 8761ee8b066d..a305aba36d1b 100644 --- a/pkg/sql/catalog/descpb/structured.proto +++ b/pkg/sql/catalog/descpb/structured.proto @@ -136,7 +136,18 @@ message ColumnDescriptor { // schemaexpr.FormatExpr* functions. optional string default_expr = 5; reserved 9; + + // A hidden column does not appear in star expansion, but can be referenced in + // queries and can be viewed when inspecting a table via SHOW CREATE TABLE. A + // column cannot be both hidden and inaccessible. optional bool hidden = 6 [(gogoproto.nullable) = false]; + + // An inaccessible column does not appear in star expansion and cannot be + // referenced in queries. It cannot be viewed when inspecting a table via SHOW + // CREATE TABLE and is not shown as an attribute of its table in + // pg_catalog.pg_attribute. A column cannot be both hidden and inaccessible. + optional bool inaccessible = 17 [(gogoproto.nullable) = false]; + reserved 7; // Ids of sequences used in this column's DEFAULT expression, in calls to nextval(). repeated uint32 uses_sequence_ids = 10 [(gogoproto.casttype) = "ID"]; @@ -256,7 +267,7 @@ message InterleaveDescriptor { // As as example, sample field values for the following table: // // CREATE TABLE abc ( -// a INT PRIMARY KEY USING HASH WITH BUCKET_COUNT=10, // column id: 1 +// a INT PRIMARY KEY USING HASH WITH BUCKET_COUNT=10, // column id: 1 // b BYTES // ); // @@ -266,9 +277,9 @@ message InterleaveDescriptor { // column_names: ["a"] message ShardedDescriptor { option (gogoproto.equal) = true; - + // IsSharded indicates whether the index in question is a sharded one. - optional bool is_sharded = 1 [(gogoproto.nullable) = false]; + optional bool is_sharded = 1 [(gogoproto.nullable) = false]; // Name is the name of the shard column. optional string name = 2 [(gogoproto.nullable) = false]; diff --git a/pkg/sql/catalog/table_elements.go b/pkg/sql/catalog/table_elements.go index 489c4155bce8..4295e36c0224 100644 --- a/pkg/sql/catalog/table_elements.go +++ b/pkg/sql/catalog/table_elements.go @@ -238,6 +238,9 @@ type Column interface { // IsHidden returns true iff the column is not visible. IsHidden() bool + // IsInaccessible returns true iff the column is inaccessible. + IsInaccessible() bool + // NumUsesSequences returns the number of sequences used by this column. NumUsesSequences() int diff --git a/pkg/sql/catalog/tabledesc/column.go b/pkg/sql/catalog/tabledesc/column.go index 4eb869c938f4..5b57dd68dd1d 100644 --- a/pkg/sql/catalog/tabledesc/column.go +++ b/pkg/sql/catalog/tabledesc/column.go @@ -127,6 +127,11 @@ func (w column) IsHidden() bool { return w.desc.Hidden } +// IsInaccessible returns true iff the column is inaccessible. +func (w column) IsInaccessible() bool { + return w.desc.Inaccessible +} + // NumUsesSequences returns the number of sequences used by this column. func (w column) NumUsesSequences() int { return len(w.desc.UsesSequenceIds) diff --git a/pkg/sql/catalog/tabledesc/validate.go b/pkg/sql/catalog/tabledesc/validate.go index 0765e0273c86..1046efe44c4b 100644 --- a/pkg/sql/catalog/tabledesc/validate.go +++ b/pkg/sql/catalog/tabledesc/validate.go @@ -699,6 +699,10 @@ func (desc *wrapper) validateColumns( } else if column.IsVirtual() { return fmt.Errorf("virtual column %q is not computed", column.GetName()) } + + if column.IsHidden() && column.IsInaccessible() { + return fmt.Errorf("column %q cannot be hidden and inaccessible", column.GetName()) + } } return nil } diff --git a/pkg/sql/catalog/tabledesc/validate_test.go b/pkg/sql/catalog/tabledesc/validate_test.go index 91800c918590..f1388daca5f7 100644 --- a/pkg/sql/catalog/tabledesc/validate_test.go +++ b/pkg/sql/catalog/tabledesc/validate_test.go @@ -175,7 +175,8 @@ var validationMap = []struct { "DefaultExpr": { status: todoIAmKnowinglyAddingTechDebt, reason: "initial import: TODO(features): add validation"}, - "Hidden": {status: thisFieldReferencesNoObjects}, + "Hidden": {status: iSolemnlySwearThisFieldIsValidated}, + "Inaccessible": {status: iSolemnlySwearThisFieldIsValidated}, "UsesSequenceIds": { status: todoIAmKnowinglyAddingTechDebt, reason: "initial import: TODO(features): add validation"}, @@ -435,6 +436,17 @@ func TestValidateTableDesc(t *testing.T) { }, NextColumnID: 2, }}, + {`column "bar" cannot be hidden and inaccessible`, + descpb.TableDescriptor{ + ID: 2, + ParentID: 1, + Name: "foo", + FormatVersion: descpb.FamilyFormatVersion, + Columns: []descpb.ColumnDescriptor{ + {ID: 1, Name: "bar", Hidden: true, Inaccessible: true}, + }, + NextColumnID: 2, + }}, {`the 0th family must have ID 0`, descpb.TableDescriptor{ ID: 2, diff --git a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic index eee1a1c39aee..d4378bb86b70 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic @@ -39,7 +39,7 @@ WHERE message NOT LIKE '%Z/%' AND operation != 'dist sender send' ---- batch flow coordinator CPut /NamespaceTable/30/1/53/29/"kv"/4/1 -> 54 -batch flow coordinator CPut /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:1 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:1 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<> temporary:false partition_all_by:false > +batch flow coordinator CPut /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:1 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:1 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<> temporary:false partition_all_by:false > exec stmt rows affected: 0 # We avoid using the full trace output, because that would make the @@ -65,7 +65,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:2 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > mutations:<index:<name:"woo" id:2 unique:true version:3 key_column_names:"v" key_column_directions:ASC key_column_ids:2 key_suffix_column_ids:1 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:true encoding_type:0 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > state:DELETE_ONLY direction:ADD mutation_id:1 rollback:false > next_mutation_id:2 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:2 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > mutations:<index:<name:"woo" id:2 unique:true version:3 key_column_names:"v" key_column_directions:ASC key_column_ids:2 key_suffix_column_ids:1 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:true encoding_type:0 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > state:DELETE_ONLY direction:ADD mutation_id:1 rollback:false > next_mutation_id:2 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -120,7 +120,7 @@ WHERE message NOT LIKE '%Z/%' AND operation != 'dist sender send' ---- batch flow coordinator CPut /NamespaceTable/30/1/53/29/"kv2"/4/1 -> 55 -batch flow coordinator CPut /Table/3/1/55/2/1 -> table:<name:"kv2" id:55 version:1 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"rowid" id:3 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false default_expr:"unique_rowid()" hidden:true virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_names:"rowid" column_ids:1 column_ids:2 column_ids:3 default_column_id:0 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"rowid" key_column_directions:ASC store_column_names:"k" store_column_names:"v" key_column_ids:3 store_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:1 format_version:3 state:ADD offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<> temporary:false partition_all_by:false > +batch flow coordinator CPut /Table/3/1/55/2/1 -> table:<name:"kv2" id:55 version:1 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"rowid" id:3 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_names:"rowid" column_ids:1 column_ids:2 column_ids:3 default_column_id:0 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"rowid" key_column_directions:ASC store_column_names:"k" store_column_names:"v" key_column_ids:3 store_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:1 format_version:3 state:ADD offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -168,7 +168,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/55/2/1 -> table:<name:"kv2" id:55 version:3 modification_time:<> draining_names:<parent_id:53 parent_schema_id:29 name:"kv2" > parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"rowid" id:3 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false default_expr:"unique_rowid()" hidden:true virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_names:"rowid" column_ids:1 column_ids:2 column_ids:3 default_column_id:0 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"rowid" key_column_directions:ASC store_column_names:"k" store_column_names:"v" key_column_ids:3 store_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/55/2/1 -> table:<name:"kv2" id:55 version:3 modification_time:<> draining_names:<parent_id:53 parent_schema_id:29 name:"kv2" > parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"rowid" id:3 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_names:"rowid" column_ids:1 column_ids:2 column_ids:3 default_column_id:0 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"rowid" key_column_directions:ASC store_column_names:"k" store_column_names:"v" key_column_ids:3 store_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -202,7 +202,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:5 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > mutations:<index:<name:"woo" id:2 unique:true version:3 key_column_names:"v" key_column_directions:ASC key_column_ids:2 key_suffix_column_ids:1 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:true encoding_type:0 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > state:DELETE_AND_WRITE_ONLY direction:DROP mutation_id:2 rollback:false > next_mutation_id:3 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:5 modification_time:<> parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > mutations:<index:<name:"woo" id:2 unique:true version:3 key_column_names:"v" key_column_directions:ASC key_column_ids:2 key_suffix_column_ids:1 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:true encoding_type:0 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > state:DELETE_AND_WRITE_ONLY direction:DROP mutation_id:2 rollback:false > next_mutation_id:3 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -219,7 +219,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:8 modification_time:<> draining_names:<parent_id:53 parent_schema_id:29 name:"kv" > parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 gc_mutations:<index_id:2 drop_time:... job_id:0 > create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/54/2/1 -> table:<name:"kv" id:54 version:8 modification_time:<> draining_names:<parent_id:53 parent_schema_id:29 name:"kv" > parent_id:53 unexposed_parent_schema_id:29 columns:<name:"k" id:1 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:false hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns:<name:"v" id:2 type:<InternalType:<family:IntFamily width:64 precision:0 locale:"" visible_type:0 oid:20 time_precision_is_set:false > TypeMeta:<Version:0 > > nullable:true hidden:false inaccessible:false virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families:<name:"primary" id:0 column_names:"k" column_names:"v" column_ids:1 column_ids:2 default_column_id:2 > next_family_id:1 primary_index:<name:"primary" id:1 unique:true version:4 key_column_names:"k" key_column_directions:ASC store_column_names:"v" key_column_ids:1 store_column_ids:2 foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 num_implicit_columns:0 > type:FORWARD created_explicitly:false encoding_type:1 sharded:<is_sharded:false name:"" shard_buckets:0 > disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges:<users:<user_proto:"admin" privileges:2 > users:<user_proto:"root" privileges:2 > owner_proto:"root" version:1 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0 gc_mutations:<index_id:2 drop_time:... job_id:0 > create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 # Check that session tracing does not inhibit the fast path for inserts & diff --git a/pkg/sql/opt_catalog.go b/pkg/sql/opt_catalog.go index 005bf97cf9e2..59e039fe43f3 100644 --- a/pkg/sql/opt_catalog.go +++ b/pkg/sql/opt_catalog.go @@ -670,7 +670,9 @@ func newOptTable( switch { case col.Public(): kind = cat.Ordinary - if col.IsHidden() { + if col.IsInaccessible() { + visibility = cat.Inaccessible + } else if col.IsHidden() { visibility = cat.Hidden } case col.WriteAndDeleteOnly(): diff --git a/pkg/sql/pg_catalog.go b/pkg/sql/pg_catalog.go index e9e0f1d55a6e..7b033319b00d 100644 --- a/pkg/sql/pg_catalog.go +++ b/pkg/sql/pg_catalog.go @@ -393,6 +393,9 @@ https://www.postgresql.org/docs/12/catalog-pg-attribute.html`, // Columns for table. for _, column := range table.PublicColumns() { + if column.IsInaccessible() { + continue + } tableID := tableOid(table.GetID()) if err := addColumn(column, tableID, column.GetPGAttributeNum()); err != nil { return err @@ -542,6 +545,12 @@ https://www.postgresql.org/docs/9.5/catalog-pg-class.html`, relPersistence = relPersistenceTemporary } namespaceOid := h.NamespaceOid(db.GetID(), scName) + relnatts := 0 + for _, column := range table.PublicColumns() { + if !column.IsInaccessible() { + relnatts++ + } + } if err := addRow( tableOid(table.GetID()), // oid tree.NewDName(table.GetName()), // relname @@ -557,12 +566,12 @@ https://www.postgresql.org/docs/9.5/catalog-pg-class.html`, zeroVal, // relallvisible oidZero, // reltoastrelid tree.MakeDBool(tree.DBool(table.IsPhysicalTable())), // relhasindex - tree.DBoolFalse, // relisshared - relPersistence, // relPersistence - tree.DBoolFalse, // relistemp - relKind, // relkind - tree.NewDInt(tree.DInt(len(table.PublicColumns()))), // relnatts - tree.NewDInt(tree.DInt(len(table.GetChecks()))), // relchecks + tree.DBoolFalse, // relisshared + relPersistence, // relPersistence + tree.DBoolFalse, // relistemp + relKind, // relkind + tree.NewDInt(tree.DInt(relnatts)), // relnatts + tree.NewDInt(tree.DInt(len(table.GetChecks()))), // relchecks tree.DBoolFalse, // relhasoids tree.MakeDBool(tree.DBool(table.IsPhysicalTable())), // relhaspkey tree.DBoolFalse, // relhasrules diff --git a/pkg/sql/show_create.go b/pkg/sql/show_create.go index f0e64bbe8708..8705a970395e 100644 --- a/pkg/sql/show_create.go +++ b/pkg/sql/show_create.go @@ -83,6 +83,10 @@ func ShowCreateTable( f.FormatNode(tn) f.WriteString(" (") for i, col := range desc.PublicColumns() { + // Inaccessible columns are not displayed in SHOW CREATE TABLE. + if col.IsInaccessible() { + continue + } if i != 0 { f.WriteString(",") }
96934715895c84f7b39d9d5a69746fb88174b5a1
2019-08-14 18:20:54
Yahor Yuzefovich
exec: introduce two panic functions to use within the exec package
false
introduce two panic functions to use within the exec package
exec
diff --git a/pkg/sql/distsqlrun/materializer.go b/pkg/sql/distsqlrun/materializer.go index 4924a5acd4db..0f2520c33015 100644 --- a/pkg/sql/distsqlrun/materializer.go +++ b/pkg/sql/distsqlrun/materializer.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/cockroachdb/cockroach/pkg/sql/types" @@ -175,7 +176,7 @@ func (m *materializer) next() (sqlbase.EncDatumRow, *distsqlpb.ProducerMetadata) } func (m *materializer) Next() (sqlbase.EncDatumRow, *distsqlpb.ProducerMetadata) { - if err := exec.CatchVectorizedRuntimeError(m.nextAdapter); err != nil { + if err := execerror.CatchVectorizedRuntimeError(m.nextAdapter); err != nil { m.MoveToDraining(err) return nil, m.DrainHelper() } diff --git a/pkg/sql/distsqlrun/vectorized_error_propagation_test.go b/pkg/sql/distsqlrun/vectorized_panic_propagation_test.go similarity index 64% rename from pkg/sql/distsqlrun/vectorized_error_propagation_test.go rename to pkg/sql/distsqlrun/vectorized_panic_propagation_test.go index 7536d48463e4..2642c8255b0f 100644 --- a/pkg/sql/distsqlrun/vectorized_error_propagation_test.go +++ b/pkg/sql/distsqlrun/vectorized_panic_propagation_test.go @@ -18,17 +18,18 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/cockroachdb/cockroach/pkg/util/leaktest" - "github.com/pkg/errors" + "github.com/stretchr/testify/require" ) -// TestVectorizedErrorPropagation verifies that materializers successfully +// TestVectorizedInternalPanic verifies that materializers successfully // handle panics coming from exec package. It sets up the following chain: -// RowSource -> columnarizer -> exec error emitter -> materializer, +// RowSource -> columnarizer -> test panic emitter -> materializer, // and makes sure that a panic doesn't occur yet the error is propagated. -func TestVectorizedErrorPropagation(t *testing.T) { +func TestVectorizedInternalPanic(t *testing.T) { defer leaktest.AfterTest(t)() ctx := context.Background() st := cluster.MakeTestingClusterSettings() @@ -49,7 +50,7 @@ func TestVectorizedErrorPropagation(t *testing.T) { t.Fatal(err) } - vee := exec.NewTestVectorizedErrorEmitter(col) + vee := newTestVectorizedPanicEmitter(col, execerror.VectorizedInternalPanic) mat, err := newMaterializer( &flowCtx, 1, /* processorID */ @@ -64,31 +65,18 @@ func TestVectorizedErrorPropagation(t *testing.T) { if err != nil { t.Fatal(err) } + mat.Start(ctx) var meta *distsqlpb.ProducerMetadata - panicEmitted := false - func() { - defer func() { - if err := recover(); err != nil { - panicEmitted = true - } - }() - mat.Start(ctx) - _, meta = mat.Next() - }() - if panicEmitted { - t.Fatalf("VectorizedRuntimeError was not caught by the operators.") - } - if meta == nil || meta.Err == nil { - t.Fatalf("VectorizedRuntimeError was not propagated as metadata.") - } + require.NotPanics(t, func() { _, meta = mat.Next() }, "VectorizedInternalPanic was not caught") + require.NotNil(t, meta.Err, "VectorizedInternalPanic was not propagated as metadata") } -// TestNonVectorizedErrorPropagation verifies that materializers do not handle +// TestNonVectorizedPanicPropagation verifies that materializers do not handle // panics coming not from exec package. It sets up the following chain: -// RowSource -> columnarizer -> distsqlrun error emitter -> materializer, +// RowSource -> columnarizer -> test panic emitter -> materializer, // and makes sure that a panic is emitted all the way through the chain. -func TestNonVectorizedErrorPropagation(t *testing.T) { +func TestNonVectorizedPanicPropagation(t *testing.T) { defer leaktest.AfterTest(t)() ctx := context.Background() st := cluster.MakeTestingClusterSettings() @@ -109,7 +97,7 @@ func TestNonVectorizedErrorPropagation(t *testing.T) { t.Fatal(err) } - nvee := newTestVectorizedErrorEmitter(col) + nvee := newTestVectorizedPanicEmitter(col, nil /* panicFn */) mat, err := newMaterializer( &flowCtx, 1, /* processorID */ @@ -124,48 +112,45 @@ func TestNonVectorizedErrorPropagation(t *testing.T) { if err != nil { t.Fatal(err) } + mat.Start(ctx) - panicEmitted := false - func() { - defer func() { - if err := recover(); err != nil { - panicEmitted = true - } - }() - mat.Start(ctx) - _, _ = mat.Next() - }() - if !panicEmitted { - t.Fatalf("Not VectorizedRuntimeError was caught by the operators.") - } + require.Panics(t, func() { mat.Next() }, "NonVectorizedPanic was caught by the operators") } -// testNonVectorizedErrorEmitter is an exec.Operator that panics on every +// testVectorizedPanicEmitter is an exec.Operator that panics on every // odd-numbered invocation of Next() and returns the next batch from the input // on every even-numbered (i.e. it becomes a noop for those iterations). Used -// for tests only. -type testNonVectorizedErrorEmitter struct { +// for tests only. If panicFn is non-nil, it is used; otherwise, the builtin +// panic function is called. +type testVectorizedPanicEmitter struct { exec.OneInputNode emitBatch bool + + panicFn func(interface{}) } -var _ exec.Operator = &testNonVectorizedErrorEmitter{} +var _ exec.Operator = &testVectorizedPanicEmitter{} -// newTestVectorizedErrorEmitter creates a new TestVectorizedErrorEmitter. -func newTestVectorizedErrorEmitter(input exec.Operator) exec.Operator { - return &testNonVectorizedErrorEmitter{OneInputNode: exec.NewOneInputNode(input)} +func newTestVectorizedPanicEmitter(input exec.Operator, panicFn func(interface{})) exec.Operator { + return &testVectorizedPanicEmitter{ + OneInputNode: exec.NewOneInputNode(input), + panicFn: panicFn, + } } // Init is part of exec.Operator interface. -func (e *testNonVectorizedErrorEmitter) Init() { +func (e *testVectorizedPanicEmitter) Init() { e.Input().Init() } // Next is part of exec.Operator interface. -func (e *testNonVectorizedErrorEmitter) Next(ctx context.Context) coldata.Batch { +func (e *testVectorizedPanicEmitter) Next(ctx context.Context) coldata.Batch { if !e.emitBatch { e.emitBatch = true - panic(errors.New("An error from distsqlrun package")) + if e.panicFn != nil { + e.panicFn("") + } + panic("") } e.emitBatch = false diff --git a/pkg/sql/exec/avg_agg_tmpl.go b/pkg/sql/exec/avg_agg_tmpl.go index 3bf786c4e83e..7a71e47cd68e 100644 --- a/pkg/sql/exec/avg_agg_tmpl.go +++ b/pkg/sql/exec/avg_agg_tmpl.go @@ -23,6 +23,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/pkg/errors" ) @@ -40,13 +41,13 @@ var _ tree.Datum // input to the result of the second input / the third input, where the third // input is an int64. func _ASSIGN_DIV_INT64(_, _, _ string) { - panic("") + execerror.VectorizedInternalPanic("") } // _ASSIGN_ADD is the template addition function for assigning the first input // to the result of the second input + the third input. func _ASSIGN_ADD(_, _, _ string) { - panic("") + execerror.VectorizedInternalPanic("") } // */}} diff --git a/pkg/sql/exec/builtin_funcs.go b/pkg/sql/exec/builtin_funcs.go index 0c72b0068e1a..be3c8cb0d0c4 100644 --- a/pkg/sql/exec/builtin_funcs.go +++ b/pkg/sql/exec/builtin_funcs.go @@ -15,6 +15,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" @@ -80,7 +81,7 @@ func (b *defaultBuiltinFuncOperator) Next(ctx context.Context) coldata.Batch { } else { res, err = b.funcExpr.ResolvedOverload().Fn(b.evalCtx, b.row) if err != nil { - panic(err) + execerror.NonVectorizedPanic(err) } } @@ -90,7 +91,7 @@ func (b *defaultBuiltinFuncOperator) Next(ctx context.Context) coldata.Batch { } else { converted, err := b.converter(res) if err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } coldata.SetValueAt(batch.ColVec(b.outputIdx), converted, rowIdx, b.outputPhysType) } diff --git a/pkg/sql/exec/cancel_checker.go b/pkg/sql/exec/cancel_checker.go index 7e1a202a7b2a..23086dd63ca2 100644 --- a/pkg/sql/exec/cancel_checker.go +++ b/pkg/sql/exec/cancel_checker.go @@ -14,6 +14,7 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" ) @@ -69,7 +70,7 @@ func (c *CancelChecker) check(ctx context.Context) { func (c *CancelChecker) checkEveryCall(ctx context.Context) { select { case <-ctx.Done(): - panic(sqlbase.QueryCanceledError) + execerror.NonVectorizedPanic(sqlbase.QueryCanceledError) default: } } diff --git a/pkg/sql/exec/cancel_checker_test.go b/pkg/sql/exec/cancel_checker_test.go index 9b87858b8cd8..b76bf8d2e588 100644 --- a/pkg/sql/exec/cancel_checker_test.go +++ b/pkg/sql/exec/cancel_checker_test.go @@ -16,6 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/stretchr/testify/require" ) @@ -27,7 +28,8 @@ func TestCancelChecker(t *testing.T) { batch := coldata.NewMemBatch([]coltypes.T{coltypes.Int64}) op := NewCancelChecker(NewNoop(NewRepeatableBatchSource(batch))) cancel() - require.PanicsWithValue(t, sqlbase.QueryCanceledError, func() { + err := execerror.CatchVectorizedRuntimeError(func() { op.Next(ctx) }) + require.Equal(t, sqlbase.QueryCanceledError, err) } diff --git a/pkg/sql/exec/colrpc/colrpc_test.go b/pkg/sql/exec/colrpc/colrpc_test.go index 0b2d276bea93..c1cfaf976bee 100644 --- a/pkg/sql/exec/colrpc/colrpc_test.go +++ b/pkg/sql/exec/colrpc/colrpc_test.go @@ -26,6 +26,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/util/hlc" "github.com/cockroachdb/cockroach/pkg/util/leaktest" @@ -256,7 +257,7 @@ func TestOutboxInbox(t *testing.T) { var readerErr error for { var outputBatch coldata.Batch - if err := exec.CatchVectorizedRuntimeError(func() { + if err := execerror.CatchVectorizedRuntimeError(func() { outputBatch = inbox.Next(readerCtx) }); err != nil { readerErr = err diff --git a/pkg/sql/exec/colrpc/inbox.go b/pkg/sql/exec/colrpc/inbox.go index 866b35e7e4db..7cbe35c95c95 100644 --- a/pkg/sql/exec/colrpc/inbox.go +++ b/pkg/sql/exec/colrpc/inbox.go @@ -22,6 +22,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/syncutil" ) @@ -260,7 +261,7 @@ func (i *Inbox) Next(ctx context.Context) coldata.Batch { i.streamMu.Unlock() } i.closeLocked() - panic(err) + execerror.VectorizedInternalPanic(err) } }() @@ -269,7 +270,7 @@ func (i *Inbox) Next(ctx context.Context) coldata.Batch { // termination). DrainMeta will use the stream to read any remaining metadata // after Next returns a zero-length batch during normal execution. if err := i.maybeInitLocked(ctx); err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } for { @@ -293,7 +294,7 @@ func (i *Inbox) Next(ctx context.Context) coldata.Batch { return i.zeroBatch } i.errCh <- err - panic(err) + execerror.VectorizedInternalPanic(err) } if len(m.Data.Metadata) != 0 { for _, rpm := range m.Data.Metadata { @@ -312,10 +313,10 @@ func (i *Inbox) Next(ctx context.Context) coldata.Batch { } i.scratch.data = i.scratch.data[:0] if err := i.serializer.Deserialize(&i.scratch.data, m.Data.RawBytes); err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } if err := i.converter.ArrowToBatch(i.scratch.data, i.scratch.b); err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } return i.scratch.b } diff --git a/pkg/sql/exec/colrpc/inbox_test.go b/pkg/sql/exec/colrpc/inbox_test.go index e67af3884ba8..45fa0793c2df 100644 --- a/pkg/sql/exec/colrpc/inbox_test.go +++ b/pkg/sql/exec/colrpc/inbox_test.go @@ -17,7 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" - "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/stretchr/testify/require" @@ -56,7 +56,7 @@ func TestInboxCancellation(t *testing.T) { // Cancel the context. cancelFn() // Next should not block if the context is canceled. - err = exec.CatchVectorizedRuntimeError(func() { inbox.Next(ctx) }) + err = execerror.CatchVectorizedRuntimeError(func() { inbox.Next(ctx) }) require.True(t, testutils.IsError(err, "context canceled"), err) // Now, the remote stream arrives. err = inbox.RunWithStream(context.Background(), mockFlowStreamServer{}) @@ -148,7 +148,7 @@ func TestInboxTimeout(t *testing.T) { rpcLayer = makeMockFlowStreamRPCLayer() ) go func() { - readerErrCh <- exec.CatchVectorizedRuntimeError(func() { inbox.Next(ctx) }) + readerErrCh <- execerror.CatchVectorizedRuntimeError(func() { inbox.Next(ctx) }) }() // Timeout the inbox. diff --git a/pkg/sql/exec/colrpc/outbox.go b/pkg/sql/exec/colrpc/outbox.go index c8c1fdc15b37..99c724f80773 100644 --- a/pkg/sql/exec/colrpc/outbox.go +++ b/pkg/sql/exec/colrpc/outbox.go @@ -22,6 +22,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/logtags" "google.golang.org/grpc" @@ -207,7 +208,7 @@ func (o *Outbox) sendBatches( return true, nil } - if err := exec.CatchVectorizedRuntimeError(nextBatch); err != nil { + if err := execerror.CatchVectorizedRuntimeError(nextBatch); err != nil { log.Errorf(ctx, "Outbox Next error: %+v", err) return false, err } diff --git a/pkg/sql/exec/distinct_tmpl.go b/pkg/sql/exec/distinct_tmpl.go index 6b0b9b38b3f6..bb951c04c93d 100644 --- a/pkg/sql/exec/distinct_tmpl.go +++ b/pkg/sql/exec/distinct_tmpl.go @@ -26,6 +26,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/pkg/errors" @@ -55,7 +56,7 @@ func OrderedDistinctColsToOperators( } } if r, ok = input.(resettableOperator); !ok { - panic("unexpectedly an ordered distinct is not a resetter") + execerror.VectorizedInternalPanic("unexpectedly an ordered distinct is not a resetter") } distinctChain := distinctChainOps{ resettableOperator: r, @@ -122,7 +123,7 @@ const _TYPES_T = coltypes.Unhandled // _ASSIGN_NE is the template equality function for assigning the first input // to the result of the second input != the third input. func _ASSIGN_NE(_ bool, _, _ _GOTYPE) bool { - panic("") + execerror.VectorizedInternalPanic("") } // */}} diff --git a/pkg/sql/exec/error.go b/pkg/sql/exec/execerror/error.go similarity index 65% rename from pkg/sql/exec/error.go rename to pkg/sql/exec/execerror/error.go index 55b895a615a3..6ae9b183b722 100644 --- a/pkg/sql/exec/error.go +++ b/pkg/sql/exec/execerror/error.go @@ -8,16 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -package exec +package execerror import ( "bufio" - "context" "fmt" "runtime/debug" "strings" - "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/errors" @@ -53,11 +51,24 @@ func CatchVectorizedRuntimeError(operation func()) (retErr error) { // A StorageError was caused by something below SQL, and represents // an error that we'd simply like to propagate along. // Do nothing. - } else if code := pgerror.GetPGCode(e); code == pgcode.Uncategorized { - // Any error without a code already is "surprising" and - // needs to be annotated to indicate that it was - // unexpected. - e = errors.AssertionFailedf("unexpected error from the vectorized runtime: %+v", e) + } else { + doNotAnnotate := false + if nvie, ok := e.(*notVectorizedInternalError); ok { + // A notVectorizedInternalError was not caused by the + // vectorized engine and represents an error that we don't + // want to annotate in case it doesn't have a valid PG code. + doNotAnnotate = true + // We want to unwrap notVectorizedInternalError so that in case + // the original error does have a valid PG code, the code is + // correctly propagated. + e = nvie.error + } + if code := pgerror.GetPGCode(e); !doNotAnnotate && code == pgcode.Uncategorized { + // Any error without a code already is "surprising" and + // needs to be annotated to indicate that it was + // unexpected. + e = errors.AssertionFailedf("unexpected error from the vectorized runtime: %+v", e) + } } retErr = e } else { @@ -99,38 +110,6 @@ func isPanicFromVectorizedEngine(panicEmittedFrom string) bool { strings.HasPrefix(panicEmittedFrom, columnarizerPrefix) } -// TestVectorizedErrorEmitter is an Operator that panics on every odd-numbered -// invocation of Next() and returns the next batch from the input on every -// even-numbered (i.e. it becomes a noop for those iterations). Used for tests -// only. -type TestVectorizedErrorEmitter struct { - OneInputNode - emitBatch bool -} - -var _ Operator = &TestVectorizedErrorEmitter{} - -// NewTestVectorizedErrorEmitter creates a new TestVectorizedErrorEmitter. -func NewTestVectorizedErrorEmitter(input Operator) Operator { - return &TestVectorizedErrorEmitter{OneInputNode: NewOneInputNode(input)} -} - -// Init is part of Operator interface. -func (e *TestVectorizedErrorEmitter) Init() { - e.input.Init() -} - -// Next is part of Operator interface. -func (e *TestVectorizedErrorEmitter) Next(ctx context.Context) coldata.Batch { - if !e.emitBatch { - e.emitBatch = true - panic(errors.New("a panic from exec package")) - } - - e.emitBatch = false - return e.input.Next(ctx) -} - // StorageError is an error that was created by a component below the sql // stack, such as the network or storage layers. A StorageError will be bubbled // up all the way past the SQL layer unchanged. @@ -148,3 +127,32 @@ func (s *StorageError) Cause() error { func NewStorageError(err error) *StorageError { return &StorageError{error: err} } + +// notVectorizedInternalError is an error that originated outside of the +// vectorized engine (for example, it was caused by a non-columnar builtin). +// notVectorizedInternalError will be returned to the client not as an +// "internal error" and without the stack trace. +type notVectorizedInternalError struct { + error +} + +func newNotVectorizedInternalError(err error) *notVectorizedInternalError { + return &notVectorizedInternalError{error: err} +} + +// VectorizedInternalPanic simply panics with the provided object. It will +// always be returned as internal error to the client with the corresponding +// stack trace. This method should be called to propagate all unexpected errors +// that originated within the vectorized engine. +func VectorizedInternalPanic(err interface{}) { + panic(err) +} + +// NonVectorizedPanic panics with the error that is wrapped by +// notVectorizedInternalError which will not be treated as internal error and +// will not have a printed out stack trace. This method should be called to +// propagate all errors that originated outside of the vectorized engine and +// all expected errors from the vectorized engine. +func NonVectorizedPanic(err error) { + panic(newNotVectorizedInternalError(err)) +} diff --git a/pkg/sql/exec/execgen/cmd/execgen/avg_agg_gen.go b/pkg/sql/exec/execgen/cmd/execgen/avg_agg_gen.go index e326c8fcc4c7..221f544f1ce1 100644 --- a/pkg/sql/exec/execgen/cmd/execgen/avg_agg_gen.go +++ b/pkg/sql/exec/execgen/cmd/execgen/avg_agg_gen.go @@ -19,6 +19,7 @@ import ( "text/template" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -37,7 +38,7 @@ func (a avgAggTmplInfo) AssignDivInt64(target, l, r string) string { return fmt.Sprintf( `%s.SetInt64(%s) if _, err := tree.DecimalCtx.Quo(&%s, &%s, &%s); err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) }`, target, r, target, l, target, ) @@ -47,7 +48,9 @@ if _, err := tree.DecimalCtx.Quo(&%s, &%s, &%s); err != nil { case coltypes.Float64: return fmt.Sprintf("%s = %s / float64(%s)", target, l, r) default: - panic("unsupported avg agg type") + execerror.VectorizedInternalPanic("unsupported avg agg type") + // This code is unreachable, but the compiler cannot infer that. + return "" } } diff --git a/pkg/sql/exec/execgen/cmd/execgen/main.go b/pkg/sql/exec/execgen/cmd/execgen/main.go index 112a3a151003..5577527105d6 100644 --- a/pkg/sql/exec/execgen/cmd/execgen/main.go +++ b/pkg/sql/exec/execgen/cmd/execgen/main.go @@ -20,6 +20,7 @@ import ( "path/filepath" "regexp" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/pkg/errors" ) @@ -52,7 +53,7 @@ var generators = make(map[string]generator) func registerGenerator(g generator, filename string) { if _, ok := generators[filename]; ok { - panic(fmt.Sprintf("%s generator already registered", filename)) + execerror.VectorizedInternalPanic(fmt.Sprintf("%s generator already registered", filename)) } generators[filename] = g } diff --git a/pkg/sql/exec/execgen/cmd/execgen/overloads.go b/pkg/sql/exec/execgen/cmd/execgen/overloads.go index 6338097bd360..9ff42994a4ab 100644 --- a/pkg/sql/exec/execgen/cmd/execgen/overloads.go +++ b/pkg/sql/exec/execgen/cmd/execgen/overloads.go @@ -18,6 +18,7 @@ import ( "text/template" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -314,7 +315,7 @@ func (decimalCustomizer) getCmpOpCompareFunc() compareFunc { func (decimalCustomizer) getBinOpAssignFunc() assignFunc { return func(op overload, target, l, r string) string { - return fmt.Sprintf("if _, err := tree.DecimalCtx.%s(&%s, &%s, &%s); err != nil { panic(err) }", + return fmt.Sprintf("if _, err := tree.DecimalCtx.%s(&%s, &%s, &%s); err != nil { execerror.NonVectorizedPanic(err) }", binaryOpDecMethod[op.BinOp], target, l, r) } } @@ -324,7 +325,7 @@ func (decimalCustomizer) getHashAssignFunc() assignFunc { return fmt.Sprintf(` d, err := %[2]s.Float64() if err != nil { - panic(fmt.Sprintf("%%v", err)) + execerror.NonVectorizedPanic(err) } %[1]s = f64hash(noescape(unsafe.Pointer(&d)), %[1]s) @@ -364,7 +365,7 @@ func (c intCustomizer) getBinOpAssignFunc() assignFunc { { result := {{.Left}} + {{.Right}} if (result < {{.Left}}) != ({{.Right}} < 0) { - panic(tree.ErrIntOutOfRange) + execerror.NonVectorizedPanic(tree.ErrIntOutOfRange) } {{.Target}} = result } @@ -375,7 +376,7 @@ func (c intCustomizer) getBinOpAssignFunc() assignFunc { { result := {{.Left}} - {{.Right}} if (result < {{.Left}}) != ({{.Right}} > 0) { - panic(tree.ErrIntOutOfRange) + execerror.NonVectorizedPanic(tree.ErrIntOutOfRange) } {{.Target}} = result } @@ -403,7 +404,7 @@ func (c intCustomizer) getBinOpAssignFunc() assignFunc { upperBound = "math.MaxInt32" lowerBound = "math.MinInt32" default: - panic(fmt.Sprintf("unhandled integer width %d", c.width)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled integer width %d", c.width)) } args["UpperBound"] = upperBound @@ -415,9 +416,9 @@ func (c intCustomizer) getBinOpAssignFunc() assignFunc { if {{.Left}} != 0 && {{.Right}} != 0 { sameSign := ({{.Left}} < 0) == ({{.Right}} < 0) if (result < 0) == sameSign { - panic(tree.ErrIntOutOfRange) + execerror.NonVectorizedPanic(tree.ErrIntOutOfRange) } else if result/{{.Right}} != {{.Left}} { - panic(tree.ErrIntOutOfRange) + execerror.NonVectorizedPanic(tree.ErrIntOutOfRange) } } } @@ -437,29 +438,29 @@ func (c intCustomizer) getBinOpAssignFunc() assignFunc { case 64: minInt = "math.MinInt64" default: - panic(fmt.Sprintf("unhandled integer width %d", c.width)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled integer width %d", c.width)) } args["MinInt"] = minInt t = template.Must(template.New("").Parse(` { if {{.Right}} == 0 { - panic(tree.ErrDivByZero) + execerror.NonVectorizedPanic(tree.ErrDivByZero) } result := {{.Left}} / {{.Right}} if {{.Left}} == {{.MinInt}} && {{.Right}} == -1 { - panic(tree.ErrIntOutOfRange) + execerror.NonVectorizedPanic(tree.ErrIntOutOfRange) } {{.Target}} = result } `)) default: - panic(fmt.Sprintf("unhandled binary operator %s", op.BinOp.String())) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled binary operator %s", op.BinOp.String())) } if err := t.Execute(&buf, args); err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } return buf.String() } diff --git a/pkg/sql/exec/execgen/cmd/execgen/overloads_test_utils_gen.go b/pkg/sql/exec/execgen/cmd/execgen/overloads_test_utils_gen.go index 437301fa47fa..6e35c0f4b4a2 100644 --- a/pkg/sql/exec/execgen/cmd/execgen/overloads_test_utils_gen.go +++ b/pkg/sql/exec/execgen/cmd/execgen/overloads_test_utils_gen.go @@ -24,6 +24,7 @@ import ( "math" "github.com/cockroachdb/apd" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) diff --git a/pkg/sql/exec/execgen/cmd/execgen/projection_ops_gen.go b/pkg/sql/exec/execgen/cmd/execgen/projection_ops_gen.go index 6306af1c778b..24166a38139c 100644 --- a/pkg/sql/exec/execgen/cmd/execgen/projection_ops_gen.go +++ b/pkg/sql/exec/execgen/cmd/execgen/projection_ops_gen.go @@ -29,6 +29,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/exec/typeconv" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/pkg/errors" diff --git a/pkg/sql/exec/execgen/placeholders.go b/pkg/sql/exec/execgen/placeholders.go index ec351cde0536..8cc9cdefaf2d 100644 --- a/pkg/sql/exec/execgen/placeholders.go +++ b/pkg/sql/exec/execgen/placeholders.go @@ -10,6 +10,8 @@ package execgen +import "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" + const nonTemplatePanic = "do not call from non-template code" // Remove unused warnings. @@ -28,50 +30,54 @@ var ( // GET is a template function. func GET(target, i interface{}) interface{} { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) + return nil } // SET is a template function. func SET(target, i, new interface{}) { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) } // SWAP is a template function. func SWAP(target, i, j interface{}) { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) } // SLICE is a template function. func SLICE(target, start, end interface{}) interface{} { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) + return nil } // COPYSLICE is a template function. func COPYSLICE(target, src, destIdx, srcStartIdx, srcEndIdx interface{}) { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) } // APPENDSLICE is a template function. func APPENDSLICE(target, src, destIdx, srcStartIdx, srcEndIdx interface{}) { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) } // APPENDVAL is a template function. func APPENDVAL(target, v interface{}) { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) } // LEN is a template function. func LEN(target interface{}) interface{} { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) + return nil } // ZERO is a template function. func ZERO(target interface{}) { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) } // RANGE is a template function. func RANGE(loopVariableIdent interface{}, target interface{}) bool { - panic(nonTemplatePanic) + execerror.VectorizedInternalPanic(nonTemplatePanic) + return false } diff --git a/pkg/sql/exec/hash_aggregator.go b/pkg/sql/exec/hash_aggregator.go index 7f2fdff161a4..5b6799ecaeb5 100644 --- a/pkg/sql/exec/hash_aggregator.go +++ b/pkg/sql/exec/hash_aggregator.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util" ) @@ -178,7 +179,9 @@ func (op *hashGrouper) Child(nth int) OpNode { if nth == 0 { return op.builder.spec.source } - panic(fmt.Sprintf("invalid index %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid index %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } func (op *hashGrouper) Init() { diff --git a/pkg/sql/exec/hashjoiner.go b/pkg/sql/exec/hashjoiner.go index 492d6cffc4c8..f99797bcafd6 100644 --- a/pkg/sql/exec/hashjoiner.go +++ b/pkg/sql/exec/hashjoiner.go @@ -16,6 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/pkg/errors" ) @@ -202,7 +203,9 @@ func (hj *hashJoinEqOp) Child(nth int) OpNode { case 1: return hj.spec.right.source } - panic(fmt.Sprintf("invalid idx %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid idx %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } var _ Operator = &hashJoinEqOp{} @@ -264,7 +267,9 @@ func (hj *hashJoinEqOp) Next(ctx context.Context) coldata.Batch { hj.prober.batch.SetSelection(false) return hj.prober.batch default: - panic("hash joiner in unhandled state") + execerror.VectorizedInternalPanic("hash joiner in unhandled state") + // This code is unreachable, but the compiler cannot infer that. + return nil } } diff --git a/pkg/sql/exec/hashjoiner_test.go b/pkg/sql/exec/hashjoiner_test.go index 5400f8397c8b..0096f04e205e 100644 --- a/pkg/sql/exec/hashjoiner_test.go +++ b/pkg/sql/exec/hashjoiner_test.go @@ -18,6 +18,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/cockroachdb/cockroach/pkg/util/leaktest" ) @@ -31,7 +32,7 @@ func TestHashJoinerInt64(t *testing.T) { for i, f := range floats { _, err := decs[i].SetFloat64(f) if err != nil { - panic(fmt.Sprintf("%v", err)) + execerror.VectorizedInternalPanic(fmt.Sprintf("%v", err)) } } diff --git a/pkg/sql/exec/hashjoiner_tmpl.go b/pkg/sql/exec/hashjoiner_tmpl.go index 7b4383ab034e..e5de871fe20e 100644 --- a/pkg/sql/exec/hashjoiner_tmpl.go +++ b/pkg/sql/exec/hashjoiner_tmpl.go @@ -28,6 +28,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -52,13 +53,13 @@ type _GOTYPESLICE interface{} // _ASSIGN_HASH is the template equality function for assigning the first input // to the result of the hash value of the second input. func _ASSIGN_HASH(_, _ interface{}) uint64 { - panic("") + execerror.VectorizedInternalPanic("") } // _ASSIGN_NE is the template equality function for assigning the first input // to the result of the the second input != the third input. func _ASSIGN_NE(_, _, _ interface{}) uint64 { - panic("") + execerror.VectorizedInternalPanic("") } // _TYPES_T is the template type variable for coltypes.T. It will be replaced by @@ -324,7 +325,7 @@ func (ht *hashTable) rehash( // {{end}} default: - panic(fmt.Sprintf("unhandled type %d", t)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %d", t)) } } @@ -360,7 +361,7 @@ func (ht *hashTable) checkCol(t coltypes.T, keyColIdx int, nToCheck uint16, sel } // {{end}} default: - panic(fmt.Sprintf("unhandled type %d", t)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %d", t)) } } diff --git a/pkg/sql/exec/mem_estimation.go b/pkg/sql/exec/mem_estimation.go index 38bc9a7d2941..1ff99f8befbe 100644 --- a/pkg/sql/exec/mem_estimation.go +++ b/pkg/sql/exec/mem_estimation.go @@ -15,6 +15,7 @@ import ( "unsafe" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) const ( @@ -61,7 +62,7 @@ func EstimateBatchSizeBytes(vecTypes []coltypes.T, batchLength int) int { // to hold the arbitrary precision decimal objects. acc += 50 default: - panic(fmt.Sprintf("unhandled type %s", t)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %s", t)) } } return acc * batchLength diff --git a/pkg/sql/exec/mergejoiner.go b/pkg/sql/exec/mergejoiner.go index 49087a938c08..82ebc429ddef 100644 --- a/pkg/sql/exec/mergejoiner.go +++ b/pkg/sql/exec/mergejoiner.go @@ -16,6 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" ) @@ -210,7 +211,9 @@ func NewMergeJoinOp( case sqlbase.JoinType_LEFT_ANTI: return &mergeJoinLeftAntiOp{base}, err default: - panic("unsupported join type") + execerror.VectorizedInternalPanic("unsupported join type") + // This code is unreachable, but the compiler cannot infer that. + return nil, nil } } diff --git a/pkg/sql/exec/mergejoiner_tmpl.go b/pkg/sql/exec/mergejoiner_tmpl.go index 7d07d37c2130..4ed84dbbc01f 100644 --- a/pkg/sql/exec/mergejoiner_tmpl.go +++ b/pkg/sql/exec/mergejoiner_tmpl.go @@ -28,6 +28,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -56,13 +57,13 @@ type _GOTYPE interface{} // _ASSIGN_EQ is the template equality function for assigning the first input // to the result of the the second input == the third input. func _ASSIGN_EQ(_, _, _ interface{}) uint64 { - panic("") + execerror.VectorizedInternalPanic("") } // _ASSIGN_LT is the template equality function for assigning the first input // to the result of the the second input < the third input. func _ASSIGN_LT(_, _, _ interface{}) uint64 { - panic("") + execerror.VectorizedInternalPanic("") } // _L_SEL_IND is the template type variable for the loop variable that @@ -261,7 +262,7 @@ func _PROBE_SWITCH( } // {{end}} default: - panic(fmt.Sprintf("unhandled type %d", colType)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %d", colType)) } // {{end}} // {{/* @@ -282,7 +283,7 @@ func _LEFT_UNMATCHED_GROUP_SWITCH(_JOIN_TYPE joinTypeInfo) { // */}} // {{ if or $.JoinType.IsLeftOuter $.JoinType.IsLeftAnti }} if lGroup.unmatched { if curLIdx+1 != curLLength { - panic(fmt.Sprintf("unexpectedly length %d of the left unmatched group is not 1", curLLength-curLIdx)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpectedly length %d of the left unmatched group is not 1", curLLength-curLIdx)) } // The row already does not have a match, so we don't need to do any // additional processing. @@ -322,7 +323,7 @@ func _RIGHT_UNMATCHED_GROUP_SWITCH(_JOIN_TYPE joinTypeInfo) { // */}} // {{ if $.JoinType.IsRightOuter }} if rGroup.unmatched { if curRIdx+1 != curRLength { - panic(fmt.Sprintf("unexpectedly length %d of the right unmatched group is not 1", curRLength-curRIdx)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpectedly length %d of the right unmatched group is not 1", curRLength-curRIdx)) } // The row already does not have a match, so we don't need to do any // additional processing. @@ -680,7 +681,7 @@ func _LEFT_SWITCH(_JOIN_TYPE joinTypeInfo, _HAS_SELECTION bool, _HAS_NULLS bool) o.builderState.left.groupsIdx = zeroMJCPGroupsIdx // {{end}} default: - panic(fmt.Sprintf("unhandled type %d", colType)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %d", colType)) } // {{end}} // {{/* @@ -838,7 +839,7 @@ func _RIGHT_SWITCH(_JOIN_TYPE joinTypeInfo, _HAS_SELECTION bool, _HAS_NULLS bool o.builderState.right.groupsIdx = zeroMJCPGroupsIdx // {{end}} default: - panic(fmt.Sprintf("unhandled type %d", colType)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %d", colType)) } // {{end}} // {{/* @@ -958,7 +959,7 @@ func (o *mergeJoinBase) isBufferedGroupFinished( } // {{end}} default: - panic(fmt.Sprintf("unhandled type %d", colTyp)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %d", colTyp)) } } return false @@ -1266,7 +1267,7 @@ func (o *mergeJoin_JOIN_TYPE_STRINGOp) Next(ctx context.Context) coldata.Batch { return o.output } default: - panic(fmt.Sprintf("unexpected merge joiner state in Next: %v", o.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected merge joiner state in Next: %v", o.state)) } } } diff --git a/pkg/sql/exec/mergejoiner_util.go b/pkg/sql/exec/mergejoiner_util.go index 6e89e43f8ffa..e7cc4000b318 100644 --- a/pkg/sql/exec/mergejoiner_util.go +++ b/pkg/sql/exec/mergejoiner_util.go @@ -13,6 +13,7 @@ package exec import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // circularGroupsBuffer is a struct designed to store the groups' slices for a @@ -227,12 +228,14 @@ type mjBufferedGroup struct { var _ coldata.Batch = &mjBufferedGroup{} func (bg *mjBufferedGroup) Length() uint16 { - panic("Length() should not be called on mjBufferedGroup; instead, " + + execerror.VectorizedInternalPanic("Length() should not be called on mjBufferedGroup; instead, " + "length field should be accessed directly") + // This code is unreachable, but the compiler cannot infer that. + return 0 } func (bg *mjBufferedGroup) SetLength(uint16) { - panic("SetLength(uint16) should not be called on mjBufferedGroup;" + + execerror.VectorizedInternalPanic("SetLength(uint16) should not be called on mjBufferedGroup;" + "instead, length field should be accessed directly") } @@ -257,19 +260,19 @@ func (bg *mjBufferedGroup) Selection() []uint16 { // SetSelection is not implemented because the tuples should only be appended // to mjBufferedGroup, and Append does the deselection step. func (bg *mjBufferedGroup) SetSelection(bool) { - panic("SetSelection(bool) should not be called on mjBufferedGroup") + execerror.VectorizedInternalPanic("SetSelection(bool) should not be called on mjBufferedGroup") } // AppendCol is not implemented because mjBufferedGroup is only initialized // when the column schema is known. func (bg *mjBufferedGroup) AppendCol(coltypes.T) { - panic("AppendCol(coltypes.T) should not be called on mjBufferedGroup") + execerror.VectorizedInternalPanic("AppendCol(coltypes.T) should not be called on mjBufferedGroup") } // Reset is not implemented because mjBufferedGroup is not reused with // different column schemas at the moment. func (bg *mjBufferedGroup) Reset(types []coltypes.T, length int) { - panic("Reset([]coltypes.T, int) should not be called on mjBufferedGroup") + execerror.VectorizedInternalPanic("Reset([]coltypes.T, int) should not be called on mjBufferedGroup") } // reset resets the state of the buffered group so that we can reuse the diff --git a/pkg/sql/exec/min_max_agg_tmpl.go b/pkg/sql/exec/min_max_agg_tmpl.go index 8a7ed62c7254..426a56776a92 100644 --- a/pkg/sql/exec/min_max_agg_tmpl.go +++ b/pkg/sql/exec/min_max_agg_tmpl.go @@ -25,6 +25,9 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + // {{/* + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" + // */}} "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/pkg/errors" @@ -51,7 +54,7 @@ type _GOTYPESLICE interface{} // if the second input compares successfully to the third input. The comparison // operator is tree.LT for MIN and is tree.GT for MAX. func _ASSIGN_CMP(_, _, _ string) bool { - panic("") + execerror.VectorizedInternalPanic("") } // */}} diff --git a/pkg/sql/exec/operator.go b/pkg/sql/exec/operator.go index 4d2b0f8a7a03..3b9789a50ef8 100644 --- a/pkg/sql/exec/operator.go +++ b/pkg/sql/exec/operator.go @@ -15,6 +15,7 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // Operator is a column vector operator that produces a Batch as output. @@ -66,7 +67,9 @@ func (n OneInputNode) Child(nth int) OpNode { if nth == 0 { return n.input } - panic(fmt.Sprintf("invalid index %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid index %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } // Input returns the single input of this OneInputNode as an Operator. @@ -84,7 +87,9 @@ func (ZeroInputNode) ChildCount() int { // Child implements the OpNode interface. func (ZeroInputNode) Child(nth int) OpNode { - panic(fmt.Sprintf("invalid index %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid index %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } // newTwoInputNode returns an OpNode with two Operator inputs. @@ -108,7 +113,9 @@ func (n *twoInputNode) Child(nth int) OpNode { case 1: return n.inputTwo } - panic(fmt.Sprintf("invalid idx %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid idx %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } // StaticMemoryOperator is an interface that streaming operators can implement diff --git a/pkg/sql/exec/orderedsynchronizer.go b/pkg/sql/exec/orderedsynchronizer.go index 6e4382f46c9b..c437ff1fba46 100644 --- a/pkg/sql/exec/orderedsynchronizer.go +++ b/pkg/sql/exec/orderedsynchronizer.go @@ -16,6 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/cockroachdb/cockroach/pkg/util/encoding" ) @@ -162,7 +163,7 @@ func (o *OrderedSynchronizer) compareRow(batchIdx1 int, batchIdx2 int) int { case encoding.Descending: return -res default: - panic(fmt.Sprintf("unexpected direction value %d", d)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected direction value %d", d)) } } } diff --git a/pkg/sql/exec/overloads_test.go b/pkg/sql/exec/overloads_test.go index 4d712faa99cf..6408f9ffb985 100644 --- a/pkg/sql/exec/overloads_test.go +++ b/pkg/sql/exec/overloads_test.go @@ -14,17 +14,19 @@ import ( "math" "testing" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestIntegerAddition(t *testing.T) { // The addition overload is the same for all integer widths, so we only test // one of them. - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performPlusInt16(1, math.MaxInt16) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performPlusInt16(-1, math.MinInt16) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performPlusInt16(math.MaxInt16, 1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performPlusInt16(math.MinInt16, -1) }) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performPlusInt16(1, math.MaxInt16) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performPlusInt16(-1, math.MinInt16) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performPlusInt16(math.MaxInt16, 1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performPlusInt16(math.MinInt16, -1) })) assert.Equal(t, int16(math.MaxInt16), performPlusInt16(1, math.MaxInt16-1)) assert.Equal(t, int16(math.MinInt16), performPlusInt16(-1, math.MinInt16+1)) @@ -40,10 +42,10 @@ func TestIntegerAddition(t *testing.T) { func TestIntegerSubtraction(t *testing.T) { // The subtraction overload is the same for all integer widths, so we only // test one of them. - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMinusInt16(1, -math.MaxInt16) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMinusInt16(-2, math.MaxInt16) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMinusInt16(math.MaxInt16, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMinusInt16(math.MinInt16, 1) }) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMinusInt16(1, -math.MaxInt16) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMinusInt16(-2, math.MaxInt16) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMinusInt16(math.MaxInt16, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMinusInt16(math.MinInt16, 1) })) assert.Equal(t, int16(math.MaxInt16), performMinusInt16(1, -math.MaxInt16+1)) assert.Equal(t, int16(math.MinInt16), performMinusInt16(-1, math.MaxInt16)) @@ -57,15 +59,15 @@ func TestIntegerSubtraction(t *testing.T) { } func TestIntegerDivision(t *testing.T) { - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performDivInt8(math.MinInt8, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performDivInt16(math.MinInt16, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performDivInt32(math.MinInt32, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performDivInt64(math.MinInt64, -1) }) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performDivInt8(math.MinInt8, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performDivInt16(math.MinInt16, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performDivInt32(math.MinInt32, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performDivInt64(math.MinInt64, -1) })) - assert.PanicsWithValue(t, tree.ErrDivByZero, func() { performDivInt8(10, 0) }) - assert.PanicsWithValue(t, tree.ErrDivByZero, func() { performDivInt16(10, 0) }) - assert.PanicsWithValue(t, tree.ErrDivByZero, func() { performDivInt32(10, 0) }) - assert.PanicsWithValue(t, tree.ErrDivByZero, func() { performDivInt64(10, 0) }) + require.Equal(t, tree.ErrDivByZero, execerror.CatchVectorizedRuntimeError(func() { performDivInt8(10, 0) })) + require.Equal(t, tree.ErrDivByZero, execerror.CatchVectorizedRuntimeError(func() { performDivInt16(10, 0) })) + require.Equal(t, tree.ErrDivByZero, execerror.CatchVectorizedRuntimeError(func() { performDivInt32(10, 0) })) + require.Equal(t, tree.ErrDivByZero, execerror.CatchVectorizedRuntimeError(func() { performDivInt64(10, 0) })) assert.Equal(t, int8(-math.MaxInt8), performDivInt8(math.MaxInt8, -1)) assert.Equal(t, int16(-math.MaxInt16), performDivInt16(math.MaxInt16, -1)) @@ -79,30 +81,30 @@ func TestIntegerDivision(t *testing.T) { } func TestIntegerMultiplication(t *testing.T) { - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt8(math.MaxInt8-1, 100) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt8(math.MaxInt8-1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt8(math.MinInt8+1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt8(math.MinInt8+1, 100) }) - - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt16(math.MaxInt16-1, 100) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt16(math.MaxInt16-1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt16(math.MinInt16+1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt16(math.MinInt16+1, 100) }) - - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt32(math.MaxInt32-1, 100) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt32(math.MaxInt32-1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt32(math.MinInt32+1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt32(math.MinInt32+1, 100) }) - - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt64(math.MaxInt64-1, 100) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt64(math.MaxInt64-1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt64(math.MinInt64+1, 3) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt64(math.MinInt64+1, 100) }) - - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt8(math.MinInt8, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt16(math.MinInt16, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt32(math.MinInt32, -1) }) - assert.PanicsWithValue(t, tree.ErrIntOutOfRange, func() { performMultInt64(math.MinInt64, -1) }) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt8(math.MaxInt8-1, 100) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt8(math.MaxInt8-1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt8(math.MinInt8+1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt8(math.MinInt8+1, 100) })) + + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt16(math.MaxInt16-1, 100) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt16(math.MaxInt16-1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt16(math.MinInt16+1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt16(math.MinInt16+1, 100) })) + + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt32(math.MaxInt32-1, 100) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt32(math.MaxInt32-1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt32(math.MinInt32+1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt32(math.MinInt32+1, 100) })) + + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt64(math.MaxInt64-1, 100) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt64(math.MaxInt64-1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt64(math.MinInt64+1, 3) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt64(math.MinInt64+1, 100) })) + + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt8(math.MinInt8, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt16(math.MinInt16, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt32(math.MinInt32, -1) })) + require.Equal(t, tree.ErrIntOutOfRange, execerror.CatchVectorizedRuntimeError(func() { performMultInt64(math.MinInt64, -1) })) assert.Equal(t, int8(-math.MaxInt8), performMultInt8(math.MaxInt8, -1)) assert.Equal(t, int16(-math.MaxInt16), performMultInt16(math.MaxInt16, -1)) diff --git a/pkg/sql/exec/partitioner.go b/pkg/sql/exec/partitioner.go index 232ecc56c204..39a967a09c53 100644 --- a/pkg/sql/exec/partitioner.go +++ b/pkg/sql/exec/partitioner.go @@ -16,6 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // NewWindowSortingPartitioner creates a new exec.Operator that orders input @@ -75,7 +76,7 @@ func (p *windowSortingPartitioner) Next(ctx context.Context) coldata.Batch { if p.partitionColIdx == b.Width() { b.AppendCol(coltypes.Bool) } else if p.partitionColIdx > b.Width() { - panic("unexpected: column partitionColIdx is neither present nor the next to be appended") + execerror.VectorizedInternalPanic("unexpected: column partitionColIdx is neither present nor the next to be appended") } partitionVec := b.ColVec(p.partitionColIdx).Bool() sel := b.Selection() diff --git a/pkg/sql/exec/random_testutils.go b/pkg/sql/exec/random_testutils.go index 2469a9afee43..e6cedae9e60d 100644 --- a/pkg/sql/exec/random_testutils.go +++ b/pkg/sql/exec/random_testutils.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // maxVarLen specifies a length limit for variable length types (e.g. byte slices). @@ -94,7 +95,7 @@ func randomVec(rng *rand.Rand, typ coltypes.T, vec coldata.Vec, n int, nullProba floats[i] = rng.Float64() } default: - panic(fmt.Sprintf("unhandled type %s", typ)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %s", typ)) } vec.Nulls().UnsetNulls() if nullProbability == 0 { @@ -128,7 +129,7 @@ func RandomBatch(rng *rand.Rand, typs []coltypes.T, n int, nullProbability float // less than batchSize. func randomSel(rng *rand.Rand, batchSize uint16, probOfOmitting float64) []uint16 { if probOfOmitting < 0 || probOfOmitting > 1 { - panic(fmt.Sprintf("probability of omitting a row is %f - outside of [0, 1] range", probOfOmitting)) + execerror.VectorizedInternalPanic(fmt.Sprintf("probability of omitting a row is %f - outside of [0, 1] range", probOfOmitting)) } sel := make([]uint16, batchSize) used := make([]bool, batchSize) diff --git a/pkg/sql/exec/routers.go b/pkg/sql/exec/routers.go index 104404f3a2cc..bd0f11654562 100644 --- a/pkg/sql/exec/routers.go +++ b/pkg/sql/exec/routers.go @@ -18,6 +18,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util/syncutil" ) @@ -75,7 +76,9 @@ func (o *routerOutputOp) Child(nth int) OpNode { if nth == 0 { return o.input } - panic(fmt.Sprintf("invalid index %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid index %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } var _ Operator = &routerOutputOp{} @@ -396,7 +399,7 @@ func (r *HashRouter) Run(ctx context.Context) { } } - if err := CatchVectorizedRuntimeError(processNextBatch); err != nil { + if err := execerror.CatchVectorizedRuntimeError(processNextBatch); err != nil { cancelOutputs(err) return } diff --git a/pkg/sql/exec/rowstovec_tmpl.go b/pkg/sql/exec/rowstovec_tmpl.go index 5890f475e6eb..4407b2b6994f 100644 --- a/pkg/sql/exec/rowstovec_tmpl.go +++ b/pkg/sql/exec/rowstovec_tmpl.go @@ -24,6 +24,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/exec/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -99,14 +100,14 @@ func EncDatumRowsToColVec( _ROWS_TO_COL_VEC(rows, vec, columnIdx, columnType, alloc) // {{end}} default: - panic(fmt.Sprintf("unsupported width %d for column type %s", columnType.Width(), columnType.String())) + execerror.VectorizedInternalPanic(fmt.Sprintf("unsupported width %d for column type %s", columnType.Width(), columnType.String())) } // {{ else }} _ROWS_TO_COL_VEC(rows, vec, columnIdx, columnType, alloc) // {{end}} // {{end}} default: - panic(fmt.Sprintf("unsupported column type %s", columnType.String())) + execerror.VectorizedInternalPanic(fmt.Sprintf("unsupported column type %s", columnType.String())) } return nil } diff --git a/pkg/sql/exec/select_in_tmpl.go b/pkg/sql/exec/select_in_tmpl.go index d9554eec502b..d131bec4d57b 100644 --- a/pkg/sql/exec/select_in_tmpl.go +++ b/pkg/sql/exec/select_in_tmpl.go @@ -11,7 +11,7 @@ // {{/* // +build execgen_template // -// This file is the execgen template for distinct.eg.go. It's formatted in a +// This file is the execgen template for select_in.eg.go. It's formatted in a // special way, so it's both valid Go and a valid text/template input. This // permits editing this file with editor support. // @@ -26,6 +26,9 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + // {{/* + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" + // */}} "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/exec/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -48,7 +51,7 @@ var _ coltypes.T var _ bytes.Buffer func _ASSIGN_EQ(_, _, _ interface{}) uint64 { - panic("") + execerror.VectorizedInternalPanic("") } // */}} diff --git a/pkg/sql/exec/simple_project.go b/pkg/sql/exec/simple_project.go index ff7b7ab01905..a2b83dfb6a74 100644 --- a/pkg/sql/exec/simple_project.go +++ b/pkg/sql/exec/simple_project.go @@ -15,6 +15,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // simpleProjectOp is an operator that implements "simple projection" - removal of @@ -47,7 +48,9 @@ func (b *projectingBatch) ColVec(i int) coldata.Vec { } func (b *projectingBatch) ColVecs() []coldata.Vec { - panic("projectingBatch doesn't support ColVecs()") + execerror.VectorizedInternalPanic("projectingBatch doesn't support ColVecs()") + // This code is unreachable, but the compiler cannot infer that. + return nil } func (b *projectingBatch) Width() int { diff --git a/pkg/sql/exec/sort.go b/pkg/sql/exec/sort.go index d0b94bbe6f51..8f6e7866b6cd 100644 --- a/pkg/sql/exec/sort.go +++ b/pkg/sql/exec/sort.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/pkg/errors" ) @@ -111,7 +112,7 @@ func (p *allSpooler) init() { func (p *allSpooler) spool(ctx context.Context) { if p.spooled { - panic("spool() is called for the second time") + execerror.VectorizedInternalPanic("spool() is called for the second time") } p.spooled = true batch := p.input.Next(ctx) @@ -135,21 +136,21 @@ func (p *allSpooler) spool(ctx context.Context) { func (p *allSpooler) getValues(i int) coldata.Vec { if !p.spooled { - panic("getValues() is called before spool()") + execerror.VectorizedInternalPanic("getValues() is called before spool()") } return p.values[i] } func (p *allSpooler) getNumTuples() uint64 { if !p.spooled { - panic("getNumTuples() is called before spool()") + execerror.VectorizedInternalPanic("getNumTuples() is called before spool()") } return p.spooledTuples } func (p *allSpooler) getPartitionsCol() []bool { if !p.spooled { - panic("getPartitionsCol() is called before spool()") + execerror.VectorizedInternalPanic("getPartitionsCol() is called before spool()") } return nil } @@ -261,7 +262,9 @@ func (p *sortOp) Next(ctx context.Context) coldata.Batch { p.emitted = newEmitted return p.output } - panic(fmt.Sprintf("invalid sort state %v", p.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid sort state %v", p.state)) + // This code is unreachable, but the compiler cannot infer that. + return nil } // sort sorts the spooled tuples, so it must be called after spool() has been @@ -377,5 +380,7 @@ func (p *sortOp) Child(nth int) OpNode { if nth == 0 { return p.input } - panic(fmt.Sprintf("invalid index %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid index %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } diff --git a/pkg/sql/exec/sort_chunks.go b/pkg/sql/exec/sort_chunks.go index 9f6076da2761..ff0ac6c436e9 100644 --- a/pkg/sql/exec/sort_chunks.go +++ b/pkg/sql/exec/sort_chunks.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // NewSortChunks returns a new sort chunks operator, which sorts its input on @@ -32,7 +33,7 @@ func NewSortChunks( return input, nil } if matchLen < 1 { - panic(fmt.Sprintf("Sort Chunks should only be used when the input is "+ + execerror.VectorizedInternalPanic(fmt.Sprintf("Sort Chunks should only be used when the input is "+ "already ordered on at least one column. matchLen = %d was given.", matchLen)) } @@ -60,7 +61,9 @@ func (c *sortChunksOp) Child(nth int) OpNode { if nth == 0 { return c.input } - panic(fmt.Sprintf("invalid index %d", nth)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid index %d", nth)) + // This code is unreachable, but the compiler cannot infer that. + return nil } var _ Operator = &sortChunksOp{} @@ -248,7 +251,7 @@ func (s *chunker) prepareNextChunks(ctx context.Context) chunkerReadingState { if s.batch.Selection() != nil { // We assume that the input has been deselected, so the batch should // never have a selection vector set. - panic(fmt.Sprintf("unexpected: batch with non-nil selection vector")) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected: batch with non-nil selection vector")) } // First, run the partitioners on our pre-sorted columns to determine the @@ -288,7 +291,7 @@ func (s *chunker) prepareNextChunks(ctx context.Context) chunkerReadingState { 0, /* bTupleIdx */ &differ, ); err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } } if differ { @@ -343,11 +346,11 @@ func (s *chunker) prepareNextChunks(ctx context.Context) chunkerReadingState { if s.inputDone { return inputDone } - panic(fmt.Sprintf("unexpected: chunkerEmittingFromBatch state" + + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected: chunkerEmittingFromBatch state" + "when s.chunks is fully processed and input is not done")) } default: - panic(fmt.Sprintf("invalid chunker spooler state %v", s.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid chunker spooler state %v", s.state)) } } } @@ -380,7 +383,9 @@ func (s *chunker) getValues(i int) coldata.Vec { case chunkerReadFromBatch: return s.batch.ColVec(i).Slice(s.inputTypes[i], s.chunks[s.chunksStartIdx], s.chunks[len(s.chunks)-1]) default: - panic(fmt.Sprintf("unexpected chunkerReadingState in getValues: %v", s.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected chunkerReadingState in getValues: %v", s.state)) + // This code is unreachable, but the compiler cannot infer that. + return nil } } @@ -393,7 +398,9 @@ func (s *chunker) getNumTuples() uint64 { case inputDone: return 0 default: - panic(fmt.Sprintf("unexpected chunkerReadingState in getNumTuples: %v", s.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected chunkerReadingState in getNumTuples: %v", s.state)) + // This code is unreachable, but the compiler cannot infer that. + return 0 } } @@ -417,7 +424,9 @@ func (s *chunker) getPartitionsCol() []bool { } return s.partitionCol default: - panic(fmt.Sprintf("unexpected chunkerReadingState in getPartitionsCol: %v", s.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected chunkerReadingState in getPartitionsCol: %v", s.state)) + // This code is unreachable, but the compiler cannot infer that. + return nil } } diff --git a/pkg/sql/exec/sort_test.go b/pkg/sql/exec/sort_test.go index 71f1079b18d1..24856985c966 100644 --- a/pkg/sql/exec/sort_test.go +++ b/pkg/sql/exec/sort_test.go @@ -21,6 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/randutil" ) @@ -401,7 +402,7 @@ func generateColumnOrdering( rng *rand.Rand, nCols int, nOrderingCols int, ) []distsqlpb.Ordering_Column { if nOrderingCols > nCols { - panic("nOrderingCols > nCols in generateColumnOrdering") + execerror.VectorizedInternalPanic("nOrderingCols > nCols in generateColumnOrdering") } orderingCols := make([]distsqlpb.Ordering_Column, nOrderingCols) for i, col := range rng.Perm(nCols)[:nOrderingCols] { diff --git a/pkg/sql/exec/sort_tmpl.go b/pkg/sql/exec/sort_tmpl.go index 5e2ab678f9e7..08fce56bc325 100644 --- a/pkg/sql/exec/sort_tmpl.go +++ b/pkg/sql/exec/sort_tmpl.go @@ -28,6 +28,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -61,7 +62,7 @@ const _ISNULL = false // _ASSIGN_LT is the template equality function for assigning the first input // to the result of the second input < the third input. func _ASSIGN_LT(_, _, _ string) bool { - panic("") + execerror.VectorizedInternalPanic("") } // */}} @@ -102,16 +103,18 @@ func newSingleSorter( return &sort_TYPE_DIR_HANDLES_NULLSOp{} // {{end}} default: - panic("nulls switch failed") + execerror.VectorizedInternalPanic("nulls switch failed") } // {{end}} default: - panic("nulls switch failed") + execerror.VectorizedInternalPanic("nulls switch failed") } // {{end}} default: - panic("nulls switch failed") + execerror.VectorizedInternalPanic("nulls switch failed") } + // This code is unreachable, but the compiler cannot infer that. + return nil } // {{range $typ, $ := . }} {{/* for each type */}} @@ -138,7 +141,7 @@ func (s *sort_TYPE_DIR_HANDLES_NULLSOp) sort(ctx context.Context) { func (s *sort_TYPE_DIR_HANDLES_NULLSOp) sortPartitions(ctx context.Context, partitions []uint64) { if len(partitions) < 1 { - panic(fmt.Sprintf("invalid partitions list %v", partitions)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid partitions list %v", partitions)) } order := s.order for i, partitionStart := range partitions { diff --git a/pkg/sql/exec/sorttopk.go b/pkg/sql/exec/sorttopk.go index e5431c79e470..ffc686fce372 100644 --- a/pkg/sql/exec/sorttopk.go +++ b/pkg/sql/exec/sorttopk.go @@ -18,6 +18,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/distsqlpb" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) const ( @@ -98,7 +99,9 @@ func (t *topKSorter) Next(ctx context.Context) coldata.Batch { case topKSortEmitting: return t.emit() } - panic(fmt.Sprintf("invalid sort state %v", t.state)) + execerror.VectorizedInternalPanic(fmt.Sprintf("invalid sort state %v", t.state)) + // This code is unreachable, but the compiler cannot infer that. + return nil } // spool reads in the entire input, always storing the top K rows it has seen so @@ -223,7 +226,7 @@ func (t *topKSorter) compareRow(vecIdx1, vecIdx2 int, rowIdx1, rowIdx2 uint16) i case distsqlpb.Ordering_Column_DESC: return -res default: - panic(fmt.Sprintf("unexpected direction value %d", d)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unexpected direction value %d", d)) } } } diff --git a/pkg/sql/exec/stats.go b/pkg/sql/exec/stats.go index 174630376e73..1b784163a3c2 100644 --- a/pkg/sql/exec/stats.go +++ b/pkg/sql/exec/stats.go @@ -14,6 +14,7 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/execpb" "github.com/cockroachdb/cockroach/pkg/util/timeutil" ) @@ -48,7 +49,7 @@ func NewVectorizedStatsCollector( op Operator, id int32, isStall bool, inputWatch *timeutil.StopWatch, ) *VectorizedStatsCollector { if inputWatch == nil { - panic("input watch for VectorizedStatsCollector is nil") + execerror.VectorizedInternalPanic("input watch for VectorizedStatsCollector is nil") } return &VectorizedStatsCollector{ Operator: op, diff --git a/pkg/sql/exec/sum_agg_tmpl.go b/pkg/sql/exec/sum_agg_tmpl.go index 3ca90619ad86..6317c596960e 100644 --- a/pkg/sql/exec/sum_agg_tmpl.go +++ b/pkg/sql/exec/sum_agg_tmpl.go @@ -23,6 +23,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/pkg/errors" ) @@ -39,7 +40,7 @@ var _ tree.Datum // _ASSIGN_ADD is the template addition function for assigning the first input // to the result of the second input + the third input. func _ASSIGN_ADD(_, _, _ string) { - panic("") + execerror.VectorizedInternalPanic("") } // */}} diff --git a/pkg/sql/exec/tuples_differ_tmpl.go b/pkg/sql/exec/tuples_differ_tmpl.go index 9ae99a049dfa..fd79eb2c67ad 100644 --- a/pkg/sql/exec/tuples_differ_tmpl.go +++ b/pkg/sql/exec/tuples_differ_tmpl.go @@ -24,6 +24,9 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + // {{/* + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" + // */}} "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/pkg/errors" @@ -51,7 +54,7 @@ const _TYPES_T = coltypes.Unhandled // _ASSIGN_NE is the template equality function for assigning the first input // to the result of the second input != the third input. func _ASSIGN_NE(_, _, _ string) bool { - panic("") + execerror.VectorizedInternalPanic("") } // */}} diff --git a/pkg/sql/exec/typeconv/typeconv.go b/pkg/sql/exec/typeconv/typeconv.go index 97684731b9bd..9fec57042842 100644 --- a/pkg/sql/exec/typeconv/typeconv.go +++ b/pkg/sql/exec/typeconv/typeconv.go @@ -15,6 +15,7 @@ import ( "reflect" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/cockroach/pkg/util/encoding" @@ -43,7 +44,7 @@ func FromColumnType(ct *types.T) coltypes.T { case 0, 64: return coltypes.Int64 } - panic(fmt.Sprintf("integer with unknown width %d", ct.Width())) + execerror.VectorizedInternalPanic(fmt.Sprintf("integer with unknown width %d", ct.Width())) case types.FloatFamily: return coltypes.Float64 } @@ -118,7 +119,7 @@ func GetDatumToPhysicalFn(ct *types.T) func(tree.Datum) (interface{}, error) { return int64(*d), nil } } - panic(fmt.Sprintf("unhandled INT width %d", ct.Width())) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled INT width %d", ct.Width())) case types.DateFamily: return func(datum tree.Datum) (interface{}, error) { d, ok := datum.(*tree.DDate) diff --git a/pkg/sql/exec/unorderedsynchronizer.go b/pkg/sql/exec/unorderedsynchronizer.go index 22879f9e0ec0..abd585989960 100644 --- a/pkg/sql/exec/unorderedsynchronizer.go +++ b/pkg/sql/exec/unorderedsynchronizer.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util/contextutil" ) @@ -153,7 +154,7 @@ func (s *UnorderedSynchronizer) init(ctx context.Context) { inputIdx: inputIdx, } for { - if err := CatchVectorizedRuntimeError(s.nextBatch[inputIdx]); err != nil { + if err := execerror.CatchVectorizedRuntimeError(s.nextBatch[inputIdx]); err != nil { select { // Non-blocking write to errCh, if an error is present the main // goroutine will use that and cancel all inputs. @@ -216,7 +217,7 @@ func (s *UnorderedSynchronizer) Next(ctx context.Context) coldata.Batch { // propagate this error through a panic. s.cancelFn() s.internalWaitGroup.Wait() - panic(err) + execerror.VectorizedInternalPanic(err) } case msg := <-s.batchCh: if msg == nil { @@ -226,7 +227,7 @@ func (s *UnorderedSynchronizer) Next(ctx context.Context) coldata.Batch { select { case err := <-s.errCh: if err != nil { - panic(err) + execerror.VectorizedInternalPanic(err) } default: } diff --git a/pkg/sql/exec/unorderedsynchronizer_test.go b/pkg/sql/exec/unorderedsynchronizer_test.go index 898b4d9f68f8..b64ebbbba3f7 100644 --- a/pkg/sql/exec/unorderedsynchronizer_test.go +++ b/pkg/sql/exec/unorderedsynchronizer_test.go @@ -19,6 +19,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/randutil" @@ -71,7 +72,7 @@ func TestUnorderedSynchronizer(t *testing.T) { batchesReturned := 0 for { var b coldata.Batch - if err := CatchVectorizedRuntimeError(func() { b = s.Next(ctx) }); err != nil { + if err := execerror.CatchVectorizedRuntimeError(func() { b = s.Next(ctx) }); err != nil { if cancel { require.True(t, testutils.IsError(err, "context canceled"), err) break @@ -96,12 +97,18 @@ func TestUnorderedSynchronizerNoLeaksOnError(t *testing.T) { const expectedErr = "first input error" inputs := make([]Operator, 6) - inputs[0] = &CallbackOperator{NextCb: func(context.Context) coldata.Batch { panic(expectedErr) }} + inputs[0] = &CallbackOperator{NextCb: func(context.Context) coldata.Batch { + execerror.VectorizedInternalPanic(expectedErr) + // This code is unreachable, but the compiler cannot infer that. + return nil + }} for i := 1; i < len(inputs); i++ { inputs[i] = &CallbackOperator{ NextCb: func(ctx context.Context) coldata.Batch { <-ctx.Done() - panic(ctx.Err()) + execerror.VectorizedInternalPanic(ctx.Err()) + // This code is unreachable, but the compiler cannot infer that. + return nil }, } } @@ -111,7 +118,7 @@ func TestUnorderedSynchronizerNoLeaksOnError(t *testing.T) { wg sync.WaitGroup ) s := NewUnorderedSynchronizer(inputs, []coltypes.T{coltypes.Int64}, &wg) - err := CatchVectorizedRuntimeError(func() { _ = s.Next(ctx) }) + err := execerror.CatchVectorizedRuntimeError(func() { _ = s.Next(ctx) }) // This is the crux of the test: assert that all inputs have finished. require.Equal(t, len(inputs), int(atomic.LoadUint32(&s.numFinishedInputs))) require.True(t, testutils.IsError(err, expectedErr), err) diff --git a/pkg/sql/exec/utils_test.go b/pkg/sql/exec/utils_test.go index 33f5e6e3837b..17dad17013ae 100644 --- a/pkg/sql/exec/utils_test.go +++ b/pkg/sql/exec/utils_test.go @@ -23,6 +23,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/util/randutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" @@ -218,7 +219,7 @@ func newOpTestSelInput(rng *rand.Rand, batchSize uint16, tuples tuples) *opTestI func (s *opTestInput) Init() { if len(s.tuples) == 0 { - panic("empty tuple source") + execerror.VectorizedInternalPanic("empty tuple source") } typs := make([]coltypes.T, len(s.tuples[0])) @@ -259,7 +260,7 @@ func (s *opTestInput) Next(context.Context) coldata.Batch { tupleLen := len(tups[0]) for i := range tups { if len(tups[i]) != tupleLen { - panic(fmt.Sprintf("mismatched tuple lens: found %+v expected %d vals", + execerror.VectorizedInternalPanic(fmt.Sprintf("mismatched tuple lens: found %+v expected %d vals", tups[i], tupleLen)) } } @@ -312,7 +313,7 @@ func (s *opTestInput) Next(context.Context) coldata.Batch { d := apd.Decimal{} _, err := d.SetFloat64(rng.Float64()) if err != nil { - panic(fmt.Sprintf("%v", err)) + execerror.VectorizedInternalPanic(fmt.Sprintf("%v", err)) } col.Index(int(outputIdx)).Set(reflect.ValueOf(d)) } else if typ == coltypes.Bytes { @@ -322,7 +323,7 @@ func (s *opTestInput) Next(context.Context) coldata.Batch { } else if val, ok := quick.Value(reflect.TypeOf(vec.Col()).Elem(), rng); ok { setColVal(vec, int(outputIdx), val.Interface()) } else { - panic(fmt.Sprintf("could not generate a random value of type %T\n.", vec.Type())) + execerror.VectorizedInternalPanic(fmt.Sprintf("could not generate a random value of type %T\n.", vec.Type())) } } else { setColVal(vec, int(outputIdx), tups[j][i]) @@ -365,7 +366,7 @@ func newOpFixedSelTestInput(sel []uint16, batchSize uint16, tuples tuples) *opFi func (s *opFixedSelTestInput) Init() { if len(s.tuples) == 0 { - panic("empty tuple source") + execerror.VectorizedInternalPanic("empty tuple source") } typs := make([]coltypes.T, len(s.tuples[0])) @@ -386,7 +387,7 @@ func (s *opFixedSelTestInput) Init() { tupleLen := len(s.tuples[0]) for _, i := range s.sel { if len(s.tuples[i]) != tupleLen { - panic(fmt.Sprintf("mismatched tuple lens: found %+v expected %d vals", + execerror.VectorizedInternalPanic(fmt.Sprintf("mismatched tuple lens: found %+v expected %d vals", s.tuples[i], tupleLen)) } } diff --git a/pkg/sql/exec/vec_comparators_tmpl.go b/pkg/sql/exec/vec_comparators_tmpl.go index f8b526d03de8..f6c993457566 100644 --- a/pkg/sql/exec/vec_comparators_tmpl.go +++ b/pkg/sql/exec/vec_comparators_tmpl.go @@ -26,6 +26,7 @@ import ( "github.com/cockroachdb/apd" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -46,7 +47,7 @@ var _ tree.Datum // _COMPARE is the template equality function for assigning the first input // to the result of comparing second and third inputs. func _COMPARE(_, _, _ string) bool { - panic("") + execerror.VectorizedInternalPanic("") } // */}} @@ -104,5 +105,7 @@ func GetVecComparator(t coltypes.T, numVecs int) vecComparator { } // {{end}} } - panic(fmt.Sprintf("unhandled type %v", t)) + execerror.VectorizedInternalPanic(fmt.Sprintf("unhandled type %v", t)) + // This code is unreachable, but the compiler cannot infer that. + return nil } diff --git a/pkg/sql/exec/vec_elem_to_datum.go b/pkg/sql/exec/vec_elem_to_datum.go index 68e3eb9bf72b..5a270c8852cb 100644 --- a/pkg/sql/exec/vec_elem_to_datum.go +++ b/pkg/sql/exec/vec_elem_to_datum.go @@ -15,6 +15,7 @@ import ( "unsafe" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/cockroachdb/cockroach/pkg/sql/types" @@ -60,6 +61,8 @@ func PhysicalTypeColElemToDatum( case types.OidFamily: return da.NewDOid(tree.MakeDOid(tree.DInt(col.Int64()[rowIdx]))) default: - panic(fmt.Sprintf("Unsupported column type %s", ct.String())) + execerror.VectorizedInternalPanic(fmt.Sprintf("Unsupported column type %s", ct.String())) + // This code is unreachable, but the compiler cannot infer that. + return nil } } diff --git a/pkg/sql/exec/vecbuiltins/rank_tmpl.go b/pkg/sql/exec/vecbuiltins/rank_tmpl.go index 5f5551673ab5..80c7dc214c3f 100644 --- a/pkg/sql/exec/vecbuiltins/rank_tmpl.go +++ b/pkg/sql/exec/vecbuiltins/rank_tmpl.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // {{/* @@ -32,13 +33,13 @@ import ( // _UPDATE_RANK_ is the template function for updating the state of rank // operators. func _UPDATE_RANK_() { - panic("") + execerror.VectorizedInternalPanic("") } // _UPDATE_RANK_INCREMENT is the template function for updating the state of // rank operators. func _UPDATE_RANK_INCREMENT() { - panic("") + execerror.VectorizedInternalPanic("") } // */}} @@ -87,7 +88,7 @@ func (r *_RANK_STRINGOp) Next(ctx context.Context) coldata.Batch { if r.partitionColIdx == batch.Width() { batch.AppendCol(coltypes.Bool) } else if r.partitionColIdx > batch.Width() { - panic("unexpected: column partitionColIdx is neither present nor the next to be appended") + execerror.VectorizedInternalPanic("unexpected: column partitionColIdx is neither present nor the next to be appended") } partitionCol := batch.ColVec(r.partitionColIdx).Bool() // {{ end }} @@ -95,7 +96,7 @@ func (r *_RANK_STRINGOp) Next(ctx context.Context) coldata.Batch { if r.outputColIdx == batch.Width() { batch.AppendCol(coltypes.Int64) } else if r.outputColIdx > batch.Width() { - panic("unexpected: column outputColIdx is neither present nor the next to be appended") + execerror.VectorizedInternalPanic("unexpected: column outputColIdx is neither present nor the next to be appended") } rankCol := batch.ColVec(r.outputColIdx).Int64() sel := batch.Selection() diff --git a/pkg/sql/exec/vecbuiltins/row_number_tmpl.go b/pkg/sql/exec/vecbuiltins/row_number_tmpl.go index 87859487f5f9..888db4089274 100644 --- a/pkg/sql/exec/vecbuiltins/row_number_tmpl.go +++ b/pkg/sql/exec/vecbuiltins/row_number_tmpl.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coltypes" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" ) // {{ range . }} @@ -44,7 +45,7 @@ func (r *_ROW_NUMBER_STRINGOp) Next(ctx context.Context) coldata.Batch { if r.partitionColIdx == batch.Width() { batch.AppendCol(coltypes.Bool) } else if r.partitionColIdx > batch.Width() { - panic("unexpected: column partitionColIdx is neither present nor the next to be appended") + execerror.VectorizedInternalPanic("unexpected: column partitionColIdx is neither present nor the next to be appended") } partitionCol := batch.ColVec(r.partitionColIdx).Bool() // {{ end }} @@ -52,7 +53,7 @@ func (r *_ROW_NUMBER_STRINGOp) Next(ctx context.Context) coldata.Batch { if r.outputColIdx == batch.Width() { batch.AppendCol(coltypes.Int64) } else if r.outputColIdx > batch.Width() { - panic("unexpected: column outputColIdx is neither present nor the next to be appended") + execerror.VectorizedInternalPanic("unexpected: column outputColIdx is neither present nor the next to be appended") } rowNumberCol := batch.ColVec(r.outputColIdx).Int64() sel := batch.Selection() diff --git a/pkg/sql/row/cfetcher.go b/pkg/sql/row/cfetcher.go index b417069da0a3..327fefc0a8b1 100644 --- a/pkg/sql/row/cfetcher.go +++ b/pkg/sql/row/cfetcher.go @@ -24,6 +24,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/sql/colencoding" "github.com/cockroachdb/cockroach/pkg/sql/exec" + "github.com/cockroachdb/cockroach/pkg/sql/exec/execerror" "github.com/cockroachdb/cockroach/pkg/sql/exec/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/scrub" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -558,7 +559,7 @@ func (rf *CFetcher) NextBatch(ctx context.Context) (coldata.Batch, error) { case stateInitFetch: moreKeys, kv, newSpan, err := rf.fetcher.nextKV(ctx) if err != nil { - return nil, exec.NewStorageError(err) + return nil, execerror.NewStorageError(err) } if !moreKeys { rf.machine.state[0] = stateEmitLastBatch @@ -660,7 +661,7 @@ func (rf *CFetcher) NextBatch(ctx context.Context) (coldata.Batch, error) { for { moreRows, kv, _, err := rf.fetcher.nextKV(ctx) if err != nil { - return nil, exec.NewStorageError(err) + return nil, execerror.NewStorageError(err) } if debugState { log.Infof(ctx, "found kv %s, seeking to prefix %s", kv.Key, rf.machine.seekPrefix) @@ -683,7 +684,7 @@ func (rf *CFetcher) NextBatch(ctx context.Context) (coldata.Batch, error) { case stateFetchNextKVWithUnfinishedRow: moreKVs, kv, _, err := rf.fetcher.nextKV(ctx) if err != nil { - return nil, exec.NewStorageError(err) + return nil, execerror.NewStorageError(err) } if !moreKVs { // No more data. Finalize the row and exit. diff --git a/pkg/testutils/lint/lint_test.go b/pkg/testutils/lint/lint_test.go index b97f0bc97019..aad1cf3fadb4 100644 --- a/pkg/testutils/lint/lint_test.go +++ b/pkg/testutils/lint/lint_test.go @@ -1450,4 +1450,37 @@ func TestLint(t *testing.T) { stream.GrepNot(`pkg/.*_test\.go:`), }) }) + + t.Run("TestVectorizedPanics", func(t *testing.T) { + t.Parallel() + cmd, stderr, filter, err := dirCmd( + pkgDir, + "git", + "grep", + "-nE", + fmt.Sprintf(`panic\(.*\)`), + "--", + "sql/exec", + ":!sql/exec/execerror/error.go", + ) + if err != nil { + t.Fatal(err) + } + + if err := cmd.Start(); err != nil { + t.Fatal(err) + } + + if err := stream.ForEach(filter, func(s string) { + t.Errorf("\n%s <- forbidden; use either execerror.VectorizedInternalPanic() or execerror.NonVectorizedPanic() instead", s) + }); err != nil { + t.Error(err) + } + + if err := cmd.Wait(); err != nil { + if out := stderr.String(); len(out) > 0 { + t.Fatalf("err=%s, stderr=%s", err, out) + } + } + }) }
1c993e07d2d644504709a1f2a4ccd039ee0ba31c
2020-07-15 05:01:40
Andrei Matei
kvserver: make RangeStatsRequest return the desc explicitly
false
make RangeStatsRequest return the desc explicitly
kvserver
diff --git a/c-deps/libroach/protos/roachpb/api.pb.cc b/c-deps/libroach/protos/roachpb/api.pb.cc index 659c23146d87..f732086f5193 100644 --- a/c-deps/libroach/protos/roachpb/api.pb.cc +++ b/c-deps/libroach/protos/roachpb/api.pb.cc @@ -103,7 +103,6 @@ extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobu extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_QueryTxnRequest; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_QueryTxnResponse; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_RangeFeedCheckpoint; -extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_RangeStatsResponse; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_RecomputeStatsResponse; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_RecoverTxnRequest; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_RecoverTxnResponse; @@ -118,6 +117,7 @@ extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobu extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_ExportResponse; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_GCRequest; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Header; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_RangeStatsResponse; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_RequestLeaseRequest; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_ResolveIntentRequest; extern PROTOBUF_INTERNAL_EXPORT_protobuf_roachpb_2fapi_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_ResponseHeader; @@ -2529,10 +2529,11 @@ static void InitDefaultsRangeStatsResponse() { ::cockroach::roachpb::RangeStatsResponse::InitAsDefaultInstance(); } -::google::protobuf::internal::SCCInfo<2> scc_info_RangeStatsResponse = - {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsRangeStatsResponse}, { +::google::protobuf::internal::SCCInfo<3> scc_info_RangeStatsResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsRangeStatsResponse}, { &protobuf_roachpb_2fapi_2eproto::scc_info_ResponseHeader.base, - &protobuf_storage_2fenginepb_2fmvcc_2eproto::scc_info_MVCCStats.base,}}; + &protobuf_storage_2fenginepb_2fmvcc_2eproto::scc_info_MVCCStats.base, + &protobuf_roachpb_2fdata_2eproto::scc_info_RangeInfo.base,}}; static void InitDefaultsRequestUnion() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -30275,6 +30276,8 @@ void RangeStatsResponse::InitAsDefaultInstance() { ::cockroach::roachpb::ResponseHeader::internal_default_instance()); ::cockroach::roachpb::_RangeStatsResponse_default_instance_._instance.get_mutable()->mvcc_stats_ = const_cast< ::cockroach::storage::enginepb::MVCCStats*>( ::cockroach::storage::enginepb::MVCCStats::internal_default_instance()); + ::cockroach::roachpb::_RangeStatsResponse_default_instance_._instance.get_mutable()->range_info_ = const_cast< ::cockroach::roachpb::RangeInfo*>( + ::cockroach::roachpb::RangeInfo::internal_default_instance()); } void RangeStatsResponse::clear_mvcc_stats() { if (GetArenaNoVirtual() == NULL && mvcc_stats_ != NULL) { @@ -30282,10 +30285,17 @@ void RangeStatsResponse::clear_mvcc_stats() { } mvcc_stats_ = NULL; } +void RangeStatsResponse::clear_range_info() { + if (GetArenaNoVirtual() == NULL && range_info_ != NULL) { + delete range_info_; + } + range_info_ = NULL; +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int RangeStatsResponse::kHeaderFieldNumber; const int RangeStatsResponse::kMvccStatsFieldNumber; const int RangeStatsResponse::kQueriesPerSecondFieldNumber; +const int RangeStatsResponse::kRangeInfoFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 RangeStatsResponse::RangeStatsResponse() @@ -30309,6 +30319,11 @@ RangeStatsResponse::RangeStatsResponse(const RangeStatsResponse& from) } else { mvcc_stats_ = NULL; } + if (from.has_range_info()) { + range_info_ = new ::cockroach::roachpb::RangeInfo(*from.range_info_); + } else { + range_info_ = NULL; + } queries_per_second_ = from.queries_per_second_; // @@protoc_insertion_point(copy_constructor:cockroach.roachpb.RangeStatsResponse) } @@ -30327,6 +30342,7 @@ RangeStatsResponse::~RangeStatsResponse() { void RangeStatsResponse::SharedDtor() { if (this != internal_default_instance()) delete header_; if (this != internal_default_instance()) delete mvcc_stats_; + if (this != internal_default_instance()) delete range_info_; } void RangeStatsResponse::SetCachedSize(int size) const { @@ -30352,6 +30368,10 @@ void RangeStatsResponse::Clear() { delete mvcc_stats_; } mvcc_stats_ = NULL; + if (GetArenaNoVirtual() == NULL && range_info_ != NULL) { + delete range_info_; + } + range_info_ = NULL; queries_per_second_ = 0; _internal_metadata_.Clear(); } @@ -30408,6 +30428,18 @@ bool RangeStatsResponse::MergePartialFromCodedStream( break; } + // .cockroach.roachpb.RangeInfo range_info = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_range_info())); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -30449,6 +30481,12 @@ void RangeStatsResponse::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->queries_per_second(), output); } + // .cockroach.roachpb.RangeInfo range_info = 4; + if (this->has_range_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->_internal_range_info(), output); + } + output->WriteRaw((::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).data(), static_cast<int>((::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()).size())); // @@protoc_insertion_point(serialize_end:cockroach.roachpb.RangeStatsResponse) @@ -30472,6 +30510,13 @@ size_t RangeStatsResponse::ByteSizeLong() const { *mvcc_stats_); } + // .cockroach.roachpb.RangeInfo range_info = 4; + if (this->has_range_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *range_info_); + } + // double queries_per_second = 3; if (this->queries_per_second() != 0) { total_size += 1 + 8; @@ -30500,6 +30545,9 @@ void RangeStatsResponse::MergeFrom(const RangeStatsResponse& from) { if (from.has_mvcc_stats()) { mutable_mvcc_stats()->::cockroach::storage::enginepb::MVCCStats::MergeFrom(from.mvcc_stats()); } + if (from.has_range_info()) { + mutable_range_info()->::cockroach::roachpb::RangeInfo::MergeFrom(from.range_info()); + } if (from.queries_per_second() != 0) { set_queries_per_second(from.queries_per_second()); } @@ -30524,6 +30572,7 @@ void RangeStatsResponse::InternalSwap(RangeStatsResponse* other) { using std::swap; swap(header_, other->header_); swap(mvcc_stats_, other->mvcc_stats_); + swap(range_info_, other->range_info_); swap(queries_per_second_, other->queries_per_second_); _internal_metadata_.Swap(&other->_internal_metadata_); } diff --git a/c-deps/libroach/protos/roachpb/api.pb.h b/c-deps/libroach/protos/roachpb/api.pb.h index ca0a2208616a..36ca022c48af 100644 --- a/c-deps/libroach/protos/roachpb/api.pb.h +++ b/c-deps/libroach/protos/roachpb/api.pb.h @@ -14113,6 +14113,18 @@ class RangeStatsResponse : public ::google::protobuf::MessageLite /* @@protoc_in ::cockroach::storage::enginepb::MVCCStats* mutable_mvcc_stats(); void set_allocated_mvcc_stats(::cockroach::storage::enginepb::MVCCStats* mvcc_stats); + // .cockroach.roachpb.RangeInfo range_info = 4; + bool has_range_info() const; + void clear_range_info(); + static const int kRangeInfoFieldNumber = 4; + private: + const ::cockroach::roachpb::RangeInfo& _internal_range_info() const; + public: + const ::cockroach::roachpb::RangeInfo& range_info() const; + ::cockroach::roachpb::RangeInfo* release_range_info(); + ::cockroach::roachpb::RangeInfo* mutable_range_info(); + void set_allocated_range_info(::cockroach::roachpb::RangeInfo* range_info); + // double queries_per_second = 3; void clear_queries_per_second(); static const int kQueriesPerSecondFieldNumber = 3; @@ -14125,6 +14137,7 @@ class RangeStatsResponse : public ::google::protobuf::MessageLite /* @@protoc_in ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; ::cockroach::roachpb::ResponseHeader* header_; ::cockroach::storage::enginepb::MVCCStats* mvcc_stats_; + ::cockroach::roachpb::RangeInfo* range_info_; double queries_per_second_; mutable ::google::protobuf::internal::CachedSize _cached_size_; friend struct ::protobuf_roachpb_2fapi_2eproto::TableStruct; @@ -29567,6 +29580,54 @@ inline void RangeStatsResponse::set_queries_per_second(double value) { // @@protoc_insertion_point(field_set:cockroach.roachpb.RangeStatsResponse.queries_per_second) } +// .cockroach.roachpb.RangeInfo range_info = 4; +inline bool RangeStatsResponse::has_range_info() const { + return this != internal_default_instance() && range_info_ != NULL; +} +inline const ::cockroach::roachpb::RangeInfo& RangeStatsResponse::_internal_range_info() const { + return *range_info_; +} +inline const ::cockroach::roachpb::RangeInfo& RangeStatsResponse::range_info() const { + const ::cockroach::roachpb::RangeInfo* p = range_info_; + // @@protoc_insertion_point(field_get:cockroach.roachpb.RangeStatsResponse.range_info) + return p != NULL ? *p : *reinterpret_cast<const ::cockroach::roachpb::RangeInfo*>( + &::cockroach::roachpb::_RangeInfo_default_instance_); +} +inline ::cockroach::roachpb::RangeInfo* RangeStatsResponse::release_range_info() { + // @@protoc_insertion_point(field_release:cockroach.roachpb.RangeStatsResponse.range_info) + + ::cockroach::roachpb::RangeInfo* temp = range_info_; + range_info_ = NULL; + return temp; +} +inline ::cockroach::roachpb::RangeInfo* RangeStatsResponse::mutable_range_info() { + + if (range_info_ == NULL) { + auto* p = CreateMaybeMessage<::cockroach::roachpb::RangeInfo>(GetArenaNoVirtual()); + range_info_ = p; + } + // @@protoc_insertion_point(field_mutable:cockroach.roachpb.RangeStatsResponse.range_info) + return range_info_; +} +inline void RangeStatsResponse::set_allocated_range_info(::cockroach::roachpb::RangeInfo* range_info) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(range_info_); + } + if (range_info) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + range_info = ::google::protobuf::internal::GetOwnedMessage( + message_arena, range_info, submessage_arena); + } + + } else { + + } + range_info_ = range_info; + // @@protoc_insertion_point(field_set_allocated:cockroach.roachpb.RangeStatsResponse.range_info) +} + // ------------------------------------------------------------------- // RequestUnion diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index 8b82f844cdfa..ec45f16d73b7 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -72,6 +72,6 @@ <tr><td><code>trace.debug.enable</code></td><td>boolean</td><td><code>false</code></td><td>if set, traces for recent requests can be seen in the /debug page</td></tr> <tr><td><code>trace.lightstep.token</code></td><td>string</td><td><code></code></td><td>if set, traces go to Lightstep using this token</td></tr> <tr><td><code>trace.zipkin.collector</code></td><td>string</td><td><code></code></td><td>if set, traces go to the given Zipkin instance (example: '127.0.0.1:9411'); ignored if trace.lightstep.token is set</td></tr> -<tr><td><code>version</code></td><td>custom validation</td><td><code>20.1-11</code></td><td>set the active cluster version in the format '<major>.<minor>'</td></tr> +<tr><td><code>version</code></td><td>custom validation</td><td><code>20.1-12</code></td><td>set the active cluster version in the format '<major>.<minor>'</td></tr> </tbody> </table> diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 151b4015e67e..12440496897c 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -71,6 +71,7 @@ const ( VersionNoOriginFKIndexes VersionClientRangeInfosOnBatchResponse VersionNodeMembershipStatus + VersionRangeStatsRespHasDesc // Add new versions here (step one of two). ) @@ -539,6 +540,11 @@ var versionsSingleton = keyedVersions([]keyedVersion{ Key: VersionNodeMembershipStatus, Version: roachpb.Version{Major: 20, Minor: 1, Unstable: 11}, }, + { + // VersionRangeStatsRespHasDesc adds the RangeStatsResponse.RangeInfo field. + Key: VersionRangeStatsRespHasDesc, + Version: roachpb.Version{Major: 20, Minor: 1, Unstable: 12}, + }, // Add new versions here (step two of two). diff --git a/pkg/clusterversion/versionkey_string.go b/pkg/clusterversion/versionkey_string.go index d4a7beba0e38..b906073e12b7 100644 --- a/pkg/clusterversion/versionkey_string.go +++ b/pkg/clusterversion/versionkey_string.go @@ -47,11 +47,12 @@ func _() { _ = x[VersionNoOriginFKIndexes-36] _ = x[VersionClientRangeInfosOnBatchResponse-37] _ = x[VersionNodeMembershipStatus-38] + _ = x[VersionRangeStatsRespHasDesc-39] } -const _VersionKey_name = "Version19_1VersionStart19_2VersionLearnerReplicasVersionTopLevelForeignKeysVersionAtomicChangeReplicasTriggerVersionAtomicChangeReplicasVersionTableDescModificationTimeFromMVCCVersionPartitionedBackupVersion19_2VersionStart20_1VersionContainsEstimatesCounterVersionChangeReplicasDemotionVersionSecondaryIndexColumnFamiliesVersionNamespaceTableWithSchemasVersionProtectedTimestampsVersionPrimaryKeyChangesVersionAuthLocalAndTrustRejectMethodsVersionPrimaryKeyColumnsOutOfFamilyZeroVersionRootPasswordVersionNoExplicitForeignKeyIndexIDsVersionHashShardedIndexesVersionCreateRolePrivilegeVersionStatementDiagnosticsSystemTablesVersionSchemaChangeJobVersionSavepointsVersionTimeTZTypeVersionTimePrecisionVersion20_1VersionStart20_2VersionGeospatialTypeVersionEnumsVersionRangefeedLeasesVersionAlterColumnTypeGeneralVersionAlterSystemJobsAddCreatedByColumnsVersionAddScheduledJobsTableVersionUserDefinedSchemasVersionNoOriginFKIndexesVersionClientRangeInfosOnBatchResponseVersionNodeMembershipStatus" +const _VersionKey_name = "Version19_1VersionStart19_2VersionLearnerReplicasVersionTopLevelForeignKeysVersionAtomicChangeReplicasTriggerVersionAtomicChangeReplicasVersionTableDescModificationTimeFromMVCCVersionPartitionedBackupVersion19_2VersionStart20_1VersionContainsEstimatesCounterVersionChangeReplicasDemotionVersionSecondaryIndexColumnFamiliesVersionNamespaceTableWithSchemasVersionProtectedTimestampsVersionPrimaryKeyChangesVersionAuthLocalAndTrustRejectMethodsVersionPrimaryKeyColumnsOutOfFamilyZeroVersionRootPasswordVersionNoExplicitForeignKeyIndexIDsVersionHashShardedIndexesVersionCreateRolePrivilegeVersionStatementDiagnosticsSystemTablesVersionSchemaChangeJobVersionSavepointsVersionTimeTZTypeVersionTimePrecisionVersion20_1VersionStart20_2VersionGeospatialTypeVersionEnumsVersionRangefeedLeasesVersionAlterColumnTypeGeneralVersionAlterSystemJobsAddCreatedByColumnsVersionAddScheduledJobsTableVersionUserDefinedSchemasVersionNoOriginFKIndexesVersionClientRangeInfosOnBatchResponseVersionNodeMembershipStatusVersionRangeStatsRespHasDesc" -var _VersionKey_index = [...]uint16{0, 11, 27, 49, 75, 109, 136, 176, 200, 211, 227, 258, 287, 322, 354, 380, 404, 441, 480, 499, 534, 559, 585, 624, 646, 663, 680, 700, 711, 727, 748, 760, 782, 811, 852, 880, 905, 929, 967, 994} +var _VersionKey_index = [...]uint16{0, 11, 27, 49, 75, 109, 136, 176, 200, 211, 227, 258, 287, 322, 354, 380, 404, 441, 480, 499, 534, 559, 585, 624, 646, 663, 680, 700, 711, 727, 748, 760, 782, 811, 852, 880, 905, 929, 967, 994, 1022} func (i VersionKey) String() string { if i < 0 || i >= VersionKey(len(_VersionKey_index)-1) { diff --git a/pkg/kv/kvserver/batcheval/cmd_range_stats.go b/pkg/kv/kvserver/batcheval/cmd_range_stats.go index 3f28db7d5436..42def34516a5 100644 --- a/pkg/kv/kvserver/batcheval/cmd_range_stats.go +++ b/pkg/kv/kvserver/batcheval/cmd_range_stats.go @@ -13,21 +13,37 @@ package batcheval import ( "context" + "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval/result" + "github.com/cockroachdb/cockroach/pkg/kv/kvserver/spanset" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/storage" ) +func declareKeysRangeStats( + desc *roachpb.RangeDescriptor, + header roachpb.Header, + req roachpb.Request, + latchSpans, lockSpans *spanset.SpanSet, +) { + DefaultDeclareKeys(desc, header, req, latchSpans, lockSpans) + // The request will return the descriptor and lease. + latchSpans.AddNonMVCC(spanset.SpanReadOnly, roachpb.Span{Key: keys.RangeDescriptorKey(desc.StartKey)}) + latchSpans.AddNonMVCC(spanset.SpanReadOnly, roachpb.Span{Key: keys.RangeLeaseKey(header.RangeID)}) +} + func init() { - RegisterReadOnlyCommand(roachpb.RangeStats, DefaultDeclareKeys, RangeStats) + RegisterReadOnlyCommand(roachpb.RangeStats, declareKeysRangeStats, RangeStats) } // RangeStats returns the MVCC statistics for a range. func RangeStats( - _ context.Context, _ storage.Reader, cArgs CommandArgs, resp roachpb.Response, + ctx context.Context, _ storage.Reader, cArgs CommandArgs, resp roachpb.Response, ) (result.Result, error) { reply := resp.(*roachpb.RangeStatsResponse) reply.MVCCStats = cArgs.EvalCtx.GetMVCCStats() reply.QueriesPerSecond = cArgs.EvalCtx.GetSplitQPS() + desc, lease := cArgs.EvalCtx.GetDescAndLease(ctx) + reply.RangeInfo = &roachpb.RangeInfo{Desc: desc, Lease: lease} return result.Result{}, nil } diff --git a/pkg/kv/kvserver/batcheval/eval_context.go b/pkg/kv/kvserver/batcheval/eval_context.go index f46642f43088..5d2bbbbbb230 100644 --- a/pkg/kv/kvserver/batcheval/eval_context.go +++ b/pkg/kv/kvserver/batcheval/eval_context.go @@ -92,6 +92,7 @@ type EvalContext interface { GetGCThreshold() hlc.Timestamp GetLastReplicaGCTimestamp(context.Context) (hlc.Timestamp, error) GetLease() (roachpb.Lease, roachpb.Lease) + GetDescAndLease(context.Context) (roachpb.RangeDescriptor, roachpb.Lease) GetExternalStorage(ctx context.Context, dest roachpb.ExternalStorage) (cloud.ExternalStorage, error) GetExternalStorageFromURI(ctx context.Context, uri string, user string) (cloud.ExternalStorage, @@ -203,6 +204,11 @@ func (m *mockEvalCtxImpl) GetLastReplicaGCTimestamp(context.Context) (hlc.Timest func (m *mockEvalCtxImpl) GetLease() (roachpb.Lease, roachpb.Lease) { return m.Lease, roachpb.Lease{} } +func (m *mockEvalCtxImpl) GetDescAndLease( + ctx context.Context, +) (roachpb.RangeDescriptor, roachpb.Lease) { + return *m.Desc(), m.Lease +} func (m *mockEvalCtxImpl) GetExternalStorage( ctx context.Context, dest roachpb.ExternalStorage, diff --git a/pkg/kv/kvserver/merge_queue.go b/pkg/kv/kvserver/merge_queue.go index 60a1ac3a4d64..0f1af5509771 100644 --- a/pkg/kv/kvserver/merge_queue.go +++ b/pkg/kv/kvserver/merge_queue.go @@ -16,6 +16,7 @@ import ( "math" "time" + "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/config" "github.com/cockroachdb/cockroach/pkg/gossip" "github.com/cockroachdb/cockroach/pkg/kv" @@ -174,27 +175,33 @@ func (mq *mergeQueue) requestRangeStats( ctx context.Context, key roachpb.Key, ) (*roachpb.RangeDescriptor, enginepb.MVCCStats, float64, error) { - ba := roachpb.BatchRequest{ - Header: roachpb.Header{ - ReturnRangeInfo: true, - }, - } + var ba roachpb.BatchRequest ba.Add(&roachpb.RangeStatsRequest{ RequestHeader: roachpb.RequestHeader{Key: key}, }) + if !mq.store.ClusterSettings().Version.IsActive(ctx, clusterversion.VersionRangeStatsRespHasDesc) { + ba.Header.ReturnRangeInfo = true + } + br, pErr := mq.db.NonTransactionalSender().Send(ctx, ba) if pErr != nil { return nil, enginepb.MVCCStats{}, 0, pErr.GoError() } res := br.Responses[0].GetInner().(*roachpb.RangeStatsResponse) - if len(br.RangeInfos) != 1 { - return nil, enginepb.MVCCStats{}, 0, errors.AssertionFailedf( - "mergeQueue.requestRangeStats: response had %d range infos but exactly one was expected", - len(br.RangeInfos)) + var desc *roachpb.RangeDescriptor + if res.RangeInfo != nil { + desc = &res.RangeInfo.Desc + } else { + if len(br.RangeInfos) != 1 { + return nil, enginepb.MVCCStats{}, 0, errors.AssertionFailedf( + "mergeQueue.requestRangeStats: response had %d range infos but exactly one was expected", + len(br.RangeInfos)) + } + desc = &br.RangeInfos[0].Desc } - return &br.RangeInfos[0].Desc, res.MVCCStats, res.QueriesPerSecond, nil + return desc, res.MVCCStats, res.QueriesPerSecond, nil } func (mq *mergeQueue) process( diff --git a/pkg/kv/kvserver/replica_eval_context_span.go b/pkg/kv/kvserver/replica_eval_context_span.go index 5c5b34828ba1..cc91feeb7845 100644 --- a/pkg/kv/kvserver/replica_eval_context_span.go +++ b/pkg/kv/kvserver/replica_eval_context_span.go @@ -193,6 +193,17 @@ func (rec SpanSetReplicaEvalContext) GetLease() (roachpb.Lease, roachpb.Lease) { return rec.i.GetLease() } +// GetDescAndLease is part of the EvalContext interface. +func (rec SpanSetReplicaEvalContext) GetDescAndLease( + ctx context.Context, +) (roachpb.RangeDescriptor, roachpb.Lease) { + // Do the latching checks and ignore the results. + rec.Desc() + rec.GetLease() + + return rec.i.GetDescAndLease(ctx) +} + // GetLimiters returns the per-store limiters. func (rec *SpanSetReplicaEvalContext) GetLimiters() *batcheval.Limiters { return rec.i.GetLimiters() diff --git a/pkg/roachpb/api.pb.go b/pkg/roachpb/api.pb.go index 8dbd75bdc246..695f451f21bc 100644 --- a/pkg/roachpb/api.pb.go +++ b/pkg/roachpb/api.pb.go @@ -72,7 +72,7 @@ func (x ReadConsistencyType) String() string { return proto.EnumName(ReadConsistencyType_name, int32(x)) } func (ReadConsistencyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{0} + return fileDescriptor_api_d3d69809727ab49a, []int{0} } // ScanFormat is an enumeration of the available response formats for MVCCScan @@ -100,7 +100,7 @@ func (x ScanFormat) String() string { return proto.EnumName(ScanFormat_name, int32(x)) } func (ScanFormat) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{1} + return fileDescriptor_api_d3d69809727ab49a, []int{1} } type ChecksumMode int32 @@ -147,7 +147,7 @@ func (x ChecksumMode) String() string { return proto.EnumName(ChecksumMode_name, int32(x)) } func (ChecksumMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{2} + return fileDescriptor_api_d3d69809727ab49a, []int{2} } // PushTxnType determines what action to take when pushing a transaction. @@ -178,7 +178,7 @@ func (x PushTxnType) String() string { return proto.EnumName(PushTxnType_name, int32(x)) } func (PushTxnType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{3} + return fileDescriptor_api_d3d69809727ab49a, []int{3} } type ExternalStorageProvider int32 @@ -219,7 +219,7 @@ func (x ExternalStorageProvider) String() string { return proto.EnumName(ExternalStorageProvider_name, int32(x)) } func (ExternalStorageProvider) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{4} + return fileDescriptor_api_d3d69809727ab49a, []int{4} } type MVCCFilter int32 @@ -242,7 +242,7 @@ func (x MVCCFilter) String() string { return proto.EnumName(MVCCFilter_name, int32(x)) } func (MVCCFilter) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{5} + return fileDescriptor_api_d3d69809727ab49a, []int{5} } type ResponseHeader_ResumeReason int32 @@ -268,7 +268,7 @@ func (x ResponseHeader_ResumeReason) String() string { return proto.EnumName(ResponseHeader_ResumeReason_name, int32(x)) } func (ResponseHeader_ResumeReason) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{1, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{1, 0} } type CheckConsistencyResponse_Status int32 @@ -310,7 +310,7 @@ func (x CheckConsistencyResponse_Status) String() string { return proto.EnumName(CheckConsistencyResponse_Status_name, int32(x)) } func (CheckConsistencyResponse_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{25, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{25, 0} } // RequestHeader is supplied with every storage node request. @@ -331,7 +331,7 @@ func (m *RequestHeader) Reset() { *m = RequestHeader{} } func (m *RequestHeader) String() string { return proto.CompactTextString(m) } func (*RequestHeader) ProtoMessage() {} func (*RequestHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{0} + return fileDescriptor_api_d3d69809727ab49a, []int{0} } func (m *RequestHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -402,7 +402,7 @@ func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } func (*ResponseHeader) ProtoMessage() {} func (*ResponseHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{1} + return fileDescriptor_api_d3d69809727ab49a, []int{1} } func (m *ResponseHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,7 +436,7 @@ func (m *GetRequest) Reset() { *m = GetRequest{} } func (m *GetRequest) String() string { return proto.CompactTextString(m) } func (*GetRequest) ProtoMessage() {} func (*GetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{2} + return fileDescriptor_api_d3d69809727ab49a, []int{2} } func (m *GetRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -479,7 +479,7 @@ func (m *GetResponse) Reset() { *m = GetResponse{} } func (m *GetResponse) String() string { return proto.CompactTextString(m) } func (*GetResponse) ProtoMessage() {} func (*GetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{3} + return fileDescriptor_api_d3d69809727ab49a, []int{3} } func (m *GetResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -522,7 +522,7 @@ func (m *PutRequest) Reset() { *m = PutRequest{} } func (m *PutRequest) String() string { return proto.CompactTextString(m) } func (*PutRequest) ProtoMessage() {} func (*PutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{4} + return fileDescriptor_api_d3d69809727ab49a, []int{4} } func (m *PutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -556,7 +556,7 @@ func (m *PutResponse) Reset() { *m = PutResponse{} } func (m *PutResponse) String() string { return proto.CompactTextString(m) } func (*PutResponse) ProtoMessage() {} func (*PutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{5} + return fileDescriptor_api_d3d69809727ab49a, []int{5} } func (m *PutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -638,7 +638,7 @@ func (m *ConditionalPutRequest) Reset() { *m = ConditionalPutRequest{} } func (m *ConditionalPutRequest) String() string { return proto.CompactTextString(m) } func (*ConditionalPutRequest) ProtoMessage() {} func (*ConditionalPutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{6} + return fileDescriptor_api_d3d69809727ab49a, []int{6} } func (m *ConditionalPutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -673,7 +673,7 @@ func (m *ConditionalPutResponse) Reset() { *m = ConditionalPutResponse{} func (m *ConditionalPutResponse) String() string { return proto.CompactTextString(m) } func (*ConditionalPutResponse) ProtoMessage() {} func (*ConditionalPutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{7} + return fileDescriptor_api_d3d69809727ab49a, []int{7} } func (m *ConditionalPutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -719,7 +719,7 @@ func (m *InitPutRequest) Reset() { *m = InitPutRequest{} } func (m *InitPutRequest) String() string { return proto.CompactTextString(m) } func (*InitPutRequest) ProtoMessage() {} func (*InitPutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{8} + return fileDescriptor_api_d3d69809727ab49a, []int{8} } func (m *InitPutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -753,7 +753,7 @@ func (m *InitPutResponse) Reset() { *m = InitPutResponse{} } func (m *InitPutResponse) String() string { return proto.CompactTextString(m) } func (*InitPutResponse) ProtoMessage() {} func (*InitPutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{9} + return fileDescriptor_api_d3d69809727ab49a, []int{9} } func (m *InitPutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,7 +793,7 @@ func (m *IncrementRequest) Reset() { *m = IncrementRequest{} } func (m *IncrementRequest) String() string { return proto.CompactTextString(m) } func (*IncrementRequest) ProtoMessage() {} func (*IncrementRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{10} + return fileDescriptor_api_d3d69809727ab49a, []int{10} } func (m *IncrementRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -830,7 +830,7 @@ func (m *IncrementResponse) Reset() { *m = IncrementResponse{} } func (m *IncrementResponse) String() string { return proto.CompactTextString(m) } func (*IncrementResponse) ProtoMessage() {} func (*IncrementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{11} + return fileDescriptor_api_d3d69809727ab49a, []int{11} } func (m *IncrementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -864,7 +864,7 @@ func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRequest) ProtoMessage() {} func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{12} + return fileDescriptor_api_d3d69809727ab49a, []int{12} } func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -898,7 +898,7 @@ func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } func (*DeleteResponse) ProtoMessage() {} func (*DeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{13} + return fileDescriptor_api_d3d69809727ab49a, []int{13} } func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -950,7 +950,7 @@ func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} } func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRangeRequest) ProtoMessage() {} func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{14} + return fileDescriptor_api_d3d69809727ab49a, []int{14} } func (m *DeleteRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +987,7 @@ func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} } func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) } func (*DeleteRangeResponse) ProtoMessage() {} func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{15} + return fileDescriptor_api_d3d69809727ab49a, []int{15} } func (m *DeleteRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1034,7 +1034,7 @@ func (m *ClearRangeRequest) Reset() { *m = ClearRangeRequest{} } func (m *ClearRangeRequest) String() string { return proto.CompactTextString(m) } func (*ClearRangeRequest) ProtoMessage() {} func (*ClearRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{16} + return fileDescriptor_api_d3d69809727ab49a, []int{16} } func (m *ClearRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1068,7 +1068,7 @@ func (m *ClearRangeResponse) Reset() { *m = ClearRangeResponse{} } func (m *ClearRangeResponse) String() string { return proto.CompactTextString(m) } func (*ClearRangeResponse) ProtoMessage() {} func (*ClearRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{17} + return fileDescriptor_api_d3d69809727ab49a, []int{17} } func (m *ClearRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1109,7 +1109,7 @@ func (m *RevertRangeRequest) Reset() { *m = RevertRangeRequest{} } func (m *RevertRangeRequest) String() string { return proto.CompactTextString(m) } func (*RevertRangeRequest) ProtoMessage() {} func (*RevertRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{18} + return fileDescriptor_api_d3d69809727ab49a, []int{18} } func (m *RevertRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1143,7 +1143,7 @@ func (m *RevertRangeResponse) Reset() { *m = RevertRangeResponse{} } func (m *RevertRangeResponse) String() string { return proto.CompactTextString(m) } func (*RevertRangeResponse) ProtoMessage() {} func (*RevertRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{19} + return fileDescriptor_api_d3d69809727ab49a, []int{19} } func (m *RevertRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1194,7 +1194,7 @@ func (m *ScanRequest) Reset() { *m = ScanRequest{} } func (m *ScanRequest) String() string { return proto.CompactTextString(m) } func (*ScanRequest) ProtoMessage() {} func (*ScanRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{20} + return fileDescriptor_api_d3d69809727ab49a, []int{20} } func (m *ScanRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1246,7 +1246,7 @@ func (m *ScanResponse) Reset() { *m = ScanResponse{} } func (m *ScanResponse) String() string { return proto.CompactTextString(m) } func (*ScanResponse) ProtoMessage() {} func (*ScanResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{21} + return fileDescriptor_api_d3d69809727ab49a, []int{21} } func (m *ScanResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1297,7 +1297,7 @@ func (m *ReverseScanRequest) Reset() { *m = ReverseScanRequest{} } func (m *ReverseScanRequest) String() string { return proto.CompactTextString(m) } func (*ReverseScanRequest) ProtoMessage() {} func (*ReverseScanRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{22} + return fileDescriptor_api_d3d69809727ab49a, []int{22} } func (m *ReverseScanRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1349,7 +1349,7 @@ func (m *ReverseScanResponse) Reset() { *m = ReverseScanResponse{} } func (m *ReverseScanResponse) String() string { return proto.CompactTextString(m) } func (*ReverseScanResponse) ProtoMessage() {} func (*ReverseScanResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{23} + return fileDescriptor_api_d3d69809727ab49a, []int{23} } func (m *ReverseScanResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1402,7 +1402,7 @@ func (m *CheckConsistencyRequest) Reset() { *m = CheckConsistencyRequest func (m *CheckConsistencyRequest) String() string { return proto.CompactTextString(m) } func (*CheckConsistencyRequest) ProtoMessage() {} func (*CheckConsistencyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{24} + return fileDescriptor_api_d3d69809727ab49a, []int{24} } func (m *CheckConsistencyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1439,7 +1439,7 @@ func (m *CheckConsistencyResponse) Reset() { *m = CheckConsistencyRespon func (m *CheckConsistencyResponse) String() string { return proto.CompactTextString(m) } func (*CheckConsistencyResponse) ProtoMessage() {} func (*CheckConsistencyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{25} + return fileDescriptor_api_d3d69809727ab49a, []int{25} } func (m *CheckConsistencyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1483,7 +1483,7 @@ func (m *CheckConsistencyResponse_Result) Reset() { *m = CheckConsistenc func (m *CheckConsistencyResponse_Result) String() string { return proto.CompactTextString(m) } func (*CheckConsistencyResponse_Result) ProtoMessage() {} func (*CheckConsistencyResponse_Result) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{25, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{25, 0} } func (m *CheckConsistencyResponse_Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1531,7 +1531,7 @@ func (m *RecomputeStatsRequest) Reset() { *m = RecomputeStatsRequest{} } func (m *RecomputeStatsRequest) String() string { return proto.CompactTextString(m) } func (*RecomputeStatsRequest) ProtoMessage() {} func (*RecomputeStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{26} + return fileDescriptor_api_d3d69809727ab49a, []int{26} } func (m *RecomputeStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1567,7 +1567,7 @@ func (m *RecomputeStatsResponse) Reset() { *m = RecomputeStatsResponse{} func (m *RecomputeStatsResponse) String() string { return proto.CompactTextString(m) } func (*RecomputeStatsResponse) ProtoMessage() {} func (*RecomputeStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{27} + return fileDescriptor_api_d3d69809727ab49a, []int{27} } func (m *RecomputeStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1664,7 +1664,7 @@ func (m *EndTxnRequest) Reset() { *m = EndTxnRequest{} } func (m *EndTxnRequest) String() string { return proto.CompactTextString(m) } func (*EndTxnRequest) ProtoMessage() {} func (*EndTxnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{28} + return fileDescriptor_api_d3d69809727ab49a, []int{28} } func (m *EndTxnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1710,7 +1710,7 @@ func (m *EndTxnResponse) Reset() { *m = EndTxnResponse{} } func (m *EndTxnResponse) String() string { return proto.CompactTextString(m) } func (*EndTxnResponse) ProtoMessage() {} func (*EndTxnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{29} + return fileDescriptor_api_d3d69809727ab49a, []int{29} } func (m *EndTxnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1771,7 +1771,7 @@ func (m *AdminSplitRequest) Reset() { *m = AdminSplitRequest{} } func (m *AdminSplitRequest) String() string { return proto.CompactTextString(m) } func (*AdminSplitRequest) ProtoMessage() {} func (*AdminSplitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{30} + return fileDescriptor_api_d3d69809727ab49a, []int{30} } func (m *AdminSplitRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1806,7 +1806,7 @@ func (m *AdminSplitResponse) Reset() { *m = AdminSplitResponse{} } func (m *AdminSplitResponse) String() string { return proto.CompactTextString(m) } func (*AdminSplitResponse) ProtoMessage() {} func (*AdminSplitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{31} + return fileDescriptor_api_d3d69809727ab49a, []int{31} } func (m *AdminSplitResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1845,7 +1845,7 @@ func (m *AdminUnsplitRequest) Reset() { *m = AdminUnsplitRequest{} } func (m *AdminUnsplitRequest) String() string { return proto.CompactTextString(m) } func (*AdminUnsplitRequest) ProtoMessage() {} func (*AdminUnsplitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{32} + return fileDescriptor_api_d3d69809727ab49a, []int{32} } func (m *AdminUnsplitRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1880,7 +1880,7 @@ func (m *AdminUnsplitResponse) Reset() { *m = AdminUnsplitResponse{} } func (m *AdminUnsplitResponse) String() string { return proto.CompactTextString(m) } func (*AdminUnsplitResponse) ProtoMessage() {} func (*AdminUnsplitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{33} + return fileDescriptor_api_d3d69809727ab49a, []int{33} } func (m *AdminUnsplitResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1923,7 +1923,7 @@ func (m *AdminMergeRequest) Reset() { *m = AdminMergeRequest{} } func (m *AdminMergeRequest) String() string { return proto.CompactTextString(m) } func (*AdminMergeRequest) ProtoMessage() {} func (*AdminMergeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{34} + return fileDescriptor_api_d3d69809727ab49a, []int{34} } func (m *AdminMergeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1958,7 +1958,7 @@ func (m *AdminMergeResponse) Reset() { *m = AdminMergeResponse{} } func (m *AdminMergeResponse) String() string { return proto.CompactTextString(m) } func (*AdminMergeResponse) ProtoMessage() {} func (*AdminMergeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{35} + return fileDescriptor_api_d3d69809727ab49a, []int{35} } func (m *AdminMergeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1996,7 +1996,7 @@ func (m *AdminTransferLeaseRequest) Reset() { *m = AdminTransferLeaseReq func (m *AdminTransferLeaseRequest) String() string { return proto.CompactTextString(m) } func (*AdminTransferLeaseRequest) ProtoMessage() {} func (*AdminTransferLeaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{36} + return fileDescriptor_api_d3d69809727ab49a, []int{36} } func (m *AdminTransferLeaseRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2029,7 +2029,7 @@ func (m *AdminTransferLeaseResponse) Reset() { *m = AdminTransferLeaseRe func (m *AdminTransferLeaseResponse) String() string { return proto.CompactTextString(m) } func (*AdminTransferLeaseResponse) ProtoMessage() {} func (*AdminTransferLeaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{37} + return fileDescriptor_api_d3d69809727ab49a, []int{37} } func (m *AdminTransferLeaseResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2064,7 +2064,7 @@ func (m *ReplicationChange) Reset() { *m = ReplicationChange{} } func (m *ReplicationChange) String() string { return proto.CompactTextString(m) } func (*ReplicationChange) ProtoMessage() {} func (*ReplicationChange) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{38} + return fileDescriptor_api_d3d69809727ab49a, []int{38} } func (m *ReplicationChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2122,7 +2122,7 @@ func (m *AdminChangeReplicasRequest) Reset() { *m = AdminChangeReplicasR func (m *AdminChangeReplicasRequest) String() string { return proto.CompactTextString(m) } func (*AdminChangeReplicasRequest) ProtoMessage() {} func (*AdminChangeReplicasRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{39} + return fileDescriptor_api_d3d69809727ab49a, []int{39} } func (m *AdminChangeReplicasRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2157,7 +2157,7 @@ func (m *AdminChangeReplicasResponse) Reset() { *m = AdminChangeReplicas func (m *AdminChangeReplicasResponse) String() string { return proto.CompactTextString(m) } func (*AdminChangeReplicasResponse) ProtoMessage() {} func (*AdminChangeReplicasResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{40} + return fileDescriptor_api_d3d69809727ab49a, []int{40} } func (m *AdminChangeReplicasResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2194,7 +2194,7 @@ func (m *AdminRelocateRangeRequest) Reset() { *m = AdminRelocateRangeReq func (m *AdminRelocateRangeRequest) String() string { return proto.CompactTextString(m) } func (*AdminRelocateRangeRequest) ProtoMessage() {} func (*AdminRelocateRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{41} + return fileDescriptor_api_d3d69809727ab49a, []int{41} } func (m *AdminRelocateRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2227,7 +2227,7 @@ func (m *AdminRelocateRangeResponse) Reset() { *m = AdminRelocateRangeRe func (m *AdminRelocateRangeResponse) String() string { return proto.CompactTextString(m) } func (*AdminRelocateRangeResponse) ProtoMessage() {} func (*AdminRelocateRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{42} + return fileDescriptor_api_d3d69809727ab49a, []int{42} } func (m *AdminRelocateRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2266,7 +2266,7 @@ func (m *HeartbeatTxnRequest) Reset() { *m = HeartbeatTxnRequest{} } func (m *HeartbeatTxnRequest) String() string { return proto.CompactTextString(m) } func (*HeartbeatTxnRequest) ProtoMessage() {} func (*HeartbeatTxnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{43} + return fileDescriptor_api_d3d69809727ab49a, []int{43} } func (m *HeartbeatTxnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2303,7 +2303,7 @@ func (m *HeartbeatTxnResponse) Reset() { *m = HeartbeatTxnResponse{} } func (m *HeartbeatTxnResponse) String() string { return proto.CompactTextString(m) } func (*HeartbeatTxnResponse) ProtoMessage() {} func (*HeartbeatTxnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{44} + return fileDescriptor_api_d3d69809727ab49a, []int{44} } func (m *HeartbeatTxnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2341,7 +2341,7 @@ func (m *GCRequest) Reset() { *m = GCRequest{} } func (m *GCRequest) String() string { return proto.CompactTextString(m) } func (*GCRequest) ProtoMessage() {} func (*GCRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{45} + return fileDescriptor_api_d3d69809727ab49a, []int{45} } func (m *GCRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2375,7 +2375,7 @@ func (m *GCRequest_GCKey) Reset() { *m = GCRequest_GCKey{} } func (m *GCRequest_GCKey) String() string { return proto.CompactTextString(m) } func (*GCRequest_GCKey) ProtoMessage() {} func (*GCRequest_GCKey) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{45, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{45, 0} } func (m *GCRequest_GCKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2409,7 +2409,7 @@ func (m *GCResponse) Reset() { *m = GCResponse{} } func (m *GCResponse) String() string { return proto.CompactTextString(m) } func (*GCResponse) ProtoMessage() {} func (*GCResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{46} + return fileDescriptor_api_d3d69809727ab49a, []int{46} } func (m *GCResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2478,7 +2478,7 @@ func (m *PushTxnRequest) Reset() { *m = PushTxnRequest{} } func (m *PushTxnRequest) String() string { return proto.CompactTextString(m) } func (*PushTxnRequest) ProtoMessage() {} func (*PushTxnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{47} + return fileDescriptor_api_d3d69809727ab49a, []int{47} } func (m *PushTxnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2521,7 +2521,7 @@ func (m *PushTxnResponse) Reset() { *m = PushTxnResponse{} } func (m *PushTxnResponse) String() string { return proto.CompactTextString(m) } func (*PushTxnResponse) ProtoMessage() {} func (*PushTxnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{48} + return fileDescriptor_api_d3d69809727ab49a, []int{48} } func (m *PushTxnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2568,7 +2568,7 @@ func (m *RecoverTxnRequest) Reset() { *m = RecoverTxnRequest{} } func (m *RecoverTxnRequest) String() string { return proto.CompactTextString(m) } func (*RecoverTxnRequest) ProtoMessage() {} func (*RecoverTxnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{49} + return fileDescriptor_api_d3d69809727ab49a, []int{49} } func (m *RecoverTxnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2604,7 +2604,7 @@ func (m *RecoverTxnResponse) Reset() { *m = RecoverTxnResponse{} } func (m *RecoverTxnResponse) String() string { return proto.CompactTextString(m) } func (*RecoverTxnResponse) ProtoMessage() {} func (*RecoverTxnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{50} + return fileDescriptor_api_d3d69809727ab49a, []int{50} } func (m *RecoverTxnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2648,7 +2648,7 @@ func (m *QueryTxnRequest) Reset() { *m = QueryTxnRequest{} } func (m *QueryTxnRequest) String() string { return proto.CompactTextString(m) } func (*QueryTxnRequest) ProtoMessage() {} func (*QueryTxnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{51} + return fileDescriptor_api_d3d69809727ab49a, []int{51} } func (m *QueryTxnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2687,7 +2687,7 @@ func (m *QueryTxnResponse) Reset() { *m = QueryTxnResponse{} } func (m *QueryTxnResponse) String() string { return proto.CompactTextString(m) } func (*QueryTxnResponse) ProtoMessage() {} func (*QueryTxnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{52} + return fileDescriptor_api_d3d69809727ab49a, []int{52} } func (m *QueryTxnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2747,7 +2747,7 @@ func (m *QueryIntentRequest) Reset() { *m = QueryIntentRequest{} } func (m *QueryIntentRequest) String() string { return proto.CompactTextString(m) } func (*QueryIntentRequest) ProtoMessage() {} func (*QueryIntentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{53} + return fileDescriptor_api_d3d69809727ab49a, []int{53} } func (m *QueryIntentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2783,7 +2783,7 @@ func (m *QueryIntentResponse) Reset() { *m = QueryIntentResponse{} } func (m *QueryIntentResponse) String() string { return proto.CompactTextString(m) } func (*QueryIntentResponse) ProtoMessage() {} func (*QueryIntentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{54} + return fileDescriptor_api_d3d69809727ab49a, []int{54} } func (m *QueryIntentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2829,7 +2829,7 @@ func (m *ResolveIntentRequest) Reset() { *m = ResolveIntentRequest{} } func (m *ResolveIntentRequest) String() string { return proto.CompactTextString(m) } func (*ResolveIntentRequest) ProtoMessage() {} func (*ResolveIntentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{55} + return fileDescriptor_api_d3d69809727ab49a, []int{55} } func (m *ResolveIntentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2864,7 +2864,7 @@ func (m *ResolveIntentResponse) Reset() { *m = ResolveIntentResponse{} } func (m *ResolveIntentResponse) String() string { return proto.CompactTextString(m) } func (*ResolveIntentResponse) ProtoMessage() {} func (*ResolveIntentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{56} + return fileDescriptor_api_d3d69809727ab49a, []int{56} } func (m *ResolveIntentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2914,7 +2914,7 @@ func (m *ResolveIntentRangeRequest) Reset() { *m = ResolveIntentRangeReq func (m *ResolveIntentRangeRequest) String() string { return proto.CompactTextString(m) } func (*ResolveIntentRangeRequest) ProtoMessage() {} func (*ResolveIntentRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{57} + return fileDescriptor_api_d3d69809727ab49a, []int{57} } func (m *ResolveIntentRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2949,7 +2949,7 @@ func (m *ResolveIntentRangeResponse) Reset() { *m = ResolveIntentRangeRe func (m *ResolveIntentRangeResponse) String() string { return proto.CompactTextString(m) } func (*ResolveIntentRangeResponse) ProtoMessage() {} func (*ResolveIntentRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{58} + return fileDescriptor_api_d3d69809727ab49a, []int{58} } func (m *ResolveIntentRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2986,7 +2986,7 @@ func (m *MergeRequest) Reset() { *m = MergeRequest{} } func (m *MergeRequest) String() string { return proto.CompactTextString(m) } func (*MergeRequest) ProtoMessage() {} func (*MergeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{59} + return fileDescriptor_api_d3d69809727ab49a, []int{59} } func (m *MergeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3020,7 +3020,7 @@ func (m *MergeResponse) Reset() { *m = MergeResponse{} } func (m *MergeResponse) String() string { return proto.CompactTextString(m) } func (*MergeResponse) ProtoMessage() {} func (*MergeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{60} + return fileDescriptor_api_d3d69809727ab49a, []int{60} } func (m *MergeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3065,7 +3065,7 @@ func (m *TruncateLogRequest) Reset() { *m = TruncateLogRequest{} } func (m *TruncateLogRequest) String() string { return proto.CompactTextString(m) } func (*TruncateLogRequest) ProtoMessage() {} func (*TruncateLogRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{61} + return fileDescriptor_api_d3d69809727ab49a, []int{61} } func (m *TruncateLogRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3099,7 +3099,7 @@ func (m *TruncateLogResponse) Reset() { *m = TruncateLogResponse{} } func (m *TruncateLogResponse) String() string { return proto.CompactTextString(m) } func (*TruncateLogResponse) ProtoMessage() {} func (*TruncateLogResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{62} + return fileDescriptor_api_d3d69809727ab49a, []int{62} } func (m *TruncateLogResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3143,7 +3143,7 @@ func (m *RequestLeaseRequest) Reset() { *m = RequestLeaseRequest{} } func (m *RequestLeaseRequest) String() string { return proto.CompactTextString(m) } func (*RequestLeaseRequest) ProtoMessage() {} func (*RequestLeaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{63} + return fileDescriptor_api_d3d69809727ab49a, []int{63} } func (m *RequestLeaseRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3192,7 +3192,7 @@ func (m *TransferLeaseRequest) Reset() { *m = TransferLeaseRequest{} } func (m *TransferLeaseRequest) String() string { return proto.CompactTextString(m) } func (*TransferLeaseRequest) ProtoMessage() {} func (*TransferLeaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{64} + return fileDescriptor_api_d3d69809727ab49a, []int{64} } func (m *TransferLeaseRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3229,7 +3229,7 @@ func (m *LeaseInfoRequest) Reset() { *m = LeaseInfoRequest{} } func (m *LeaseInfoRequest) String() string { return proto.CompactTextString(m) } func (*LeaseInfoRequest) ProtoMessage() {} func (*LeaseInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{65} + return fileDescriptor_api_d3d69809727ab49a, []int{65} } func (m *LeaseInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3266,7 +3266,7 @@ func (m *LeaseInfoResponse) Reset() { *m = LeaseInfoResponse{} } func (m *LeaseInfoResponse) String() string { return proto.CompactTextString(m) } func (*LeaseInfoResponse) ProtoMessage() {} func (*LeaseInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{66} + return fileDescriptor_api_d3d69809727ab49a, []int{66} } func (m *LeaseInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3301,7 +3301,7 @@ func (m *RequestLeaseResponse) Reset() { *m = RequestLeaseResponse{} } func (m *RequestLeaseResponse) String() string { return proto.CompactTextString(m) } func (*RequestLeaseResponse) ProtoMessage() {} func (*RequestLeaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{67} + return fileDescriptor_api_d3d69809727ab49a, []int{67} } func (m *RequestLeaseResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3356,7 +3356,7 @@ func (m *ComputeChecksumRequest) Reset() { *m = ComputeChecksumRequest{} func (m *ComputeChecksumRequest) String() string { return proto.CompactTextString(m) } func (*ComputeChecksumRequest) ProtoMessage() {} func (*ComputeChecksumRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{68} + return fileDescriptor_api_d3d69809727ab49a, []int{68} } func (m *ComputeChecksumRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3393,7 +3393,7 @@ func (m *ComputeChecksumResponse) Reset() { *m = ComputeChecksumResponse func (m *ComputeChecksumResponse) String() string { return proto.CompactTextString(m) } func (*ComputeChecksumResponse) ProtoMessage() {} func (*ComputeChecksumResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{69} + return fileDescriptor_api_d3d69809727ab49a, []int{69} } func (m *ComputeChecksumResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3433,7 +3433,7 @@ func (m *ExternalStorage) Reset() { *m = ExternalStorage{} } func (m *ExternalStorage) String() string { return proto.CompactTextString(m) } func (*ExternalStorage) ProtoMessage() {} func (*ExternalStorage) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70} + return fileDescriptor_api_d3d69809727ab49a, []int{70} } func (m *ExternalStorage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3467,7 +3467,7 @@ func (m *ExternalStorage_LocalFilePath) Reset() { *m = ExternalStorage_L func (m *ExternalStorage_LocalFilePath) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_LocalFilePath) ProtoMessage() {} func (*ExternalStorage_LocalFilePath) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 0} } func (m *ExternalStorage_LocalFilePath) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3500,7 +3500,7 @@ func (m *ExternalStorage_Http) Reset() { *m = ExternalStorage_Http{} } func (m *ExternalStorage_Http) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_Http) ProtoMessage() {} func (*ExternalStorage_Http) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 1} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 1} } func (m *ExternalStorage_Http) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3540,7 +3540,7 @@ func (m *ExternalStorage_S3) Reset() { *m = ExternalStorage_S3{} } func (m *ExternalStorage_S3) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_S3) ProtoMessage() {} func (*ExternalStorage_S3) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 2} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 2} } func (m *ExternalStorage_S3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3579,7 +3579,7 @@ func (m *ExternalStorage_GCS) Reset() { *m = ExternalStorage_GCS{} } func (m *ExternalStorage_GCS) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_GCS) ProtoMessage() {} func (*ExternalStorage_GCS) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 3} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 3} } func (m *ExternalStorage_GCS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3615,7 +3615,7 @@ func (m *ExternalStorage_Azure) Reset() { *m = ExternalStorage_Azure{} } func (m *ExternalStorage_Azure) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_Azure) ProtoMessage() {} func (*ExternalStorage_Azure) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 4} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 4} } func (m *ExternalStorage_Azure) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3654,7 +3654,7 @@ func (m *ExternalStorage_Workload) Reset() { *m = ExternalStorage_Worklo func (m *ExternalStorage_Workload) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_Workload) ProtoMessage() {} func (*ExternalStorage_Workload) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 5} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 5} } func (m *ExternalStorage_Workload) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3694,7 +3694,7 @@ func (m *ExternalStorage_FileTable) Reset() { *m = ExternalStorage_FileT func (m *ExternalStorage_FileTable) String() string { return proto.CompactTextString(m) } func (*ExternalStorage_FileTable) ProtoMessage() {} func (*ExternalStorage_FileTable) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{70, 6} + return fileDescriptor_api_d3d69809727ab49a, []int{70, 6} } func (m *ExternalStorage_FileTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3734,7 +3734,7 @@ func (m *WriteBatchRequest) Reset() { *m = WriteBatchRequest{} } func (m *WriteBatchRequest) String() string { return proto.CompactTextString(m) } func (*WriteBatchRequest) ProtoMessage() {} func (*WriteBatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{71} + return fileDescriptor_api_d3d69809727ab49a, []int{71} } func (m *WriteBatchRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3768,7 +3768,7 @@ func (m *WriteBatchResponse) Reset() { *m = WriteBatchResponse{} } func (m *WriteBatchResponse) String() string { return proto.CompactTextString(m) } func (*WriteBatchResponse) ProtoMessage() {} func (*WriteBatchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{72} + return fileDescriptor_api_d3d69809727ab49a, []int{72} } func (m *WriteBatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3802,7 +3802,7 @@ func (m *FileEncryptionOptions) Reset() { *m = FileEncryptionOptions{} } func (m *FileEncryptionOptions) String() string { return proto.CompactTextString(m) } func (*FileEncryptionOptions) ProtoMessage() {} func (*FileEncryptionOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{73} + return fileDescriptor_api_d3d69809727ab49a, []int{73} } func (m *FileEncryptionOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3872,7 +3872,7 @@ func (m *ExportRequest) Reset() { *m = ExportRequest{} } func (m *ExportRequest) String() string { return proto.CompactTextString(m) } func (*ExportRequest) ProtoMessage() {} func (*ExportRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{74} + return fileDescriptor_api_d3d69809727ab49a, []int{74} } func (m *ExportRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3924,7 +3924,7 @@ func (m *BulkOpSummary) Reset() { *m = BulkOpSummary{} } func (m *BulkOpSummary) String() string { return proto.CompactTextString(m) } func (*BulkOpSummary) ProtoMessage() {} func (*BulkOpSummary) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{75} + return fileDescriptor_api_d3d69809727ab49a, []int{75} } func (m *BulkOpSummary) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3960,7 +3960,7 @@ func (m *ExportResponse) Reset() { *m = ExportResponse{} } func (m *ExportResponse) String() string { return proto.CompactTextString(m) } func (*ExportResponse) ProtoMessage() {} func (*ExportResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{76} + return fileDescriptor_api_d3d69809727ab49a, []int{76} } func (m *ExportResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4000,7 +4000,7 @@ func (m *ExportResponse_File) Reset() { *m = ExportResponse_File{} } func (m *ExportResponse_File) String() string { return proto.CompactTextString(m) } func (*ExportResponse_File) ProtoMessage() {} func (*ExportResponse_File) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{76, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{76, 0} } func (m *ExportResponse_File) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4051,7 +4051,7 @@ func (m *ImportRequest) Reset() { *m = ImportRequest{} } func (m *ImportRequest) String() string { return proto.CompactTextString(m) } func (*ImportRequest) ProtoMessage() {} func (*ImportRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{77} + return fileDescriptor_api_d3d69809727ab49a, []int{77} } func (m *ImportRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4086,7 +4086,7 @@ func (m *ImportRequest_File) Reset() { *m = ImportRequest_File{} } func (m *ImportRequest_File) String() string { return proto.CompactTextString(m) } func (*ImportRequest_File) ProtoMessage() {} func (*ImportRequest_File) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{77, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{77, 0} } func (m *ImportRequest_File) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4122,7 +4122,7 @@ func (m *ImportRequest_TableRekey) Reset() { *m = ImportRequest_TableRek func (m *ImportRequest_TableRekey) String() string { return proto.CompactTextString(m) } func (*ImportRequest_TableRekey) ProtoMessage() {} func (*ImportRequest_TableRekey) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{77, 1} + return fileDescriptor_api_d3d69809727ab49a, []int{77, 1} } func (m *ImportRequest_TableRekey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4157,7 +4157,7 @@ func (m *ImportResponse) Reset() { *m = ImportResponse{} } func (m *ImportResponse) String() string { return proto.CompactTextString(m) } func (*ImportResponse) ProtoMessage() {} func (*ImportResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{78} + return fileDescriptor_api_d3d69809727ab49a, []int{78} } func (m *ImportResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4195,7 +4195,7 @@ func (m *AdminScatterRequest) Reset() { *m = AdminScatterRequest{} } func (m *AdminScatterRequest) String() string { return proto.CompactTextString(m) } func (*AdminScatterRequest) ProtoMessage() {} func (*AdminScatterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{79} + return fileDescriptor_api_d3d69809727ab49a, []int{79} } func (m *AdminScatterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4230,7 +4230,7 @@ func (m *AdminScatterResponse) Reset() { *m = AdminScatterResponse{} } func (m *AdminScatterResponse) String() string { return proto.CompactTextString(m) } func (*AdminScatterResponse) ProtoMessage() {} func (*AdminScatterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{80} + return fileDescriptor_api_d3d69809727ab49a, []int{80} } func (m *AdminScatterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4263,7 +4263,7 @@ func (m *AdminScatterResponse_Range) Reset() { *m = AdminScatterResponse func (m *AdminScatterResponse_Range) String() string { return proto.CompactTextString(m) } func (*AdminScatterResponse_Range) ProtoMessage() {} func (*AdminScatterResponse_Range) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{80, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{80, 0} } func (m *AdminScatterResponse_Range) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4308,7 +4308,7 @@ func (m *AdminVerifyProtectedTimestampRequest) Reset() { *m = AdminVerif func (m *AdminVerifyProtectedTimestampRequest) String() string { return proto.CompactTextString(m) } func (*AdminVerifyProtectedTimestampRequest) ProtoMessage() {} func (*AdminVerifyProtectedTimestampRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{81} + return fileDescriptor_api_d3d69809727ab49a, []int{81} } func (m *AdminVerifyProtectedTimestampRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4346,7 +4346,7 @@ func (m *AdminVerifyProtectedTimestampResponse) Reset() { *m = AdminVeri func (m *AdminVerifyProtectedTimestampResponse) String() string { return proto.CompactTextString(m) } func (*AdminVerifyProtectedTimestampResponse) ProtoMessage() {} func (*AdminVerifyProtectedTimestampResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{82} + return fileDescriptor_api_d3d69809727ab49a, []int{82} } func (m *AdminVerifyProtectedTimestampResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4399,7 +4399,7 @@ func (m *AddSSTableRequest) Reset() { *m = AddSSTableRequest{} } func (m *AddSSTableRequest) String() string { return proto.CompactTextString(m) } func (*AddSSTableRequest) ProtoMessage() {} func (*AddSSTableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{83} + return fileDescriptor_api_d3d69809727ab49a, []int{83} } func (m *AddSSTableRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4433,7 +4433,7 @@ func (m *AddSSTableResponse) Reset() { *m = AddSSTableResponse{} } func (m *AddSSTableResponse) String() string { return proto.CompactTextString(m) } func (*AddSSTableResponse) ProtoMessage() {} func (*AddSSTableResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{84} + return fileDescriptor_api_d3d69809727ab49a, []int{84} } func (m *AddSSTableResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4477,7 +4477,7 @@ func (m *RefreshRequest) Reset() { *m = RefreshRequest{} } func (m *RefreshRequest) String() string { return proto.CompactTextString(m) } func (*RefreshRequest) ProtoMessage() {} func (*RefreshRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{85} + return fileDescriptor_api_d3d69809727ab49a, []int{85} } func (m *RefreshRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4511,7 +4511,7 @@ func (m *RefreshResponse) Reset() { *m = RefreshResponse{} } func (m *RefreshResponse) String() string { return proto.CompactTextString(m) } func (*RefreshResponse) ProtoMessage() {} func (*RefreshResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{86} + return fileDescriptor_api_d3d69809727ab49a, []int{86} } func (m *RefreshResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4550,7 +4550,7 @@ func (m *RefreshRangeRequest) Reset() { *m = RefreshRangeRequest{} } func (m *RefreshRangeRequest) String() string { return proto.CompactTextString(m) } func (*RefreshRangeRequest) ProtoMessage() {} func (*RefreshRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{87} + return fileDescriptor_api_d3d69809727ab49a, []int{87} } func (m *RefreshRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4584,7 +4584,7 @@ func (m *RefreshRangeResponse) Reset() { *m = RefreshRangeResponse{} } func (m *RefreshRangeResponse) String() string { return proto.CompactTextString(m) } func (*RefreshRangeResponse) ProtoMessage() {} func (*RefreshRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{88} + return fileDescriptor_api_d3d69809727ab49a, []int{88} } func (m *RefreshRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4633,7 +4633,7 @@ func (m *SubsumeRequest) Reset() { *m = SubsumeRequest{} } func (m *SubsumeRequest) String() string { return proto.CompactTextString(m) } func (*SubsumeRequest) ProtoMessage() {} func (*SubsumeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{89} + return fileDescriptor_api_d3d69809727ab49a, []int{89} } func (m *SubsumeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4682,7 +4682,7 @@ func (m *SubsumeResponse) Reset() { *m = SubsumeResponse{} } func (m *SubsumeResponse) String() string { return proto.CompactTextString(m) } func (*SubsumeResponse) ProtoMessage() {} func (*SubsumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{90} + return fileDescriptor_api_d3d69809727ab49a, []int{90} } func (m *SubsumeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4717,7 +4717,7 @@ func (m *RangeStatsRequest) Reset() { *m = RangeStatsRequest{} } func (m *RangeStatsRequest) String() string { return proto.CompactTextString(m) } func (*RangeStatsRequest) ProtoMessage() {} func (*RangeStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{91} + return fileDescriptor_api_d3d69809727ab49a, []int{91} } func (m *RangeStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4750,13 +4750,16 @@ type RangeStatsResponse struct { MVCCStats enginepb.MVCCStats `protobuf:"bytes,2,opt,name=mvcc_stats,json=mvccStats,proto3" json:"mvcc_stats"` // QueriesPerSecond is the rate of request/s or QPS for the range. QueriesPerSecond float64 `protobuf:"fixed64,3,opt,name=queries_per_second,json=queriesPerSecond,proto3" json:"queries_per_second,omitempty"` + // range_info contains descriptor and lease information. Added in 20.2. + // TODO(andrei): Make non-nullable in 21.1. + RangeInfo *RangeInfo `protobuf:"bytes,4,opt,name=range_info,json=rangeInfo,proto3" json:"range_info,omitempty"` } func (m *RangeStatsResponse) Reset() { *m = RangeStatsResponse{} } func (m *RangeStatsResponse) String() string { return proto.CompactTextString(m) } func (*RangeStatsResponse) ProtoMessage() {} func (*RangeStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{92} + return fileDescriptor_api_d3d69809727ab49a, []int{92} } func (m *RangeStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4839,7 +4842,7 @@ func (m *RequestUnion) Reset() { *m = RequestUnion{} } func (m *RequestUnion) String() string { return proto.CompactTextString(m) } func (*RequestUnion) ProtoMessage() {} func (*RequestUnion) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{93} + return fileDescriptor_api_d3d69809727ab49a, []int{93} } func (m *RequestUnion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6289,7 +6292,7 @@ func (m *ResponseUnion) Reset() { *m = ResponseUnion{} } func (m *ResponseUnion) String() string { return proto.CompactTextString(m) } func (*ResponseUnion) ProtoMessage() {} func (*ResponseUnion) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{94} + return fileDescriptor_api_d3d69809727ab49a, []int{94} } func (m *ResponseUnion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7804,7 +7807,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{95} + return fileDescriptor_api_d3d69809727ab49a, []int{95} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7840,7 +7843,7 @@ type BatchRequest struct { func (m *BatchRequest) Reset() { *m = BatchRequest{} } func (*BatchRequest) ProtoMessage() {} func (*BatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{96} + return fileDescriptor_api_d3d69809727ab49a, []int{96} } func (m *BatchRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7877,7 +7880,7 @@ type BatchResponse struct { func (m *BatchResponse) Reset() { *m = BatchResponse{} } func (*BatchResponse) ProtoMessage() {} func (*BatchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{97} + return fileDescriptor_api_d3d69809727ab49a, []int{97} } func (m *BatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7943,7 +7946,7 @@ func (m *BatchResponse_Header) Reset() { *m = BatchResponse_Header{} } func (m *BatchResponse_Header) String() string { return proto.CompactTextString(m) } func (*BatchResponse_Header) ProtoMessage() {} func (*BatchResponse_Header) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{97, 0} + return fileDescriptor_api_d3d69809727ab49a, []int{97, 0} } func (m *BatchResponse_Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7982,7 +7985,7 @@ func (m *RangeFeedRequest) Reset() { *m = RangeFeedRequest{} } func (m *RangeFeedRequest) String() string { return proto.CompactTextString(m) } func (*RangeFeedRequest) ProtoMessage() {} func (*RangeFeedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{98} + return fileDescriptor_api_d3d69809727ab49a, []int{98} } func (m *RangeFeedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -8023,7 +8026,7 @@ func (m *RangeFeedValue) Reset() { *m = RangeFeedValue{} } func (m *RangeFeedValue) String() string { return proto.CompactTextString(m) } func (*RangeFeedValue) ProtoMessage() {} func (*RangeFeedValue) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{99} + return fileDescriptor_api_d3d69809727ab49a, []int{99} } func (m *RangeFeedValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -8064,7 +8067,7 @@ func (m *RangeFeedCheckpoint) Reset() { *m = RangeFeedCheckpoint{} } func (m *RangeFeedCheckpoint) String() string { return proto.CompactTextString(m) } func (*RangeFeedCheckpoint) ProtoMessage() {} func (*RangeFeedCheckpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{100} + return fileDescriptor_api_d3d69809727ab49a, []int{100} } func (m *RangeFeedCheckpoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -8101,7 +8104,7 @@ func (m *RangeFeedError) Reset() { *m = RangeFeedError{} } func (m *RangeFeedError) String() string { return proto.CompactTextString(m) } func (*RangeFeedError) ProtoMessage() {} func (*RangeFeedError) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{101} + return fileDescriptor_api_d3d69809727ab49a, []int{101} } func (m *RangeFeedError) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -8138,7 +8141,7 @@ func (m *RangeFeedEvent) Reset() { *m = RangeFeedEvent{} } func (m *RangeFeedEvent) String() string { return proto.CompactTextString(m) } func (*RangeFeedEvent) ProtoMessage() {} func (*RangeFeedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a06e0f3f58e22ede, []int{102} + return fileDescriptor_api_d3d69809727ab49a, []int{102} } func (m *RangeFeedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -14642,6 +14645,16 @@ func (m *RangeStatsResponse) MarshalTo(dAtA []byte) (int, error) { encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.QueriesPerSecond)))) i += 8 } + if m.RangeInfo != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintApi(dAtA, i, uint64(m.RangeInfo.Size())) + n160, err := m.RangeInfo.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n160 + } return i, nil } @@ -14661,11 +14674,11 @@ func (m *RequestUnion) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if m.Value != nil { - nn160, err := m.Value.MarshalTo(dAtA[i:]) + nn161, err := m.Value.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn160 + i += nn161 } return i, nil } @@ -14676,11 +14689,11 @@ func (m *RequestUnion_Get) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Get.Size())) - n161, err := m.Get.MarshalTo(dAtA[i:]) + n162, err := m.Get.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n161 + i += n162 } return i, nil } @@ -14690,11 +14703,11 @@ func (m *RequestUnion_Put) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Put.Size())) - n162, err := m.Put.MarshalTo(dAtA[i:]) + n163, err := m.Put.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n162 + i += n163 } return i, nil } @@ -14704,11 +14717,11 @@ func (m *RequestUnion_ConditionalPut) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.ConditionalPut.Size())) - n163, err := m.ConditionalPut.MarshalTo(dAtA[i:]) + n164, err := m.ConditionalPut.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n163 + i += n164 } return i, nil } @@ -14718,11 +14731,11 @@ func (m *RequestUnion_Increment) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.Increment.Size())) - n164, err := m.Increment.MarshalTo(dAtA[i:]) + n165, err := m.Increment.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n164 + i += n165 } return i, nil } @@ -14732,11 +14745,11 @@ func (m *RequestUnion_Delete) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.Delete.Size())) - n165, err := m.Delete.MarshalTo(dAtA[i:]) + n166, err := m.Delete.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n165 + i += n166 } return i, nil } @@ -14746,11 +14759,11 @@ func (m *RequestUnion_DeleteRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(m.DeleteRange.Size())) - n166, err := m.DeleteRange.MarshalTo(dAtA[i:]) + n167, err := m.DeleteRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n166 + i += n167 } return i, nil } @@ -14760,11 +14773,11 @@ func (m *RequestUnion_Scan) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3a i++ i = encodeVarintApi(dAtA, i, uint64(m.Scan.Size())) - n167, err := m.Scan.MarshalTo(dAtA[i:]) + n168, err := m.Scan.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n167 + i += n168 } return i, nil } @@ -14774,11 +14787,11 @@ func (m *RequestUnion_EndTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4a i++ i = encodeVarintApi(dAtA, i, uint64(m.EndTxn.Size())) - n168, err := m.EndTxn.MarshalTo(dAtA[i:]) + n169, err := m.EndTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n168 + i += n169 } return i, nil } @@ -14788,11 +14801,11 @@ func (m *RequestUnion_AdminSplit) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminSplit.Size())) - n169, err := m.AdminSplit.MarshalTo(dAtA[i:]) + n170, err := m.AdminSplit.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n169 + i += n170 } return i, nil } @@ -14802,11 +14815,11 @@ func (m *RequestUnion_AdminMerge) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x5a i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminMerge.Size())) - n170, err := m.AdminMerge.MarshalTo(dAtA[i:]) + n171, err := m.AdminMerge.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n170 + i += n171 } return i, nil } @@ -14816,11 +14829,11 @@ func (m *RequestUnion_HeartbeatTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x62 i++ i = encodeVarintApi(dAtA, i, uint64(m.HeartbeatTxn.Size())) - n171, err := m.HeartbeatTxn.MarshalTo(dAtA[i:]) + n172, err := m.HeartbeatTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n171 + i += n172 } return i, nil } @@ -14830,11 +14843,11 @@ func (m *RequestUnion_Gc) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x6a i++ i = encodeVarintApi(dAtA, i, uint64(m.Gc.Size())) - n172, err := m.Gc.MarshalTo(dAtA[i:]) + n173, err := m.Gc.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n172 + i += n173 } return i, nil } @@ -14844,11 +14857,11 @@ func (m *RequestUnion_PushTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x72 i++ i = encodeVarintApi(dAtA, i, uint64(m.PushTxn.Size())) - n173, err := m.PushTxn.MarshalTo(dAtA[i:]) + n174, err := m.PushTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n173 + i += n174 } return i, nil } @@ -14860,11 +14873,11 @@ func (m *RequestUnion_ResolveIntent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ResolveIntent.Size())) - n174, err := m.ResolveIntent.MarshalTo(dAtA[i:]) + n175, err := m.ResolveIntent.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n174 + i += n175 } return i, nil } @@ -14876,11 +14889,11 @@ func (m *RequestUnion_ResolveIntentRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ResolveIntentRange.Size())) - n175, err := m.ResolveIntentRange.MarshalTo(dAtA[i:]) + n176, err := m.ResolveIntentRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n175 + i += n176 } return i, nil } @@ -14892,11 +14905,11 @@ func (m *RequestUnion_Merge) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.Merge.Size())) - n176, err := m.Merge.MarshalTo(dAtA[i:]) + n177, err := m.Merge.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n176 + i += n177 } return i, nil } @@ -14908,11 +14921,11 @@ func (m *RequestUnion_TruncateLog) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.TruncateLog.Size())) - n177, err := m.TruncateLog.MarshalTo(dAtA[i:]) + n178, err := m.TruncateLog.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n177 + i += n178 } return i, nil } @@ -14924,11 +14937,11 @@ func (m *RequestUnion_RequestLease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.RequestLease.Size())) - n178, err := m.RequestLease.MarshalTo(dAtA[i:]) + n179, err := m.RequestLease.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n178 + i += n179 } return i, nil } @@ -14940,11 +14953,11 @@ func (m *RequestUnion_ReverseScan) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ReverseScan.Size())) - n179, err := m.ReverseScan.MarshalTo(dAtA[i:]) + n180, err := m.ReverseScan.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n179 + i += n180 } return i, nil } @@ -14956,11 +14969,11 @@ func (m *RequestUnion_ComputeChecksum) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ComputeChecksum.Size())) - n180, err := m.ComputeChecksum.MarshalTo(dAtA[i:]) + n181, err := m.ComputeChecksum.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n180 + i += n181 } return i, nil } @@ -14972,11 +14985,11 @@ func (m *RequestUnion_CheckConsistency) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.CheckConsistency.Size())) - n181, err := m.CheckConsistency.MarshalTo(dAtA[i:]) + n182, err := m.CheckConsistency.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n181 + i += n182 } return i, nil } @@ -14988,11 +15001,11 @@ func (m *RequestUnion_InitPut) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.InitPut.Size())) - n182, err := m.InitPut.MarshalTo(dAtA[i:]) + n183, err := m.InitPut.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n182 + i += n183 } return i, nil } @@ -15004,11 +15017,11 @@ func (m *RequestUnion_TransferLease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.TransferLease.Size())) - n183, err := m.TransferLease.MarshalTo(dAtA[i:]) + n184, err := m.TransferLease.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n183 + i += n184 } return i, nil } @@ -15020,11 +15033,11 @@ func (m *RequestUnion_AdminTransferLease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminTransferLease.Size())) - n184, err := m.AdminTransferLease.MarshalTo(dAtA[i:]) + n185, err := m.AdminTransferLease.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n184 + i += n185 } return i, nil } @@ -15036,11 +15049,11 @@ func (m *RequestUnion_LeaseInfo) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.LeaseInfo.Size())) - n185, err := m.LeaseInfo.MarshalTo(dAtA[i:]) + n186, err := m.LeaseInfo.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n185 + i += n186 } return i, nil } @@ -15052,11 +15065,11 @@ func (m *RequestUnion_WriteBatch) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.WriteBatch.Size())) - n186, err := m.WriteBatch.MarshalTo(dAtA[i:]) + n187, err := m.WriteBatch.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n186 + i += n187 } return i, nil } @@ -15068,11 +15081,11 @@ func (m *RequestUnion_Export) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Export.Size())) - n187, err := m.Export.MarshalTo(dAtA[i:]) + n188, err := m.Export.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n187 + i += n188 } return i, nil } @@ -15084,11 +15097,11 @@ func (m *RequestUnion_QueryTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.QueryTxn.Size())) - n188, err := m.QueryTxn.MarshalTo(dAtA[i:]) + n189, err := m.QueryTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n188 + i += n189 } return i, nil } @@ -15100,11 +15113,11 @@ func (m *RequestUnion_Import) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Import.Size())) - n189, err := m.Import.MarshalTo(dAtA[i:]) + n190, err := m.Import.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n189 + i += n190 } return i, nil } @@ -15116,11 +15129,11 @@ func (m *RequestUnion_AdminChangeReplicas) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminChangeReplicas.Size())) - n190, err := m.AdminChangeReplicas.MarshalTo(dAtA[i:]) + n191, err := m.AdminChangeReplicas.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n190 + i += n191 } return i, nil } @@ -15132,11 +15145,11 @@ func (m *RequestUnion_AdminScatter) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminScatter.Size())) - n191, err := m.AdminScatter.MarshalTo(dAtA[i:]) + n192, err := m.AdminScatter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n191 + i += n192 } return i, nil } @@ -15148,11 +15161,11 @@ func (m *RequestUnion_AddSstable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AddSstable.Size())) - n192, err := m.AddSstable.MarshalTo(dAtA[i:]) + n193, err := m.AddSstable.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n192 + i += n193 } return i, nil } @@ -15164,11 +15177,11 @@ func (m *RequestUnion_ClearRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.ClearRange.Size())) - n193, err := m.ClearRange.MarshalTo(dAtA[i:]) + n194, err := m.ClearRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n193 + i += n194 } return i, nil } @@ -15180,11 +15193,11 @@ func (m *RequestUnion_RecomputeStats) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RecomputeStats.Size())) - n194, err := m.RecomputeStats.MarshalTo(dAtA[i:]) + n195, err := m.RecomputeStats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n194 + i += n195 } return i, nil } @@ -15196,11 +15209,11 @@ func (m *RequestUnion_Refresh) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Refresh.Size())) - n195, err := m.Refresh.MarshalTo(dAtA[i:]) + n196, err := m.Refresh.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n195 + i += n196 } return i, nil } @@ -15212,11 +15225,11 @@ func (m *RequestUnion_RefreshRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RefreshRange.Size())) - n196, err := m.RefreshRange.MarshalTo(dAtA[i:]) + n197, err := m.RefreshRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n196 + i += n197 } return i, nil } @@ -15228,11 +15241,11 @@ func (m *RequestUnion_QueryIntent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.QueryIntent.Size())) - n197, err := m.QueryIntent.MarshalTo(dAtA[i:]) + n198, err := m.QueryIntent.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n197 + i += n198 } return i, nil } @@ -15244,11 +15257,11 @@ func (m *RequestUnion_Subsume) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Subsume.Size())) - n198, err := m.Subsume.MarshalTo(dAtA[i:]) + n199, err := m.Subsume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n198 + i += n199 } return i, nil } @@ -15260,11 +15273,11 @@ func (m *RequestUnion_RangeStats) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RangeStats.Size())) - n199, err := m.RangeStats.MarshalTo(dAtA[i:]) + n200, err := m.RangeStats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n199 + i += n200 } return i, nil } @@ -15276,11 +15289,11 @@ func (m *RequestUnion_AdminRelocateRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminRelocateRange.Size())) - n200, err := m.AdminRelocateRange.MarshalTo(dAtA[i:]) + n201, err := m.AdminRelocateRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n200 + i += n201 } return i, nil } @@ -15292,11 +15305,11 @@ func (m *RequestUnion_RecoverTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RecoverTxn.Size())) - n201, err := m.RecoverTxn.MarshalTo(dAtA[i:]) + n202, err := m.RecoverTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n201 + i += n202 } return i, nil } @@ -15308,11 +15321,11 @@ func (m *RequestUnion_AdminUnsplit) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminUnsplit.Size())) - n202, err := m.AdminUnsplit.MarshalTo(dAtA[i:]) + n203, err := m.AdminUnsplit.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n202 + i += n203 } return i, nil } @@ -15324,11 +15337,11 @@ func (m *RequestUnion_RevertRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3 i++ i = encodeVarintApi(dAtA, i, uint64(m.RevertRange.Size())) - n203, err := m.RevertRange.MarshalTo(dAtA[i:]) + n204, err := m.RevertRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n203 + i += n204 } return i, nil } @@ -15340,11 +15353,11 @@ func (m *RequestUnion_AdminVerifyProtectedTimestamp) MarshalTo(dAtA []byte) (int dAtA[i] = 0x3 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminVerifyProtectedTimestamp.Size())) - n204, err := m.AdminVerifyProtectedTimestamp.MarshalTo(dAtA[i:]) + n205, err := m.AdminVerifyProtectedTimestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n204 + i += n205 } return i, nil } @@ -15364,11 +15377,11 @@ func (m *ResponseUnion) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if m.Value != nil { - nn205, err := m.Value.MarshalTo(dAtA[i:]) + nn206, err := m.Value.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn205 + i += nn206 } return i, nil } @@ -15379,11 +15392,11 @@ func (m *ResponseUnion_Get) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Get.Size())) - n206, err := m.Get.MarshalTo(dAtA[i:]) + n207, err := m.Get.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n206 + i += n207 } return i, nil } @@ -15393,11 +15406,11 @@ func (m *ResponseUnion_Put) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Put.Size())) - n207, err := m.Put.MarshalTo(dAtA[i:]) + n208, err := m.Put.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n207 + i += n208 } return i, nil } @@ -15407,11 +15420,11 @@ func (m *ResponseUnion_ConditionalPut) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.ConditionalPut.Size())) - n208, err := m.ConditionalPut.MarshalTo(dAtA[i:]) + n209, err := m.ConditionalPut.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n208 + i += n209 } return i, nil } @@ -15421,11 +15434,11 @@ func (m *ResponseUnion_Increment) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.Increment.Size())) - n209, err := m.Increment.MarshalTo(dAtA[i:]) + n210, err := m.Increment.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n209 + i += n210 } return i, nil } @@ -15435,11 +15448,11 @@ func (m *ResponseUnion_Delete) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.Delete.Size())) - n210, err := m.Delete.MarshalTo(dAtA[i:]) + n211, err := m.Delete.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n210 + i += n211 } return i, nil } @@ -15449,11 +15462,11 @@ func (m *ResponseUnion_DeleteRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(m.DeleteRange.Size())) - n211, err := m.DeleteRange.MarshalTo(dAtA[i:]) + n212, err := m.DeleteRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n211 + i += n212 } return i, nil } @@ -15463,11 +15476,11 @@ func (m *ResponseUnion_Scan) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3a i++ i = encodeVarintApi(dAtA, i, uint64(m.Scan.Size())) - n212, err := m.Scan.MarshalTo(dAtA[i:]) + n213, err := m.Scan.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n212 + i += n213 } return i, nil } @@ -15477,11 +15490,11 @@ func (m *ResponseUnion_EndTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4a i++ i = encodeVarintApi(dAtA, i, uint64(m.EndTxn.Size())) - n213, err := m.EndTxn.MarshalTo(dAtA[i:]) + n214, err := m.EndTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n213 + i += n214 } return i, nil } @@ -15491,11 +15504,11 @@ func (m *ResponseUnion_AdminSplit) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminSplit.Size())) - n214, err := m.AdminSplit.MarshalTo(dAtA[i:]) + n215, err := m.AdminSplit.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n214 + i += n215 } return i, nil } @@ -15505,11 +15518,11 @@ func (m *ResponseUnion_AdminMerge) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x5a i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminMerge.Size())) - n215, err := m.AdminMerge.MarshalTo(dAtA[i:]) + n216, err := m.AdminMerge.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n215 + i += n216 } return i, nil } @@ -15519,11 +15532,11 @@ func (m *ResponseUnion_HeartbeatTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x62 i++ i = encodeVarintApi(dAtA, i, uint64(m.HeartbeatTxn.Size())) - n216, err := m.HeartbeatTxn.MarshalTo(dAtA[i:]) + n217, err := m.HeartbeatTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n216 + i += n217 } return i, nil } @@ -15533,11 +15546,11 @@ func (m *ResponseUnion_Gc) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x6a i++ i = encodeVarintApi(dAtA, i, uint64(m.Gc.Size())) - n217, err := m.Gc.MarshalTo(dAtA[i:]) + n218, err := m.Gc.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n217 + i += n218 } return i, nil } @@ -15547,11 +15560,11 @@ func (m *ResponseUnion_PushTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x72 i++ i = encodeVarintApi(dAtA, i, uint64(m.PushTxn.Size())) - n218, err := m.PushTxn.MarshalTo(dAtA[i:]) + n219, err := m.PushTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n218 + i += n219 } return i, nil } @@ -15563,11 +15576,11 @@ func (m *ResponseUnion_ResolveIntent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ResolveIntent.Size())) - n219, err := m.ResolveIntent.MarshalTo(dAtA[i:]) + n220, err := m.ResolveIntent.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n219 + i += n220 } return i, nil } @@ -15579,11 +15592,11 @@ func (m *ResponseUnion_ResolveIntentRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ResolveIntentRange.Size())) - n220, err := m.ResolveIntentRange.MarshalTo(dAtA[i:]) + n221, err := m.ResolveIntentRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n220 + i += n221 } return i, nil } @@ -15595,11 +15608,11 @@ func (m *ResponseUnion_Merge) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.Merge.Size())) - n221, err := m.Merge.MarshalTo(dAtA[i:]) + n222, err := m.Merge.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n221 + i += n222 } return i, nil } @@ -15611,11 +15624,11 @@ func (m *ResponseUnion_TruncateLog) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.TruncateLog.Size())) - n222, err := m.TruncateLog.MarshalTo(dAtA[i:]) + n223, err := m.TruncateLog.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n222 + i += n223 } return i, nil } @@ -15627,11 +15640,11 @@ func (m *ResponseUnion_RequestLease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.RequestLease.Size())) - n223, err := m.RequestLease.MarshalTo(dAtA[i:]) + n224, err := m.RequestLease.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n223 + i += n224 } return i, nil } @@ -15643,11 +15656,11 @@ func (m *ResponseUnion_ReverseScan) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ReverseScan.Size())) - n224, err := m.ReverseScan.MarshalTo(dAtA[i:]) + n225, err := m.ReverseScan.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n224 + i += n225 } return i, nil } @@ -15659,11 +15672,11 @@ func (m *ResponseUnion_ComputeChecksum) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.ComputeChecksum.Size())) - n225, err := m.ComputeChecksum.MarshalTo(dAtA[i:]) + n226, err := m.ComputeChecksum.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n225 + i += n226 } return i, nil } @@ -15675,11 +15688,11 @@ func (m *ResponseUnion_CheckConsistency) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.CheckConsistency.Size())) - n226, err := m.CheckConsistency.MarshalTo(dAtA[i:]) + n227, err := m.CheckConsistency.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n226 + i += n227 } return i, nil } @@ -15691,11 +15704,11 @@ func (m *ResponseUnion_InitPut) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.InitPut.Size())) - n227, err := m.InitPut.MarshalTo(dAtA[i:]) + n228, err := m.InitPut.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n227 + i += n228 } return i, nil } @@ -15707,11 +15720,11 @@ func (m *ResponseUnion_AdminTransferLease) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminTransferLease.Size())) - n228, err := m.AdminTransferLease.MarshalTo(dAtA[i:]) + n229, err := m.AdminTransferLease.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n228 + i += n229 } return i, nil } @@ -15723,11 +15736,11 @@ func (m *ResponseUnion_LeaseInfo) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.LeaseInfo.Size())) - n229, err := m.LeaseInfo.MarshalTo(dAtA[i:]) + n230, err := m.LeaseInfo.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n229 + i += n230 } return i, nil } @@ -15739,11 +15752,11 @@ func (m *ResponseUnion_WriteBatch) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintApi(dAtA, i, uint64(m.WriteBatch.Size())) - n230, err := m.WriteBatch.MarshalTo(dAtA[i:]) + n231, err := m.WriteBatch.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n230 + i += n231 } return i, nil } @@ -15755,11 +15768,11 @@ func (m *ResponseUnion_Export) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Export.Size())) - n231, err := m.Export.MarshalTo(dAtA[i:]) + n232, err := m.Export.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n231 + i += n232 } return i, nil } @@ -15771,11 +15784,11 @@ func (m *ResponseUnion_QueryTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.QueryTxn.Size())) - n232, err := m.QueryTxn.MarshalTo(dAtA[i:]) + n233, err := m.QueryTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n232 + i += n233 } return i, nil } @@ -15787,11 +15800,11 @@ func (m *ResponseUnion_Import) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Import.Size())) - n233, err := m.Import.MarshalTo(dAtA[i:]) + n234, err := m.Import.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n233 + i += n234 } return i, nil } @@ -15803,11 +15816,11 @@ func (m *ResponseUnion_AdminChangeReplicas) MarshalTo(dAtA []byte) (int, error) dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminChangeReplicas.Size())) - n234, err := m.AdminChangeReplicas.MarshalTo(dAtA[i:]) + n235, err := m.AdminChangeReplicas.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n234 + i += n235 } return i, nil } @@ -15819,11 +15832,11 @@ func (m *ResponseUnion_AdminScatter) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminScatter.Size())) - n235, err := m.AdminScatter.MarshalTo(dAtA[i:]) + n236, err := m.AdminScatter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n235 + i += n236 } return i, nil } @@ -15835,11 +15848,11 @@ func (m *ResponseUnion_AddSstable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AddSstable.Size())) - n236, err := m.AddSstable.MarshalTo(dAtA[i:]) + n237, err := m.AddSstable.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n236 + i += n237 } return i, nil } @@ -15851,11 +15864,11 @@ func (m *ResponseUnion_ClearRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.ClearRange.Size())) - n237, err := m.ClearRange.MarshalTo(dAtA[i:]) + n238, err := m.ClearRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n237 + i += n238 } return i, nil } @@ -15867,11 +15880,11 @@ func (m *ResponseUnion_RecomputeStats) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RecomputeStats.Size())) - n238, err := m.RecomputeStats.MarshalTo(dAtA[i:]) + n239, err := m.RecomputeStats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n238 + i += n239 } return i, nil } @@ -15883,11 +15896,11 @@ func (m *ResponseUnion_Refresh) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Refresh.Size())) - n239, err := m.Refresh.MarshalTo(dAtA[i:]) + n240, err := m.Refresh.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n239 + i += n240 } return i, nil } @@ -15899,11 +15912,11 @@ func (m *ResponseUnion_RefreshRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RefreshRange.Size())) - n240, err := m.RefreshRange.MarshalTo(dAtA[i:]) + n241, err := m.RefreshRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n240 + i += n241 } return i, nil } @@ -15915,11 +15928,11 @@ func (m *ResponseUnion_QueryIntent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.QueryIntent.Size())) - n241, err := m.QueryIntent.MarshalTo(dAtA[i:]) + n242, err := m.QueryIntent.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n241 + i += n242 } return i, nil } @@ -15931,11 +15944,11 @@ func (m *ResponseUnion_Subsume) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.Subsume.Size())) - n242, err := m.Subsume.MarshalTo(dAtA[i:]) + n243, err := m.Subsume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n242 + i += n243 } return i, nil } @@ -15947,11 +15960,11 @@ func (m *ResponseUnion_RangeStats) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RangeStats.Size())) - n243, err := m.RangeStats.MarshalTo(dAtA[i:]) + n244, err := m.RangeStats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n243 + i += n244 } return i, nil } @@ -15963,11 +15976,11 @@ func (m *ResponseUnion_AdminRelocateRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminRelocateRange.Size())) - n244, err := m.AdminRelocateRange.MarshalTo(dAtA[i:]) + n245, err := m.AdminRelocateRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n244 + i += n245 } return i, nil } @@ -15979,11 +15992,11 @@ func (m *ResponseUnion_RecoverTxn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.RecoverTxn.Size())) - n245, err := m.RecoverTxn.MarshalTo(dAtA[i:]) + n246, err := m.RecoverTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n245 + i += n246 } return i, nil } @@ -15995,11 +16008,11 @@ func (m *ResponseUnion_AdminUnsplit) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminUnsplit.Size())) - n246, err := m.AdminUnsplit.MarshalTo(dAtA[i:]) + n247, err := m.AdminUnsplit.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n246 + i += n247 } return i, nil } @@ -16011,11 +16024,11 @@ func (m *ResponseUnion_RevertRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3 i++ i = encodeVarintApi(dAtA, i, uint64(m.RevertRange.Size())) - n247, err := m.RevertRange.MarshalTo(dAtA[i:]) + n248, err := m.RevertRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n247 + i += n248 } return i, nil } @@ -16027,11 +16040,11 @@ func (m *ResponseUnion_AdminVerifyProtectedTimestamp) MarshalTo(dAtA []byte) (in dAtA[i] = 0x3 i++ i = encodeVarintApi(dAtA, i, uint64(m.AdminVerifyProtectedTimestamp.Size())) - n248, err := m.AdminVerifyProtectedTimestamp.MarshalTo(dAtA[i:]) + n249, err := m.AdminVerifyProtectedTimestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n248 + i += n249 } return i, nil } @@ -16053,19 +16066,19 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Timestamp.Size())) - n249, err := m.Timestamp.MarshalTo(dAtA[i:]) + n250, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n249 + i += n250 dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Replica.Size())) - n250, err := m.Replica.MarshalTo(dAtA[i:]) + n251, err := m.Replica.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n250 + i += n251 if m.RangeID != 0 { dAtA[i] = 0x18 i++ @@ -16081,11 +16094,11 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.Txn.Size())) - n251, err := m.Txn.MarshalTo(dAtA[i:]) + n252, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n251 + i += n252 } if m.ReadConsistency != 0 { dAtA[i] = 0x30 @@ -16170,11 +16183,11 @@ func (m *BatchRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Header.Size())) - n252, err := m.Header.MarshalTo(dAtA[i:]) + n253, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n252 + i += n253 if len(m.Requests) > 0 { for _, msg := range m.Requests { dAtA[i] = 0x12 @@ -16208,11 +16221,11 @@ func (m *BatchResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.BatchResponse_Header.Size())) - n253, err := m.BatchResponse_Header.MarshalTo(dAtA[i:]) + n254, err := m.BatchResponse_Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n253 + i += n254 if len(m.Responses) > 0 { for _, msg := range m.Responses { dAtA[i] = 0x12 @@ -16247,38 +16260,38 @@ func (m *BatchResponse_Header) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Error.Size())) - n254, err := m.Error.MarshalTo(dAtA[i:]) + n255, err := m.Error.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n254 + i += n255 } dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Timestamp.Size())) - n255, err := m.Timestamp.MarshalTo(dAtA[i:]) + n256, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n255 + i += n256 if m.Txn != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.Txn.Size())) - n256, err := m.Txn.MarshalTo(dAtA[i:]) + n257, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n256 + i += n257 } dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.Now.Size())) - n257, err := m.Now.MarshalTo(dAtA[i:]) + n258, err := m.Now.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n257 + i += n258 if len(m.CollectedSpans) > 0 { for _, msg := range m.CollectedSpans { dAtA[i] = 0x32 @@ -16324,19 +16337,19 @@ func (m *RangeFeedRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Header.Size())) - n258, err := m.Header.MarshalTo(dAtA[i:]) + n259, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n258 + i += n259 dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Span.Size())) - n259, err := m.Span.MarshalTo(dAtA[i:]) + n260, err := m.Span.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n259 + i += n260 if m.WithDiff { dAtA[i] = 0x18 i++ @@ -16374,19 +16387,19 @@ func (m *RangeFeedValue) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Value.Size())) - n260, err := m.Value.MarshalTo(dAtA[i:]) + n261, err := m.Value.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n260 + i += n261 dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.PrevValue.Size())) - n261, err := m.PrevValue.MarshalTo(dAtA[i:]) + n262, err := m.PrevValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n261 + i += n262 return i, nil } @@ -16408,19 +16421,19 @@ func (m *RangeFeedCheckpoint) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Span.Size())) - n262, err := m.Span.MarshalTo(dAtA[i:]) + n263, err := m.Span.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n262 + i += n263 dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.ResolvedTS.Size())) - n263, err := m.ResolvedTS.MarshalTo(dAtA[i:]) + n264, err := m.ResolvedTS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n263 + i += n264 return i, nil } @@ -16442,11 +16455,11 @@ func (m *RangeFeedError) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Error.Size())) - n264, err := m.Error.MarshalTo(dAtA[i:]) + n265, err := m.Error.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n264 + i += n265 return i, nil } @@ -16469,31 +16482,31 @@ func (m *RangeFeedEvent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Val.Size())) - n265, err := m.Val.MarshalTo(dAtA[i:]) + n266, err := m.Val.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n265 + i += n266 } if m.Checkpoint != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Checkpoint.Size())) - n266, err := m.Checkpoint.MarshalTo(dAtA[i:]) + n267, err := m.Checkpoint.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n266 + i += n267 } if m.Error != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.Error.Size())) - n267, err := m.Error.MarshalTo(dAtA[i:]) + n268, err := m.Error.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n267 + i += n268 } return i, nil } @@ -18360,6 +18373,10 @@ func (m *RangeStatsResponse) Size() (n int) { if m.QueriesPerSecond != 0 { n += 9 } + if m.RangeInfo != nil { + l = m.RangeInfo.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -33346,6 +33363,39 @@ func (m *RangeStatsResponse) Unmarshal(dAtA []byte) error { v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.QueriesPerSecond = float64(math.Float64frombits(v)) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RangeInfo == nil { + m.RangeInfo = &RangeInfo{} + } + if err := m.RangeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -37755,474 +37805,475 @@ var ( ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("roachpb/api.proto", fileDescriptor_api_a06e0f3f58e22ede) } - -var fileDescriptor_api_a06e0f3f58e22ede = []byte{ - // 7450 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7d, 0x5d, 0x68, 0x24, 0xd9, - 0x75, 0xbf, 0xaa, 0xbb, 0x25, 0x75, 0x9f, 0x6e, 0xb5, 0x4a, 0x57, 0x9a, 0x99, 0x1e, 0xcd, 0xac, - 0xa4, 0xe9, 0x9d, 0xaf, 0x1d, 0xef, 0x4a, 0x3b, 0x33, 0xbb, 0xff, 0x5d, 0xef, 0xac, 0xd7, 0x96, - 0x5a, 0x3d, 0xd3, 0x2d, 0x8d, 0x34, 0x9a, 0xea, 0xd6, 0xac, 0x77, 0xed, 0xa5, 0x5c, 0xaa, 0xba, - 0x6a, 0x95, 0xd5, 0x5d, 0xd5, 0x53, 0x55, 0xad, 0x8f, 0x81, 0x3f, 0xf8, 0xff, 0x01, 0x0e, 0x26, - 0x2c, 0x79, 0x08, 0x21, 0xc4, 0x09, 0x5e, 0x70, 0xc0, 0x01, 0xb3, 0x21, 0xc9, 0x5b, 0x82, 0x43, - 0xf2, 0x90, 0xc0, 0xc6, 0x38, 0x60, 0x02, 0x89, 0x4d, 0x20, 0xc2, 0x1e, 0x83, 0x09, 0x7e, 0x08, - 0xe4, 0x25, 0x81, 0x85, 0x84, 0x70, 0x3f, 0xea, 0xa3, 0xbb, 0xab, 0x3f, 0x34, 0xae, 0x4d, 0x16, - 0xfc, 0xd2, 0x74, 0x9d, 0xba, 0xe7, 0xd4, 0xbd, 0xe7, 0x9e, 0x7b, 0xee, 0xf9, 0xdd, 0x3a, 0xf7, - 0x16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e, 0x60, 0x5c, 0x12, 0x91, 0x71, 0x0d, 0x26, 0x77, 0x14, - 0x47, 0xdd, 0x93, 0x2d, 0x5e, 0x49, 0x32, 0x9b, 0xc5, 0xaf, 0x67, 0xa4, 0x2c, 0x25, 0xbb, 0x55, - 0xb7, 0xf3, 0xff, 0xe1, 0x5a, 0xbd, 0x8d, 0x7f, 0x25, 0x7b, 0xfe, 0x3f, 0x05, 0x3e, 0x9e, 0xdc, - 0xf6, 0xff, 0xaa, 0x19, 0xc0, 0xb7, 0x62, 0x70, 0xae, 0xb0, 0x87, 0xd5, 0xfd, 0x82, 0x69, 0xd8, - 0xba, 0xed, 0x10, 0x0d, 0x46, 0x69, 0x05, 0x17, 0x20, 0x75, 0xa8, 0x3b, 0x7b, 0xb2, 0xa6, 0xef, - 0xee, 0x52, 0xcf, 0x97, 0x94, 0x92, 0x84, 0xb0, 0xaa, 0xef, 0xee, 0xa2, 0xdb, 0x90, 0x68, 0x98, - 0x1a, 0x0b, 0x91, 0xb3, 0xb7, 0xe6, 0x43, 0xc4, 0xd3, 0xaa, 0xd9, 0xad, 0xc6, 0x86, 0xa9, 0x61, - 0x89, 0x16, 0x46, 0x73, 0x00, 0x2a, 0xa1, 0x36, 0x4d, 0xdd, 0x70, 0xf8, 0x1c, 0x18, 0xa0, 0xa0, - 0x12, 0xa4, 0x1c, 0x6c, 0x35, 0x74, 0x43, 0x71, 0x70, 0x6e, 0x94, 0x2a, 0xef, 0x72, 0x68, 0xc5, - 0x9b, 0x75, 0x5d, 0x55, 0x56, 0xb1, 0xad, 0x5a, 0x7a, 0xd3, 0x31, 0x2d, 0xae, 0x45, 0x9f, 0x99, - 0x7b, 0xdc, 0xf7, 0x13, 0x90, 0xeb, 0xd6, 0x50, 0x94, 0x76, 0xb2, 0x05, 0x63, 0x04, 0x65, 0xd7, - 0x1d, 0x6e, 0x29, 0xb7, 0x7a, 0x29, 0x22, 0xa4, 0x06, 0x14, 0xad, 0xd7, 0x1d, 0x5e, 0x79,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0xdf, 0x32, 0x6b, 0x99, 0x8b, 0x76, 0x4e, 0xa3, - 0x94, 0x29, 0x5f, 0x0a, 0xa3, 0xdb, 0xa8, 0x00, 0x49, 0x7c, 0xd4, 0x94, 0x35, 0x6c, 0xab, 0xdc, - 0xad, 0xe5, 0x7b, 0xbd, 0x47, 0xeb, 0x8a, 0xff, 0xc7, 0xf1, 0x51, 0x93, 0x10, 0xd1, 0x36, 0x99, - 0xe1, 0xdc, 0x70, 0x80, 0x56, 0xdb, 0x1e, 0x0c, 0x27, 0x7c, 0x7b, 0xe1, 0xe2, 0x26, 0xbd, 0x48, - 0x80, 0x89, 0xe0, 0x7d, 0xf7, 0x81, 0x00, 0x17, 0x42, 0xfb, 0x2e, 0xca, 0xc9, 0xee, 0x4d, 0x48, - 0x50, 0x15, 0xc4, 0x4e, 0xa9, 0x02, 0xca, 0x95, 0xff, 0xae, 0x3b, 0xea, 0x25, 0x5c, 0x37, 0x89, - 0x7a, 0x3f, 0x81, 0x75, 0xb1, 0x71, 0xb7, 0xdb, 0x63, 0xa7, 0xee, 0x76, 0x97, 0xb5, 0xc3, 0x2d, - 0x74, 0x54, 0x36, 0x4a, 0xb7, 0xf0, 0x5b, 0x02, 0x4c, 0x97, 0xb0, 0x62, 0x39, 0x3b, 0x58, 0x71, - 0x22, 0x0e, 0x67, 0x5f, 0x85, 0xb8, 0x61, 0x1e, 0x9e, 0x66, 0x69, 0x90, 0x94, 0xf7, 0xa7, 0xad, - 0xf6, 0x7a, 0x45, 0xd9, 0xea, 0xbf, 0x89, 0x41, 0xea, 0x5e, 0x21, 0xca, 0xb6, 0xbe, 0xc9, 0x17, - 0x90, 0xd9, 0x50, 0x0f, 0x33, 0x4b, 0xef, 0x79, 0x8b, 0xf7, 0x0a, 0xeb, 0xf8, 0xd8, 0x35, 0x4b, - 0xc2, 0x85, 0x96, 0x21, 0xe5, 0xec, 0x59, 0xd8, 0xde, 0x33, 0xeb, 0xda, 0x69, 0x62, 0x16, 0x9f, - 0x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- 0xc2, 0x10, 0x98, 0xc8, 0x13, 0xd5, 0x09, 0x8a, 0x56, 0xbb, 0x41, 0xd1, 0xe5, 0xfe, 0xa0, 0xc8, - 0x13, 0x15, 0x40, 0x45, 0x77, 0x3a, 0x50, 0xd1, 0xa5, 0x3e, 0xa8, 0xc8, 0xe3, 0x77, 0x61, 0xd1, - 0x7a, 0x28, 0x2c, 0xba, 0x3a, 0x08, 0x16, 0x79, 0x72, 0xda, 0x70, 0xd1, 0xab, 0x6d, 0xb8, 0x68, - 0xbe, 0x27, 0x2e, 0xf2, 0xb8, 0x19, 0x30, 0x7a, 0xb3, 0x13, 0x18, 0x5d, 0xea, 0x03, 0x8c, 0xfc, - 0x16, 0x70, 0x64, 0x54, 0x0a, 0x43, 0x46, 0x57, 0x06, 0x20, 0x23, 0x4f, 0x4a, 0x10, 0x1a, 0x95, - 0xc2, 0xa0, 0xd1, 0x95, 0x01, 0xd0, 0xa8, 0x43, 0x12, 0xc3, 0x46, 0x9b, 0xe1, 0xd8, 0xe8, 0xda, - 0x40, 0x6c, 0xe4, 0x49, 0x6b, 0x07, 0x47, 0x4b, 0x01, 0x70, 0xf4, 0x5c, 0x0f, 0x70, 0xe4, 0xb1, - 0x12, 0x74, 0xf4, 0xf9, 0x2e, 0x74, 0x94, 0xef, 0x87, 0x8e, 0x3c, 0x5e, 0x0f, 0x1e, 0x3d, 0xec, - 0x01, 0x8f, 0xae, 0x0f, 0x86, 0x47, 0x9e, 0xb0, 0x0e, 0x7c, 0xa4, 0xf4, 0xc5, 0x47, 0x2f, 0x0d, - 0x89, 0x8f, 0x3c, 0xe9, 0x61, 0x00, 0xe9, 0xf5, 0x76, 0x80, 0xb4, 0xd0, 0x1b, 0x20, 0x79, 0x62, - 0x38, 0x42, 0x5a, 0x0f, 0x45, 0x48, 0x57, 0x07, 0x21, 0x24, 0x7f, 0x1c, 0x04, 0x21, 0xd2, 0x66, - 0x38, 0x44, 0xba, 0x36, 0x10, 0x22, 0xf9, 0xdd, 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, 0x56, - 0x27, 0xc0, 0xc9, 0xf7, 0x03, 0x38, 0xfe, 0x88, 0x74, 0x11, 0xce, 0x66, 0x38, 0xc2, 0xb9, 0x36, - 0x10, 0xe1, 0x04, 0x9d, 0x64, 0x00, 0xe2, 0xac, 0x87, 0x42, 0x9c, 0xab, 0x83, 0x20, 0x8e, 0xef, - 0x24, 0x83, 0x18, 0xe7, 0xad, 0x4e, 0x8c, 0x93, 0xef, 0x87, 0x71, 0xfc, 0xc6, 0xb9, 0x20, 0xa7, - 0x14, 0x06, 0x72, 0xae, 0x0c, 0x00, 0x39, 0x7e, 0xe7, 0x05, 0x50, 0x8e, 0xd2, 0x17, 0xe5, 0xbc, - 0x34, 0x24, 0xca, 0xe9, 0x70, 0x5c, 0xed, 0x30, 0xa7, 0x14, 0x06, 0x73, 0xae, 0x0c, 0x80, 0x39, - 0x81, 0xca, 0xfa, 0x38, 0x67, 0x33, 0x1c, 0xe7, 0x5c, 0x1b, 0x88, 0x73, 0x3a, 0x46, 0x93, 0x0b, - 0x74, 0xd6, 0x43, 0x81, 0xce, 0xd5, 0x41, 0x40, 0xa7, 0x63, 0xe2, 0xe3, 0xc1, 0xc1, 0xff, 0x1b, - 0x1e, 0xe9, 0xbc, 0x7e, 0x7a, 0xa4, 0xe3, 0x3d, 0x33, 0x12, 0xa8, 0xb3, 0x96, 0x48, 0x5e, 0x14, - 0x9f, 0xcb, 0xff, 0x7c, 0x14, 0xc6, 0x4a, 0x5e, 0x3a, 0x8b, 0x5f, 0x4b, 0xe1, 0x59, 0x4e, 0x32, - 0x42, 0xab, 0x64, 0xc4, 0x52, 0xbf, 0x37, 0xf8, 0xd0, 0xba, 0xee, 0x03, 0xd5, 0x38, 0xeb, 0x33, - 0x6c, 0x24, 0x46, 0xaf, 0xc2, 0x44, 0xcb, 0xc6, 0x96, 0xdc, 0xb4, 0x74, 0xd3, 0xd2, 0x1d, 0xb6, - 0x29, 0x43, 0x58, 0x11, 0x3f, 0x3e, 0x99, 0xcf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5b, 0x2c, 0x76, 0x00, 0x00, +func init() { proto.RegisterFile("roachpb/api.proto", fileDescriptor_api_d3d69809727ab49a) } + +var fileDescriptor_api_d3d69809727ab49a = []byte{ + // 7464 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7d, 0x6f, 0x6c, 0x23, 0xc9, + 0x95, 0x9f, 0x9a, 0xa4, 0x28, 0xf2, 0x91, 0xa2, 0x5a, 0x25, 0xcd, 0x0c, 0x47, 0xb3, 0x2b, 0x69, + 0xb8, 0xf3, 0x6f, 0xc7, 0xbb, 0xd2, 0xce, 0xcc, 0x6e, 0x76, 0xbd, 0xb3, 0x5e, 0x5b, 0xa2, 0x38, + 0x43, 0x4a, 0x23, 0x8d, 0xa6, 0x49, 0xcd, 0x7a, 0xd7, 0x5e, 0xb4, 0x5b, 0xdd, 0x25, 0xaa, 0x2d, + 0xb2, 0x9b, 0xd3, 0xdd, 0xd4, 0x9f, 0x01, 0x02, 0x38, 0x7f, 0x00, 0x07, 0x46, 0xb0, 0xc8, 0x87, + 0x20, 0x08, 0xe2, 0x18, 0x5e, 0xc0, 0x01, 0x1c, 0xc0, 0xd8, 0x20, 0xc9, 0xb7, 0x04, 0x0e, 0x92, + 0x0f, 0x09, 0xb0, 0x31, 0x1c, 0xc0, 0x08, 0x70, 0x67, 0xe3, 0x80, 0x13, 0xce, 0x63, 0xc0, 0x38, + 0xf8, 0xc3, 0x01, 0xf7, 0xe5, 0x0e, 0x58, 0xe0, 0x0e, 0x87, 0xfa, 0xd3, 0x7f, 0x48, 0x36, 0xff, + 0x68, 0xdc, 0x7b, 0xb7, 0x80, 0xbf, 0x10, 0xec, 0x57, 0xf5, 0x5e, 0x57, 0xbd, 0xaa, 0x7a, 0xf5, + 0x7e, 0x55, 0xaf, 0xaa, 0x61, 0xda, 0x32, 0x15, 0x75, 0xbf, 0xb5, 0xbb, 0xac, 0xb4, 0xf4, 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x0f, 0xb1, 0xe5, 0x44, + 0xde, 0xa4, 0x6b, 0x90, 0x71, 0x14, 0xab, 0x8e, 0x1d, 0x99, 0xf8, 0xe3, 0xdc, 0x5c, 0xbd, 0x18, + 0x10, 0x44, 0xbc, 0xf2, 0xa5, 0xfd, 0x86, 0xba, 0x54, 0x73, 0xfd, 0x75, 0x6e, 0xb3, 0x80, 0xf1, + 0x11, 0x32, 0xd7, 0xc0, 0x07, 0x30, 0xd3, 0x51, 0xca, 0x28, 0x55, 0xf0, 0x57, 0x02, 0x64, 0xaa, + 0xaa, 0x62, 0x44, 0x59, 0xf7, 0x77, 0x21, 0x63, 0xab, 0x8a, 0x21, 0xef, 0x99, 0x56, 0x53, 0x71, + 0x68, 0x97, 0xcd, 0x75, 0xd4, 0xdd, 0xf3, 0x9a, 0x55, 0xc5, 0xb8, 0x47, 0x33, 0x49, 0x60, 0x7b, + 0xff, 0xd1, 0x23, 0xc8, 0x1c, 0xe0, 0x13, 0x99, 0xa3, 0x2b, 0x3a, 0xcf, 0xe5, 0x6e, 0xbf, 0x16, + 0xe0, 0x3f, 0x38, 0x5c, 0x72, 0x41, 0xd9, 0x52, 0x00, 0x94, 0x2d, 0x11, 0x8e, 0xa5, 0xaa, 0x63, + 0x61, 0xa3, 0xee, 0xec, 0x4b, 0x70, 0x80, 0x4f, 0x1e, 0x30, 0x19, 0xc1, 0x81, 0xb2, 0x9e, 0x48, + 0xc5, 0xc5, 0x44, 0xe1, 0xaf, 0x05, 0xc8, 0xb2, 0x8a, 0x47, 0x39, 0x50, 0xde, 0x80, 0x84, 0x65, + 0x1e, 0xb1, 0x81, 0x92, 0xb9, 0x7d, 0x29, 0x44, 0xc4, 0x06, 0x3e, 0x09, 0xce, 0x50, 0x34, 0x3b, + 0x5a, 0x05, 0xee, 0xfb, 0xc9, 0x94, 0x3b, 0x3e, 0x2a, 0x37, 0x30, 0x2e, 0x89, 0xc8, 0xb8, 0x0e, + 0x53, 0xbb, 0x8a, 0xa3, 0xee,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0xe7, 0xf3, + 0xfa, 0xd0, 0x84, 0xd7, 0xec, 0x7d, 0x40, 0xc1, 0x8a, 0x45, 0x89, 0x4f, 0x64, 0x98, 0xa1, 0xa2, + 0x77, 0x0c, 0x3b, 0x62, 0xad, 0x71, 0xeb, 0xfa, 0x0d, 0x98, 0xed, 0x7c, 0x41, 0x94, 0xa5, 0xff, + 0x90, 0xb7, 0xf8, 0x26, 0xb6, 0x3e, 0x27, 0x68, 0x1c, 0x14, 0x1f, 0x65, 0xc9, 0xbf, 0x27, 0xc0, + 0x45, 0x2a, 0x9b, 0xee, 0x89, 0xec, 0x61, 0xeb, 0x01, 0x56, 0xec, 0x48, 0x11, 0xf2, 0x4b, 0x90, + 0x64, 0x48, 0x97, 0xf6, 0xd8, 0xf1, 0xd5, 0x0c, 0xf1, 0x4b, 0xaa, 0x8e, 0x69, 0x11, 0xbf, 0x84, + 0x27, 0xf1, 0x7a, 0x2a, 0x30, 0x17, 0x56, 0x96, 0x88, 0x97, 0x02, 0xa6, 0xb9, 0x7b, 0x48, 0xba, + 0x78, 0x71, 0x9f, 0xf8, 0x45, 0xa8, 0x04, 0x19, 0x95, 0xfe, 0x93, 0x9d, 0x93, 0x16, 0xa6, 0xf2, + 0x73, 0x83, 0x3c, 0x4b, 0xc6, 0x56, 0x3b, 0x69, 0x61, 0xe2, 0x9e, 0xba, 0xff, 0x89, 0xba, 0x02, + 0x55, 0x1d, 0xe8, 0x9b, 0xd2, 0xf1, 0x45, 0xf3, 0xba, 0xee, 0x5d, 0x87, 0x26, 0xfe, 0x5b, 0x9c, + 0xab, 0x82, 0xbd, 0x89, 0x33, 0x45, 0xea, 0x8d, 0x7c, 0xd0, 0xb1, 0x3d, 0x15, 0xac, 0x7e, 0xec, + 0x0c, 0xd5, 0x0f, 0xac, 0x8b, 0xfb, 0x54, 0xf4, 0x3e, 0x04, 0x56, 0xbe, 0x65, 0x56, 0x33, 0x17, + 0xed, 0x9c, 0x45, 0x29, 0xd3, 0xbe, 0x14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, 0xb3, 0xad, 0x15, 0x4d, 0x63, 0x4f, + 0xaf, 0x73, 0x7b, 0x7c, 0x6d, 0x04, 0x99, 0xf7, 0x8b, 0x55, 0xa9, 0x57, 0x00, 0x5a, 0x81, 0x54, + 0xf5, 0x0e, 0x17, 0xc6, 0x1c, 0xb8, 0xab, 0x23, 0x08, 0xab, 0xde, 0x91, 0x3c, 0x36, 0xb4, 0x0e, + 0x99, 0x95, 0xa7, 0x6d, 0x0b, 0x73, 0x29, 0xc9, 0xbe, 0x71, 0x09, 0xdd, 0x52, 0x28, 0x97, 0x14, + 0x64, 0x46, 0x55, 0xc8, 0xbd, 0x67, 0x5a, 0x07, 0x0d, 0x53, 0x71, 0x6b, 0x38, 0x41, 0xc5, 0x7d, + 0x69, 0x04, 0x71, 0x2e, 0xa3, 0xd4, 0x25, 0x02, 0x7d, 0x13, 0xa6, 0x48, 0x63, 0xd4, 0x94, 0xdd, + 0x86, 0x5b, 0xc8, 0x14, 0x95, 0xfa, 0xca, 0x08, 0x52, 0x3d, 0x4e, 0x77, 0xf3, 0xa4, 0x4b, 0xd4, + 0xdc, 0xd7, 0x61, 0xb2, 0xa3, 0x13, 0x20, 0x04, 0x89, 0x16, 0x69, 0x6f, 0x81, 0xc6, 0x0f, 0xd1, + 0xff, 0xe8, 0x55, 0x98, 0x30, 0x4c, 0x0d, 0xbb, 0x23, 0x64, 0x72, 0x75, 0xf6, 0xd9, 0xe9, 0x42, + 0x72, 0xcb, 0xd4, 0x98, 0xbb, 0xc2, 0xff, 0x49, 0x49, 0x92, 0xc9, 0x75, 0x56, 0xe6, 0xae, 0x41, + 0x82, 0xb4, 0x3e, 0x31, 0x52, 0xbb, 0x8a, 0x8d, 0x77, 0x2c, 0x9d, 0xcb, 0x74, 0x1f, 0x79, 0xbe, + 0x5f, 0x09, 0x10, 0xab, 0xde, 0x21, 0x8e, 0xfa, 0x6e, 0x5b, 0x3d, 0xc0, 0x0e, 0xcf, 0xc5, 0x9f, + 0xa8, 0x03,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, 0x21, + 0xd2, 0x56, 0x38, 0x44, 0xba, 0x3e, 0x14, 0x22, 0xf9, 0xcd, 0xdf, 0x81, 0x91, 0x36, 0x42, 0x31, + 0xd2, 0xb5, 0x61, 0x18, 0xc9, 0x2f, 0x5c, 0x10, 0x24, 0xbd, 0xd7, 0x17, 0x24, 0xdd, 0x1c, 0x05, + 0x24, 0x79, 0x42, 0x7b, 0x50, 0xd2, 0x07, 0xfd, 0x51, 0xd2, 0x97, 0xce, 0x70, 0x35, 0x61, 0x28, + 0x4c, 0xfa, 0x6a, 0x0f, 0x4c, 0x2a, 0x0c, 0x82, 0x49, 0x7e, 0x7f, 0x76, 0x71, 0x92, 0x32, 0x10, + 0xd5, 0xbc, 0x3a, 0x22, 0xaa, 0xf1, 0x3b, 0x5f, 0x08, 0xac, 0x29, 0x85, 0xc0, 0x9a, 0x2b, 0x83, + 0x61, 0x8d, 0x6f, 0xce, 0x7d, 0x5c, 0x53, 0x0e, 0xc3, 0x35, 0x57, 0x87, 0xe0, 0x1a, 0xdf, 0x0a, + 0x05, 0x80, 0xcd, 0xdd, 0x2e, 0x60, 0x73, 0x79, 0x68, 0x5c, 0x4f, 0x00, 0xd9, 0xac, 0xf6, 0x22, + 0x9b, 0x97, 0x06, 0x22, 0x1b, 0x4f, 0x82, 0x0f, 0x6d, 0xee, 0x76, 0x41, 0x9b, 0xcb, 0x03, 0xa0, + 0x8d, 0x5f, 0x00, 0x8e, 0x6d, 0xb4, 0xc1, 0xd8, 0x66, 0x69, 0x54, 0x6c, 0xe3, 0x09, 0x0e, 0x05, + 0x37, 0x5b, 0xe1, 0xe0, 0xe6, 0xfa, 0x88, 0xbb, 0xec, 0x3d, 0xe8, 0xa6, 0x1c, 0x86, 0x6e, 0xae, + 0x0e, 0x41, 0x37, 0xc1, 0x39, 0xc4, 0x83, 0x37, 0xe5, 0x30, 0x78, 0x73, 0x75, 0x08, 0xbc, 0xf1, + 0x25, 0x05, 0xf0, 0x4d, 0xad, 0x1f, 0xb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0x00, 0xff, 0xff, + 0x33, 0xfb, 0x05, 0x9d, 0x69, 0x76, 0x00, 0x00, } diff --git a/pkg/roachpb/api.proto b/pkg/roachpb/api.proto index 8c62c84e906d..23427baa3517 100644 --- a/pkg/roachpb/api.proto +++ b/pkg/roachpb/api.proto @@ -1733,6 +1733,10 @@ message RangeStatsResponse { // QueriesPerSecond is the rate of request/s or QPS for the range. double queries_per_second = 3; + + // range_info contains descriptor and lease information. Added in 20.2. + // TODO(andrei): Make non-nullable in 21.1. + RangeInfo range_info = 4; } // A RequestUnion contains exactly one of the requests.
e92993d38ae1c144b1d4acace2291de60239a98e
2018-03-18 10:20:31
Andrew Kimball
opt: Create new memo package
false
Create new memo package
opt
diff --git a/pkg/sql/opt/exec/execbuilder/builder.go b/pkg/sql/opt/exec/execbuilder/builder.go index f96d5222b176..85807545d807 100644 --- a/pkg/sql/opt/exec/execbuilder/builder.go +++ b/pkg/sql/opt/exec/execbuilder/builder.go @@ -16,22 +16,22 @@ package execbuilder import ( "github.com/cockroachdb/cockroach/pkg/sql/opt/exec" - "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/pkg/errors" ) // Builder constructs a tree of execution nodes (exec.Node) from an optimized -// expression tree (xform.ExprView). +// expression tree (memo.ExprView). type Builder struct { factory exec.Factory - ev xform.ExprView + ev memo.ExprView } // New constructs an instance of the execution node builder using the // given factory to construct nodes. The Build method will build the execution // node tree from the given optimized expression tree. -func New(factory exec.Factory, ev xform.ExprView) *Builder { +func New(factory exec.Factory, ev memo.ExprView) *Builder { return &Builder{factory: factory, ev: ev} } @@ -41,7 +41,7 @@ func (b *Builder) Build() (exec.Node, error) { return b.build(b.ev) } -func (b *Builder) build(ev xform.ExprView) (exec.Node, error) { +func (b *Builder) build(ev memo.ExprView) (exec.Node, error) { if !ev.IsRelational() && !ev.IsEnforcer() { return nil, errors.Errorf("building execution for non-relational operator %s", ev.Operator()) } diff --git a/pkg/sql/opt/exec/execbuilder/builder_test.go b/pkg/sql/opt/exec/execbuilder/builder_test.go index decf356047c7..689cc4e23c7b 100644 --- a/pkg/sql/opt/exec/execbuilder/builder_test.go +++ b/pkg/sql/opt/exec/execbuilder/builder_test.go @@ -101,15 +101,7 @@ var ( func TestBuild(t *testing.T) { defer leaktest.AfterTest(t)() - paths, err := filepath.Glob(*testDataGlob) - if err != nil { - t.Fatal(err) - } - if len(paths) == 0 { - t.Fatalf("no testfiles found matching: %s", *testDataGlob) - } - - for _, path := range paths { + for _, path := range testutils.GetTestFiles(t, *testDataGlob) { t.Run(filepath.Base(path), func(t *testing.T) { ctx := context.Background() evalCtx := tree.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) diff --git a/pkg/sql/opt/exec/execbuilder/relational_builder.go b/pkg/sql/opt/exec/execbuilder/relational_builder.go index f706d0cefa31..e5ba823d62c9 100644 --- a/pkg/sql/opt/exec/execbuilder/relational_builder.go +++ b/pkg/sql/opt/exec/execbuilder/relational_builder.go @@ -22,7 +22,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/exec" - "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" "github.com/cockroachdb/cockroach/pkg/util/encoding" @@ -80,7 +80,7 @@ func (ep *execPlan) getColumnOrdinal(col opt.ColumnIndex) exec.ColumnOrdinal { return exec.ColumnOrdinal(ord) } -func (b *Builder) buildRelational(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildRelational(ev memo.ExprView) (execPlan, error) { var ep execPlan var err error switch ev.Operator() { @@ -139,7 +139,7 @@ func (b *Builder) buildRelational(ev xform.ExprView) (execPlan, error) { return ep, err } -func (b *Builder) buildValues(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildValues(ev memo.ExprView) (execPlan, error) { md := ev.Metadata() cols := *ev.Private().(*opt.ColList) numCols := len(cols) @@ -177,8 +177,8 @@ func (b *Builder) buildValues(ev xform.ExprView) (execPlan, error) { return ep, nil } -func (b *Builder) buildScan(ev xform.ExprView) (execPlan, error) { - def := ev.Private().(*opt.ScanOpDef) +func (b *Builder) buildScan(ev memo.ExprView) (execPlan, error) { + def := ev.Private().(*memo.ScanOpDef) md := ev.Metadata() tbl := md.Table(def.Table) @@ -202,7 +202,7 @@ func (b *Builder) buildScan(ev xform.ExprView) (execPlan, error) { return res, nil } -func (b *Builder) buildSelect(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildSelect(ev memo.ExprView) (execPlan, error) { input, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -220,7 +220,7 @@ func (b *Builder) buildSelect(ev xform.ExprView) (execPlan, error) { }, nil } -func (b *Builder) buildProject(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildProject(ev memo.ExprView) (execPlan, error) { input, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -245,7 +245,7 @@ func (b *Builder) buildProject(ev xform.ExprView) (execPlan, error) { return ep, nil } -func (b *Builder) buildJoin(ev xform.ExprView, joinType sqlbase.JoinType) (execPlan, error) { +func (b *Builder) buildJoin(ev memo.ExprView, joinType sqlbase.JoinType) (execPlan, error) { left, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -277,7 +277,7 @@ func (b *Builder) buildJoin(ev xform.ExprView, joinType sqlbase.JoinType) (execP return ep, nil } -func (b *Builder) buildGroupBy(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildGroupBy(ev memo.ExprView) (execPlan, error) { input, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -297,7 +297,7 @@ func (b *Builder) buildGroupBy(ev xform.ExprView) (execPlan, error) { aggInfos := make([]exec.AggInfo, numAgg) for i := 0; i < numAgg; i++ { fn := aggregations.Child(i) - funcDef := fn.Private().(opt.FuncOpDef) + funcDef := fn.Private().(memo.FuncOpDef) argIdx := make([]exec.ColumnOrdinal, fn.ChildCount()) for j := range argIdx { @@ -325,7 +325,7 @@ func (b *Builder) buildGroupBy(ev xform.ExprView) (execPlan, error) { return ep, nil } -func (b *Builder) buildSetOp(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildSetOp(ev memo.ExprView) (execPlan, error) { left, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -335,7 +335,7 @@ func (b *Builder) buildSetOp(ev xform.ExprView) (execPlan, error) { return execPlan{}, err } - colMap := *ev.Private().(*opt.SetOpColMap) + colMap := *ev.Private().(*memo.SetOpColMap) // We need to make sure that the two sides render the columns in the same // order; otherwise we add projections. @@ -396,7 +396,7 @@ func (b *Builder) buildSetOp(ev xform.ExprView) (execPlan, error) { } // buildLimitOffset builds a plan for a LimitOp or OffsetOp -func (b *Builder) buildLimitOffset(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildLimitOffset(ev memo.ExprView) (execPlan, error) { input, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -423,7 +423,7 @@ func (b *Builder) buildLimitOffset(ev xform.ExprView) (execPlan, error) { return execPlan{root: node, outputCols: input.outputCols}, nil } -func (b *Builder) buildSort(ev xform.ExprView) (execPlan, error) { +func (b *Builder) buildSort(ev memo.ExprView) (execPlan, error) { input, err := b.buildRelational(ev.Child(0)) if err != nil { return execPlan{}, err @@ -485,7 +485,7 @@ func (b *Builder) ensureColumns(input execPlan, colList opt.ColList) (exec.Node, // applyPresentation adds a projection to a plan to satisfy a required // Presentation property. func (b *Builder) applyPresentation( - input execPlan, md *opt.Metadata, p opt.Presentation, + input execPlan, md *opt.Metadata, p memo.Presentation, ) (execPlan, error) { colList := make(opt.ColList, len(p)) colNames := make([]string, len(p)) diff --git a/pkg/sql/opt/exec/execbuilder/scalar_builder.go b/pkg/sql/opt/exec/execbuilder/scalar_builder.go index 05b6cef11f60..e3e1c9edc4da 100644 --- a/pkg/sql/opt/exec/execbuilder/scalar_builder.go +++ b/pkg/sql/opt/exec/execbuilder/scalar_builder.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -30,7 +31,7 @@ type buildScalarCtx struct { ivarMap opt.ColMap } -type buildFunc func(b *Builder, ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr +type buildFunc func(b *Builder, ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr var scalarBuildFuncMap [opt.NumOperators]buildFunc @@ -70,22 +71,22 @@ func init() { // buildScalar converts a scalar expression to a TypedExpr. Variables are mapped // according to ctx. -func (b *Builder) buildScalar(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildScalar(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { if fn := scalarBuildFuncMap[ev.Operator()]; fn != nil { return fn(b, ctx, ev) } panic(fmt.Sprintf("unsupported op %s", ev.Operator())) } -func (b *Builder) buildTypedExpr(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildTypedExpr(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { return ev.Private().(tree.TypedExpr) } -func (b *Builder) buildNull(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildNull(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { return tree.DNull } -func (b *Builder) buildVariable(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildVariable(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { colIndex := ev.Private().(opt.ColumnIndex) idx, ok := ctx.ivarMap.Get(int(colIndex)) if !ok { @@ -94,11 +95,11 @@ func (b *Builder) buildVariable(ctx *buildScalarCtx, ev xform.ExprView) tree.Typ return ctx.ivh.IndexedVarWithType(idx, ev.Metadata().ColumnType(colIndex)) } -func (b *Builder) buildTuple(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildTuple(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { if xform.MatchesTupleOfConstants(ev) { datums := make(tree.Datums, ev.ChildCount()) for i := range datums { - datums[i] = xform.ExtractConstDatum(ev.Child(i)) + datums[i] = memo.ExtractConstDatum(ev.Child(i)) } return tree.NewDTuple(datums...) } @@ -110,7 +111,7 @@ func (b *Builder) buildTuple(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedE return tree.NewTypedTuple(typedExprs) } -func (b *Builder) buildBoolean(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildBoolean(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { switch ev.Operator() { case opt.AndOp, opt.OrOp, opt.FiltersOp: expr := b.buildScalar(ctx, ev.Child(0)) @@ -138,7 +139,7 @@ func (b *Builder) buildBoolean(ctx *buildScalarCtx, ev xform.ExprView) tree.Type } } -func (b *Builder) buildComparison(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildComparison(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { return tree.NewTypedComparisonExpr( opt.ComparisonOpReverseMap[ev.Operator()], b.buildScalar(ctx, ev.Child(0)), @@ -146,7 +147,7 @@ func (b *Builder) buildComparison(ctx *buildScalarCtx, ev xform.ExprView) tree.T ) } -func (b *Builder) buildUnary(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildUnary(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { return tree.NewTypedUnaryExpr( opt.UnaryOpReverseMap[ev.Operator()], b.buildScalar(ctx, ev.Child(0)), @@ -154,7 +155,7 @@ func (b *Builder) buildUnary(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedE ) } -func (b *Builder) buildBinary(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildBinary(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { return tree.NewTypedBinaryExpr( opt.BinaryOpReverseMap[ev.Operator()], b.buildScalar(ctx, ev.Child(0)), @@ -163,12 +164,12 @@ func (b *Builder) buildBinary(ctx *buildScalarCtx, ev xform.ExprView) tree.Typed ) } -func (b *Builder) buildFunction(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildFunction(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { exprs := make(tree.TypedExprs, ev.ChildCount()) for i := range exprs { exprs[i] = b.buildScalar(ctx, ev.Child(i)) } - funcDef := ev.Private().(opt.FuncOpDef) + funcDef := ev.Private().(memo.FuncOpDef) funcRef := tree.WrapFunction(funcDef.Name) return tree.NewTypedFuncExpr( funcRef, @@ -181,7 +182,7 @@ func (b *Builder) buildFunction(ctx *buildScalarCtx, ev xform.ExprView) tree.Typ ) } -func (b *Builder) buildCase(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildCase(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { input := b.buildScalar(ctx, ev.Child(0)) // A searched CASE statement is represented by the optimizer with input=True. @@ -212,7 +213,7 @@ func (b *Builder) buildCase(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedEx return expr } -func (b *Builder) buildCast(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildCast(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { expr, err := tree.NewTypedCastExpr( b.buildScalar(ctx, ev.Child(0)), ev.Logical().Scalar.Type, @@ -223,7 +224,7 @@ func (b *Builder) buildCast(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedEx return expr } -func (b *Builder) buildCoalesce(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildCoalesce(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { exprs := make(tree.TypedExprs, ev.ChildCount()) for i := range exprs { exprs[i] = b.buildScalar(ctx, ev.Child(i)) @@ -231,6 +232,6 @@ func (b *Builder) buildCoalesce(ctx *buildScalarCtx, ev xform.ExprView) tree.Typ return tree.NewTypedCoalesceExpr(exprs, ev.Logical().Scalar.Type) } -func (b *Builder) buildUnsupportedExpr(ctx *buildScalarCtx, ev xform.ExprView) tree.TypedExpr { +func (b *Builder) buildUnsupportedExpr(ctx *buildScalarCtx, ev memo.ExprView) tree.TypedExpr { return ev.Private().(tree.TypedExpr) } diff --git a/pkg/sql/opt/idxconstraint/index_constraints.go b/pkg/sql/opt/idxconstraint/index_constraints.go index ce0dab8fccd4..b63d19ee1338 100644 --- a/pkg/sql/opt/idxconstraint/index_constraints.go +++ b/pkg/sql/opt/idxconstraint/index_constraints.go @@ -21,6 +21,7 @@ import ( "strings" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" @@ -103,13 +104,13 @@ func (c *indexConstraintCtx) verifyType(offset int, typ types.T) bool { // operand. The <tight> return value indicates if the spans are exactly // equivalent to the expression (and not weaker). func (c *indexConstraintCtx) makeSpansForSingleColumn( - offset int, op opt.Operator, val xform.ExprView, + offset int, op opt.Operator, val memo.ExprView, ) (_ LogicalSpans, ok bool, tight bool) { if op == opt.InOp && xform.MatchesTupleOfConstants(val) { // We assume that the values of the tuple are already ordered and distinct. spans := make(LogicalSpans, 0, val.ChildCount()) for i, n := 0, val.ChildCount(); i < n; i++ { - datum := xform.ExtractConstDatum(val.Child(i)) + datum := memo.ExtractConstDatum(val.Child(i)) if !c.verifyType(offset, datum.ResolvedType()) { return nil, false, false } @@ -133,7 +134,7 @@ func (c *indexConstraintCtx) makeSpansForSingleColumn( if !val.IsConstValue() { return nil, false, false } - return c.makeSpansForSingleColumnDatum(offset, op, xform.ExtractConstDatum(val)) + return c.makeSpansForSingleColumnDatum(offset, op, memo.ExtractConstDatum(val)) } // makeSpansForSingleColumn creates spans for a single index column from a @@ -238,7 +239,7 @@ func (c *indexConstraintCtx) makeSpansForSingleColumnDatum( // The <tight> return value indicates if the spans are exactly equivalent // to the expression (and not weaker). func (c *indexConstraintCtx) makeSpansForTupleInequality( - offset int, ev xform.ExprView, + offset int, ev memo.ExprView, ) (_ LogicalSpans, ok bool, tight bool) { lhs, rhs := ev.Child(0), ev.Child(1) @@ -291,7 +292,7 @@ func (c *indexConstraintCtx) makeSpansForTupleInequality( datums := make(tree.Datums, prefixLen) for i := range datums { - datums[i] = xform.ExtractConstDatum(rhs.Child(i)) + datums[i] = memo.ExtractConstDatum(rhs.Child(i)) } // less is true if the op is < or <= and false if the op is > or >=. @@ -418,7 +419,7 @@ func (c *indexConstraintCtx) makeSpansForTupleInequality( // The <tight> return value indicates if the spans are exactly equivalent // to the expression (and not weaker). func (c *indexConstraintCtx) makeSpansForTupleIn( - offset int, ev xform.ExprView, + offset int, ev memo.ExprView, ) (_ LogicalSpans, ok bool, tight bool) { lhs, rhs := ev.Child(0), ev.Child(1) @@ -456,7 +457,7 @@ func (c *indexConstraintCtx) makeSpansForTupleIn( if !val.IsConstValue() { return nil, false, false } - datum := xform.ExtractConstDatum(val) + datum := memo.ExtractConstDatum(val) if !c.verifyType(offset+i, datum.ResolvedType()) { return nil, false, false } @@ -500,11 +501,11 @@ func (c *indexConstraintCtx) makeSpansForTupleIn( // The <tight> return value indicates if the spans are exactly equivalent to the // expression (and not weaker). See simplifyFilter for more information. func (c *indexConstraintCtx) makeSpansForExpr( - offset int, ev xform.ExprView, + offset int, ev memo.ExprView, ) (_ LogicalSpans, ok bool, tight bool) { if ev.IsConstValue() { - datum := xform.ExtractConstDatum(ev) + datum := memo.ExtractConstDatum(ev) if datum == tree.DBoolFalse || datum == tree.DNull { // Condition is never true, return no spans. return LogicalSpans{}, true, true @@ -594,7 +595,7 @@ type indexConstraintConjunctionCtx struct { *indexConstraintCtx // andExprs is a set of conjuncts that make up the filter. - andExprs []xform.ExprView + andExprs []memo.ExprView // Memoization data structure for calcOffset. results []calcOffsetResult @@ -611,11 +612,11 @@ type calcOffsetResult struct { // makeSpansForAndcalculates spans for an AndOp. func (c *indexConstraintCtx) makeSpansForAnd( - offset int, ev xform.ExprView, + offset int, ev memo.ExprView, ) (_ LogicalSpans, ok bool) { conjCtx := indexConstraintConjunctionCtx{ indexConstraintCtx: c, - andExprs: make([]xform.ExprView, ev.ChildCount()), + andExprs: make([]memo.ExprView, ev.ChildCount()), results: make([]calcOffsetResult, len(c.colInfos)), } for i := range conjCtx.andExprs { @@ -818,7 +819,7 @@ func (c indexConstraintConjunctionCtx) calcOffset(offset int) (_ LogicalSpans, o // makeSpansForOr calculates spans for an OrOp. func (c *indexConstraintCtx) makeSpansForOr( - offset int, ev xform.ExprView, + offset int, ev memo.ExprView, ) (_ LogicalSpans, ok bool, tight bool) { var spans LogicalSpans @@ -847,7 +848,7 @@ func (c *indexConstraintCtx) makeSpansForOr( // makeInvertedIndexSpansForExpr is analogous to makeSpansForExpr, but it is // used for inverted indexes. func (c *indexConstraintCtx) makeInvertedIndexSpansForExpr( - ev xform.ExprView, + ev memo.ExprView, ) (_ LogicalSpans, ok bool, tight bool) { switch ev.Operator() { case opt.ContainsOp: @@ -857,7 +858,7 @@ func (c *indexConstraintCtx) makeInvertedIndexSpansForExpr( return nil, false, false } - rightDatum := xform.ExtractConstDatum(rhs) + rightDatum := memo.ExtractConstDatum(rhs) rd := rightDatum.(*tree.DJSON).JSON switch rd.Type() { @@ -872,7 +873,7 @@ func (c *indexConstraintCtx) makeInvertedIndexSpansForExpr( if hasContainerLeaf { return nil, false, false } - return LogicalSpans{c.makeEqSpan(xform.ExtractConstDatum(rhs))}, true, true + return LogicalSpans{c.makeEqSpan(memo.ExtractConstDatum(rhs))}, true, true default: // If we find a scalar on the right side of the @> operator it means that we need to find // both matching scalars and arrays that contain that value. In order to do this we generate @@ -1009,11 +1010,11 @@ func (c *indexConstraintCtx) getMaxSimplifyPrefix(spans LogicalSpans) int { // `@1 <= 1 OR @1 >= 4` has spans `[ - /1], [/1 - ]` but in separation neither // sub-expression is always true inside these spans. func (c *indexConstraintCtx) simplifyFilter( - ev xform.ExprView, spans LogicalSpans, maxSimplifyPrefix int, -) opt.GroupID { + ev memo.ExprView, spans LogicalSpans, maxSimplifyPrefix int, +) memo.GroupID { // Special handling for AND and OR. if ev.Operator() == opt.OrOp || ev.Operator() == opt.AndOp { - newChildren := make([]opt.GroupID, ev.ChildCount()) + newChildren := make([]memo.GroupID, ev.ChildCount()) for i := range newChildren { newChildren[i] = c.simplifyFilter(ev.Child(i), spans, maxSimplifyPrefix) } @@ -1080,7 +1081,7 @@ func (c *indexConstraintCtx) simplifyFilter( type Instance struct { indexConstraintCtx - filter xform.ExprView + filter memo.ExprView spansPopulated bool spansTight bool @@ -1090,7 +1091,7 @@ type Instance struct { // Init processes the filter and calculates the spans. func (ic *Instance) Init( - filter xform.ExprView, + filter memo.ExprView, colInfos []IndexColumnInfo, isInverted bool, evalCtx *tree.EvalContext, @@ -1136,7 +1137,7 @@ func (ic *Instance) Spans() (_ LogicalSpans, ok bool) { // RemainingFilter calculates a simplified filter that needs to be applied // within the returned Spans. -func (ic *Instance) RemainingFilter() opt.GroupID { +func (ic *Instance) RemainingFilter() memo.GroupID { if !ic.spansPopulated { return ic.filter.Group() } @@ -1149,6 +1150,6 @@ func (ic *Instance) RemainingFilter() opt.GroupID { // isIndexColumn returns true if ev is an indexed var that corresponds // to index column <offset>. -func (c *indexConstraintCtx) isIndexColumn(ev xform.ExprView, index int) bool { +func (c *indexConstraintCtx) isIndexColumn(ev memo.ExprView, index int) bool { return ev.Operator() == opt.VariableOp && ev.Private().(opt.ColumnIndex) == c.colInfos[index].VarIdx } diff --git a/pkg/sql/opt/idxconstraint/index_constraints_test.go b/pkg/sql/opt/idxconstraint/index_constraints_test.go index 47787769357e..baf1b62e2378 100644 --- a/pkg/sql/opt/idxconstraint/index_constraints_test.go +++ b/pkg/sql/opt/idxconstraint/index_constraints_test.go @@ -27,6 +27,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" @@ -162,7 +163,7 @@ func TestIndexConstraints(t *testing.T) { if err != nil { return fmt.Sprintf("error: %v\n", err) } - ev := o.Optimize(group, &opt.PhysicalProps{}) + ev := o.Optimize(group, &memo.PhysicalProps{}) var ic Instance ic.Init(ev, colInfos, invertedIndex, &evalCtx, o.Factory()) @@ -176,7 +177,7 @@ func TestIndexConstraints(t *testing.T) { fmt.Fprintf(&buf, "%s\n", sp) } remainingFilter := ic.RemainingFilter() - remEv := o.Optimize(remainingFilter, &opt.PhysicalProps{}) + remEv := o.Optimize(remainingFilter, &memo.PhysicalProps{}) if remEv.Operator() != opt.TrueOp { execBld := execbuilder.New(nil /* execFactory */, remEv) expr := execBld.BuildScalar(&iVarHelper) @@ -259,7 +260,7 @@ func BenchmarkIndexConstraints(b *testing.B) { if err != nil { b.Fatal(err) } - ev := o.Optimize(group, &opt.PhysicalProps{}) + ev := o.Optimize(group, &memo.PhysicalProps{}) b.ResetTimer() for i := 0; i < b.N; i++ { var ic Instance diff --git a/pkg/sql/opt/memo/best_expr.go b/pkg/sql/opt/memo/best_expr.go index e156a2dab3a3..434618b3afc1 100644 --- a/pkg/sql/opt/memo/best_expr.go +++ b/pkg/sql/opt/memo/best_expr.go @@ -18,24 +18,31 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" ) -// bestExpr references the lowest cost expression in a memo group for a given +// BestExprID uniquely identifies a BestExpr stored in the memo by pairing the +// ID of its group with the ordinal position of the BestExpr within that group. +type BestExprID struct { + group GroupID + ordinal bestOrdinal +} + +// BestExpr references the lowest cost expression in a memo group for a given // set of required physical properties. This may be any kind of expression, -// including an enforcer expression like Sort. bestExpr also stores the ids of +// including an enforcer expression like Sort. BestExpr also stores the ids of // its child expressions, which are also the lowest cost expressions in their // respective groups. Recursively, this allows the best expression tree to be // efficiently extracted from the memo. -// NOTE: Do not reorder the fields in bestExpr, as they are arranged to +// NOTE: Do not reorder the fields in BestExpr, as they are arranged to // minimize its memory footprint. -type bestExpr struct { +type BestExpr struct { // eid references the lowest cost expression in the group. If op is an // enforcer, then eid references the non-enforcer expression that is // wrapped by the enforcer (could be several enforcer wrappers). - eid exprID + eid ExprID // required is the set of physical properties that must be provided by this // lowest cost expression. An expression that cannot provide these properties - // cannot be referenced by this bestExpr, no matter how low its cost. - required opt.PhysicalPropsID + // cannot be the best expression, no matter how low its cost. + required PhysicalPropsID // op is the operator type of the lowest cost expression. op opt.Operator @@ -47,47 +54,48 @@ type bestExpr struct { // initial is inline storage for the first several children. Most operators // have a small, fixed number of children and will never need to allocate // the remainder slice. - initial [opt.MaxOperands]bestExprID + initial [opt.MaxOperands]BestExprID // remainder stores any additional children once the initial array is full. // This will only be used for operators that have a list operand. - remainder []bestExprID + remainder []BestExprID } -// makeBestExpr constructs a new candidate bestExpr for the given expression, +// MakeBestExpr constructs a new candidate BestExpr for the given expression, // with respect to the given physical properties. This will be passed to -// memoGroup.ratchetBestExpr in order to check whether it has a lower cost than +// group.RatchetBestExpr in order to check whether it has a lower cost than // the current best expression for the group. -func makeBestExpr(op opt.Operator, eid exprID, required opt.PhysicalPropsID) bestExpr { - return bestExpr{op: op, eid: eid, required: required} +func MakeBestExpr(op opt.Operator, eid ExprID, required PhysicalPropsID) BestExpr { + return BestExpr{op: op, eid: eid, required: required} } -// initialized returns true once makeBestExpr has been called to initialize the -// bestExpr. -func (be *bestExpr) initialized() bool { - return be.required != 0 +// Required is the set of physical properties that must be provided by this +// lowest cost expression. An expression that cannot provide these properties +// cannot be the best expression, no matter how low its cost. +func (be *BestExpr) Required() PhysicalPropsID { + return be.required } -// childCount returns the number of children added to the best expression. -func (be *bestExpr) childCount() int { +// ChildCount returns the number of children added to the best expression. +func (be *BestExpr) ChildCount() int { return int(be.initialCount) + len(be.remainder) } -// child returns the id of the nth child of the best expression. It can be used -// in concert with childCount to iterate over the children: -// for i := 0; i < be.childCount(); i++ { +// Child returns the id of the nth child of the best expression. It can be used +// in concert with ChildCount to iterate over the children: +// for i := 0; i < be.ChildCount(); i++ { // child := be.child(i) // } -func (be *bestExpr) child(nth int) bestExprID { +func (be *BestExpr) Child(nth int) BestExprID { if nth < int(be.initialCount) { return be.initial[nth] } return be.remainder[nth-opt.MaxOperands] } -// addChild adds the identifier of the next child of the best expression. Each +// AddChild adds the identifier of the next child of the best expression. Each // child should also be the lowest cost expression in its respective group. -func (be *bestExpr) addChild(best bestExprID) { +func (be *BestExpr) AddChild(best BestExprID) { if be.initialCount < opt.MaxOperands { be.initial[be.initialCount] = best be.initialCount++ @@ -96,13 +104,18 @@ func (be *bestExpr) addChild(best bestExprID) { } } -// private returns the private value associated with this expression, or nil if +// Private returns the private value associated with this expression, or nil if // there is none. -func (be *bestExpr) private(mem *memo) interface{} { - // Enforcers can wrap expressions with private values, so don't return any - // wrapped private value. +func (be *BestExpr) Private(mem *Memo) interface{} { + // Don't return private values from expressions wrapped by enforcers. if isEnforcerLookup[be.op] { return nil } - return mem.lookupExpr(be.eid).private(mem) + return mem.Expr(be.eid).Private(mem) +} + +// initialized returns true once MakeBestExpr has been called to initialize the +// BestExpr. +func (be *BestExpr) initialized() bool { + return be.required != 0 } diff --git a/pkg/sql/opt/memo/expr.go b/pkg/sql/opt/memo/expr.go index 59380849c385..1be280bb19e0 100644 --- a/pkg/sql/opt/memo/expr.go +++ b/pkg/sql/opt/memo/expr.go @@ -14,28 +14,49 @@ package memo +//go:generate optgen -out expr.og.go exprs ../ops/*.opt + import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" ) +// ExprOrdinal is the ordinal position of an expression within its memo group. +// Each group stores one or more logically equivalent expressions. The 0th +// expression is always the normalized expression for the group. +type ExprOrdinal uint16 + +const ( + // normExprOrdinal is the ordinal position of the normalized expression in + // its group. + normExprOrdinal ExprOrdinal = 0 +) + +// ExprID uniquely identifies an expression stored in the memo by pairing the +// ID of its group with the ordinal position of the expression within that +// group. +type ExprID struct { + Group GroupID + Expr ExprOrdinal +} + // exprState is opaque storage used to store operator-specific fields in the // memo expression. type exprState [opt.MaxOperands]uint32 -// memoExpr is a memoized representation of an expression. Strongly-typed -// specializations of memoExpr are generated by optgen for each operator (see -// expr.og.go). Each memoExpr belongs to a memo group, which contains logically +// Expr is a memoized representation of an expression. Strongly-typed +// specializations of Expr are generated by optgen for each operator (see +// expr.og.go). Each Expr belongs to a memo group, which contains logically // equivalent expressions. Two expressions are considered logically equivalent // if they both reduce to an identical normal form after normalizing // transformations have been applied. // -// The children of memoExpr are recursively memoized in the same way as the -// memoExpr, and are referenced by their memo group. Therefore, the memoExpr +// The children of Expr are recursively memoized in the same way as the +// Expr, and are referenced by their memo group. Therefore, the Expr // is the root of a forest of expressions. -type memoExpr struct { +type Expr struct { // op is this expression's operator type. Each operator may have additional // fields. To access these fields in a strongly-typed way, use the asXXX() - // generated methods to cast the memoExpr to the more specialized + // generated methods to cast the Expr to the more specialized // expression type. op opt.Operator @@ -44,17 +65,25 @@ type memoExpr struct { state exprState } -// fingerprint uniquely identifies a memo expression by combining its operator +// Operator returns this memo expression's operator type. Each operator may +// have additional fields. To access these fields in a strongly-typed way, use +// the AsXXX() generated methods to cast the Expr to the more specialized +// expression type. +func (e *Expr) Operator() opt.Operator { + return e.op +} + +// Fingerprint uniquely identifies a memo expression by combining its operator // type plus its operator fields. It can be used as a map key. If two // expressions share the same fingerprint, then they are the identical // expression. If they don't share a fingerprint, then they still may be // logically equivalent expressions. Since a memo expression is 16 bytes and // contains no pointers, it can function as its own fingerprint/hash. -type fingerprint memoExpr +type Fingerprint Expr -// fingerprint returns this memo expression's unique fingerprint. -func (me *memoExpr) fingerprint() fingerprint { - return fingerprint(*me) +// Fingerprint returns this memo expression's unique fingerprint. +func (e *Expr) Fingerprint() Fingerprint { + return Fingerprint(*e) } // opLayout describes the "layout" of each op's children. It contains multiple @@ -90,45 +119,45 @@ func makeOpLayout(baseCount, list, priv uint8) opLayout { return opLayout(baseCount | (list << 2) | (priv << 4)) } -// childCount returns the number of expressions that are inputs to this parent +// ChildCount returns the number of expressions that are inputs to this parent // expression. -func (me *memoExpr) childCount() int { - layout := opLayoutTable[me.op] +func (e *Expr) ChildCount() int { + layout := opLayoutTable[e.op] baseCount := layout.baseCount() list := layout.list() if list == 0 { return int(baseCount) } - return int(baseCount) + int(me.state[list]) + return int(baseCount) + int(e.state[list]) } -// childGroup returns the memo group containing the nth child of this parent +// ChildGroup returns the memo group containing the nth child of this parent // expression. -func (me *memoExpr) childGroup(mem *memo, nth int) opt.GroupID { - layout := opLayoutTable[me.op] +func (e *Expr) ChildGroup(mem *Memo, nth int) GroupID { + layout := opLayoutTable[e.op] baseCount := layout.baseCount() if nth < int(baseCount) { - return opt.GroupID(me.state[nth]) + return GroupID(e.state[nth]) } nth -= int(baseCount) list := layout.list() - if list != 0 && nth < int(me.state[list]) { - listID := opt.ListID{Offset: me.state[list-1], Length: me.state[list]} - return mem.lookupList(listID)[nth] + if list != 0 && nth < int(e.state[list]) { + listID := ListID{Offset: e.state[list-1], Length: e.state[list]} + return mem.LookupList(listID)[nth] } panic("child index out of range") } -// private returns the value of this expression's private field, if it has one, +// Private returns the value of this expression's private field, if it has one, // or nil if not. -func (me *memoExpr) private(mem *memo) interface{} { - return mem.lookupPrivate(me.privateID()) +func (e *Expr) Private(mem *Memo) interface{} { + return mem.LookupPrivate(e.privateID()) } -func (me *memoExpr) privateID() opt.PrivateID { - priv := opLayoutTable[me.op].priv() +func (e *Expr) privateID() PrivateID { + priv := opLayoutTable[e.op].priv() if priv == 0 { return 0 } - return opt.PrivateID(me.state[priv-1]) + return PrivateID(e.state[priv-1]) } diff --git a/pkg/sql/opt/memo/expr.og.go b/pkg/sql/opt/memo/expr.og.go index 396d95bdd843..9e67c9f312af 100644 --- a/pkg/sql/opt/memo/expr.og.go +++ b/pkg/sql/opt/memo/expr.og.go @@ -1057,73 +1057,73 @@ func (ev ExprView) IsUnary() bool { return isUnaryLookup[ev.op] } -func (me *memoExpr) isEnforcer() bool { - return isEnforcerLookup[me.op] +func (e *Expr) IsEnforcer() bool { + return isEnforcerLookup[e.op] } -func (me *memoExpr) isRelational() bool { - return isRelationalLookup[me.op] +func (e *Expr) IsRelational() bool { + return isRelationalLookup[e.op] } -func (me *memoExpr) isJoin() bool { - return isJoinLookup[me.op] +func (e *Expr) IsJoin() bool { + return isJoinLookup[e.op] } -func (me *memoExpr) isJoinApply() bool { - return isJoinApplyLookup[me.op] +func (e *Expr) IsJoinApply() bool { + return isJoinApplyLookup[e.op] } -func (me *memoExpr) isScalar() bool { - return isScalarLookup[me.op] +func (e *Expr) IsScalar() bool { + return isScalarLookup[e.op] } -func (me *memoExpr) isConstValue() bool { - return isConstValueLookup[me.op] +func (e *Expr) IsConstValue() bool { + return isConstValueLookup[e.op] } -func (me *memoExpr) isBoolean() bool { - return isBooleanLookup[me.op] +func (e *Expr) IsBoolean() bool { + return isBooleanLookup[e.op] } -func (me *memoExpr) isComparison() bool { - return isComparisonLookup[me.op] +func (e *Expr) IsComparison() bool { + return isComparisonLookup[e.op] } -func (me *memoExpr) isBinary() bool { - return isBinaryLookup[me.op] +func (e *Expr) IsBinary() bool { + return isBinaryLookup[e.op] } -func (me *memoExpr) isUnary() bool { - return isUnaryLookup[me.op] +func (e *Expr) IsUnary() bool { + return isUnaryLookup[e.op] } -// scanExpr returns a result set containing every row in the specified table. The +// ScanExpr returns a result set containing every row in the specified table. The // private Def field is an *opt.ScanOpDef that identifies the table to scan, as // well as the subset of columns to project from it. Rows and columns are not // expected to have any particular ordering unless a physical property requires // it. -type scanExpr memoExpr +type ScanExpr Expr -func makeScanExpr(def opt.PrivateID) scanExpr { - return scanExpr{op: opt.ScanOp, state: exprState{uint32(def)}} +func MakeScanExpr(def PrivateID) ScanExpr { + return ScanExpr{op: opt.ScanOp, state: exprState{uint32(def)}} } -func (e *scanExpr) def() opt.PrivateID { - return opt.PrivateID(e.state[0]) +func (e *ScanExpr) Def() PrivateID { + return PrivateID(e.state[0]) } -func (e *scanExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ScanExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asScan() *scanExpr { - if m.op != opt.ScanOp { +func (e *Expr) AsScan() *ScanExpr { + if e.op != opt.ScanOp { return nil } - return (*scanExpr)(m) + return (*ScanExpr)(e) } -// valuesExpr returns a manufactured result set containing a constant number of rows. +// ValuesExpr returns a manufactured result set containing a constant number of rows. // specified by the Rows list field. Each row must contain the same set of // columns in the same order. // @@ -1132,587 +1132,587 @@ func (m *memoExpr) asScan() *scanExpr { // // The Cols field contains the set of column indices returned by each row // as a *ColList. It is legal for Cols to be empty. -type valuesExpr memoExpr +type ValuesExpr Expr -func makeValuesExpr(rows opt.ListID, cols opt.PrivateID) valuesExpr { - return valuesExpr{op: opt.ValuesOp, state: exprState{rows.Offset, rows.Length, uint32(cols)}} +func MakeValuesExpr(rows ListID, cols PrivateID) ValuesExpr { + return ValuesExpr{op: opt.ValuesOp, state: exprState{rows.Offset, rows.Length, uint32(cols)}} } -func (e *valuesExpr) rows() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *ValuesExpr) Rows() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *valuesExpr) cols() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *ValuesExpr) Cols() PrivateID { + return PrivateID(e.state[2]) } -func (e *valuesExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ValuesExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asValues() *valuesExpr { - if m.op != opt.ValuesOp { +func (e *Expr) AsValues() *ValuesExpr { + if e.op != opt.ValuesOp { return nil } - return (*valuesExpr)(m) + return (*ValuesExpr)(e) } -// selectExpr filters rows from its input result set, based on the boolean filter +// SelectExpr filters rows from its input result set, based on the boolean filter // predicate expression. Rows which do not match the filter are discarded. While // the Filter operand can be any boolean expression, normalization rules will // typically convert it to a Filters operator in order to make conjunction list // matching easier. -type selectExpr memoExpr +type SelectExpr Expr -func makeSelectExpr(input opt.GroupID, filter opt.GroupID) selectExpr { - return selectExpr{op: opt.SelectOp, state: exprState{uint32(input), uint32(filter)}} +func MakeSelectExpr(input GroupID, filter GroupID) SelectExpr { + return SelectExpr{op: opt.SelectOp, state: exprState{uint32(input), uint32(filter)}} } -func (e *selectExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *SelectExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *selectExpr) filter() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *SelectExpr) Filter() GroupID { + return GroupID(e.state[1]) } -func (e *selectExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *SelectExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asSelect() *selectExpr { - if m.op != opt.SelectOp { +func (e *Expr) AsSelect() *SelectExpr { + if e.op != opt.SelectOp { return nil } - return (*selectExpr)(m) + return (*SelectExpr)(e) } -// projectExpr modifies the set of columns returned by the input result set. Columns +// ProjectExpr modifies the set of columns returned by the input result set. Columns // can be removed, reordered, or renamed. In addition, new columns can be // synthesized. Projections is a scalar Projections list operator that contains // the list of expressions that describe the output columns. The Cols field of // the Projections operator provides the indexes of each of the output columns. -type projectExpr memoExpr +type ProjectExpr Expr -func makeProjectExpr(input opt.GroupID, projections opt.GroupID) projectExpr { - return projectExpr{op: opt.ProjectOp, state: exprState{uint32(input), uint32(projections)}} +func MakeProjectExpr(input GroupID, projections GroupID) ProjectExpr { + return ProjectExpr{op: opt.ProjectOp, state: exprState{uint32(input), uint32(projections)}} } -func (e *projectExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ProjectExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *projectExpr) projections() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ProjectExpr) Projections() GroupID { + return GroupID(e.state[1]) } -func (e *projectExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ProjectExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asProject() *projectExpr { - if m.op != opt.ProjectOp { +func (e *Expr) AsProject() *ProjectExpr { + if e.op != opt.ProjectOp { return nil } - return (*projectExpr)(m) + return (*ProjectExpr)(e) } -// innerJoinExpr creates a result set that combines columns from its left and right +// InnerJoinExpr creates a result set that combines columns from its left and right // inputs, based upon its "on" join predicate. Rows which do not match the // predicate are filtered. While expressions in the predicate can refer to // columns projected by either the left or right inputs, the inputs are not // allowed to refer to the other's projected columns. -type innerJoinExpr memoExpr +type InnerJoinExpr Expr -func makeInnerJoinExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) innerJoinExpr { - return innerJoinExpr{op: opt.InnerJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeInnerJoinExpr(left GroupID, right GroupID, on GroupID) InnerJoinExpr { + return InnerJoinExpr{op: opt.InnerJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *innerJoinExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *InnerJoinExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *innerJoinExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *InnerJoinExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *innerJoinExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *InnerJoinExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *innerJoinExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *InnerJoinExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asInnerJoin() *innerJoinExpr { - if m.op != opt.InnerJoinOp { +func (e *Expr) AsInnerJoin() *InnerJoinExpr { + if e.op != opt.InnerJoinOp { return nil } - return (*innerJoinExpr)(m) + return (*InnerJoinExpr)(e) } -type leftJoinExpr memoExpr +type LeftJoinExpr Expr -func makeLeftJoinExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) leftJoinExpr { - return leftJoinExpr{op: opt.LeftJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeLeftJoinExpr(left GroupID, right GroupID, on GroupID) LeftJoinExpr { + return LeftJoinExpr{op: opt.LeftJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *leftJoinExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LeftJoinExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *leftJoinExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LeftJoinExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *leftJoinExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *LeftJoinExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *leftJoinExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LeftJoinExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLeftJoin() *leftJoinExpr { - if m.op != opt.LeftJoinOp { +func (e *Expr) AsLeftJoin() *LeftJoinExpr { + if e.op != opt.LeftJoinOp { return nil } - return (*leftJoinExpr)(m) + return (*LeftJoinExpr)(e) } -type rightJoinExpr memoExpr +type RightJoinExpr Expr -func makeRightJoinExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) rightJoinExpr { - return rightJoinExpr{op: opt.RightJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeRightJoinExpr(left GroupID, right GroupID, on GroupID) RightJoinExpr { + return RightJoinExpr{op: opt.RightJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *rightJoinExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *RightJoinExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *rightJoinExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *RightJoinExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *rightJoinExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *RightJoinExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *rightJoinExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *RightJoinExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asRightJoin() *rightJoinExpr { - if m.op != opt.RightJoinOp { +func (e *Expr) AsRightJoin() *RightJoinExpr { + if e.op != opt.RightJoinOp { return nil } - return (*rightJoinExpr)(m) + return (*RightJoinExpr)(e) } -type fullJoinExpr memoExpr +type FullJoinExpr Expr -func makeFullJoinExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) fullJoinExpr { - return fullJoinExpr{op: opt.FullJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeFullJoinExpr(left GroupID, right GroupID, on GroupID) FullJoinExpr { + return FullJoinExpr{op: opt.FullJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *fullJoinExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FullJoinExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *fullJoinExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FullJoinExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *fullJoinExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *FullJoinExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *fullJoinExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FullJoinExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFullJoin() *fullJoinExpr { - if m.op != opt.FullJoinOp { +func (e *Expr) AsFullJoin() *FullJoinExpr { + if e.op != opt.FullJoinOp { return nil } - return (*fullJoinExpr)(m) + return (*FullJoinExpr)(e) } -type semiJoinExpr memoExpr +type SemiJoinExpr Expr -func makeSemiJoinExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) semiJoinExpr { - return semiJoinExpr{op: opt.SemiJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeSemiJoinExpr(left GroupID, right GroupID, on GroupID) SemiJoinExpr { + return SemiJoinExpr{op: opt.SemiJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *semiJoinExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *SemiJoinExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *semiJoinExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *SemiJoinExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *semiJoinExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *SemiJoinExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *semiJoinExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *SemiJoinExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asSemiJoin() *semiJoinExpr { - if m.op != opt.SemiJoinOp { +func (e *Expr) AsSemiJoin() *SemiJoinExpr { + if e.op != opt.SemiJoinOp { return nil } - return (*semiJoinExpr)(m) + return (*SemiJoinExpr)(e) } -type antiJoinExpr memoExpr +type AntiJoinExpr Expr -func makeAntiJoinExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) antiJoinExpr { - return antiJoinExpr{op: opt.AntiJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeAntiJoinExpr(left GroupID, right GroupID, on GroupID) AntiJoinExpr { + return AntiJoinExpr{op: opt.AntiJoinOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *antiJoinExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *AntiJoinExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *antiJoinExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *AntiJoinExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *antiJoinExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *AntiJoinExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *antiJoinExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *AntiJoinExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asAntiJoin() *antiJoinExpr { - if m.op != opt.AntiJoinOp { +func (e *Expr) AsAntiJoin() *AntiJoinExpr { + if e.op != opt.AntiJoinOp { return nil } - return (*antiJoinExpr)(m) + return (*AntiJoinExpr)(e) } -// innerJoinApplyExpr has the same join semantics as InnerJoin. However, unlike +// InnerJoinApplyExpr has the same join semantics as InnerJoin. However, unlike // InnerJoin, it allows the right input to refer to columns projected by the // left input. -type innerJoinApplyExpr memoExpr +type InnerJoinApplyExpr Expr -func makeInnerJoinApplyExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) innerJoinApplyExpr { - return innerJoinApplyExpr{op: opt.InnerJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeInnerJoinApplyExpr(left GroupID, right GroupID, on GroupID) InnerJoinApplyExpr { + return InnerJoinApplyExpr{op: opt.InnerJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *innerJoinApplyExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *InnerJoinApplyExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *innerJoinApplyExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *InnerJoinApplyExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *innerJoinApplyExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *InnerJoinApplyExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *innerJoinApplyExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *InnerJoinApplyExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asInnerJoinApply() *innerJoinApplyExpr { - if m.op != opt.InnerJoinApplyOp { +func (e *Expr) AsInnerJoinApply() *InnerJoinApplyExpr { + if e.op != opt.InnerJoinApplyOp { return nil } - return (*innerJoinApplyExpr)(m) + return (*InnerJoinApplyExpr)(e) } -type leftJoinApplyExpr memoExpr +type LeftJoinApplyExpr Expr -func makeLeftJoinApplyExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) leftJoinApplyExpr { - return leftJoinApplyExpr{op: opt.LeftJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeLeftJoinApplyExpr(left GroupID, right GroupID, on GroupID) LeftJoinApplyExpr { + return LeftJoinApplyExpr{op: opt.LeftJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *leftJoinApplyExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LeftJoinApplyExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *leftJoinApplyExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LeftJoinApplyExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *leftJoinApplyExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *LeftJoinApplyExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *leftJoinApplyExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LeftJoinApplyExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLeftJoinApply() *leftJoinApplyExpr { - if m.op != opt.LeftJoinApplyOp { +func (e *Expr) AsLeftJoinApply() *LeftJoinApplyExpr { + if e.op != opt.LeftJoinApplyOp { return nil } - return (*leftJoinApplyExpr)(m) + return (*LeftJoinApplyExpr)(e) } -type rightJoinApplyExpr memoExpr +type RightJoinApplyExpr Expr -func makeRightJoinApplyExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) rightJoinApplyExpr { - return rightJoinApplyExpr{op: opt.RightJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeRightJoinApplyExpr(left GroupID, right GroupID, on GroupID) RightJoinApplyExpr { + return RightJoinApplyExpr{op: opt.RightJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *rightJoinApplyExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *RightJoinApplyExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *rightJoinApplyExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *RightJoinApplyExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *rightJoinApplyExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *RightJoinApplyExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *rightJoinApplyExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *RightJoinApplyExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asRightJoinApply() *rightJoinApplyExpr { - if m.op != opt.RightJoinApplyOp { +func (e *Expr) AsRightJoinApply() *RightJoinApplyExpr { + if e.op != opt.RightJoinApplyOp { return nil } - return (*rightJoinApplyExpr)(m) + return (*RightJoinApplyExpr)(e) } -type fullJoinApplyExpr memoExpr +type FullJoinApplyExpr Expr -func makeFullJoinApplyExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) fullJoinApplyExpr { - return fullJoinApplyExpr{op: opt.FullJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeFullJoinApplyExpr(left GroupID, right GroupID, on GroupID) FullJoinApplyExpr { + return FullJoinApplyExpr{op: opt.FullJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *fullJoinApplyExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FullJoinApplyExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *fullJoinApplyExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FullJoinApplyExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *fullJoinApplyExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *FullJoinApplyExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *fullJoinApplyExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FullJoinApplyExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFullJoinApply() *fullJoinApplyExpr { - if m.op != opt.FullJoinApplyOp { +func (e *Expr) AsFullJoinApply() *FullJoinApplyExpr { + if e.op != opt.FullJoinApplyOp { return nil } - return (*fullJoinApplyExpr)(m) + return (*FullJoinApplyExpr)(e) } -type semiJoinApplyExpr memoExpr +type SemiJoinApplyExpr Expr -func makeSemiJoinApplyExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) semiJoinApplyExpr { - return semiJoinApplyExpr{op: opt.SemiJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeSemiJoinApplyExpr(left GroupID, right GroupID, on GroupID) SemiJoinApplyExpr { + return SemiJoinApplyExpr{op: opt.SemiJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *semiJoinApplyExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *SemiJoinApplyExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *semiJoinApplyExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *SemiJoinApplyExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *semiJoinApplyExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *SemiJoinApplyExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *semiJoinApplyExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *SemiJoinApplyExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asSemiJoinApply() *semiJoinApplyExpr { - if m.op != opt.SemiJoinApplyOp { +func (e *Expr) AsSemiJoinApply() *SemiJoinApplyExpr { + if e.op != opt.SemiJoinApplyOp { return nil } - return (*semiJoinApplyExpr)(m) + return (*SemiJoinApplyExpr)(e) } -type antiJoinApplyExpr memoExpr +type AntiJoinApplyExpr Expr -func makeAntiJoinApplyExpr(left opt.GroupID, right opt.GroupID, on opt.GroupID) antiJoinApplyExpr { - return antiJoinApplyExpr{op: opt.AntiJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} +func MakeAntiJoinApplyExpr(left GroupID, right GroupID, on GroupID) AntiJoinApplyExpr { + return AntiJoinApplyExpr{op: opt.AntiJoinApplyOp, state: exprState{uint32(left), uint32(right), uint32(on)}} } -func (e *antiJoinApplyExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *AntiJoinApplyExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *antiJoinApplyExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *AntiJoinApplyExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *antiJoinApplyExpr) on() opt.GroupID { - return opt.GroupID(e.state[2]) +func (e *AntiJoinApplyExpr) On() GroupID { + return GroupID(e.state[2]) } -func (e *antiJoinApplyExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *AntiJoinApplyExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asAntiJoinApply() *antiJoinApplyExpr { - if m.op != opt.AntiJoinApplyOp { +func (e *Expr) AsAntiJoinApply() *AntiJoinApplyExpr { + if e.op != opt.AntiJoinApplyOp { return nil } - return (*antiJoinApplyExpr)(m) + return (*AntiJoinApplyExpr)(e) } -// groupByExpr is an operator that is used for performing aggregations (for queries +// GroupByExpr is an operator that is used for performing aggregations (for queries // with aggregate functions, HAVING clauses and/or group by expressions). It // groups results that are equal on the grouping columns and computes // aggregations as described by Aggregations (which is always an Aggregations // operator). The arguments of the aggregations are columns from the input. -type groupByExpr memoExpr +type GroupByExpr Expr -func makeGroupByExpr(input opt.GroupID, aggregations opt.GroupID, groupingCols opt.PrivateID) groupByExpr { - return groupByExpr{op: opt.GroupByOp, state: exprState{uint32(input), uint32(aggregations), uint32(groupingCols)}} +func MakeGroupByExpr(input GroupID, aggregations GroupID, groupingCols PrivateID) GroupByExpr { + return GroupByExpr{op: opt.GroupByOp, state: exprState{uint32(input), uint32(aggregations), uint32(groupingCols)}} } -func (e *groupByExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *GroupByExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *groupByExpr) aggregations() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *GroupByExpr) Aggregations() GroupID { + return GroupID(e.state[1]) } -func (e *groupByExpr) groupingCols() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *GroupByExpr) GroupingCols() PrivateID { + return PrivateID(e.state[2]) } -func (e *groupByExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *GroupByExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asGroupBy() *groupByExpr { - if m.op != opt.GroupByOp { +func (e *Expr) AsGroupBy() *GroupByExpr { + if e.op != opt.GroupByOp { return nil } - return (*groupByExpr)(m) + return (*GroupByExpr)(e) } -// unionExpr is an operator used to combine the Left and Right input relations into +// UnionExpr is an operator used to combine the Left and Right input relations into // a single set containing rows from both inputs. Duplicate rows are discarded. // The private field, ColMap, matches columns from the Left and Right inputs // of the Union with the output columns. See the comment above opt.SetOpColMap // for more details. -type unionExpr memoExpr +type UnionExpr Expr -func makeUnionExpr(left opt.GroupID, right opt.GroupID, colMap opt.PrivateID) unionExpr { - return unionExpr{op: opt.UnionOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} +func MakeUnionExpr(left GroupID, right GroupID, colMap PrivateID) UnionExpr { + return UnionExpr{op: opt.UnionOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} } -func (e *unionExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *UnionExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *unionExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *UnionExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *unionExpr) colMap() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *UnionExpr) ColMap() PrivateID { + return PrivateID(e.state[2]) } -func (e *unionExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *UnionExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asUnion() *unionExpr { - if m.op != opt.UnionOp { +func (e *Expr) AsUnion() *UnionExpr { + if e.op != opt.UnionOp { return nil } - return (*unionExpr)(m) + return (*UnionExpr)(e) } -// intersectExpr is an operator used to perform an intersection between the Left +// IntersectExpr is an operator used to perform an intersection between the Left // and Right input relations. The result consists only of rows in the Left // relation that are also present in the Right relation. Duplicate rows are // discarded. // The private field, ColMap, matches columns from the Left and Right inputs // of the Intersect with the output columns. See the comment above // opt.SetOpColMap for more details. -type intersectExpr memoExpr +type IntersectExpr Expr -func makeIntersectExpr(left opt.GroupID, right opt.GroupID, colMap opt.PrivateID) intersectExpr { - return intersectExpr{op: opt.IntersectOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} +func MakeIntersectExpr(left GroupID, right GroupID, colMap PrivateID) IntersectExpr { + return IntersectExpr{op: opt.IntersectOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} } -func (e *intersectExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *IntersectExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *intersectExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *IntersectExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *intersectExpr) colMap() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *IntersectExpr) ColMap() PrivateID { + return PrivateID(e.state[2]) } -func (e *intersectExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *IntersectExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asIntersect() *intersectExpr { - if m.op != opt.IntersectOp { +func (e *Expr) AsIntersect() *IntersectExpr { + if e.op != opt.IntersectOp { return nil } - return (*intersectExpr)(m) + return (*IntersectExpr)(e) } -// exceptExpr is an operator used to perform a set difference between the Left and +// ExceptExpr is an operator used to perform a set difference between the Left and // Right input relations. The result consists only of rows in the Left relation // that are not present in the Right relation. Duplicate rows are discarded. // The private field, ColMap, matches columns from the Left and Right inputs // of the Except with the output columns. See the comment above opt.SetOpColMap // for more details. -type exceptExpr memoExpr +type ExceptExpr Expr -func makeExceptExpr(left opt.GroupID, right opt.GroupID, colMap opt.PrivateID) exceptExpr { - return exceptExpr{op: opt.ExceptOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} +func MakeExceptExpr(left GroupID, right GroupID, colMap PrivateID) ExceptExpr { + return ExceptExpr{op: opt.ExceptOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} } -func (e *exceptExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ExceptExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *exceptExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ExceptExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *exceptExpr) colMap() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *ExceptExpr) ColMap() PrivateID { + return PrivateID(e.state[2]) } -func (e *exceptExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ExceptExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asExcept() *exceptExpr { - if m.op != opt.ExceptOp { +func (e *Expr) AsExcept() *ExceptExpr { + if e.op != opt.ExceptOp { return nil } - return (*exceptExpr)(m) + return (*ExceptExpr)(e) } -// unionAllExpr is an operator used to combine the Left and Right input relations +// UnionAllExpr is an operator used to combine the Left and Right input relations // into a single set containing rows from both inputs. Duplicate rows are // not discarded. For example: // SELECT x FROM xx UNION ALL SELECT y FROM yy @@ -1728,36 +1728,36 @@ func (m *memoExpr) asExcept() *exceptExpr { // The private field, ColMap, matches columns from the Left and Right inputs // of the UnionAll with the output columns. See the comment above // opt.SetOpColMap for more details. -type unionAllExpr memoExpr +type UnionAllExpr Expr -func makeUnionAllExpr(left opt.GroupID, right opt.GroupID, colMap opt.PrivateID) unionAllExpr { - return unionAllExpr{op: opt.UnionAllOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} +func MakeUnionAllExpr(left GroupID, right GroupID, colMap PrivateID) UnionAllExpr { + return UnionAllExpr{op: opt.UnionAllOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} } -func (e *unionAllExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *UnionAllExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *unionAllExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *UnionAllExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *unionAllExpr) colMap() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *UnionAllExpr) ColMap() PrivateID { + return PrivateID(e.state[2]) } -func (e *unionAllExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *UnionAllExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asUnionAll() *unionAllExpr { - if m.op != opt.UnionAllOp { +func (e *Expr) AsUnionAll() *UnionAllExpr { + if e.op != opt.UnionAllOp { return nil } - return (*unionAllExpr)(m) + return (*UnionAllExpr)(e) } -// intersectAllExpr is an operator used to perform an intersection between the Left +// IntersectAllExpr is an operator used to perform an intersection between the Left // and Right input relations. The result consists only of rows in the Left // relation that have a corresponding row in the Right relation. Duplicate rows // are not discarded. This effectively creates a one-to-one mapping between the @@ -1775,36 +1775,36 @@ func (m *memoExpr) asUnionAll() *unionAllExpr { // The private field, ColMap, matches columns from the Left and Right inputs // of the IntersectAll with the output columns. See the comment above // opt.SetOpColMap for more details. -type intersectAllExpr memoExpr +type IntersectAllExpr Expr -func makeIntersectAllExpr(left opt.GroupID, right opt.GroupID, colMap opt.PrivateID) intersectAllExpr { - return intersectAllExpr{op: opt.IntersectAllOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} +func MakeIntersectAllExpr(left GroupID, right GroupID, colMap PrivateID) IntersectAllExpr { + return IntersectAllExpr{op: opt.IntersectAllOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} } -func (e *intersectAllExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *IntersectAllExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *intersectAllExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *IntersectAllExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *intersectAllExpr) colMap() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *IntersectAllExpr) ColMap() PrivateID { + return PrivateID(e.state[2]) } -func (e *intersectAllExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *IntersectAllExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asIntersectAll() *intersectAllExpr { - if m.op != opt.IntersectAllOp { +func (e *Expr) AsIntersectAll() *IntersectAllExpr { + if e.op != opt.IntersectAllOp { return nil } - return (*intersectAllExpr)(m) + return (*IntersectAllExpr)(e) } -// exceptAllExpr is an operator used to perform a set difference between the Left +// ExceptAllExpr is an operator used to perform a set difference between the Left // and Right input relations. The result consists only of rows in the Left // relation that do not have a corresponding row in the Right relation. // Duplicate rows are not discarded. This effectively creates a one-to-one @@ -1822,171 +1822,171 @@ func (m *memoExpr) asIntersectAll() *intersectAllExpr { // The private field, ColMap, matches columns from the Left and Right inputs // of the ExceptAll with the output columns. See the comment above // opt.SetOpColMap for more details. -type exceptAllExpr memoExpr +type ExceptAllExpr Expr -func makeExceptAllExpr(left opt.GroupID, right opt.GroupID, colMap opt.PrivateID) exceptAllExpr { - return exceptAllExpr{op: opt.ExceptAllOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} +func MakeExceptAllExpr(left GroupID, right GroupID, colMap PrivateID) ExceptAllExpr { + return ExceptAllExpr{op: opt.ExceptAllOp, state: exprState{uint32(left), uint32(right), uint32(colMap)}} } -func (e *exceptAllExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ExceptAllExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *exceptAllExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ExceptAllExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *exceptAllExpr) colMap() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *ExceptAllExpr) ColMap() PrivateID { + return PrivateID(e.state[2]) } -func (e *exceptAllExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ExceptAllExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asExceptAll() *exceptAllExpr { - if m.op != opt.ExceptAllOp { +func (e *Expr) AsExceptAll() *ExceptAllExpr { + if e.op != opt.ExceptAllOp { return nil } - return (*exceptAllExpr)(m) + return (*ExceptAllExpr)(e) } -// limitExpr returns a limited subset of the results in the input relation. +// LimitExpr returns a limited subset of the results in the input relation. // The limit expression is a scalar value; the operator returns at most this many // rows. The private field is an *opt.Ordering which indicates the desired // row ordering (the first rows with respect to this ordering are returned). -type limitExpr memoExpr +type LimitExpr Expr -func makeLimitExpr(input opt.GroupID, limit opt.GroupID, ordering opt.PrivateID) limitExpr { - return limitExpr{op: opt.LimitOp, state: exprState{uint32(input), uint32(limit), uint32(ordering)}} +func MakeLimitExpr(input GroupID, limit GroupID, ordering PrivateID) LimitExpr { + return LimitExpr{op: opt.LimitOp, state: exprState{uint32(input), uint32(limit), uint32(ordering)}} } -func (e *limitExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LimitExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *limitExpr) limit() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LimitExpr) Limit() GroupID { + return GroupID(e.state[1]) } -func (e *limitExpr) ordering() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *LimitExpr) Ordering() PrivateID { + return PrivateID(e.state[2]) } -func (e *limitExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LimitExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLimit() *limitExpr { - if m.op != opt.LimitOp { +func (e *Expr) AsLimit() *LimitExpr { + if e.op != opt.LimitOp { return nil } - return (*limitExpr)(m) + return (*LimitExpr)(e) } -// offsetExpr filters out the first Offset rows of the input relation; used in +// OffsetExpr filters out the first Offset rows of the input relation; used in // conjunction with Limit. -type offsetExpr memoExpr +type OffsetExpr Expr -func makeOffsetExpr(input opt.GroupID, offset opt.GroupID, ordering opt.PrivateID) offsetExpr { - return offsetExpr{op: opt.OffsetOp, state: exprState{uint32(input), uint32(offset), uint32(ordering)}} +func MakeOffsetExpr(input GroupID, offset GroupID, ordering PrivateID) OffsetExpr { + return OffsetExpr{op: opt.OffsetOp, state: exprState{uint32(input), uint32(offset), uint32(ordering)}} } -func (e *offsetExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *OffsetExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *offsetExpr) offset() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *OffsetExpr) Offset() GroupID { + return GroupID(e.state[1]) } -func (e *offsetExpr) ordering() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *OffsetExpr) Ordering() PrivateID { + return PrivateID(e.state[2]) } -func (e *offsetExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *OffsetExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asOffset() *offsetExpr { - if m.op != opt.OffsetOp { +func (e *Expr) AsOffset() *OffsetExpr { + if e.op != opt.OffsetOp { return nil } - return (*offsetExpr)(m) + return (*OffsetExpr)(e) } -type subqueryExpr memoExpr +type SubqueryExpr Expr -func makeSubqueryExpr(input opt.GroupID, projection opt.GroupID) subqueryExpr { - return subqueryExpr{op: opt.SubqueryOp, state: exprState{uint32(input), uint32(projection)}} +func MakeSubqueryExpr(input GroupID, projection GroupID) SubqueryExpr { + return SubqueryExpr{op: opt.SubqueryOp, state: exprState{uint32(input), uint32(projection)}} } -func (e *subqueryExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *SubqueryExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *subqueryExpr) projection() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *SubqueryExpr) Projection() GroupID { + return GroupID(e.state[1]) } -func (e *subqueryExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *SubqueryExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asSubquery() *subqueryExpr { - if m.op != opt.SubqueryOp { +func (e *Expr) AsSubquery() *SubqueryExpr { + if e.op != opt.SubqueryOp { return nil } - return (*subqueryExpr)(m) + return (*SubqueryExpr)(e) } -// variableExpr is the typed scalar value of a column in the query. The private +// VariableExpr is the typed scalar value of a column in the query. The private // field is a Metadata.ColumnIndex that references the column by index. -type variableExpr memoExpr +type VariableExpr Expr -func makeVariableExpr(col opt.PrivateID) variableExpr { - return variableExpr{op: opt.VariableOp, state: exprState{uint32(col)}} +func MakeVariableExpr(col PrivateID) VariableExpr { + return VariableExpr{op: opt.VariableOp, state: exprState{uint32(col)}} } -func (e *variableExpr) col() opt.PrivateID { - return opt.PrivateID(e.state[0]) +func (e *VariableExpr) Col() PrivateID { + return PrivateID(e.state[0]) } -func (e *variableExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *VariableExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asVariable() *variableExpr { - if m.op != opt.VariableOp { +func (e *Expr) AsVariable() *VariableExpr { + if e.op != opt.VariableOp { return nil } - return (*variableExpr)(m) + return (*VariableExpr)(e) } -// constExpr is a typed scalar constant value. The private field is a tree.Datum +// ConstExpr is a typed scalar constant value. The private field is a tree.Datum // value having any datum type that's legal in the expression's context. -type constExpr memoExpr +type ConstExpr Expr -func makeConstExpr(value opt.PrivateID) constExpr { - return constExpr{op: opt.ConstOp, state: exprState{uint32(value)}} +func MakeConstExpr(value PrivateID) ConstExpr { + return ConstExpr{op: opt.ConstOp, state: exprState{uint32(value)}} } -func (e *constExpr) value() opt.PrivateID { - return opt.PrivateID(e.state[0]) +func (e *ConstExpr) Value() PrivateID { + return PrivateID(e.state[0]) } -func (e *constExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ConstExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asConst() *constExpr { - if m.op != opt.ConstOp { +func (e *Expr) AsConst() *ConstExpr { + if e.op != opt.ConstOp { return nil } - return (*constExpr)(m) + return (*ConstExpr)(e) } -// nullExpr is the constant SQL null value that has "unknown value" semantics. If +// NullExpr is the constant SQL null value that has "unknown value" semantics. If // the Typ field is not types.Unknown, then the value is known to be in the // domain of that type. This is important for preserving correct types in // replacement patterns. For example: @@ -2002,189 +2002,189 @@ func (m *memoExpr) asConst() *constExpr { // Null is its own operator rather than a Const datum in order to make matching // and replacement easier and more efficient, as patterns can contain (Null) // expressions. -type nullExpr memoExpr +type NullExpr Expr -func makeNullExpr(typ opt.PrivateID) nullExpr { - return nullExpr{op: opt.NullOp, state: exprState{uint32(typ)}} +func MakeNullExpr(typ PrivateID) NullExpr { + return NullExpr{op: opt.NullOp, state: exprState{uint32(typ)}} } -func (e *nullExpr) typ() opt.PrivateID { - return opt.PrivateID(e.state[0]) +func (e *NullExpr) Typ() PrivateID { + return PrivateID(e.state[0]) } -func (e *nullExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NullExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNull() *nullExpr { - if m.op != opt.NullOp { +func (e *Expr) AsNull() *NullExpr { + if e.op != opt.NullOp { return nil } - return (*nullExpr)(m) + return (*NullExpr)(e) } -// trueExpr is the boolean true value that is equivalent to the tree.DBoolTrue datum +// TrueExpr is the boolean true value that is equivalent to the tree.DBoolTrue datum // value. It is a separate operator to make matching and replacement simpler and // more efficient, as patterns can contain (True) expressions. -type trueExpr memoExpr +type TrueExpr Expr -func makeTrueExpr() trueExpr { - return trueExpr{op: opt.TrueOp, state: exprState{}} +func MakeTrueExpr() TrueExpr { + return TrueExpr{op: opt.TrueOp, state: exprState{}} } -func (e *trueExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *TrueExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asTrue() *trueExpr { - if m.op != opt.TrueOp { +func (e *Expr) AsTrue() *TrueExpr { + if e.op != opt.TrueOp { return nil } - return (*trueExpr)(m) + return (*TrueExpr)(e) } -// falseExpr is the boolean false value that is equivalent to the tree.DBoolFalse +// FalseExpr is the boolean false value that is equivalent to the tree.DBoolFalse // datum value. It is a separate operator to make matching and replacement // simpler and more efficient, as patterns can contain (False) expressions. -type falseExpr memoExpr +type FalseExpr Expr -func makeFalseExpr() falseExpr { - return falseExpr{op: opt.FalseOp, state: exprState{}} +func MakeFalseExpr() FalseExpr { + return FalseExpr{op: opt.FalseOp, state: exprState{}} } -func (e *falseExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FalseExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFalse() *falseExpr { - if m.op != opt.FalseOp { +func (e *Expr) AsFalse() *FalseExpr { + if e.op != opt.FalseOp { return nil } - return (*falseExpr)(m) + return (*FalseExpr)(e) } -type placeholderExpr memoExpr +type PlaceholderExpr Expr -func makePlaceholderExpr(value opt.PrivateID) placeholderExpr { - return placeholderExpr{op: opt.PlaceholderOp, state: exprState{uint32(value)}} +func MakePlaceholderExpr(value PrivateID) PlaceholderExpr { + return PlaceholderExpr{op: opt.PlaceholderOp, state: exprState{uint32(value)}} } -func (e *placeholderExpr) value() opt.PrivateID { - return opt.PrivateID(e.state[0]) +func (e *PlaceholderExpr) Value() PrivateID { + return PrivateID(e.state[0]) } -func (e *placeholderExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *PlaceholderExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asPlaceholder() *placeholderExpr { - if m.op != opt.PlaceholderOp { +func (e *Expr) AsPlaceholder() *PlaceholderExpr { + if e.op != opt.PlaceholderOp { return nil } - return (*placeholderExpr)(m) + return (*PlaceholderExpr)(e) } -type tupleExpr memoExpr +type TupleExpr Expr -func makeTupleExpr(elems opt.ListID) tupleExpr { - return tupleExpr{op: opt.TupleOp, state: exprState{elems.Offset, elems.Length}} +func MakeTupleExpr(elems ListID) TupleExpr { + return TupleExpr{op: opt.TupleOp, state: exprState{elems.Offset, elems.Length}} } -func (e *tupleExpr) elems() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *TupleExpr) Elems() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *tupleExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *TupleExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asTuple() *tupleExpr { - if m.op != opt.TupleOp { +func (e *Expr) AsTuple() *TupleExpr { + if e.op != opt.TupleOp { return nil } - return (*tupleExpr)(m) + return (*TupleExpr)(e) } -// projectionsExpr is a set of typed scalar expressions that will become output +// ProjectionsExpr is a set of typed scalar expressions that will become output // columns for a containing Project operator. The private Cols field contains // the list of column indexes returned by the expression, as a *opt.ColList. It // is not legal for Cols to be empty. -type projectionsExpr memoExpr +type ProjectionsExpr Expr -func makeProjectionsExpr(elems opt.ListID, cols opt.PrivateID) projectionsExpr { - return projectionsExpr{op: opt.ProjectionsOp, state: exprState{elems.Offset, elems.Length, uint32(cols)}} +func MakeProjectionsExpr(elems ListID, cols PrivateID) ProjectionsExpr { + return ProjectionsExpr{op: opt.ProjectionsOp, state: exprState{elems.Offset, elems.Length, uint32(cols)}} } -func (e *projectionsExpr) elems() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *ProjectionsExpr) Elems() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *projectionsExpr) cols() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *ProjectionsExpr) Cols() PrivateID { + return PrivateID(e.state[2]) } -func (e *projectionsExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ProjectionsExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asProjections() *projectionsExpr { - if m.op != opt.ProjectionsOp { +func (e *Expr) AsProjections() *ProjectionsExpr { + if e.op != opt.ProjectionsOp { return nil } - return (*projectionsExpr)(m) + return (*ProjectionsExpr)(e) } -// aggregationsExpr is a set of aggregate expressions that will become output +// AggregationsExpr is a set of aggregate expressions that will become output // columns for a containing GroupBy operator. The private Cols field contains // the list of column indexes returned by the expression, as a *ColList. It // is legal for Cols to be empty. -type aggregationsExpr memoExpr +type AggregationsExpr Expr -func makeAggregationsExpr(aggs opt.ListID, cols opt.PrivateID) aggregationsExpr { - return aggregationsExpr{op: opt.AggregationsOp, state: exprState{aggs.Offset, aggs.Length, uint32(cols)}} +func MakeAggregationsExpr(aggs ListID, cols PrivateID) AggregationsExpr { + return AggregationsExpr{op: opt.AggregationsOp, state: exprState{aggs.Offset, aggs.Length, uint32(cols)}} } -func (e *aggregationsExpr) aggs() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *AggregationsExpr) Aggs() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *aggregationsExpr) cols() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *AggregationsExpr) Cols() PrivateID { + return PrivateID(e.state[2]) } -func (e *aggregationsExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *AggregationsExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asAggregations() *aggregationsExpr { - if m.op != opt.AggregationsOp { +func (e *Expr) AsAggregations() *AggregationsExpr { + if e.op != opt.AggregationsOp { return nil } - return (*aggregationsExpr)(m) + return (*AggregationsExpr)(e) } -type existsExpr memoExpr +type ExistsExpr Expr -func makeExistsExpr(input opt.GroupID) existsExpr { - return existsExpr{op: opt.ExistsOp, state: exprState{uint32(input)}} +func MakeExistsExpr(input GroupID) ExistsExpr { + return ExistsExpr{op: opt.ExistsOp, state: exprState{uint32(input)}} } -func (e *existsExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ExistsExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *existsExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ExistsExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asExists() *existsExpr { - if m.op != opt.ExistsOp { +func (e *Expr) AsExists() *ExistsExpr { + if e.op != opt.ExistsOp { return nil } - return (*existsExpr)(m) + return (*ExistsExpr)(e) } -// filtersExpr is a boolean And operator that only appears as the Filters child of +// FiltersExpr is a boolean And operator that only appears as the Filters child of // a Select operator, or the On child of a Join operator. For example: // (Select // (Scan a) @@ -2195,1116 +2195,1116 @@ func (m *memoExpr) asExists() *existsExpr { // there is at least one condition, so that other rules can rely on its presence // when matching, even in the case where there is only one condition. The // semantics of the Filters operator are identical to those of the And operator. -type filtersExpr memoExpr +type FiltersExpr Expr -func makeFiltersExpr(conditions opt.ListID) filtersExpr { - return filtersExpr{op: opt.FiltersOp, state: exprState{conditions.Offset, conditions.Length}} +func MakeFiltersExpr(conditions ListID) FiltersExpr { + return FiltersExpr{op: opt.FiltersOp, state: exprState{conditions.Offset, conditions.Length}} } -func (e *filtersExpr) conditions() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *FiltersExpr) Conditions() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *filtersExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FiltersExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFilters() *filtersExpr { - if m.op != opt.FiltersOp { +func (e *Expr) AsFilters() *FiltersExpr { + if e.op != opt.FiltersOp { return nil } - return (*filtersExpr)(m) + return (*FiltersExpr)(e) } -// andExpr is the boolean conjunction operator that evalutes to true if all of its +// AndExpr is the boolean conjunction operator that evalutes to true if all of its // conditions evaluate to true. If the conditions list is empty, it evalutes to // true. -type andExpr memoExpr +type AndExpr Expr -func makeAndExpr(conditions opt.ListID) andExpr { - return andExpr{op: opt.AndOp, state: exprState{conditions.Offset, conditions.Length}} +func MakeAndExpr(conditions ListID) AndExpr { + return AndExpr{op: opt.AndOp, state: exprState{conditions.Offset, conditions.Length}} } -func (e *andExpr) conditions() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *AndExpr) Conditions() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *andExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *AndExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asAnd() *andExpr { - if m.op != opt.AndOp { +func (e *Expr) AsAnd() *AndExpr { + if e.op != opt.AndOp { return nil } - return (*andExpr)(m) + return (*AndExpr)(e) } -// orExpr is the boolean disjunction operator that evalutes to true if any of its +// OrExpr is the boolean disjunction operator that evalutes to true if any of its // conditions evaluate to true. If the conditions list is empty, it evaluates to // false. -type orExpr memoExpr +type OrExpr Expr -func makeOrExpr(conditions opt.ListID) orExpr { - return orExpr{op: opt.OrOp, state: exprState{conditions.Offset, conditions.Length}} +func MakeOrExpr(conditions ListID) OrExpr { + return OrExpr{op: opt.OrOp, state: exprState{conditions.Offset, conditions.Length}} } -func (e *orExpr) conditions() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *OrExpr) Conditions() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *orExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *OrExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asOr() *orExpr { - if m.op != opt.OrOp { +func (e *Expr) AsOr() *OrExpr { + if e.op != opt.OrOp { return nil } - return (*orExpr)(m) + return (*OrExpr)(e) } -// notExpr is the boolean negation operator that evaluates to true if its input +// NotExpr is the boolean negation operator that evaluates to true if its input // evalutes to false. -type notExpr memoExpr +type NotExpr Expr -func makeNotExpr(input opt.GroupID) notExpr { - return notExpr{op: opt.NotOp, state: exprState{uint32(input)}} +func MakeNotExpr(input GroupID) NotExpr { + return NotExpr{op: opt.NotOp, state: exprState{uint32(input)}} } -func (e *notExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *notExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNot() *notExpr { - if m.op != opt.NotOp { +func (e *Expr) AsNot() *NotExpr { + if e.op != opt.NotOp { return nil } - return (*notExpr)(m) + return (*NotExpr)(e) } -type eqExpr memoExpr +type EqExpr Expr -func makeEqExpr(left opt.GroupID, right opt.GroupID) eqExpr { - return eqExpr{op: opt.EqOp, state: exprState{uint32(left), uint32(right)}} +func MakeEqExpr(left GroupID, right GroupID) EqExpr { + return EqExpr{op: opt.EqOp, state: exprState{uint32(left), uint32(right)}} } -func (e *eqExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *EqExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *eqExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *EqExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *eqExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *EqExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asEq() *eqExpr { - if m.op != opt.EqOp { +func (e *Expr) AsEq() *EqExpr { + if e.op != opt.EqOp { return nil } - return (*eqExpr)(m) + return (*EqExpr)(e) } -type ltExpr memoExpr +type LtExpr Expr -func makeLtExpr(left opt.GroupID, right opt.GroupID) ltExpr { - return ltExpr{op: opt.LtOp, state: exprState{uint32(left), uint32(right)}} +func MakeLtExpr(left GroupID, right GroupID) LtExpr { + return LtExpr{op: opt.LtOp, state: exprState{uint32(left), uint32(right)}} } -func (e *ltExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LtExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *ltExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LtExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *ltExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LtExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLt() *ltExpr { - if m.op != opt.LtOp { +func (e *Expr) AsLt() *LtExpr { + if e.op != opt.LtOp { return nil } - return (*ltExpr)(m) + return (*LtExpr)(e) } -type gtExpr memoExpr +type GtExpr Expr -func makeGtExpr(left opt.GroupID, right opt.GroupID) gtExpr { - return gtExpr{op: opt.GtOp, state: exprState{uint32(left), uint32(right)}} +func MakeGtExpr(left GroupID, right GroupID) GtExpr { + return GtExpr{op: opt.GtOp, state: exprState{uint32(left), uint32(right)}} } -func (e *gtExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *GtExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *gtExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *GtExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *gtExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *GtExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asGt() *gtExpr { - if m.op != opt.GtOp { +func (e *Expr) AsGt() *GtExpr { + if e.op != opt.GtOp { return nil } - return (*gtExpr)(m) + return (*GtExpr)(e) } -type leExpr memoExpr +type LeExpr Expr -func makeLeExpr(left opt.GroupID, right opt.GroupID) leExpr { - return leExpr{op: opt.LeOp, state: exprState{uint32(left), uint32(right)}} +func MakeLeExpr(left GroupID, right GroupID) LeExpr { + return LeExpr{op: opt.LeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *leExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *leExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *leExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLe() *leExpr { - if m.op != opt.LeOp { +func (e *Expr) AsLe() *LeExpr { + if e.op != opt.LeOp { return nil } - return (*leExpr)(m) + return (*LeExpr)(e) } -type geExpr memoExpr +type GeExpr Expr -func makeGeExpr(left opt.GroupID, right opt.GroupID) geExpr { - return geExpr{op: opt.GeOp, state: exprState{uint32(left), uint32(right)}} +func MakeGeExpr(left GroupID, right GroupID) GeExpr { + return GeExpr{op: opt.GeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *geExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *GeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *geExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *GeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *geExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *GeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asGe() *geExpr { - if m.op != opt.GeOp { +func (e *Expr) AsGe() *GeExpr { + if e.op != opt.GeOp { return nil } - return (*geExpr)(m) + return (*GeExpr)(e) } -type neExpr memoExpr +type NeExpr Expr -func makeNeExpr(left opt.GroupID, right opt.GroupID) neExpr { - return neExpr{op: opt.NeOp, state: exprState{uint32(left), uint32(right)}} +func MakeNeExpr(left GroupID, right GroupID) NeExpr { + return NeExpr{op: opt.NeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *neExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *neExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *neExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNe() *neExpr { - if m.op != opt.NeOp { +func (e *Expr) AsNe() *NeExpr { + if e.op != opt.NeOp { return nil } - return (*neExpr)(m) + return (*NeExpr)(e) } -type inExpr memoExpr +type InExpr Expr -func makeInExpr(left opt.GroupID, right opt.GroupID) inExpr { - return inExpr{op: opt.InOp, state: exprState{uint32(left), uint32(right)}} +func MakeInExpr(left GroupID, right GroupID) InExpr { + return InExpr{op: opt.InOp, state: exprState{uint32(left), uint32(right)}} } -func (e *inExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *InExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *inExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *InExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *inExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *InExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asIn() *inExpr { - if m.op != opt.InOp { +func (e *Expr) AsIn() *InExpr { + if e.op != opt.InOp { return nil } - return (*inExpr)(m) + return (*InExpr)(e) } -type notInExpr memoExpr +type NotInExpr Expr -func makeNotInExpr(left opt.GroupID, right opt.GroupID) notInExpr { - return notInExpr{op: opt.NotInOp, state: exprState{uint32(left), uint32(right)}} +func MakeNotInExpr(left GroupID, right GroupID) NotInExpr { + return NotInExpr{op: opt.NotInOp, state: exprState{uint32(left), uint32(right)}} } -func (e *notInExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotInExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *notInExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NotInExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *notInExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotInExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNotIn() *notInExpr { - if m.op != opt.NotInOp { +func (e *Expr) AsNotIn() *NotInExpr { + if e.op != opt.NotInOp { return nil } - return (*notInExpr)(m) + return (*NotInExpr)(e) } -type likeExpr memoExpr +type LikeExpr Expr -func makeLikeExpr(left opt.GroupID, right opt.GroupID) likeExpr { - return likeExpr{op: opt.LikeOp, state: exprState{uint32(left), uint32(right)}} +func MakeLikeExpr(left GroupID, right GroupID) LikeExpr { + return LikeExpr{op: opt.LikeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *likeExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LikeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *likeExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LikeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *likeExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LikeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLike() *likeExpr { - if m.op != opt.LikeOp { +func (e *Expr) AsLike() *LikeExpr { + if e.op != opt.LikeOp { return nil } - return (*likeExpr)(m) + return (*LikeExpr)(e) } -type notLikeExpr memoExpr +type NotLikeExpr Expr -func makeNotLikeExpr(left opt.GroupID, right opt.GroupID) notLikeExpr { - return notLikeExpr{op: opt.NotLikeOp, state: exprState{uint32(left), uint32(right)}} +func MakeNotLikeExpr(left GroupID, right GroupID) NotLikeExpr { + return NotLikeExpr{op: opt.NotLikeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *notLikeExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotLikeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *notLikeExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NotLikeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *notLikeExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotLikeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNotLike() *notLikeExpr { - if m.op != opt.NotLikeOp { +func (e *Expr) AsNotLike() *NotLikeExpr { + if e.op != opt.NotLikeOp { return nil } - return (*notLikeExpr)(m) + return (*NotLikeExpr)(e) } -type iLikeExpr memoExpr +type ILikeExpr Expr -func makeILikeExpr(left opt.GroupID, right opt.GroupID) iLikeExpr { - return iLikeExpr{op: opt.ILikeOp, state: exprState{uint32(left), uint32(right)}} +func MakeILikeExpr(left GroupID, right GroupID) ILikeExpr { + return ILikeExpr{op: opt.ILikeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *iLikeExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ILikeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *iLikeExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ILikeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *iLikeExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ILikeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asILike() *iLikeExpr { - if m.op != opt.ILikeOp { +func (e *Expr) AsILike() *ILikeExpr { + if e.op != opt.ILikeOp { return nil } - return (*iLikeExpr)(m) + return (*ILikeExpr)(e) } -type notILikeExpr memoExpr +type NotILikeExpr Expr -func makeNotILikeExpr(left opt.GroupID, right opt.GroupID) notILikeExpr { - return notILikeExpr{op: opt.NotILikeOp, state: exprState{uint32(left), uint32(right)}} +func MakeNotILikeExpr(left GroupID, right GroupID) NotILikeExpr { + return NotILikeExpr{op: opt.NotILikeOp, state: exprState{uint32(left), uint32(right)}} } -func (e *notILikeExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotILikeExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *notILikeExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NotILikeExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *notILikeExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotILikeExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNotILike() *notILikeExpr { - if m.op != opt.NotILikeOp { +func (e *Expr) AsNotILike() *NotILikeExpr { + if e.op != opt.NotILikeOp { return nil } - return (*notILikeExpr)(m) + return (*NotILikeExpr)(e) } -type similarToExpr memoExpr +type SimilarToExpr Expr -func makeSimilarToExpr(left opt.GroupID, right opt.GroupID) similarToExpr { - return similarToExpr{op: opt.SimilarToOp, state: exprState{uint32(left), uint32(right)}} +func MakeSimilarToExpr(left GroupID, right GroupID) SimilarToExpr { + return SimilarToExpr{op: opt.SimilarToOp, state: exprState{uint32(left), uint32(right)}} } -func (e *similarToExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *SimilarToExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *similarToExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *SimilarToExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *similarToExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *SimilarToExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asSimilarTo() *similarToExpr { - if m.op != opt.SimilarToOp { +func (e *Expr) AsSimilarTo() *SimilarToExpr { + if e.op != opt.SimilarToOp { return nil } - return (*similarToExpr)(m) + return (*SimilarToExpr)(e) } -type notSimilarToExpr memoExpr +type NotSimilarToExpr Expr -func makeNotSimilarToExpr(left opt.GroupID, right opt.GroupID) notSimilarToExpr { - return notSimilarToExpr{op: opt.NotSimilarToOp, state: exprState{uint32(left), uint32(right)}} +func MakeNotSimilarToExpr(left GroupID, right GroupID) NotSimilarToExpr { + return NotSimilarToExpr{op: opt.NotSimilarToOp, state: exprState{uint32(left), uint32(right)}} } -func (e *notSimilarToExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotSimilarToExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *notSimilarToExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NotSimilarToExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *notSimilarToExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotSimilarToExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNotSimilarTo() *notSimilarToExpr { - if m.op != opt.NotSimilarToOp { +func (e *Expr) AsNotSimilarTo() *NotSimilarToExpr { + if e.op != opt.NotSimilarToOp { return nil } - return (*notSimilarToExpr)(m) + return (*NotSimilarToExpr)(e) } -type regMatchExpr memoExpr +type RegMatchExpr Expr -func makeRegMatchExpr(left opt.GroupID, right opt.GroupID) regMatchExpr { - return regMatchExpr{op: opt.RegMatchOp, state: exprState{uint32(left), uint32(right)}} +func MakeRegMatchExpr(left GroupID, right GroupID) RegMatchExpr { + return RegMatchExpr{op: opt.RegMatchOp, state: exprState{uint32(left), uint32(right)}} } -func (e *regMatchExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *RegMatchExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *regMatchExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *RegMatchExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *regMatchExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *RegMatchExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asRegMatch() *regMatchExpr { - if m.op != opt.RegMatchOp { +func (e *Expr) AsRegMatch() *RegMatchExpr { + if e.op != opt.RegMatchOp { return nil } - return (*regMatchExpr)(m) + return (*RegMatchExpr)(e) } -type notRegMatchExpr memoExpr +type NotRegMatchExpr Expr -func makeNotRegMatchExpr(left opt.GroupID, right opt.GroupID) notRegMatchExpr { - return notRegMatchExpr{op: opt.NotRegMatchOp, state: exprState{uint32(left), uint32(right)}} +func MakeNotRegMatchExpr(left GroupID, right GroupID) NotRegMatchExpr { + return NotRegMatchExpr{op: opt.NotRegMatchOp, state: exprState{uint32(left), uint32(right)}} } -func (e *notRegMatchExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotRegMatchExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *notRegMatchExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NotRegMatchExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *notRegMatchExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotRegMatchExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNotRegMatch() *notRegMatchExpr { - if m.op != opt.NotRegMatchOp { +func (e *Expr) AsNotRegMatch() *NotRegMatchExpr { + if e.op != opt.NotRegMatchOp { return nil } - return (*notRegMatchExpr)(m) + return (*NotRegMatchExpr)(e) } -type regIMatchExpr memoExpr +type RegIMatchExpr Expr -func makeRegIMatchExpr(left opt.GroupID, right opt.GroupID) regIMatchExpr { - return regIMatchExpr{op: opt.RegIMatchOp, state: exprState{uint32(left), uint32(right)}} +func MakeRegIMatchExpr(left GroupID, right GroupID) RegIMatchExpr { + return RegIMatchExpr{op: opt.RegIMatchOp, state: exprState{uint32(left), uint32(right)}} } -func (e *regIMatchExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *RegIMatchExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *regIMatchExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *RegIMatchExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *regIMatchExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *RegIMatchExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asRegIMatch() *regIMatchExpr { - if m.op != opt.RegIMatchOp { +func (e *Expr) AsRegIMatch() *RegIMatchExpr { + if e.op != opt.RegIMatchOp { return nil } - return (*regIMatchExpr)(m) + return (*RegIMatchExpr)(e) } -type notRegIMatchExpr memoExpr +type NotRegIMatchExpr Expr -func makeNotRegIMatchExpr(left opt.GroupID, right opt.GroupID) notRegIMatchExpr { - return notRegIMatchExpr{op: opt.NotRegIMatchOp, state: exprState{uint32(left), uint32(right)}} +func MakeNotRegIMatchExpr(left GroupID, right GroupID) NotRegIMatchExpr { + return NotRegIMatchExpr{op: opt.NotRegIMatchOp, state: exprState{uint32(left), uint32(right)}} } -func (e *notRegIMatchExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *NotRegIMatchExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *notRegIMatchExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *NotRegIMatchExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *notRegIMatchExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *NotRegIMatchExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asNotRegIMatch() *notRegIMatchExpr { - if m.op != opt.NotRegIMatchOp { +func (e *Expr) AsNotRegIMatch() *NotRegIMatchExpr { + if e.op != opt.NotRegIMatchOp { return nil } - return (*notRegIMatchExpr)(m) + return (*NotRegIMatchExpr)(e) } -type isExpr memoExpr +type IsExpr Expr -func makeIsExpr(left opt.GroupID, right opt.GroupID) isExpr { - return isExpr{op: opt.IsOp, state: exprState{uint32(left), uint32(right)}} +func MakeIsExpr(left GroupID, right GroupID) IsExpr { + return IsExpr{op: opt.IsOp, state: exprState{uint32(left), uint32(right)}} } -func (e *isExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *IsExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *isExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *IsExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *isExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *IsExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asIs() *isExpr { - if m.op != opt.IsOp { +func (e *Expr) AsIs() *IsExpr { + if e.op != opt.IsOp { return nil } - return (*isExpr)(m) + return (*IsExpr)(e) } -type isNotExpr memoExpr +type IsNotExpr Expr -func makeIsNotExpr(left opt.GroupID, right opt.GroupID) isNotExpr { - return isNotExpr{op: opt.IsNotOp, state: exprState{uint32(left), uint32(right)}} +func MakeIsNotExpr(left GroupID, right GroupID) IsNotExpr { + return IsNotExpr{op: opt.IsNotOp, state: exprState{uint32(left), uint32(right)}} } -func (e *isNotExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *IsNotExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *isNotExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *IsNotExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *isNotExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *IsNotExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asIsNot() *isNotExpr { - if m.op != opt.IsNotOp { +func (e *Expr) AsIsNot() *IsNotExpr { + if e.op != opt.IsNotOp { return nil } - return (*isNotExpr)(m) + return (*IsNotExpr)(e) } -type containsExpr memoExpr +type ContainsExpr Expr -func makeContainsExpr(left opt.GroupID, right opt.GroupID) containsExpr { - return containsExpr{op: opt.ContainsOp, state: exprState{uint32(left), uint32(right)}} +func MakeContainsExpr(left GroupID, right GroupID) ContainsExpr { + return ContainsExpr{op: opt.ContainsOp, state: exprState{uint32(left), uint32(right)}} } -func (e *containsExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ContainsExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *containsExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ContainsExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *containsExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ContainsExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asContains() *containsExpr { - if m.op != opt.ContainsOp { +func (e *Expr) AsContains() *ContainsExpr { + if e.op != opt.ContainsOp { return nil } - return (*containsExpr)(m) + return (*ContainsExpr)(e) } -type bitandExpr memoExpr +type BitandExpr Expr -func makeBitandExpr(left opt.GroupID, right opt.GroupID) bitandExpr { - return bitandExpr{op: opt.BitandOp, state: exprState{uint32(left), uint32(right)}} +func MakeBitandExpr(left GroupID, right GroupID) BitandExpr { + return BitandExpr{op: opt.BitandOp, state: exprState{uint32(left), uint32(right)}} } -func (e *bitandExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *BitandExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *bitandExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *BitandExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *bitandExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *BitandExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asBitand() *bitandExpr { - if m.op != opt.BitandOp { +func (e *Expr) AsBitand() *BitandExpr { + if e.op != opt.BitandOp { return nil } - return (*bitandExpr)(m) + return (*BitandExpr)(e) } -type bitorExpr memoExpr +type BitorExpr Expr -func makeBitorExpr(left opt.GroupID, right opt.GroupID) bitorExpr { - return bitorExpr{op: opt.BitorOp, state: exprState{uint32(left), uint32(right)}} +func MakeBitorExpr(left GroupID, right GroupID) BitorExpr { + return BitorExpr{op: opt.BitorOp, state: exprState{uint32(left), uint32(right)}} } -func (e *bitorExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *BitorExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *bitorExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *BitorExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *bitorExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *BitorExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asBitor() *bitorExpr { - if m.op != opt.BitorOp { +func (e *Expr) AsBitor() *BitorExpr { + if e.op != opt.BitorOp { return nil } - return (*bitorExpr)(m) + return (*BitorExpr)(e) } -type bitxorExpr memoExpr +type BitxorExpr Expr -func makeBitxorExpr(left opt.GroupID, right opt.GroupID) bitxorExpr { - return bitxorExpr{op: opt.BitxorOp, state: exprState{uint32(left), uint32(right)}} +func MakeBitxorExpr(left GroupID, right GroupID) BitxorExpr { + return BitxorExpr{op: opt.BitxorOp, state: exprState{uint32(left), uint32(right)}} } -func (e *bitxorExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *BitxorExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *bitxorExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *BitxorExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *bitxorExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *BitxorExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asBitxor() *bitxorExpr { - if m.op != opt.BitxorOp { +func (e *Expr) AsBitxor() *BitxorExpr { + if e.op != opt.BitxorOp { return nil } - return (*bitxorExpr)(m) + return (*BitxorExpr)(e) } -type plusExpr memoExpr +type PlusExpr Expr -func makePlusExpr(left opt.GroupID, right opt.GroupID) plusExpr { - return plusExpr{op: opt.PlusOp, state: exprState{uint32(left), uint32(right)}} +func MakePlusExpr(left GroupID, right GroupID) PlusExpr { + return PlusExpr{op: opt.PlusOp, state: exprState{uint32(left), uint32(right)}} } -func (e *plusExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *PlusExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *plusExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *PlusExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *plusExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *PlusExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asPlus() *plusExpr { - if m.op != opt.PlusOp { +func (e *Expr) AsPlus() *PlusExpr { + if e.op != opt.PlusOp { return nil } - return (*plusExpr)(m) + return (*PlusExpr)(e) } -type minusExpr memoExpr +type MinusExpr Expr -func makeMinusExpr(left opt.GroupID, right opt.GroupID) minusExpr { - return minusExpr{op: opt.MinusOp, state: exprState{uint32(left), uint32(right)}} +func MakeMinusExpr(left GroupID, right GroupID) MinusExpr { + return MinusExpr{op: opt.MinusOp, state: exprState{uint32(left), uint32(right)}} } -func (e *minusExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *MinusExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *minusExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *MinusExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *minusExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *MinusExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asMinus() *minusExpr { - if m.op != opt.MinusOp { +func (e *Expr) AsMinus() *MinusExpr { + if e.op != opt.MinusOp { return nil } - return (*minusExpr)(m) + return (*MinusExpr)(e) } -type multExpr memoExpr +type MultExpr Expr -func makeMultExpr(left opt.GroupID, right opt.GroupID) multExpr { - return multExpr{op: opt.MultOp, state: exprState{uint32(left), uint32(right)}} +func MakeMultExpr(left GroupID, right GroupID) MultExpr { + return MultExpr{op: opt.MultOp, state: exprState{uint32(left), uint32(right)}} } -func (e *multExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *MultExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *multExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *MultExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *multExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *MultExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asMult() *multExpr { - if m.op != opt.MultOp { +func (e *Expr) AsMult() *MultExpr { + if e.op != opt.MultOp { return nil } - return (*multExpr)(m) + return (*MultExpr)(e) } -type divExpr memoExpr +type DivExpr Expr -func makeDivExpr(left opt.GroupID, right opt.GroupID) divExpr { - return divExpr{op: opt.DivOp, state: exprState{uint32(left), uint32(right)}} +func MakeDivExpr(left GroupID, right GroupID) DivExpr { + return DivExpr{op: opt.DivOp, state: exprState{uint32(left), uint32(right)}} } -func (e *divExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *DivExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *divExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *DivExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *divExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *DivExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asDiv() *divExpr { - if m.op != opt.DivOp { +func (e *Expr) AsDiv() *DivExpr { + if e.op != opt.DivOp { return nil } - return (*divExpr)(m) + return (*DivExpr)(e) } -type floorDivExpr memoExpr +type FloorDivExpr Expr -func makeFloorDivExpr(left opt.GroupID, right opt.GroupID) floorDivExpr { - return floorDivExpr{op: opt.FloorDivOp, state: exprState{uint32(left), uint32(right)}} +func MakeFloorDivExpr(left GroupID, right GroupID) FloorDivExpr { + return FloorDivExpr{op: opt.FloorDivOp, state: exprState{uint32(left), uint32(right)}} } -func (e *floorDivExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FloorDivExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *floorDivExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FloorDivExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *floorDivExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FloorDivExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFloorDiv() *floorDivExpr { - if m.op != opt.FloorDivOp { +func (e *Expr) AsFloorDiv() *FloorDivExpr { + if e.op != opt.FloorDivOp { return nil } - return (*floorDivExpr)(m) + return (*FloorDivExpr)(e) } -type modExpr memoExpr +type ModExpr Expr -func makeModExpr(left opt.GroupID, right opt.GroupID) modExpr { - return modExpr{op: opt.ModOp, state: exprState{uint32(left), uint32(right)}} +func MakeModExpr(left GroupID, right GroupID) ModExpr { + return ModExpr{op: opt.ModOp, state: exprState{uint32(left), uint32(right)}} } -func (e *modExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ModExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *modExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ModExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *modExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ModExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asMod() *modExpr { - if m.op != opt.ModOp { +func (e *Expr) AsMod() *ModExpr { + if e.op != opt.ModOp { return nil } - return (*modExpr)(m) + return (*ModExpr)(e) } -type powExpr memoExpr +type PowExpr Expr -func makePowExpr(left opt.GroupID, right opt.GroupID) powExpr { - return powExpr{op: opt.PowOp, state: exprState{uint32(left), uint32(right)}} +func MakePowExpr(left GroupID, right GroupID) PowExpr { + return PowExpr{op: opt.PowOp, state: exprState{uint32(left), uint32(right)}} } -func (e *powExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *PowExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *powExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *PowExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *powExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *PowExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asPow() *powExpr { - if m.op != opt.PowOp { +func (e *Expr) AsPow() *PowExpr { + if e.op != opt.PowOp { return nil } - return (*powExpr)(m) + return (*PowExpr)(e) } -type concatExpr memoExpr +type ConcatExpr Expr -func makeConcatExpr(left opt.GroupID, right opt.GroupID) concatExpr { - return concatExpr{op: opt.ConcatOp, state: exprState{uint32(left), uint32(right)}} +func MakeConcatExpr(left GroupID, right GroupID) ConcatExpr { + return ConcatExpr{op: opt.ConcatOp, state: exprState{uint32(left), uint32(right)}} } -func (e *concatExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *ConcatExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *concatExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *ConcatExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *concatExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *ConcatExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asConcat() *concatExpr { - if m.op != opt.ConcatOp { +func (e *Expr) AsConcat() *ConcatExpr { + if e.op != opt.ConcatOp { return nil } - return (*concatExpr)(m) + return (*ConcatExpr)(e) } -type lShiftExpr memoExpr +type LShiftExpr Expr -func makeLShiftExpr(left opt.GroupID, right opt.GroupID) lShiftExpr { - return lShiftExpr{op: opt.LShiftOp, state: exprState{uint32(left), uint32(right)}} +func MakeLShiftExpr(left GroupID, right GroupID) LShiftExpr { + return LShiftExpr{op: opt.LShiftOp, state: exprState{uint32(left), uint32(right)}} } -func (e *lShiftExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *LShiftExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *lShiftExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *LShiftExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *lShiftExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *LShiftExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asLShift() *lShiftExpr { - if m.op != opt.LShiftOp { +func (e *Expr) AsLShift() *LShiftExpr { + if e.op != opt.LShiftOp { return nil } - return (*lShiftExpr)(m) + return (*LShiftExpr)(e) } -type rShiftExpr memoExpr +type RShiftExpr Expr -func makeRShiftExpr(left opt.GroupID, right opt.GroupID) rShiftExpr { - return rShiftExpr{op: opt.RShiftOp, state: exprState{uint32(left), uint32(right)}} +func MakeRShiftExpr(left GroupID, right GroupID) RShiftExpr { + return RShiftExpr{op: opt.RShiftOp, state: exprState{uint32(left), uint32(right)}} } -func (e *rShiftExpr) left() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *RShiftExpr) Left() GroupID { + return GroupID(e.state[0]) } -func (e *rShiftExpr) right() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *RShiftExpr) Right() GroupID { + return GroupID(e.state[1]) } -func (e *rShiftExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *RShiftExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asRShift() *rShiftExpr { - if m.op != opt.RShiftOp { +func (e *Expr) AsRShift() *RShiftExpr { + if e.op != opt.RShiftOp { return nil } - return (*rShiftExpr)(m) + return (*RShiftExpr)(e) } -type fetchValExpr memoExpr +type FetchValExpr Expr -func makeFetchValExpr(json opt.GroupID, index opt.GroupID) fetchValExpr { - return fetchValExpr{op: opt.FetchValOp, state: exprState{uint32(json), uint32(index)}} +func MakeFetchValExpr(json GroupID, index GroupID) FetchValExpr { + return FetchValExpr{op: opt.FetchValOp, state: exprState{uint32(json), uint32(index)}} } -func (e *fetchValExpr) json() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FetchValExpr) Json() GroupID { + return GroupID(e.state[0]) } -func (e *fetchValExpr) index() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FetchValExpr) Index() GroupID { + return GroupID(e.state[1]) } -func (e *fetchValExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FetchValExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFetchVal() *fetchValExpr { - if m.op != opt.FetchValOp { +func (e *Expr) AsFetchVal() *FetchValExpr { + if e.op != opt.FetchValOp { return nil } - return (*fetchValExpr)(m) + return (*FetchValExpr)(e) } -type fetchTextExpr memoExpr +type FetchTextExpr Expr -func makeFetchTextExpr(json opt.GroupID, index opt.GroupID) fetchTextExpr { - return fetchTextExpr{op: opt.FetchTextOp, state: exprState{uint32(json), uint32(index)}} +func MakeFetchTextExpr(json GroupID, index GroupID) FetchTextExpr { + return FetchTextExpr{op: opt.FetchTextOp, state: exprState{uint32(json), uint32(index)}} } -func (e *fetchTextExpr) json() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FetchTextExpr) Json() GroupID { + return GroupID(e.state[0]) } -func (e *fetchTextExpr) index() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FetchTextExpr) Index() GroupID { + return GroupID(e.state[1]) } -func (e *fetchTextExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FetchTextExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFetchText() *fetchTextExpr { - if m.op != opt.FetchTextOp { +func (e *Expr) AsFetchText() *FetchTextExpr { + if e.op != opt.FetchTextOp { return nil } - return (*fetchTextExpr)(m) + return (*FetchTextExpr)(e) } -type fetchValPathExpr memoExpr +type FetchValPathExpr Expr -func makeFetchValPathExpr(json opt.GroupID, path opt.GroupID) fetchValPathExpr { - return fetchValPathExpr{op: opt.FetchValPathOp, state: exprState{uint32(json), uint32(path)}} +func MakeFetchValPathExpr(json GroupID, path GroupID) FetchValPathExpr { + return FetchValPathExpr{op: opt.FetchValPathOp, state: exprState{uint32(json), uint32(path)}} } -func (e *fetchValPathExpr) json() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FetchValPathExpr) Json() GroupID { + return GroupID(e.state[0]) } -func (e *fetchValPathExpr) path() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FetchValPathExpr) Path() GroupID { + return GroupID(e.state[1]) } -func (e *fetchValPathExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FetchValPathExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFetchValPath() *fetchValPathExpr { - if m.op != opt.FetchValPathOp { +func (e *Expr) AsFetchValPath() *FetchValPathExpr { + if e.op != opt.FetchValPathOp { return nil } - return (*fetchValPathExpr)(m) + return (*FetchValPathExpr)(e) } -type fetchTextPathExpr memoExpr +type FetchTextPathExpr Expr -func makeFetchTextPathExpr(json opt.GroupID, path opt.GroupID) fetchTextPathExpr { - return fetchTextPathExpr{op: opt.FetchTextPathOp, state: exprState{uint32(json), uint32(path)}} +func MakeFetchTextPathExpr(json GroupID, path GroupID) FetchTextPathExpr { + return FetchTextPathExpr{op: opt.FetchTextPathOp, state: exprState{uint32(json), uint32(path)}} } -func (e *fetchTextPathExpr) json() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FetchTextPathExpr) Json() GroupID { + return GroupID(e.state[0]) } -func (e *fetchTextPathExpr) path() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *FetchTextPathExpr) Path() GroupID { + return GroupID(e.state[1]) } -func (e *fetchTextPathExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FetchTextPathExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFetchTextPath() *fetchTextPathExpr { - if m.op != opt.FetchTextPathOp { +func (e *Expr) AsFetchTextPath() *FetchTextPathExpr { + if e.op != opt.FetchTextPathOp { return nil } - return (*fetchTextPathExpr)(m) + return (*FetchTextPathExpr)(e) } -type unaryMinusExpr memoExpr +type UnaryMinusExpr Expr -func makeUnaryMinusExpr(input opt.GroupID) unaryMinusExpr { - return unaryMinusExpr{op: opt.UnaryMinusOp, state: exprState{uint32(input)}} +func MakeUnaryMinusExpr(input GroupID) UnaryMinusExpr { + return UnaryMinusExpr{op: opt.UnaryMinusOp, state: exprState{uint32(input)}} } -func (e *unaryMinusExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *UnaryMinusExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *unaryMinusExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *UnaryMinusExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asUnaryMinus() *unaryMinusExpr { - if m.op != opt.UnaryMinusOp { +func (e *Expr) AsUnaryMinus() *UnaryMinusExpr { + if e.op != opt.UnaryMinusOp { return nil } - return (*unaryMinusExpr)(m) + return (*UnaryMinusExpr)(e) } -type unaryComplementExpr memoExpr +type UnaryComplementExpr Expr -func makeUnaryComplementExpr(input opt.GroupID) unaryComplementExpr { - return unaryComplementExpr{op: opt.UnaryComplementOp, state: exprState{uint32(input)}} +func MakeUnaryComplementExpr(input GroupID) UnaryComplementExpr { + return UnaryComplementExpr{op: opt.UnaryComplementOp, state: exprState{uint32(input)}} } -func (e *unaryComplementExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *UnaryComplementExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *unaryComplementExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *UnaryComplementExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asUnaryComplement() *unaryComplementExpr { - if m.op != opt.UnaryComplementOp { +func (e *Expr) AsUnaryComplement() *UnaryComplementExpr { + if e.op != opt.UnaryComplementOp { return nil } - return (*unaryComplementExpr)(m) + return (*UnaryComplementExpr)(e) } -type castExpr memoExpr +type CastExpr Expr -func makeCastExpr(input opt.GroupID, typ opt.PrivateID) castExpr { - return castExpr{op: opt.CastOp, state: exprState{uint32(input), uint32(typ)}} +func MakeCastExpr(input GroupID, typ PrivateID) CastExpr { + return CastExpr{op: opt.CastOp, state: exprState{uint32(input), uint32(typ)}} } -func (e *castExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *CastExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *castExpr) typ() opt.PrivateID { - return opt.PrivateID(e.state[1]) +func (e *CastExpr) Typ() PrivateID { + return PrivateID(e.state[1]) } -func (e *castExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *CastExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asCast() *castExpr { - if m.op != opt.CastOp { +func (e *Expr) AsCast() *CastExpr { + if e.op != opt.CastOp { return nil } - return (*castExpr)(m) + return (*CastExpr)(e) } -// caseExpr is a CASE statement of the form: +// CaseExpr is a CASE statement of the form: // CASE [ <Input> ] // WHEN <condval1> THEN <expr1> // [ WHEN <condval2> THEN <expr2> ] ... @@ -3320,127 +3320,127 @@ func (m *memoExpr) asCast() *castExpr { // Note that the Whens list inside Case is used to represent all the WHEN // branches as well as the ELSE statement if it exists. It is of the form: // [(When <condval1> <expr1>),(When <condval2> <expr2>),...,<expr>] -type caseExpr memoExpr +type CaseExpr Expr -func makeCaseExpr(input opt.GroupID, whens opt.ListID) caseExpr { - return caseExpr{op: opt.CaseOp, state: exprState{uint32(input), whens.Offset, whens.Length}} +func MakeCaseExpr(input GroupID, whens ListID) CaseExpr { + return CaseExpr{op: opt.CaseOp, state: exprState{uint32(input), whens.Offset, whens.Length}} } -func (e *caseExpr) input() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *CaseExpr) Input() GroupID { + return GroupID(e.state[0]) } -func (e *caseExpr) whens() opt.ListID { - return opt.ListID{Offset: e.state[1], Length: e.state[2]} +func (e *CaseExpr) Whens() ListID { + return ListID{Offset: e.state[1], Length: e.state[2]} } -func (e *caseExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *CaseExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asCase() *caseExpr { - if m.op != opt.CaseOp { +func (e *Expr) AsCase() *CaseExpr { + if e.op != opt.CaseOp { return nil } - return (*caseExpr)(m) + return (*CaseExpr)(e) } -// whenExpr represents a single WHEN ... THEN ... condition inside a CASE statement. +// WhenExpr represents a single WHEN ... THEN ... condition inside a CASE statement. // It is the type of each list item in Whens (except for the last item which is // a raw expression for the ELSE statement). -type whenExpr memoExpr +type WhenExpr Expr -func makeWhenExpr(condition opt.GroupID, value opt.GroupID) whenExpr { - return whenExpr{op: opt.WhenOp, state: exprState{uint32(condition), uint32(value)}} +func MakeWhenExpr(condition GroupID, value GroupID) WhenExpr { + return WhenExpr{op: opt.WhenOp, state: exprState{uint32(condition), uint32(value)}} } -func (e *whenExpr) condition() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *WhenExpr) Condition() GroupID { + return GroupID(e.state[0]) } -func (e *whenExpr) value() opt.GroupID { - return opt.GroupID(e.state[1]) +func (e *WhenExpr) Value() GroupID { + return GroupID(e.state[1]) } -func (e *whenExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *WhenExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asWhen() *whenExpr { - if m.op != opt.WhenOp { +func (e *Expr) AsWhen() *WhenExpr { + if e.op != opt.WhenOp { return nil } - return (*whenExpr)(m) + return (*WhenExpr)(e) } -// functionExpr invokes a builtin SQL function like CONCAT or NOW, passing the given +// FunctionExpr invokes a builtin SQL function like CONCAT or NOW, passing the given // arguments. The private field is an opt.FuncOpDef struct that provides the // name of the function as well as a pointer to the builtin overload definition. -type functionExpr memoExpr +type FunctionExpr Expr -func makeFunctionExpr(args opt.ListID, def opt.PrivateID) functionExpr { - return functionExpr{op: opt.FunctionOp, state: exprState{args.Offset, args.Length, uint32(def)}} +func MakeFunctionExpr(args ListID, def PrivateID) FunctionExpr { + return FunctionExpr{op: opt.FunctionOp, state: exprState{args.Offset, args.Length, uint32(def)}} } -func (e *functionExpr) args() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *FunctionExpr) Args() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *functionExpr) def() opt.PrivateID { - return opt.PrivateID(e.state[2]) +func (e *FunctionExpr) Def() PrivateID { + return PrivateID(e.state[2]) } -func (e *functionExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FunctionExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFunction() *functionExpr { - if m.op != opt.FunctionOp { +func (e *Expr) AsFunction() *FunctionExpr { + if e.op != opt.FunctionOp { return nil } - return (*functionExpr)(m) + return (*FunctionExpr)(e) } -type coalesceExpr memoExpr +type CoalesceExpr Expr -func makeCoalesceExpr(args opt.ListID) coalesceExpr { - return coalesceExpr{op: opt.CoalesceOp, state: exprState{args.Offset, args.Length}} +func MakeCoalesceExpr(args ListID) CoalesceExpr { + return CoalesceExpr{op: opt.CoalesceOp, state: exprState{args.Offset, args.Length}} } -func (e *coalesceExpr) args() opt.ListID { - return opt.ListID{Offset: e.state[0], Length: e.state[1]} +func (e *CoalesceExpr) Args() ListID { + return ListID{Offset: e.state[0], Length: e.state[1]} } -func (e *coalesceExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *CoalesceExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asCoalesce() *coalesceExpr { - if m.op != opt.CoalesceOp { +func (e *Expr) AsCoalesce() *CoalesceExpr { + if e.op != opt.CoalesceOp { return nil } - return (*coalesceExpr)(m) + return (*CoalesceExpr)(e) } -// unsupportedExprExpr is used for interfacing with the old planner code. It can +// UnsupportedExprExpr is used for interfacing with the old planner code. It can // encapsulate a TypedExpr that is otherwise not supported by the optimizer. -type unsupportedExprExpr memoExpr +type UnsupportedExprExpr Expr -func makeUnsupportedExprExpr(value opt.PrivateID) unsupportedExprExpr { - return unsupportedExprExpr{op: opt.UnsupportedExprOp, state: exprState{uint32(value)}} +func MakeUnsupportedExprExpr(value PrivateID) UnsupportedExprExpr { + return UnsupportedExprExpr{op: opt.UnsupportedExprOp, state: exprState{uint32(value)}} } -func (e *unsupportedExprExpr) value() opt.PrivateID { - return opt.PrivateID(e.state[0]) +func (e *UnsupportedExprExpr) Value() PrivateID { + return PrivateID(e.state[0]) } -func (e *unsupportedExprExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *UnsupportedExprExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asUnsupportedExpr() *unsupportedExprExpr { - if m.op != opt.UnsupportedExprOp { +func (e *Expr) AsUnsupportedExpr() *UnsupportedExprExpr { + if e.op != opt.UnsupportedExprOp { return nil } - return (*unsupportedExprExpr)(m) + return (*UnsupportedExprExpr)(e) } diff --git a/pkg/sql/opt/memo/expr_view.go b/pkg/sql/opt/memo/expr_view.go index ff4fa759aee6..0b754bd01c3a 100644 --- a/pkg/sql/opt/memo/expr_view.go +++ b/pkg/sql/opt/memo/expr_view.go @@ -22,8 +22,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/treeprinter" ) -//go:generate optgen -out expr.og.go exprs ../ops/*.opt - // ExprView provides a view of a single tree in the memo's forest of query plan // trees (see comment in memo.go for more details about the memo forest). For // a root memo group and a set of required physical properties, there is one @@ -62,10 +60,10 @@ import ( // Don't reorder fields without checking the impact on the size of ExprView. type ExprView struct { // mem references the memo which holds the expression forest. - mem *memo + mem *Memo // group is the identifier of the memo group to which the expression belongs. - group opt.GroupID + group GroupID // op is the type of the expression. op opt.Operator @@ -76,27 +74,27 @@ type ExprView struct { best bestOrdinal } -// makeExprView creates a new ExprView instance that references the given +// MakeExprView creates a new ExprView instance that references the given // expression, which is the lowest cost expression in its group for a // particular set of physical properties. Note that the group must have already // been optimized with respect to that set of properties. Children of this // expression will in turn be the lowest cost expressions in their respective // groups, and so on. -func makeExprView(mem *memo, best bestExprID) ExprView { - mgrp := mem.lookupGroup(best.group) +func MakeExprView(mem *Memo, best BestExprID) ExprView { + mgrp := mem.group(best.group) be := mgrp.bestExpr(best.ordinal) return ExprView{mem: mem, group: best.group, op: be.op, best: best.ordinal} } -// makeNormExprView constructs an ExprView that traverses the normalized +// MakeNormExprView constructs an ExprView that traverses the normalized // logical expression tree, rather than the lowest cost physical tree. The // normalized expression tree will contain no enforcer expressions and physical // properties are not available. This view is useful when testing or debugging, // and to traverse the tree before it's been fully explored and costed (and // bestExprs have been populated). See the struct comment in factory.go for // more details about the normalized expression tree. -func makeNormExprView(mem *memo, group opt.GroupID) ExprView { - op := mem.lookupNormExpr(group).op +func MakeNormExprView(mem *Memo, group GroupID) ExprView { + op := mem.NormExpr(group).op return ExprView{mem: mem, group: group, op: op, best: normBestOrdinal} } @@ -107,22 +105,22 @@ func (ev ExprView) Operator() opt.Operator { // Logical returns the set of logical properties that this expression provides. func (ev ExprView) Logical() *LogicalProps { - return &ev.mem.lookupGroup(ev.group).logical + return &ev.mem.group(ev.group).logical } // Physical returns the physical properties required of this expression, such // as the ordering of result rows. Note that Physical does not return the // properties *provided* by this expression, but those *required* of it by its // parent expression, or by the ExprView creator. -func (ev ExprView) Physical() *opt.PhysicalProps { +func (ev ExprView) Physical() *PhysicalProps { if ev.best == normBestOrdinal { panic("physical properties are not available when traversing the normalized tree") } - return ev.mem.lookupPhysicalProps(ev.lookupBestExpr().required) + return ev.mem.LookupPhysicalProps(ev.lookupBestExpr().required) } // Group returns the memo group containing this expression. -func (ev ExprView) Group() opt.GroupID { +func (ev ExprView) Group() GroupID { return ev.group } @@ -134,36 +132,36 @@ func (ev ExprView) Child(nth int) ExprView { // of the normalized expression tree, regardless of whether it's the // lowest cost. group := ev.ChildGroup(nth) - return makeNormExprView(ev.mem, group) + return MakeNormExprView(ev.mem, group) } - return makeExprView(ev.mem, ev.lookupBestExpr().child(nth)) + return MakeExprView(ev.mem, ev.lookupBestExpr().Child(nth)) } // ChildCount returns the number of expressions that are inputs to this // parent expression. func (ev ExprView) ChildCount() int { if ev.best == normBestOrdinal { - return ev.mem.lookupNormExpr(ev.group).childCount() + return ev.mem.NormExpr(ev.group).ChildCount() } - return ev.lookupBestExpr().childCount() + return ev.lookupBestExpr().ChildCount() } // ChildGroup returns the memo group containing the nth child of this parent // expression. -func (ev ExprView) ChildGroup(nth int) opt.GroupID { +func (ev ExprView) ChildGroup(nth int) GroupID { if ev.best == normBestOrdinal { - return ev.mem.lookupNormExpr(ev.group).childGroup(ev.mem, nth) + return ev.mem.NormExpr(ev.group).ChildGroup(ev.mem, nth) } - return ev.lookupBestExpr().child(nth).group + return ev.lookupBestExpr().Child(nth).group } // Private returns any private data associated with this expression, or nil if // there is none. func (ev ExprView) Private() interface{} { if ev.best == normBestOrdinal { - return ev.mem.lookupNormExpr(ev.group).private(ev.mem) + return ev.mem.NormExpr(ev.group).Private(ev.mem) } - return ev.mem.lookupExpr(ev.lookupBestExpr().eid).private(ev.mem) + return ev.mem.Expr(ev.lookupBestExpr().eid).Private(ev.mem) } // Metadata returns the metadata that's specific to this expression tree. Some @@ -181,12 +179,12 @@ func (ev ExprView) String() string { return tp.String() } -func (ev ExprView) lookupChildGroup(nth int) *memoGroup { - return ev.mem.lookupGroup(ev.ChildGroup(nth)) +func (ev ExprView) lookupChildGroup(nth int) *group { + return ev.mem.group(ev.ChildGroup(nth)) } -func (ev ExprView) lookupBestExpr() *bestExpr { - return ev.mem.lookupGroup(ev.group).bestExpr(ev.best) +func (ev ExprView) lookupBestExpr() *BestExpr { + return ev.mem.group(ev.group).bestExpr(ev.best) } func (ev ExprView) format(tp treeprinter.Node) { @@ -272,7 +270,7 @@ func (ev ExprView) formatRelational(tp treeprinter.Node) { switch ev.Operator() { case opt.ScanOp: - tblIndex := ev.Private().(*opt.ScanOpDef).Table + tblIndex := ev.Private().(*ScanOpDef).Table fmt.Fprintf(&buf, " %s", ev.Metadata().Table(tblIndex).TabName()) } @@ -301,7 +299,7 @@ func (ev ExprView) formatRelational(tp treeprinter.Node) { case opt.UnionOp, opt.IntersectOp, opt.ExceptOp, opt.UnionAllOp, opt.IntersectAllOp, opt.ExceptAllOp: - colMap := ev.Private().(*opt.SetOpColMap) + colMap := ev.Private().(*SetOpColMap) logProps.FormatColList("columns:", colMap.Out, ev.Metadata(), tp) default: @@ -322,7 +320,7 @@ func (ev ExprView) formatRelational(tp treeprinter.Node) { // input columns that correspond to the output columns. case opt.UnionOp, opt.IntersectOp, opt.ExceptOp, opt.UnionAllOp, opt.IntersectAllOp, opt.ExceptAllOp: - colMap := ev.Private().(*opt.SetOpColMap) + colMap := ev.Private().(*SetOpColMap) logProps.FormatColList("left columns:", colMap.Left, ev.Metadata(), tp) logProps.FormatColList("right columns:", colMap.Right, ev.Metadata(), tp) } @@ -336,7 +334,7 @@ func (ev ExprView) formatRelational(tp treeprinter.Node) { } } -func (ev ExprView) formatPresentation(presentation opt.Presentation, tp treeprinter.Node) { +func (ev ExprView) formatPresentation(presentation Presentation, tp treeprinter.Node) { logProps := ev.Logical() var buf bytes.Buffer diff --git a/pkg/sql/opt/memo/expr_view_test.go b/pkg/sql/opt/memo/expr_view_test.go index c78962b5796d..d83db0f72271 100644 --- a/pkg/sql/opt/memo/expr_view_test.go +++ b/pkg/sql/opt/memo/expr_view_test.go @@ -12,7 +12,7 @@ // implied. See the License for the specific language governing // permissions and limitations under the License. -package memo +package memo_test import ( "context" @@ -20,6 +20,7 @@ import ( "testing" "github.com/cockroachdb/cockroach/pkg/settings/cluster" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" @@ -53,7 +54,7 @@ func BenchmarkExprView(b *testing.B) { } exprView := o.Optimize(root, props) - stack := make([]xform.ExprView, 16) + stack := make([]memo.ExprView, 16) for i := 0; i < b.N; i++ { // Do a depth-first traversal of the ExprView tree. Don't use recursion // to minimize overhead from the benchmark code. diff --git a/pkg/sql/opt/memo/group.go b/pkg/sql/opt/memo/group.go index e74052b4fde5..6121dd6998a1 100644 --- a/pkg/sql/opt/memo/group.go +++ b/pkg/sql/opt/memo/group.go @@ -21,18 +21,11 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" ) -// exprOrdinal is the ordinal position of an expression within its memo group. -// Each group stores one or more logically equivalent expressions. The 0th -// expression is always the normalized expression for the group. -type exprOrdinal uint16 +// GroupID identifies a memo group. Groups have numbers greater than 0; a +// GroupID of 0 indicates an invalid group. +type GroupID uint32 -const ( - // normExprOrdinal is the ordinal position of the normalized expression in - // its group. - normExprOrdinal exprOrdinal = 0 -) - -// bestOrdinal is the ordinal position of a bestExpr within its memo group. +// bestOrdinal is the ordinal position of a BestExpr within its memo group. // Once optimized, each group manages one or more bestExprs that track the // lowest cost expression for a particular set of required physical properties. type bestOrdinal uint16 @@ -44,13 +37,13 @@ const ( normBestOrdinal bestOrdinal = math.MaxUint16 ) -// memoGroup stores a set of logically equivalent expressions. See the comments -// on memoExpr for the definition of logical equivalency. In addition, for each +// group stores a set of logically equivalent expressions. See the comments +// on Expr for the definition of logical equivalency. In addition, for each // required set of physical properties, the group stores the expression that // provides those properties at the lowest known cost in the bestExprs fields. -type memoGroup struct { +type group struct { // id is the index of this group within the memo. - id opt.GroupID + id GroupID // logical is the set of logical properties that all memo expressions in // the group share. @@ -60,8 +53,8 @@ type memoGroup struct { // group's normalized expression. otherExprs holds any expressions beyond // the first. These are separated in order to optimize for the common case // of a group with only one expression (often true for scalar expressions). - normExpr memoExpr - otherExprs []memoExpr + normExpr Expr + otherExprs []Expr // firstBestExpr remembers the lowest cost expression in the group that // provides a particular set of physical properties. If the group has been @@ -69,19 +62,19 @@ type memoGroup struct { // otherBestExprs remembers the lowest cost expressions for the others. // These fields are separated in order to optimize for the common case of a // group that has been optimized for only one set of properties. - firstBestExpr bestExpr - otherBestExprs []bestExpr + firstBestExpr BestExpr + otherBestExprs []BestExpr } // makeMemoGroup constructs a new memo group with the given id and its // normalized expression. -func makeMemoGroup(id opt.GroupID, norm memoExpr) memoGroup { - return memoGroup{id: id, normExpr: norm} +func makeMemoGroup(id GroupID, norm Expr) group { + return group{id: id, normExpr: norm} } // exprCount returns the number of logically-equivalent expressions in the // group. -func (g *memoGroup) exprCount() int { +func (g *group) exprCount() int { // Group always contains at least the normalized expression, plus whatever // other expressions have been added. return 1 + len(g.otherExprs) @@ -93,9 +86,9 @@ func (g *memoGroup) exprCount() int { // e := g.expr(i) // } // -// NOTE: The returned memoExpr reference is only valid until the next call to +// NOTE: The returned Expr reference is only valid until the next call to // addExpr, which may cause a resize of the exprs slice. -func (g *memoGroup) expr(nth exprOrdinal) *memoExpr { +func (g *group) expr(nth ExprOrdinal) *Expr { if nth == normExprOrdinal { return &g.normExpr } @@ -103,36 +96,36 @@ func (g *memoGroup) expr(nth exprOrdinal) *memoExpr { } // bestExprCount returns the number of bestExprs in the group. -func (g *memoGroup) bestExprCount() int { +func (g *group) bestExprCount() int { if !g.firstBestExpr.initialized() { return 0 } return 1 + len(g.otherBestExprs) } -// bestExpr returns the nth bestExpr in the group. This method is used in +// BestExpr returns the nth BestExpr in the group. This method is used in // concert with bestExprCount to iterate over the expressions in the group: // for i := 0; i < g.bestExprCount(); i++ { -// e := g.bestExpr(i) +// e := g.BestExpr(i) // } // -// NOTE: The returned bestExpr reference is only valid until the next call to +// NOTE: The returned BestExpr reference is only valid until the next call to // ensureBestExpr, which may cause a resize of the bestExprs slice. -func (g *memoGroup) bestExpr(nth bestOrdinal) *bestExpr { +func (g *group) bestExpr(nth bestOrdinal) *BestExpr { if nth == 0 { return &g.firstBestExpr } return &g.otherBestExprs[nth-1] } -// ensureBestExpr returns the id of the bestExpr that has the lowest cost for -// the given required properties. If no bestExpr exists yet, then -// ensureBestExpr creates a new empty bestExpr and returns its id. -func (g *memoGroup) ensureBestExpr(required opt.PhysicalPropsID) bestExprID { +// ensureBestExpr returns the id of the BestExpr that has the lowest cost for +// the given required properties. If no BestExpr exists yet, then +// ensureBestExpr creates a new empty BestExpr and returns its id. +func (g *group) ensureBestExpr(required PhysicalPropsID) BestExprID { // Handle case where firstBestExpr is not yet in use. if !g.firstBestExpr.initialized() { g.firstBestExpr.required = required - return bestExprID{group: g.id, ordinal: 0} + return BestExprID{group: g.id, ordinal: 0} } // Fall back to otherBestExprs. @@ -140,7 +133,7 @@ func (g *memoGroup) ensureBestExpr(required opt.PhysicalPropsID) bestExprID { be := &g.otherBestExprs[i] if be.required == required { // Bias the ordinal to skip firstBestExpr. - return bestExprID{group: g.id, ordinal: bestOrdinal(i + 1)} + return BestExprID{group: g.id, ordinal: bestOrdinal(i + 1)} } } @@ -150,15 +143,15 @@ func (g *memoGroup) ensureBestExpr(required opt.PhysicalPropsID) bestExprID { panic(fmt.Sprintf("exceeded max number of expressions in group: %+v", g)) } - g.otherBestExprs = append(g.otherBestExprs, bestExpr{required: required}) - return bestExprID{group: g.id, ordinal: bestOrdinal(ordinal)} + g.otherBestExprs = append(g.otherBestExprs, BestExpr{required: required}) + return BestExprID{group: g.id, ordinal: bestOrdinal(ordinal)} } -// ratchetBestExpr overwrites the existing best expression with the given id if +// RatchetBestExpr overwrites the existing best expression with the given id if // the candidate expression has a lower cost. // TODO(andyk): Currently, there is no costing function, so just assume that // the first expression is the lowest cost. -func (g *memoGroup) ratchetBestExpr(best bestExprID, candidate *bestExpr) { +func (g *group) ratchetBestExpr(best BestExprID, candidate *BestExpr) { be := g.bestExpr(best.ordinal) if be.op == opt.UnknownOp { *be = *candidate diff --git a/pkg/sql/opt/memo/list_storage.go b/pkg/sql/opt/memo/list_storage.go index 96bc1e109f7f..d805b243b4a6 100644 --- a/pkg/sql/opt/memo/list_storage.go +++ b/pkg/sql/opt/memo/list_storage.go @@ -14,9 +14,19 @@ package memo -import ( - "github.com/cockroachdb/cockroach/pkg/sql/opt" -) +// ListID identifies a variable-sized list used by a memo expression and stored +// by the memo. The ID consists of an offset into the memo's lists slice, plus +// the number of elements in the list. Valid lists have offsets greater than 0; +// a ListID with offset 0 indicates an undefined list (probable indicator of a +// bug). +type ListID struct { + Offset uint32 + Length uint32 +} + +// EmptyList is a list with zero elements. It begins at offset 1 because offset +// 0 is reserved to indicate an invalid, uninitialized list. +var EmptyList = ListID{Offset: 1, Length: 0} // listStorage stores lists of memo group ids. Each list is interned, which // means that each unique list is stored at most once. If the same list is @@ -67,7 +77,7 @@ type listStorage struct { // list in the lists slice. See listStorageKey comment for more details // about node path format. index map[listStorageKey]uint32 - lists []opt.GroupID + lists []GroupID } // listStorageKey is the path to a node in the prefix tree. The path is a @@ -76,14 +86,14 @@ type listStorage struct { // a legal and efficient map key type, and it allows the entire prefix tree to // be stored in a map, which are highly optimized in Go. type listStorageKey struct { - prefix opt.ListID - item opt.GroupID + prefix ListID + item GroupID } // init must be called before using other methods on listStorage. func (ls *listStorage) init() { ls.index = make(map[listStorageKey]uint32) - ls.lists = make([]opt.GroupID, 1) + ls.lists = make([]GroupID, 1) } // intern adds the given list to storage and returns an id that can later be @@ -91,9 +101,9 @@ func (ls *listStorage) init() { // previously added to storage, then intern always returns the same list id // that was returned from the previous call. intern is an O(N) operation, where // N is the length of the list. -func (ls *listStorage) intern(list []opt.GroupID) opt.ListID { +func (ls *listStorage) intern(list []GroupID) ListID { // Start with empty prefix. - prefix := opt.EmptyList + prefix := EmptyList for i, item := range list { // Is there an existing list for the prefix + next item? @@ -105,7 +115,7 @@ func (ls *listStorage) intern(list []opt.GroupID) opt.ListID { } // Yes, so set the new prefix and keep looping. - prefix = opt.ListID{Offset: existing, Length: uint32(i + 1)} + prefix = ListID{Offset: existing, Length: uint32(i + 1)} } // Found an existing list, so return it. @@ -115,11 +125,11 @@ func (ls *listStorage) intern(list []opt.GroupID) opt.ListID { // lookup returns a list that was previously interned by listStorage. Do not // change the elements of the returned list or append to it. lookup is an O(1) // operation. -func (ls *listStorage) lookup(id opt.ListID) []opt.GroupID { +func (ls *listStorage) lookup(id ListID) []GroupID { return ls.lists[id.Offset : id.Offset+id.Length] } -func (ls *listStorage) appendList(prefix opt.ListID, list []opt.GroupID) opt.ListID { +func (ls *listStorage) appendList(prefix ListID, list []GroupID) ListID { var offset uint32 // If prefix is the last list in the slice, then optimize by appending only @@ -136,8 +146,8 @@ func (ls *listStorage) appendList(prefix opt.ListID, list []opt.GroupID) opt.Lis for i := prefix.Length; i < uint32(len(list)); i++ { key := listStorageKey{prefix: prefix, item: list[i]} ls.index[key] = offset - prefix = opt.ListID{Offset: offset, Length: i + 1} + prefix = ListID{Offset: offset, Length: i + 1} } - return opt.ListID{Offset: offset, Length: uint32(len(list))} + return ListID{Offset: offset, Length: uint32(len(list))} } diff --git a/pkg/sql/opt/memo/list_storage_test.go b/pkg/sql/opt/memo/list_storage_test.go index 36509537df7a..5cd283f4de03 100644 --- a/pkg/sql/opt/memo/list_storage_test.go +++ b/pkg/sql/opt/memo/list_storage_test.go @@ -17,8 +17,6 @@ package memo import ( "bytes" "testing" - - "github.com/cockroachdb/cockroach/pkg/sql/opt" ) func TestListStorage(t *testing.T) { @@ -26,37 +24,37 @@ func TestListStorage(t *testing.T) { ls.init() catID := ls.intern(stringToGroups("cat")) - if catID != (opt.ListID{Offset: 1, Length: 3}) { + if catID != (ListID{Offset: 1, Length: 3}) { t.Fatalf("unexpected id: %v", catID) } // Should return sublist since "c" is prefix of "cat". cID := ls.intern(stringToGroups("c")) - if cID != (opt.ListID{Offset: 1, Length: 1}) { + if cID != (ListID{Offset: 1, Length: 1}) { t.Fatalf("unexpected id: %v", cID) } // Should append to existing "cat" list, since it's last in the slice. catalogID := ls.intern(stringToGroups("catalog")) - if catalogID != (opt.ListID{Offset: 1, Length: 7}) { + if catalogID != (ListID{Offset: 1, Length: 7}) { t.Fatalf("unexpected id: %v", catalogID) } // Should create new list. dogID := ls.intern(stringToGroups("dog")) - if dogID != (opt.ListID{Offset: 8, Length: 3}) { + if dogID != (ListID{Offset: 8, Length: 3}) { t.Fatalf("unexpected id: %v", dogID) } // Should create new list, since "catalog" is no longer last in the slice. catalogingID := ls.intern(stringToGroups("cataloging")) - if catalogingID != (opt.ListID{Offset: 11, Length: 10}) { + if catalogingID != (ListID{Offset: 11, Length: 10}) { t.Fatalf("unexpected id: %v", catalogingID) } // Should create new list even though it's a substring of existing list. logID := ls.intern(stringToGroups("log")) - if logID != (opt.ListID{Offset: 21, Length: 3}) { + if logID != (ListID{Offset: 21, Length: 3}) { t.Fatalf("unexpected id: %v", logID) } @@ -73,15 +71,15 @@ func TestListStorage(t *testing.T) { } } -func stringToGroups(s string) []opt.GroupID { - groups := make([]opt.GroupID, len(s)) +func stringToGroups(s string) []GroupID { + groups := make([]GroupID, len(s)) for i, rune := range s { - groups[i] = opt.GroupID(rune) + groups[i] = GroupID(rune) } return groups } -func groupsToString(groups []opt.GroupID) string { +func groupsToString(groups []GroupID) string { var buf bytes.Buffer for _, group := range groups { buf.WriteRune(rune(group)) diff --git a/pkg/sql/opt/memo/logical_props_factory.go b/pkg/sql/opt/memo/logical_props_factory.go index 6bfcce6f749f..88e1564d6648 100644 --- a/pkg/sql/opt/memo/logical_props_factory.go +++ b/pkg/sql/opt/memo/logical_props_factory.go @@ -78,7 +78,7 @@ func (f logicalPropsFactory) constructScanProps(ev ExprView) LogicalProps { props := LogicalProps{Relational: &RelationalProps{}} md := ev.Metadata() - def := ev.Private().(*opt.ScanOpDef) + def := ev.Private().(*ScanOpDef) tbl := md.Table(def.Table) // Scan output columns are stored in the definition. @@ -186,7 +186,7 @@ func (f logicalPropsFactory) constructSetProps(ev ExprView) LogicalProps { leftProps := ev.lookupChildGroup(0).logical rightProps := ev.lookupChildGroup(1).logical - colMap := *ev.Private().(*opt.SetOpColMap) + colMap := *ev.Private().(*SetOpColMap) if len(colMap.Out) != len(colMap.Left) || len(colMap.Out) != len(colMap.Right) { panic(fmt.Errorf("lists in SetOpColMap are not all the same length. new:%d, left:%d, right:%d", len(colMap.Out), len(colMap.Left), len(colMap.Right))) @@ -228,7 +228,7 @@ func (f logicalPropsFactory) passThroughRelationalProps( } func (f logicalPropsFactory) constructScalarProps(ev ExprView) LogicalProps { - props := LogicalProps{Scalar: &ScalarProps{Type: inferType(ev)}} + props := LogicalProps{Scalar: &ScalarProps{Type: InferType(ev)}} switch ev.Operator() { case opt.VariableOp: diff --git a/pkg/sql/opt/memo/logical_props_factory_test.go b/pkg/sql/opt/memo/logical_props_factory_test.go index b69a1f45febf..44e86e9be281 100644 --- a/pkg/sql/opt/memo/logical_props_factory_test.go +++ b/pkg/sql/opt/memo/logical_props_factory_test.go @@ -12,7 +12,7 @@ // implied. See the License for the specific language governing // permissions and limitations under the License. -package memo +package memo_test import ( "strings" @@ -20,6 +20,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -48,14 +49,14 @@ func TestLogicalJoinProps(t *testing.T) { leftGroup := f.ConstructScan(f.InternPrivate(constructScanOpDef(f.Metadata(), a))) rightGroup := f.ConstructScan(f.InternPrivate(constructScanOpDef(f.Metadata(), b))) onGroup := f.ConstructTrue() - operands := opt.DynamicOperands{ - opt.DynamicID(leftGroup), - opt.DynamicID(rightGroup), - opt.DynamicID(onGroup), + operands := xform.DynamicOperands{ + xform.DynamicID(leftGroup), + xform.DynamicID(rightGroup), + xform.DynamicID(onGroup), } joinGroup := f.DynamicConstruct(op, operands) - ev := o.Optimize(joinGroup, &opt.PhysicalProps{}) + ev := o.Optimize(joinGroup, &memo.PhysicalProps{}) testLogicalProps(t, f.Metadata(), ev, expected) } @@ -69,15 +70,15 @@ func TestLogicalJoinProps(t *testing.T) { joinFunc(opt.AntiJoinApplyOp, "a.x:1(int!null) a.y:2(int)\n") } -func constructScanOpDef(md *opt.Metadata, tblIndex opt.TableIndex) *opt.ScanOpDef { - def := opt.ScanOpDef{Table: tblIndex} +func constructScanOpDef(md *opt.Metadata, tblIndex opt.TableIndex) *memo.ScanOpDef { + def := memo.ScanOpDef{Table: tblIndex} for i := 0; i < md.Table(tblIndex).ColumnCount(); i++ { def.Cols.Add(int(md.TableColumn(tblIndex, i))) } return &def } -func testLogicalProps(t *testing.T, md *opt.Metadata, ev xform.ExprView, expected string) { +func testLogicalProps(t *testing.T, md *opt.Metadata, ev memo.ExprView, expected string) { t.Helper() logical := ev.Logical() diff --git a/pkg/sql/opt/memo/logical_props_test.go b/pkg/sql/opt/memo/logical_props_test.go index d08fdaf4b9e3..0199b5024ed0 100644 --- a/pkg/sql/opt/memo/logical_props_test.go +++ b/pkg/sql/opt/memo/logical_props_test.go @@ -12,13 +12,13 @@ // implied. See the License for the specific language governing // permissions and limitations under the License. -package memo +package memo_test import ( "testing" "github.com/cockroachdb/cockroach/pkg/sql/opt" - "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" "github.com/cockroachdb/cockroach/pkg/util/treeprinter" ) @@ -41,16 +41,16 @@ func TestLogicalProps(t *testing.T) { tp := treeprinter.New() nd := tp.Child("props") - relational := &xform.LogicalProps{ - Relational: &xform.RelationalProps{ + relational := &memo.LogicalProps{ + Relational: &memo.RelationalProps{ OutputCols: outCols, OuterCols: outerCols, NotNullCols: outCols, }, } - scalar := &xform.LogicalProps{ - Scalar: &xform.ScalarProps{OuterCols: outerCols}, + scalar := &memo.LogicalProps{ + Scalar: &memo.ScalarProps{OuterCols: outerCols}, } relational.FormatColSet("output:", relational.Relational.OutputCols, md, nd) diff --git a/pkg/sql/opt/memo/memo.go b/pkg/sql/opt/memo/memo.go index 14bb2b3c16dc..fae7b0141e74 100644 --- a/pkg/sql/opt/memo/memo.go +++ b/pkg/sql/opt/memo/memo.go @@ -17,7 +17,6 @@ package memo import ( "bytes" "fmt" - "sort" "strings" @@ -26,22 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/treeprinter" ) -// exprID uniquely identifies an expression stored in the memo by pairing the -// ID of its group with the ordinal position of the expression within that -// group. -type exprID struct { - group opt.GroupID - expr exprOrdinal -} - -// bestExprID uniquely identifies a bestExpr stored in the memo by pairing the -// ID of its group with the ordinal position of the bestExpr within that group. -type bestExprID struct { - group opt.GroupID - ordinal bestOrdinal -} - -// memo is a data structure for efficiently storing a forest of query plans. +// Memo is a data structure for efficiently storing a forest of query plans. // Conceptually, the memo is composed of a numbered set of equivalency classes // called groups where each group contains a set of logically equivalent // expressions. The different expressions in a single group are called memo @@ -110,21 +94,21 @@ type bestExprID struct { // 1: [scan a] // // TODO(andyk): See the comments in explorer.go for more details. -type memo struct { +type Memo struct { // metadata provides information about the columns and tables used in this // particular query. metadata *opt.Metadata - // exprMap maps from expression fingerprint (memoExpr.fingerprint()) to + // exprMap maps from expression fingerprint (Expr.fingerprint()) to // that expression's group. Multiple different fingerprints can map to the // same group, but only one of them is the fingerprint of the group's // normalized expression. - exprMap map[fingerprint]opt.GroupID + exprMap map[Fingerprint]GroupID // groups is the set of all groups in the memo, indexed by group ID. Note // the group ID 0 is invalid in order to allow zero initialization of an // expression to indicate that it did not originate from the memo. - groups []memoGroup + groups []group // logPropsFactory is used to derive logical properties for an expression, // based on the logical properties of its children. @@ -132,10 +116,10 @@ type memo struct { // Intern the set of unique physical properties used by expressions in the // memo, since there are so many duplicates. - physPropsMap map[string]opt.PhysicalPropsID - physProps []opt.PhysicalProps + physPropsMap map[string]PhysicalPropsID + physProps []PhysicalProps - // Some memoExprs have a variable number of children. The memoExpr stores + // Some memoExprs have a variable number of children. The Expr stores // the list as a ListID struct, which is a slice of an array maintained by // listStorage. Note that ListID 0 is invalid in order to indicate an // unknown list. @@ -144,46 +128,60 @@ type memo struct { // Intern the set of unique privates used by expressions in the memo, since // there are so many duplicates. Note that PrivateID 0 is invalid in order // to indicate an unknown private. - privatesMap map[interface{}]opt.PrivateID + privatesMap map[interface{}]PrivateID privates []interface{} } -func newMemo() *memo { +// New constructs a new empty memo instance. +func New() *Memo { // NB: group 0 is reserved and intentionally nil so that the 0 group index // can indicate that we don't know the group for an expression. Similarly, // index 0 for private data, index 0 for physical properties, and index 0 // for lists are all reserved. - m := &memo{ + m := &Memo{ metadata: opt.NewMetadata(), - exprMap: make(map[fingerprint]opt.GroupID), - groups: make([]memoGroup, 1), - physPropsMap: make(map[string]opt.PhysicalPropsID), - physProps: make([]opt.PhysicalProps, 1, 2), - privatesMap: make(map[interface{}]opt.PrivateID), + exprMap: make(map[Fingerprint]GroupID), + groups: make([]group, 1), + physPropsMap: make(map[string]PhysicalPropsID), + physProps: make([]PhysicalProps, 1, 2), + privatesMap: make(map[interface{}]PrivateID), privates: make([]interface{}, 1), } // Intern physical properties that require nothing of operator. - physProps := opt.PhysicalProps{} + physProps := PhysicalProps{} m.physProps = append(m.physProps, physProps) - m.physPropsMap[physProps.Fingerprint()] = opt.MinPhysPropsID + m.physPropsMap[physProps.Fingerprint()] = MinPhysPropsID m.listStorage.init() return m } -// newGroup creates a new group and adds it to the memo. -func (m *memo) newGroup(norm memoExpr) *memoGroup { - id := opt.GroupID(len(m.groups)) - m.groups = append(m.groups, makeMemoGroup(id, norm)) - return &m.groups[len(m.groups)-1] +// Metadata returns the metadata instance associated with the memo. +func (m *Memo) Metadata() *opt.Metadata { + return m.metadata +} + +// -------------------------------------------------------------------- +// Group methods. +// -------------------------------------------------------------------- + +// GroupProperties returns the logical properties of the given group. +func (m *Memo) GroupProperties(group GroupID) *LogicalProps { + return &m.groups[group].logical } -// addAltFingerprint adds an additional fingerprint that references an existing +// GroupByFingerprint returns the group of the expression that has the +// given fingerprint. +func (m *Memo) GroupByFingerprint(f Fingerprint) GroupID { + return m.exprMap[f] +} + +// AddAltFingerprint adds an additional fingerprint that references an existing // group. The new fingerprint corresponds to a denormalized expression that is // an alternate form of the group's normalized expression. Adding it to the // fingerprint map avoids re-adding the same expression in the future. -func (m *memo) addAltFingerprint(alt fingerprint, group opt.GroupID) { +func (m *Memo) AddAltFingerprint(alt Fingerprint, group GroupID) { existing, ok := m.exprMap[alt] if ok { if existing != group { @@ -194,97 +192,124 @@ func (m *memo) addAltFingerprint(alt fingerprint, group opt.GroupID) { } } -// memoizeNormExpr enters a normalized expression into the memo. This requires +// newGroup creates a new group and adds it to the memo. +func (m *Memo) newGroup(norm Expr) *group { + id := GroupID(len(m.groups)) + m.groups = append(m.groups, makeMemoGroup(id, norm)) + return &m.groups[len(m.groups)-1] +} + +// group returns the memo group for the given ID. +func (m *Memo) group(group GroupID) *group { + return &m.groups[group] +} + +// -------------------------------------------------------------------- +// Expression methods. +// -------------------------------------------------------------------- + +// ExprCount returns the number of expressions in the given memo group. There +// is always at least one expression in the group (the normalized expression). +func (m *Memo) ExprCount(group GroupID) int { + return m.groups[group].exprCount() +} + +// Expr returns the memo expression for the given ID. +func (m *Memo) Expr(eid ExprID) *Expr { + return m.groups[eid.Group].expr(eid.Expr) +} + +// NormExpr returns the normalized expression for the given group. Each group +// has one canonical expression that is always the first expression in the +// group, and which results from running normalization rules on the expression +// until the final normal state has been reached. +func (m *Memo) NormExpr(group GroupID) *Expr { + return m.groups[group].expr(normExprOrdinal) +} + +// MemoizeNormExpr enters a normalized expression into the memo. This requires // the creation of a new memo group with the normalized expression as its first // expression. -func (m *memo) memoizeNormExpr(norm memoExpr) opt.GroupID { - if m.exprMap[norm.fingerprint()] != 0 { +func (m *Memo) MemoizeNormExpr(norm Expr) GroupID { + if m.exprMap[norm.Fingerprint()] != 0 { panic("normalized expression has been entered into the memo more than once") } mgrp := m.newGroup(norm) - ev := makeNormExprView(m, mgrp.id) + ev := MakeNormExprView(m, mgrp.id) mgrp.logical = m.logPropsFactory.constructProps(ev) - m.exprMap[norm.fingerprint()] = mgrp.id + m.exprMap[norm.Fingerprint()] = mgrp.id return mgrp.id } -// lookupGroup returns the memo group for the given ID. -func (m *memo) lookupGroup(group opt.GroupID) *memoGroup { - return &m.groups[group] -} - -// lookupGroupByFingerprint returns the group of the expression that has the -// given fingerprint. -func (m *memo) lookupGroupByFingerprint(f fingerprint) opt.GroupID { - return m.exprMap[f] -} +// -------------------------------------------------------------------- +// Best expression methods. +// -------------------------------------------------------------------- -// lookupExpr returns the expression referenced by the given location. -func (m *memo) lookupExpr(eid exprID) *memoExpr { - return m.groups[eid.group].expr(eid.expr) +// EnsureBestExpr finds the expression in the given group that can provide the +// required properties for the lowest cost and returns its id. If no best +// expression exists yet, then EnsureBestExpr creates a new empty BestExpr and +// returns its id. +func (m *Memo) EnsureBestExpr(group GroupID, required PhysicalPropsID) BestExprID { + return m.group(group).ensureBestExpr(required) } -// lookupNormExpr returns the normalized expression for the given group. Each -// group has one canonical expression that is always the first expression in -// the group, and which results from running normalization rules on the -// expression until the final normal state has been reached. -func (m *memo) lookupNormExpr(group opt.GroupID) *memoExpr { - return m.groups[group].expr(normExprOrdinal) +// RatchetBestExpr overwrites the existing best expression with the given id if +// the candidate expression has a lower cost. +func (m *Memo) RatchetBestExpr(best BestExprID, candidate *BestExpr) { + m.group(best.group).ratchetBestExpr(best, candidate) } -// lookupBestExpr returns the best expression with the given id. -func (m *memo) lookupBestExpr(best bestExprID) *bestExpr { +// bestExpr returns the best expression with the given id. +func (m *Memo) bestExpr(best BestExprID) *BestExpr { return m.groups[best.group].bestExpr(best.ordinal) } -// ratchetBestExpr overwrites the existing best expression with the given id if -// the candidate expression has a lower cost. -func (m *memo) ratchetBestExpr(best bestExprID, candidate *bestExpr) { - m.lookupGroup(best.group).ratchetBestExpr(best, candidate) -} +// -------------------------------------------------------------------- +// Interning methods. +// -------------------------------------------------------------------- -// internList adds the given list of group IDs to memo storage and returns an +// InternList adds the given list of group IDs to memo storage and returns an // ID that can be used for later lookup. If the same list was added previously, // this method is a no-op and returns the ID of the previous value. -func (m *memo) internList(items []opt.GroupID) opt.ListID { +func (m *Memo) InternList(items []GroupID) ListID { return m.listStorage.intern(items) } -// lookupList returns a list of group IDs that was earlier stored in the memo -// by a call to internList. -func (m *memo) lookupList(id opt.ListID) []opt.GroupID { +// LookupList returns a list of group IDs that was earlier stored in the memo +// by a call to InternList. +func (m *Memo) LookupList(id ListID) []GroupID { return m.listStorage.lookup(id) } -// internPhysicalProps adds the given props to the memo if that set hasn't yet +// InternPhysicalProps adds the given props to the memo if that set hasn't yet // been added, and returns an ID which can later be used to look up the props. // If the same list was added previously, then this method is a no-op and // returns the same ID as did the previous call. -func (m *memo) internPhysicalProps(props *opt.PhysicalProps) opt.PhysicalPropsID { +func (m *Memo) InternPhysicalProps(props *PhysicalProps) PhysicalPropsID { fingerprint := props.Fingerprint() id, ok := m.physPropsMap[fingerprint] if !ok { - id = opt.PhysicalPropsID(len(m.physProps)) + id = PhysicalPropsID(len(m.physProps)) m.physProps = append(m.physProps, *props) m.physPropsMap[fingerprint] = id } return id } -// lookupPhysicalProps returns the set of physical props that was earlier -// interned in the memo by a call to internPhysicalProps. -func (m *memo) lookupPhysicalProps(id opt.PhysicalPropsID) *opt.PhysicalProps { +// LookupPhysicalProps returns the set of physical props that was earlier +// interned in the memo by a call to InternPhysicalProps. +func (m *Memo) LookupPhysicalProps(id PhysicalPropsID) *PhysicalProps { return &m.physProps[id] } -// internPrivate adds the given private value to the memo and returns an ID +// InternPrivate adds the given private value to the memo and returns an ID // that can be used for later lookup. If the same value was added previously, // this method is a no-op and returns the ID of the previous value. // NOTE: Because the internment uses the private value as a map key, only data // types which can be map types can be used here. -func (m *memo) internPrivate(private interface{}) opt.PrivateID { +func (m *Memo) InternPrivate(private interface{}) PrivateID { // Intern the value of certain Datum types rather than a pointer to their // value in order to support fast value comparison by private id. This is // only possible for Datum types that can be used as map types. @@ -297,20 +322,24 @@ func (m *memo) internPrivate(private interface{}) opt.PrivateID { id, ok := m.privatesMap[key] if !ok { - id = opt.PrivateID(len(m.privates)) + id = PrivateID(len(m.privates)) m.privates = append(m.privates, private) m.privatesMap[key] = id } return id } -// lookupPrivate returns a private value that was earlier interned in the memo -// by a call to internPrivate. -func (m *memo) lookupPrivate(id opt.PrivateID) interface{} { +// LookupPrivate returns a private value that was earlier interned in the memo +// by a call to InternPrivate. +func (m *Memo) LookupPrivate(id PrivateID) interface{} { return m.privates[id] } -func (m *memo) String() string { +// -------------------------------------------------------------------- +// String representation. +// -------------------------------------------------------------------- + +func (m *Memo) String() string { tp := treeprinter.New() root := tp.Child("memo") @@ -323,7 +352,7 @@ func (m *memo) String() string { if ord != 0 { buf.WriteByte(' ') } - m.formatExpr(mgrp.expr(exprOrdinal(ord)), &buf) + m.formatExpr(mgrp.expr(ExprOrdinal(ord)), &buf) } child := root.Childf("%d: %s", i, buf.String()) @@ -333,22 +362,22 @@ func (m *memo) String() string { return tp.String() } -func (m *memo) formatExpr(e *memoExpr, buf *bytes.Buffer) { +func (m *Memo) formatExpr(e *Expr, buf *bytes.Buffer) { fmt.Fprintf(buf, "(%s", e.op) - for i := 0; i < e.childCount(); i++ { - fmt.Fprintf(buf, " %d", e.childGroup(m, i)) + for i := 0; i < e.ChildCount(); i++ { + fmt.Fprintf(buf, " %d", e.ChildGroup(m, i)) } - m.formatPrivate(e.private(m), buf) + m.formatPrivate(e.Private(m), buf) buf.WriteString(")") } type bestExprSort struct { - required opt.PhysicalPropsID + required PhysicalPropsID fingerprint string - best *bestExpr + best *BestExpr } -func (m *memo) formatBestExprSet(mgrp *memoGroup, tp treeprinter.Node) { +func (m *Memo) formatBestExprSet(mgrp *group, tp treeprinter.Node) { // Sort the bestExprs by required properties. cnt := mgrp.bestExprCount() beSort := make([]bestExprSort, 0, cnt) @@ -356,7 +385,7 @@ func (m *memo) formatBestExprSet(mgrp *memoGroup, tp treeprinter.Node) { best := mgrp.bestExpr(bestOrdinal(i)) beSort = append(beSort, bestExprSort{ required: best.required, - fingerprint: m.lookupPhysicalProps(best.required).Fingerprint(), + fingerprint: m.LookupPhysicalProps(best.required).Fingerprint(), best: best, }) } @@ -379,29 +408,29 @@ func (m *memo) formatBestExprSet(mgrp *memoGroup, tp treeprinter.Node) { } } -func (m *memo) formatBestExpr(be *bestExpr, buf *bytes.Buffer) { +func (m *Memo) formatBestExpr(be *BestExpr, buf *bytes.Buffer) { fmt.Fprintf(buf, "(%s", be.op) - for i := 0; i < be.childCount(); i++ { - bestChild := be.child(i) + for i := 0; i < be.ChildCount(); i++ { + bestChild := be.Child(i) fmt.Fprintf(buf, " %d", bestChild.group) // Print properties required of the child if they are interesting. - required := m.lookupBestExpr(bestChild).required - if required != opt.MinPhysPropsID { - fmt.Fprintf(buf, "=\"%s\"", m.lookupPhysicalProps(required).Fingerprint()) + required := m.bestExpr(bestChild).required + if required != MinPhysPropsID { + fmt.Fprintf(buf, "=\"%s\"", m.LookupPhysicalProps(required).Fingerprint()) } } - m.formatPrivate(be.private(m), buf) + m.formatPrivate(be.Private(m), buf) buf.WriteString(")") } -func (m *memo) formatPrivate(private interface{}, buf *bytes.Buffer) { +func (m *Memo) formatPrivate(private interface{}, buf *bytes.Buffer) { if private != nil { switch t := private.(type) { case nil: - case *opt.ScanOpDef: + case *ScanOpDef: fmt.Fprintf(buf, " %s", m.metadata.Table(t.Table).TabName()) case opt.ColumnIndex: fmt.Fprintf(buf, " %s", m.metadata.ColumnLabel(t)) diff --git a/pkg/sql/opt/memo/memo_test.go b/pkg/sql/opt/memo/memo_test.go new file mode 100644 index 000000000000..82438cb590a9 --- /dev/null +++ b/pkg/sql/opt/memo/memo_test.go @@ -0,0 +1,95 @@ +// Copyright 2018 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. + +package memo_test + +import ( + "path/filepath" + "testing" + + "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils" + "github.com/cockroachdb/cockroach/pkg/testutils/datadriven" +) + +func TestMemo(t *testing.T) { + runDataDrivenTest(t, "testdata/memo") +} + +// runDataDrivenTest runs data-driven testcases of the form +// <command> +// <SQL statement> +// ---- +// <expected results> +// +// The supported commands are: +// +// - exec-ddl +// +// Runs a SQL DDL statement to build the test catalog. Only a small number +// of DDL statements are supported, and those not fully. +// +// - build +// +// Builds an expression tree from a SQL query and outputs it without any +// optimizations applied to it. +// +// - opt +// +// Builds an expression tree from a SQL query, fully optimizes it using the +// memo, and then outputs the lowest cost tree. +// +// - memo +// +// Builds an expression tree from a SQL query, fully optimizes it using the +// memo, and then outputs the memo containing the forest of trees. +// +func runDataDrivenTest(t *testing.T, testdataGlob string) { + for _, path := range testutils.GetTestFiles(t, testdataGlob) { + catalog := testutils.NewTestCatalog() + t.Run(filepath.Base(path), func(t *testing.T) { + datadriven.RunTest(t, path, func(d *datadriven.TestData) string { + executor := testutils.NewExecutor(catalog, d.Input) + switch d.Cmd { + case "exec-ddl": + return testutils.ExecuteTestDDL(t, d.Input, catalog) + + case "build": + ev, err := executor.OptBuild() + if err != nil { + d.Fatalf(t, "%v", err) + } + return ev.String() + + case "opt": + ev, err := executor.Optimize() + if err != nil { + d.Fatalf(t, "%v", err) + } + return ev.String() + + case "memo": + result, err := executor.Memo() + if err != nil { + d.Fatalf(t, "%v", err) + } + return result + + default: + d.Fatalf(t, "unsupported command: %s", d.Cmd) + return "" + } + }) + }) + } +} diff --git a/pkg/sql/opt/memo/opt.go b/pkg/sql/opt/memo/opt.go deleted file mode 100644 index 50b62b0984ca..000000000000 --- a/pkg/sql/opt/memo/opt.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2018 The Cockroach Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -// implied. See the License for the specific language governing -// permissions and limitations under the License. - -package memo - -// GroupID identifies a memo group. Groups have numbers greater than 0; a -// GroupID of 0 indicates an invalid group. -type GroupID uint32 - -// PrivateID identifies custom private data used by a memo expression and -// stored by the memo. Privates have numbers greater than 0; a PrivateID of 0 -// indicates an unknown private. -type PrivateID uint32 - -// ListID identifies a variable-sized list used by a memo expression and stored -// by the memo. The ID consists of an offset into the memo's lists slice, plus -// the number of elements in the list. Valid lists have offsets greater than 0; -// a ListID with offset 0 indicates an undefined list (probable indicator of a -// bug). -type ListID struct { - Offset uint32 - Length uint32 -} - -// EmptyList is a list with zero elements. It begins at offset 1 because offset -// 0 is reserved to indicate an invalid, uninitialized list. -var EmptyList = ListID{Offset: 1, Length: 0} - -// DynamicID is used when dynamically creating operators using the factory's -// DynamicConstruct method. Each operand, whether it be a group, a private, or -// a list, is first converted to a DynamicID and then passed as one of the -// DynamicOperands. -type DynamicID uint64 - -// MakeDynamicListID constructs a DynamicID from a ListID. -func MakeDynamicListID(id ListID) DynamicID { - return (DynamicID(id.Offset) << 32) | DynamicID(id.Length) -} - -// ListID converts the DynamicID to a ListID. -func (id DynamicID) ListID() ListID { - return ListID{Offset: uint32(id >> 32), Length: uint32(id & 0xffffffff)} -} - -// DynamicOperands is the list of operands passed to the factory's -// DynamicConstruct method in order to dynamically create an operator. -type DynamicOperands [MaxOperands]DynamicID diff --git a/pkg/sql/opt/memo/opt_test.go b/pkg/sql/opt/memo/opt_test.go deleted file mode 100644 index 31e673bf0ed3..000000000000 --- a/pkg/sql/opt/memo/opt_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018 The Cockroach Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -// implied. See the License for the specific language governing -// permissions and limitations under the License. - -package memo - -import ( - "testing" - - "github.com/cockroachdb/cockroach/pkg/sql/opt" -) - -func TestDynamicListID(t *testing.T) { - listID := opt.ListID{Offset: 1, Length: 2} - dynID := opt.MakeDynamicListID(listID) - roundtripID := dynID.ListID() - if listID != roundtripID { - t.Errorf("invalid ListID/DynamicID conversions") - } -} diff --git a/pkg/sql/opt/memo/physical_props.go b/pkg/sql/opt/memo/physical_props.go index ad5726583817..422506504e94 100644 --- a/pkg/sql/opt/memo/physical_props.go +++ b/pkg/sql/opt/memo/physical_props.go @@ -17,6 +17,8 @@ package memo import ( "bytes" "fmt" + + "github.com/cockroachdb/cockroach/pkg/sql/opt" ) // PhysicalPropsID identifies a set of physical properties that has been @@ -113,7 +115,7 @@ func (p *PhysicalProps) Equals(rhs *PhysicalProps) bool { // duplicate and discard columns. If Presentation is not defined, then no // particular column presentation is required or provided. For example: // a.y:2 a.x:1 a.y:2 column1:3 -type Presentation []LabeledColumn +type Presentation []opt.LabeledColumn // Defined is true if a particular column presentation is required or provided. func (p Presentation) Defined() bool { @@ -151,47 +153,9 @@ func (p Presentation) format(buf *bytes.Buffer) { } } -// LabeledColumn specifies the label and index of a column. -type LabeledColumn struct { - Label string - Index ColumnIndex -} - -// OrderingColumn is the ColumnIndex for a column that is part of an ordering, -// except that it can be negated to indicate a descending ordering on that -// column. -type OrderingColumn int32 - -// MakeOrderingColumn initializes an ordering column with a ColumnIndex and a -// flag indicating whether the direction is descending. -func MakeOrderingColumn(index ColumnIndex, descending bool) OrderingColumn { - if descending { - return OrderingColumn(-index) - } - return OrderingColumn(index) -} - -// Index returns the ColumnIndex for this OrderingColumn. -func (c OrderingColumn) Index() ColumnIndex { - if c < 0 { - return ColumnIndex(-c) - } - return ColumnIndex(c) -} - -// Ascending returns true if the ordering on this column is ascending. -func (c OrderingColumn) Ascending() bool { - return c > 0 -} - -// Descending returns true if the ordering on this column is descending. -func (c OrderingColumn) Descending() bool { - return c < 0 -} - // Ordering defines the order of rows provided or required by an operator. A // negative value indicates descending order on the column index "-(value)". -type Ordering []OrderingColumn +type Ordering []opt.OrderingColumn // Defined is true if a particular row ordering is required or provided. func (o Ordering) Defined() bool { diff --git a/pkg/sql/opt/memo/physical_props_test.go b/pkg/sql/opt/memo/physical_props_test.go index 9232bff743ff..8b5a53e0efc2 100644 --- a/pkg/sql/opt/memo/physical_props_test.go +++ b/pkg/sql/opt/memo/physical_props_test.go @@ -12,17 +12,18 @@ // implied. See the License for the specific language governing // permissions and limitations under the License. -package memo +package memo_test import ( "testing" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) func TestPhysicalProps(t *testing.T) { // Empty props. - props := &opt.PhysicalProps{} + props := &memo.PhysicalProps{} testPhysicalProps(t, props, "") if props.Defined() { @@ -30,11 +31,11 @@ func TestPhysicalProps(t *testing.T) { } // Presentation props. - presentation := opt.Presentation{ + presentation := memo.Presentation{ opt.LabeledColumn{Label: "a", Index: 1}, opt.LabeledColumn{Label: "b", Index: 2}, } - props = &opt.PhysicalProps{Presentation: presentation} + props = &memo.PhysicalProps{Presentation: presentation} testPhysicalProps(t, props, "p:a:1,b:2") if !presentation.Defined() { @@ -45,12 +46,12 @@ func TestPhysicalProps(t *testing.T) { t.Error("presentation should equal itself") } - if presentation.Equals(opt.Presentation{}) { + if presentation.Equals(memo.Presentation{}) { t.Error("presentation should not equal the empty presentation") } // Add Ordering props. - ordering := opt.Ordering{1, 5} + ordering := memo.Ordering{1, 5} props.Ordering = ordering testPhysicalProps(t, props, "p:a:1,b:2 o:+1,+5") @@ -62,15 +63,15 @@ func TestPhysicalProps(t *testing.T) { t.Error("ordering should provide itself") } - if !ordering.Provides(opt.Ordering{1}) { + if !ordering.Provides(memo.Ordering{1}) { t.Error("ordering should provide the prefix ordering") } - if (opt.Ordering{}).Provides(ordering) { + if (memo.Ordering{}).Provides(ordering) { t.Error("empty ordering should not provide ordering") } - if !ordering.Provides(opt.Ordering{}) { + if !ordering.Provides(memo.Ordering{}) { t.Error("ordering should provide the empty ordering") } @@ -78,16 +79,16 @@ func TestPhysicalProps(t *testing.T) { t.Error("ordering should be equal with itself") } - if ordering.Equals(opt.Ordering{}) { + if ordering.Equals(memo.Ordering{}) { t.Error("ordering should not equal the empty ordering") } - if (opt.Ordering{}).Equals(ordering) { + if (memo.Ordering{}).Equals(ordering) { t.Error("empty ordering should not equal ordering") } } -func testPhysicalProps(t *testing.T, physProps *opt.PhysicalProps, expected string) { +func testPhysicalProps(t *testing.T, physProps *memo.PhysicalProps, expected string) { actual := physProps.Fingerprint() if actual != expected { t.Errorf("\nexpected: %s\nactual: %s", expected, actual) diff --git a/pkg/sql/opt/memo/private_defs.go b/pkg/sql/opt/memo/private_defs.go new file mode 100644 index 000000000000..980f41f72887 --- /dev/null +++ b/pkg/sql/opt/memo/private_defs.go @@ -0,0 +1,76 @@ +// Copyright 2018 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. + +package memo + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" + "github.com/cockroachdb/cockroach/pkg/sql/sem/types" +) + +// PrivateID identifies custom private data used by a memo expression and +// stored by the memo. Privates have numbers greater than 0; a PrivateID of 0 +// indicates an unknown private. +type PrivateID uint32 + +// FuncOpDef defines the value of the Def private field of the Function +// operator. It provides the name and return type of the function, as well as a +// pointer to an already resolved builtin overload definition. +type FuncOpDef struct { + Name string + Type types.T + Overload *tree.Builtin +} + +func (f FuncOpDef) String() string { + return f.Name +} + +// ScanOpDef defines the value of the Def private field of the Scan operator. +type ScanOpDef struct { + // Table identifies the table to scan. It is an index that can be passed to + // the Metadata.Table method in order to fetch optbase.Table metadata. + Table opt.TableIndex + + // Cols specifies the set of columns that the scan operator projects. This + // may be a subset of the columns that the table contains. + Cols opt.ColSet +} + +// SetOpColMap defines the value of the ColMap private field of the set +// operators: Union, Intersect, Except, UnionAll, IntersectAll and ExceptAll. +// It matches columns from the left and right inputs of the operator +// with the output columns, since OutputCols are not ordered and may +// not correspond to each other. +// +// For example, consider the following query: +// SELECT y, x FROM xy UNION SELECT b, a FROM ab +// +// Given: +// col index +// x 1 +// y 2 +// a 3 +// b 4 +// +// SetOpColMap will contain the following values: +// Left: [2, 1] +// Right: [4, 3] +// Out: [5, 6] <-- synthesized output columns +type SetOpColMap struct { + Left opt.ColList + Right opt.ColList + Out opt.ColList +} diff --git a/pkg/sql/opt/memo/testdata/memo b/pkg/sql/opt/memo/testdata/memo new file mode 100644 index 000000000000..6f63df0d37fb --- /dev/null +++ b/pkg/sql/opt/memo/testdata/memo @@ -0,0 +1,154 @@ +exec-ddl +CREATE TABLE a (x INT PRIMARY KEY, y INT) +---- +TABLE a + ├── x int not null + ├── y int + └── INDEX primary + └── x int not null + +exec-ddl +CREATE TABLE b (x STRING PRIMARY KEY, z DECIMAL NOT NULL) +---- +TABLE b + ├── x string not null + ├── z decimal not null + └── INDEX primary + └── x string not null + +build +SELECT y, b.x, y+1 +FROM a, b +WHERE a.y=1 AND a.x::string=b.x +ORDER BY y +LIMIT 10 +---- +limit + ├── columns: y:2(int) x:3(string!null) column5:5(int) + ├── ordering: +2 + ├── project + │ ├── columns: a.y:2(int) b.x:3(string!null) column5:5(int) + │ ├── ordering: +2 + │ ├── select + │ │ ├── columns: a.x:1(int!null) a.y:2(int) b.x:3(string!null) b.z:4(decimal!null) + │ │ ├── ordering: +2 + │ │ ├── sort + │ │ │ ├── columns: a.x:1(int!null) a.y:2(int) b.x:3(string!null) b.z:4(decimal!null) + │ │ │ ├── ordering: +2 + │ │ │ └── inner-join + │ │ │ ├── columns: a.x:1(int!null) a.y:2(int) b.x:3(string!null) b.z:4(decimal!null) + │ │ │ ├── scan a + │ │ │ │ └── columns: a.x:1(int!null) a.y:2(int) + │ │ │ ├── scan b + │ │ │ │ └── columns: b.x:3(string!null) b.z:4(decimal!null) + │ │ │ └── true [type=bool] + │ │ └── and [type=bool, outer=(1-3)] + │ │ ├── eq [type=bool, outer=(2)] + │ │ │ ├── variable: a.y [type=int, outer=(2)] + │ │ │ └── const: 1 [type=int] + │ │ └── eq [type=bool, outer=(1,3)] + │ │ ├── cast: string [type=string, outer=(1)] + │ │ │ └── variable: a.x [type=int, outer=(1)] + │ │ └── variable: b.x [type=string, outer=(3)] + │ └── projections [outer=(2,3)] + │ ├── variable: a.y [type=int, outer=(2)] + │ ├── variable: b.x [type=string, outer=(3)] + │ └── plus [type=int, outer=(2)] + │ ├── variable: a.y [type=int, outer=(2)] + │ └── const: 1 [type=int] + └── const: 10 [type=int] + +opt +SELECT y, b.x, y+1 +FROM a, b +WHERE a.y=1 AND a.x::string=b.x +ORDER BY y +LIMIT 10 +---- +limit + ├── columns: y:2(int) x:3(string!null) column5:5(int) + ├── ordering: +2 + ├── project + │ ├── columns: a.y:2(int) b.x:3(string!null) column5:5(int) + │ ├── ordering: +2 + │ ├── sort + │ │ ├── columns: a.x:1(int!null) a.y:2(int) b.x:3(string!null) + │ │ ├── ordering: +2 + │ │ └── inner-join + │ │ ├── columns: a.x:1(int!null) a.y:2(int) b.x:3(string!null) + │ │ ├── select + │ │ │ ├── columns: a.x:1(int!null) a.y:2(int) + │ │ │ ├── scan a + │ │ │ │ └── columns: a.x:1(int!null) a.y:2(int) + │ │ │ └── filters [type=bool, outer=(2)] + │ │ │ └── eq [type=bool, outer=(2)] + │ │ │ ├── variable: a.y [type=int, outer=(2)] + │ │ │ └── const: 1 [type=int] + │ │ ├── scan b + │ │ │ └── columns: b.x:3(string!null) + │ │ └── filters [type=bool, outer=(1,3)] + │ │ └── eq [type=bool, outer=(1,3)] + │ │ ├── variable: b.x [type=string, outer=(3)] + │ │ └── cast: string [type=string, outer=(1)] + │ │ └── variable: a.x [type=int, outer=(1)] + │ └── projections [outer=(2,3)] + │ ├── variable: a.y [type=int, outer=(2)] + │ ├── variable: b.x [type=string, outer=(3)] + │ └── plus [type=int, outer=(2)] + │ ├── variable: a.y [type=int, outer=(2)] + │ └── const: 1 [type=int] + └── const: 10 [type=int] + +memo +SELECT y, b.x, y+1 +FROM a, b +WHERE a.y=1 AND a.x::string=b.x +ORDER BY y +LIMIT 10 +---- +[26: "p:y:2,x:3,column5:5 o:+2"] +memo + ├── 26: (limit 24 25 +2) + │ ├── "" [cost=0.0] + │ │ └── best: (limit 24="o:+2" 25 +2) + │ └── "p:y:2,x:3,column5:5 o:+2" [cost=0.0] + │ └── best: (limit 24="o:+2" 25 +2) + ├── 25: (const 10) + ├── 24: (project 23 21) + │ ├── "" [cost=0.0] + │ │ └── best: (project 23 21) + │ └── "o:+2" [cost=0.0] + │ └── best: (project 23="o:+2" 21) + ├── 23: (inner-join 15 22 17) + │ ├── "" [cost=0.0] + │ │ └── best: (inner-join 15 22 17) + │ └── "o:+2" [cost=0.0] + │ └── best: (sort 23) + ├── 22: (scan b) + │ └── "" [cost=0.0] + │ └── best: (scan b) + ├── 21: (projections 5 10 20) + ├── 20: (plus 5 19) + ├── 19: (const 1) + ├── 18: (inner-join 15 2 17) + ├── 17: (filters 11) + ├── 16: (inner-join 15 2 3) + ├── 15: (select 1 14) + │ └── "" [cost=0.0] + │ └── best: (select 1 14) + ├── 14: (filters 7) + ├── 13: (filters 7 11) + ├── 12: (and 7 11) + ├── 11: (eq 10 9) + ├── 10: (variable b.x) + ├── 9: (cast 8 string) + ├── 8: (variable a.x) + ├── 7: (eq 5 6) + ├── 6: (const 1) + ├── 5: (variable a.y) + ├── 4: (inner-join 1 2 3) + ├── 3: (true) + ├── 2: (scan b) + └── 1: (scan a) + └── "" [cost=0.0] + └── best: (scan a) diff --git a/pkg/sql/opt/memo/typing.go b/pkg/sql/opt/memo/typing.go index 193da6b8c218..9f9bcee90b96 100644 --- a/pkg/sql/opt/memo/typing.go +++ b/pkg/sql/opt/memo/typing.go @@ -22,24 +22,11 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) -// overload encapsulates information about a binary operator overload, to be -// used for type inference and null folding. The tree.BinOp struct does not -// work well for this use case, because it is quite large, and was not defined -// in a way allowing it to be passed by reference (without extra allocation). -type overload struct { - // returnType of the overload. This depends on the argument types. - returnType types.T - - // allowNullArgs is true if the operator allows null arguments, and cannot - // therefore be folded away to null. - allowNullArgs bool -} - -// inferType derives the type of the given scalar expression. Depending upon +// InferType derives the type of the given scalar expression. Depending upon // the operator, the type may be fixed, or it may be dependent upon the -// operands. inferType is called during initial construction of the expression, +// operands. InferType is called during initial construction of the expression, // so its logical properties are not yet available. -func inferType(ev ExprView) types.T { +func InferType(ev ExprView) types.T { fn := typingFuncMap[ev.Operator()] if fn == nil { panic(fmt.Sprintf("type inference for %v is not yet implemented", ev.Operator())) @@ -47,9 +34,9 @@ func inferType(ev ExprView) types.T { return fn(ev) } -// inferUnaryType infers the return type of a unary operator, given the type of +// InferUnaryType infers the return type of a unary operator, given the type of // its input. -func inferUnaryType(op opt.Operator, inputType types.T) types.T { +func InferUnaryType(op opt.Operator, inputType types.T) types.T { unaryOp := opt.UnaryOpReverseMap[op] // Find the unary op that matches the type of the expression's child. @@ -62,9 +49,9 @@ func inferUnaryType(op opt.Operator, inputType types.T) types.T { panic(fmt.Sprintf("could not find type for unary expression %s", op)) } -// inferBinaryType infers the return type of a binary operator, given the type +// InferBinaryType infers the return type of a binary operator, given the type // of its inputs. -func inferBinaryType(op opt.Operator, leftType, rightType types.T) types.T { +func InferBinaryType(op opt.Operator, leftType, rightType types.T) types.T { o, ok := findBinaryOverload(op, leftType, rightType) if !ok { panic(fmt.Sprintf("could not find type for binary expression %s", op)) @@ -79,6 +66,16 @@ func BinaryOverloadExists(op opt.Operator, leftType, rightType types.T) bool { return ok } +// BinaryAllowsNullArgs returns true if the given binary operator allows null +// arguments, and cannot therefore be folded away to null. +func BinaryAllowsNullArgs(op opt.Operator, leftType, rightType types.T) bool { + o, ok := findBinaryOverload(op, leftType, rightType) + if !ok { + panic(fmt.Sprintf("could not find overload for binary expression %s", op)) + } + return o.allowNullArgs +} + type typingFunc func(ev ExprView) types.T // typingFuncMap is a lookup table from scalar operator type to a function @@ -156,7 +153,7 @@ func typeAsTypedExpr(ev ExprView) types.T { // typeAsUnary returns the type of a unary expression by hooking into the sql // semantics code that searches for unary operator overloads. func typeAsUnary(ev ExprView) types.T { - return inferUnaryType(ev.Operator(), ev.Child(0).Logical().Scalar.Type) + return InferUnaryType(ev.Operator(), ev.Child(0).Logical().Scalar.Type) } // typeAsBinary returns the type of a binary expression by hooking into the sql @@ -164,13 +161,13 @@ func typeAsUnary(ev ExprView) types.T { func typeAsBinary(ev ExprView) types.T { leftType := ev.Child(0).Logical().Scalar.Type rightType := ev.Child(1).Logical().Scalar.Type - return inferBinaryType(ev.Operator(), leftType, rightType) + return InferBinaryType(ev.Operator(), leftType, rightType) } // typeFunction returns the type of a function expression by extracting it from // the function's private field, which is an instance of opt.FuncOpDef. func typeFunction(ev ExprView) types.T { - return ev.Private().(opt.FuncOpDef).Type + return ev.Private().(FuncOpDef).Type } // typeAsAny returns types.Any for an operator that never has its type used. @@ -226,6 +223,19 @@ func typeAsPrivate(ev ExprView) types.T { return ev.Private().(types.T) } +// overload encapsulates information about a binary operator overload, to be +// used for type inference and null folding. The tree.BinOp struct does not +// work well for this use case, because it is quite large, and was not defined +// in a way allowing it to be passed by reference (without extra allocation). +type overload struct { + // returnType of the overload. This depends on the argument types. + returnType types.T + + // allowNullArgs is true if the operator allows null arguments, and cannot + // therefore be folded away to null. + allowNullArgs bool +} + // findBinaryOverload finds the correct type signature overload for the // specified binary operator, given the types of its inputs. If an overload is // found, findBinaryOverload returns true, plus information about the overload. diff --git a/pkg/sql/opt/memo/typing_test.go b/pkg/sql/opt/memo/typing_test.go index 9490077bf672..e6c6c50c12fe 100644 --- a/pkg/sql/opt/memo/typing_test.go +++ b/pkg/sql/opt/memo/typing_test.go @@ -12,13 +12,14 @@ // implied. See the License for the specific language governing // permissions and limitations under the License. -package memo +package memo_test import ( "testing" "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" @@ -46,22 +47,22 @@ func TestTypingJson(t *testing.T) { // (FetchVal (Const <json>) (Const <int>)) fetchValGroup := f.ConstructFetchVal(jsonGroup, intGroup) - ev := o.Optimize(fetchValGroup, &opt.PhysicalProps{}) + ev := o.Optimize(fetchValGroup, &memo.PhysicalProps{}) testTyping(t, ev, types.JSON) // (FetchValPath (Const <json>) (Const <string-array>)) fetchValPathGroup := f.ConstructFetchValPath(jsonGroup, arrGroup) - ev = o.Optimize(fetchValPathGroup, &opt.PhysicalProps{}) + ev = o.Optimize(fetchValPathGroup, &memo.PhysicalProps{}) testTyping(t, ev, types.JSON) // (FetchText (Const <json>) (Const <int>)) fetchTextGroup := f.ConstructFetchText(jsonGroup, intGroup) - ev = o.Optimize(fetchTextGroup, &opt.PhysicalProps{}) + ev = o.Optimize(fetchTextGroup, &memo.PhysicalProps{}) testTyping(t, ev, types.String) // (FetchTextPath (Const <json>) (Const <string-array>)) fetchTextPathGroup := f.ConstructFetchTextPath(jsonGroup, arrGroup) - ev = o.Optimize(fetchTextPathGroup, &opt.PhysicalProps{}) + ev = o.Optimize(fetchTextPathGroup, &memo.PhysicalProps{}) testTyping(t, ev, types.String) } @@ -74,12 +75,27 @@ func TestBinaryOverloadExists(t *testing.T) { arrType := types.TArray{Typ: types.Int} - test(true, xform.BinaryOverloadExists(opt.MinusOp, types.Date, types.Int)) - test(true, xform.BinaryOverloadExists(opt.MinusOp, types.Date, types.Unknown)) - test(true, xform.BinaryOverloadExists(opt.MinusOp, types.Unknown, types.Int)) - test(false, xform.BinaryOverloadExists(opt.MinusOp, types.Int, types.Date)) - test(true, xform.BinaryOverloadExists(opt.ConcatOp, arrType, types.Int)) - test(true, xform.BinaryOverloadExists(opt.ConcatOp, types.Unknown, arrType)) + test(true, memo.BinaryOverloadExists(opt.MinusOp, types.Date, types.Int)) + test(true, memo.BinaryOverloadExists(opt.MinusOp, types.Date, types.Unknown)) + test(true, memo.BinaryOverloadExists(opt.MinusOp, types.Unknown, types.Int)) + test(false, memo.BinaryOverloadExists(opt.MinusOp, types.Int, types.Date)) + test(true, memo.BinaryOverloadExists(opt.ConcatOp, arrType, types.Int)) + test(true, memo.BinaryOverloadExists(opt.ConcatOp, types.Unknown, arrType)) +} + +func TestBinaryAllowsNullArgs(t *testing.T) { + test := func(expected, actual bool) { + if expected != actual { + t.Errorf("expected %v, got %v", expected, actual) + } + } + + arrType := types.TArray{Typ: types.Int} + + test(false, memo.BinaryAllowsNullArgs(opt.PlusOp, types.Int, types.Int)) + test(false, memo.BinaryAllowsNullArgs(opt.PlusOp, types.Int, types.Unknown)) + test(true, memo.BinaryOverloadExists(opt.ConcatOp, arrType, types.Int)) + test(true, memo.BinaryOverloadExists(opt.ConcatOp, types.Unknown, arrType)) } // TestTypingUnaryAssumptions ensures that unary overloads conform to certain @@ -159,7 +175,7 @@ func TestTypingBinaryAssumptions(t *testing.T) { } } -func testTyping(t *testing.T, ev xform.ExprView, expected types.T) { +func testTyping(t *testing.T, ev memo.ExprView, expected types.T) { t.Helper() actual := ev.Logical().Scalar.Type diff --git a/pkg/sql/opt/metadata.go b/pkg/sql/opt/metadata.go index 24d3468c29d2..93e4afea5582 100644 --- a/pkg/sql/opt/metadata.go +++ b/pkg/sql/opt/metadata.go @@ -18,45 +18,13 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" - "github.com/cockroachdb/cockroach/pkg/util" ) -// ColumnIndex uniquely identifies the usage of a column within the scope of a -// query. ColumnIndex 0 is reserved to mean "unknown column". See the comment -// for Metadata for more details. -type ColumnIndex int32 - // TableIndex uniquely identifies the usage of a table within the scope of a // query. The indexes of its columns start at the table index and proceed // sequentially from there. See the comment for Metadata for more details. type TableIndex int32 -// ColSet efficiently stores an unordered set of column indexes. -type ColSet = util.FastIntSet - -// ColList is a list of column indexes. -// -// TODO(radu): perhaps implement a FastIntList with the same "small" -// representation as FastIntMap but with a slice for large cases. -type ColList = []ColumnIndex - -// ColMap provides a 1:1 mapping from one column index to another. It is used -// by operators that need to match columns from its inputs. -type ColMap = util.FastIntMap - -// mdCol stores information about one of the columns stored in the metadata, -// including its label and type. -type mdCol struct { - // label is the best-effort name of this column. Since the same column can - // have multiple labels (using aliasing), one of those is chosen to be used - // for pretty-printing and debugging. This might be different than what is - // stored in the physical properties and is presented to end users. - label string - - // typ is the scalar SQL type of this column. - typ types.T -} - // Metadata indexes the columns, tables, and other metadata used within the // scope of a particular query. Because it is specific to one query, the // indexes tend to be small integers that can be efficiently stored and @@ -95,6 +63,19 @@ type Metadata struct { tables map[TableIndex]Table } +// mdCol stores information about one of the columns stored in the metadata, +// including its label and type. +type mdCol struct { + // label is the best-effort name of this column. Since the same column can + // have multiple labels (using aliasing), one of those is chosen to be used + // for pretty-printing and debugging. This might be different than what is + // stored in the physical properties and is presented to end users. + label string + + // typ is the scalar SQL type of this column. + typ types.T +} + // NewMetadata constructs a new instance of metadata for the optimizer. func NewMetadata() *Metadata { // Skip label index 0 so that it is reserved for "unknown column". @@ -167,12 +148,3 @@ func (md *Metadata) Table(index TableIndex) Table { func (md *Metadata) TableColumn(tblIndex TableIndex, ord int) ColumnIndex { return ColumnIndex(int(tblIndex) + ord) } - -// ColListToSet converts a column index list to a column index set. -func ColListToSet(colList ColList) ColSet { - var r ColSet - for _, col := range colList { - r.Add(int(col)) - } - return r -} diff --git a/pkg/sql/opt/metadata_column.go b/pkg/sql/opt/metadata_column.go new file mode 100644 index 000000000000..f519bc91d9e3 --- /dev/null +++ b/pkg/sql/opt/metadata_column.go @@ -0,0 +1,84 @@ +// Copyright 2018 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. + +package opt + +import ( + "github.com/cockroachdb/cockroach/pkg/util" +) + +// ColumnIndex uniquely identifies the usage of a column within the scope of a +// query. ColumnIndex 0 is reserved to mean "unknown column". See the comment +// for Metadata for more details. +type ColumnIndex int32 + +// ColSet efficiently stores an unordered set of column indexes. +type ColSet = util.FastIntSet + +// ColList is a list of column indexes. +// +// TODO(radu): perhaps implement a FastIntList with the same "small" +// representation as FastIntMap but with a slice for large cases. +type ColList = []ColumnIndex + +// ColMap provides a 1:1 mapping from one column index to another. It is used +// by operators that need to match columns from its inputs. +type ColMap = util.FastIntMap + +// LabeledColumn specifies the label and index of a column. +type LabeledColumn struct { + Label string + Index ColumnIndex +} + +// OrderingColumn is the ColumnIndex for a column that is part of an ordering, +// except that it can be negated to indicate a descending ordering on that +// column. +type OrderingColumn int32 + +// MakeOrderingColumn initializes an ordering column with a ColumnIndex and a +// flag indicating whether the direction is descending. +func MakeOrderingColumn(index ColumnIndex, descending bool) OrderingColumn { + if descending { + return OrderingColumn(-index) + } + return OrderingColumn(index) +} + +// Index returns the ColumnIndex for this OrderingColumn. +func (c OrderingColumn) Index() ColumnIndex { + if c < 0 { + return ColumnIndex(-c) + } + return ColumnIndex(c) +} + +// Ascending returns true if the ordering on this column is ascending. +func (c OrderingColumn) Ascending() bool { + return c > 0 +} + +// Descending returns true if the ordering on this column is descending. +func (c OrderingColumn) Descending() bool { + return c < 0 +} + +// ColListToSet converts a column index list to a column index set. +func ColListToSet(colList ColList) ColSet { + var r ColSet + for _, col := range colList { + r.Add(int(col)) + } + return r +} diff --git a/pkg/sql/opt/operator.go b/pkg/sql/opt/operator.go index 72e6d81aefd7..5871751a6ee2 100644 --- a/pkg/sql/opt/operator.go +++ b/pkg/sql/opt/operator.go @@ -18,7 +18,6 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" - "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) //go:generate optgen -out operator.og.go ops ops/*.opt @@ -43,56 +42,6 @@ func (i Operator) String() string { return opNames[opIndexes[i]:opIndexes[i+1]] } -// FuncOpDef defines the value of the Def private field of the Function -// operator. It provides the name and return type of the function, as well as a -// pointer to an already resolved builtin overload definition. -type FuncOpDef struct { - Name string - Type types.T - Overload *tree.Builtin -} - -func (f FuncOpDef) String() string { - return f.Name -} - -// ScanOpDef defines the value of the Def private field of the Scan operator. -type ScanOpDef struct { - // Table identifies the table to scan. It is an index that can be passed to - // the Metadata.Table method in order to fetch optbase.Table metadata. - Table TableIndex - - // Cols specifies the set of columns that the scan operator projects. This - // may be a subset of the columns that the table contains. - Cols ColSet -} - -// SetOpColMap defines the value of the ColMap private field of the set -// operators: Union, Intersect, Except, UnionAll, IntersectAll and ExceptAll. -// It matches columns from the left and right inputs of the operator -// with the output columns, since OutputCols are not ordered and may -// not correspond to each other. -// -// For example, consider the following query: -// SELECT y, x FROM xy UNION SELECT b, a FROM ab -// -// Given: -// col index -// x 1 -// y 2 -// a 3 -// b 4 -// -// SetOpColMap will contain the following values: -// Left: [2, 1] -// Right: [4, 3] -// Out: [5, 6] <-- synthesized output columns -type SetOpColMap struct { - Left ColList - Right ColList - Out ColList -} - // ComparisonOpReverseMap maps from an optimizer operator type to a semantic // tree comparison operator type. var ComparisonOpReverseMap = [...]tree.ComparisonOperator{ diff --git a/pkg/sql/opt/optbuilder/builder.go b/pkg/sql/opt/optbuilder/builder.go index 0a4194b1d0ca..1e16663f538b 100644 --- a/pkg/sql/opt/optbuilder/builder.go +++ b/pkg/sql/opt/optbuilder/builder.go @@ -21,6 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -95,7 +96,7 @@ func New( // (e.g., row and column ordering) that are required of the root memo group. // If any subroutines panic with a builderError as part of the build process, // the panic is caught here and returned as an error. -func (b *Builder) Build() (root opt.GroupID, required *opt.PhysicalProps, err error) { +func (b *Builder) Build() (root memo.GroupID, required *memo.PhysicalProps, err error) { defer func() { if r := recover(); r != nil { // This code allows us to propagate builder errors without adding @@ -132,11 +133,11 @@ func errorf(format string, a ...interface{}) builderError { // buildPhysicalProps construct a set of required physical properties from the // given scope. -func (b *Builder) buildPhysicalProps(scope *scope) *opt.PhysicalProps { +func (b *Builder) buildPhysicalProps(scope *scope) *memo.PhysicalProps { if scope.presentation == nil { scope.presentation = makePresentation(scope.cols) } - return &opt.PhysicalProps{Presentation: scope.presentation, Ordering: scope.ordering} + return &memo.PhysicalProps{Presentation: scope.presentation, Ordering: scope.ordering} } // buildStmt builds a set of memo groups that represent the given SQL @@ -156,7 +157,7 @@ func (b *Builder) buildPhysicalProps(scope *scope) *opt.PhysicalProps { // "parent" scope that is still visible. func (b *Builder) buildStmt( stmt tree.Statement, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { // NB: The case statements are sorted lexicographically. switch stmt := stmt.(type) { case *tree.ParenSelect: diff --git a/pkg/sql/opt/optbuilder/builder_test.go b/pkg/sql/opt/optbuilder/builder_test.go index 6805a14a5ba4..4250f16faa47 100644 --- a/pkg/sql/opt/optbuilder/builder_test.go +++ b/pkg/sql/opt/optbuilder/builder_test.go @@ -59,7 +59,7 @@ import ( "testing" "github.com/cockroachdb/cockroach/pkg/settings/cluster" - "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" @@ -78,15 +78,7 @@ var ( func TestBuilder(t *testing.T) { defer leaktest.AfterTest(t)() - paths, err := filepath.Glob(*testDataGlob) - if err != nil { - t.Fatal(err) - } - if len(paths) == 0 { - t.Fatalf("no testfiles found matching: %s", *testDataGlob) - } - - for _, path := range paths { + for _, path := range testutils.GetTestFiles(t, *testDataGlob) { t.Run(filepath.Base(path), func(t *testing.T) { catalog := testutils.NewTestCatalog() @@ -94,6 +86,7 @@ func TestBuilder(t *testing.T) { var varTypes []types.T var iVarHelper tree.IndexedVarHelper var allowUnsupportedExpr bool + var err error for _, arg := range d.CmdArgs { key, vals := arg.Key, arg.Vals @@ -150,7 +143,7 @@ func TestBuilder(t *testing.T) { if err != nil { return fmt.Sprintf("error: %s\n", strings.TrimSpace(err.Error())) } - exprView := o.Optimize(group, &opt.PhysicalProps{}) + exprView := o.Optimize(group, &memo.PhysicalProps{}) return exprView.String() case "exec-ddl": diff --git a/pkg/sql/opt/optbuilder/distinct.go b/pkg/sql/opt/optbuilder/distinct.go index 33f48b1467b6..a7a390d96f6e 100644 --- a/pkg/sql/opt/optbuilder/distinct.go +++ b/pkg/sql/opt/optbuilder/distinct.go @@ -16,6 +16,7 @@ package optbuilder import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // buildDistinct builds a set of memo groups that represent a DISTINCT @@ -31,8 +32,8 @@ import ( // See Builder.buildStmt for a description of the remaining input and // return values. func (b *Builder) buildDistinct( - in opt.GroupID, distinct bool, byCols []columnProps, inScope *scope, -) (out opt.GroupID, outScope *scope) { + in memo.GroupID, distinct bool, byCols []columnProps, inScope *scope, +) (out memo.GroupID, outScope *scope) { if !distinct { return in, inScope } diff --git a/pkg/sql/opt/optbuilder/groupby.go b/pkg/sql/opt/optbuilder/groupby.go index 1d5b2fb88fb0..160edba0c7b5 100644 --- a/pkg/sql/opt/optbuilder/groupby.go +++ b/pkg/sql/opt/optbuilder/groupby.go @@ -45,6 +45,7 @@ import ( "strings" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/builtins" "github.com/cockroachdb/cockroach/pkg/sql/sem/transform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -63,7 +64,7 @@ type groupby struct { // groupings contains all group by expressions that were extracted from the // query and which will become columns in this scope. - groupings []opt.GroupID + groupings []memo.GroupID // groupStrs contains a string representation of each GROUP BY expression // using symbolic notation. These strings are used to determine if SELECT @@ -112,8 +113,8 @@ type groupby struct { // aggregateInfo stores information about an aggregation function call. type aggregateInfo struct { - def opt.FuncOpDef - args []opt.GroupID + def memo.FuncOpDef + args []memo.GroupID } func (b *Builder) needsAggregation(sel *tree.SelectClause) bool { @@ -144,8 +145,8 @@ func (b *Builder) hasAggregates(selects tree.SelectExprs) bool { // - the group with the aggregation operator and the corresponding scope // - post-projections with corresponding scope. func (b *Builder) buildAggregation( - sel *tree.SelectClause, fromGroup opt.GroupID, fromScope *scope, -) (outGroup opt.GroupID, outScope *scope, projections []opt.GroupID, projectionsScope *scope) { + sel *tree.SelectClause, fromGroup memo.GroupID, fromScope *scope, +) (outGroup memo.GroupID, outScope *scope, projections []memo.GroupID, projectionsScope *scope) { // We use two scopes: // - aggInScope contains columns that are used as input by the // GroupBy operator, specifically: @@ -187,7 +188,7 @@ func (b *Builder) buildAggregation( fromScope.groupby.aggInScope = aggInScope fromScope.groupby.aggOutScope = aggOutScope - var having opt.GroupID + var having memo.GroupID if sel.Having != nil { // Any "grouping" columns are visible to both the "having" and "projection" // expressions. The build has the side effect of extracting aggregation @@ -209,10 +210,10 @@ func (b *Builder) buildAggregation( // Construct the aggregation. We represent the aggregations as Function // operators with Variable arguments; construct those now. - aggExprs := make([]opt.GroupID, len(aggInfos)) + aggExprs := make([]memo.GroupID, len(aggInfos)) argCols := aggInScope.cols[len(groupings):] for i, agg := range aggInfos { - argList := make([]opt.GroupID, len(agg.args)) + argList := make([]memo.GroupID, len(agg.args)) for j := range agg.args { colIndex := argCols[0].index argCols = argCols[1:] @@ -243,18 +244,18 @@ func (b *Builder) buildAggregation( // - grouping columns // - arguments to aggregate functions func (b *Builder) buildPreProjection( - fromGroup opt.GroupID, + fromGroup memo.GroupID, fromScope *scope, aggInfos []aggregateInfo, aggInScope *scope, - groupings []opt.GroupID, -) (outGroup opt.GroupID) { + groupings []memo.GroupID, +) (outGroup memo.GroupID) { // Don't add an unnecessary "pass-through" projection. if fromScope.hasSameColumns(aggInScope) { return fromGroup } - preProjGroups := make([]opt.GroupID, 0, len(aggInScope.cols)) + preProjGroups := make([]memo.GroupID, 0, len(aggInScope.cols)) preProjGroups = append(preProjGroups, groupings...) // Add the aggregate function arguments. @@ -280,7 +281,7 @@ func (b *Builder) buildPreProjection( // // The return value corresponds to the top-level memo group ID for this // HAVING clause. -func (b *Builder) buildHaving(having tree.Expr, inScope *scope) opt.GroupID { +func (b *Builder) buildHaving(having tree.Expr, inScope *scope) memo.GroupID { out := b.buildScalar(inScope.resolveType(having, types.Bool), inScope) if len(inScope.groupby.varsUsed) > 0 { i := inScope.groupby.varsUsed[0] @@ -304,9 +305,9 @@ func (b *Builder) buildHaving(having tree.Expr, inScope *scope) opt.GroupID { // for a description of the remaining input and return values. func (b *Builder) buildGroupingList( groupBy tree.GroupBy, selects tree.SelectExprs, inScope *scope, outScope *scope, -) (groupings []opt.GroupID) { +) (groupings []memo.GroupID) { - groupings = make([]opt.GroupID, 0, len(groupBy)) + groupings = make([]memo.GroupID, 0, len(groupBy)) inScope.groupby.groupStrs = make(groupByStrSet, len(groupBy)) for _, e := range groupBy { subset := b.buildGrouping(e, selects, inScope, outScope) @@ -333,7 +334,7 @@ func (b *Builder) buildGroupingList( // buildGroupingList). func (b *Builder) buildGrouping( groupBy tree.Expr, selects tree.SelectExprs, inScope, outScope *scope, -) []opt.GroupID { +) []memo.GroupID { // Unwrap parenthesized expressions like "((a))" to "a". groupBy = tree.StripParens(groupBy) @@ -351,7 +352,7 @@ func (b *Builder) buildGrouping( exprs = flattenTuples(exprs) // Finally, build each of the GROUP BY columns. - out := make([]opt.GroupID, 0, len(exprs)) + out := make([]memo.GroupID, 0, len(exprs)) for _, e := range exprs { // Save a representation of the GROUP BY expression for validation of the // SELECT and HAVING expressions. This enables queries such as: @@ -365,13 +366,13 @@ func (b *Builder) buildGrouping( // buildAggregateFunction is called when we are building a function which is an // aggregate. func (b *Builder) buildAggregateFunction( - f *tree.FuncExpr, funcDef opt.FuncOpDef, label string, inScope *scope, -) (out opt.GroupID, col *columnProps) { + f *tree.FuncExpr, funcDef memo.FuncOpDef, label string, inScope *scope, +) (out memo.GroupID, col *columnProps) { aggInScope, aggOutScope := inScope.startAggFunc() info := aggregateInfo{ def: funcDef, - args: make([]opt.GroupID, len(f.Exprs)), + args: make([]memo.GroupID, len(f.Exprs)), } aggInScopeColsBefore := len(aggInScope.cols) for i, pexpr := range f.Exprs { diff --git a/pkg/sql/opt/optbuilder/join.go b/pkg/sql/opt/optbuilder/join.go index a054927143d8..a2b080debdf1 100644 --- a/pkg/sql/opt/optbuilder/join.go +++ b/pkg/sql/opt/optbuilder/join.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" @@ -30,7 +31,7 @@ import ( // return values. func (b *Builder) buildJoin( join *tree.JoinTableExpr, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { left, leftScope := b.buildTable(join.Left, inScope) right, rightScope := b.buildTable(join.Right, inScope) @@ -75,7 +76,7 @@ func (b *Builder) buildJoin( outScope.appendColumns(leftScope) outScope.appendColumns(rightScope) - var filter opt.GroupID + var filter memo.GroupID if on, ok := cond.(*tree.OnJoinCond); ok { filter = b.buildScalar(outScope.resolveType(on.Expr, types.Bool), outScope) } else { @@ -127,9 +128,9 @@ func commonColumns(leftScope, rightScope *scope) (common tree.NameList) { func (b *Builder) buildUsingJoin( joinType sqlbase.JoinType, names tree.NameList, - left, right opt.GroupID, + left, right memo.GroupID, leftScope, rightScope, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { // Build the join predicate. mergedCols, filter, outScope := b.buildUsingJoinPredicate( joinType, leftScope.cols, rightScope.cols, names, inScope, @@ -139,7 +140,7 @@ func (b *Builder) buildUsingJoin( if len(mergedCols) > 0 { // Wrap in a projection to include the merged columns. - projections := make([]opt.GroupID, 0, len(outScope.cols)) + projections := make([]memo.GroupID, 0, len(outScope.cols)) for _, col := range outScope.cols { if mergedCol, ok := mergedCols[col.index]; ok { projections = append(projections, mergedCol) @@ -229,10 +230,10 @@ func (b *Builder) buildUsingJoinPredicate( rightCols []columnProps, names tree.NameList, inScope *scope, -) (mergedCols map[opt.ColumnIndex]opt.GroupID, out opt.GroupID, outScope *scope) { +) (mergedCols map[opt.ColumnIndex]memo.GroupID, out memo.GroupID, outScope *scope) { joined := make(map[tree.Name]*columnProps, len(names)) - conditions := make([]opt.GroupID, 0, len(names)) - mergedCols = make(map[opt.ColumnIndex]opt.GroupID) + conditions := make([]memo.GroupID, 0, len(names)) + mergedCols = make(map[opt.ColumnIndex]memo.GroupID) outScope = inScope.push() for _, name := range names { @@ -280,7 +281,7 @@ func (b *Builder) buildUsingJoinPredicate( } texpr := tree.NewTypedCoalesceExpr(tree.TypedExprs{leftCol, rightCol}, typ) col := b.synthesizeColumn(outScope, string(leftCol.name), typ, texpr) - merged := b.factory.ConstructCoalesce(b.factory.InternList([]opt.GroupID{leftVar, rightVar})) + merged := b.factory.ConstructCoalesce(b.factory.InternList([]memo.GroupID{leftVar, rightVar})) mergedCols[col.index] = merged } @@ -317,7 +318,7 @@ func hideMatchingColumns(cols []columnProps, joined map[tree.Name]*columnProps, // constructFilter builds a set of memo groups that represent the given // list of filter conditions. It returns the top-level memo group ID for the // filter. -func (b *Builder) constructFilter(conditions []opt.GroupID) opt.GroupID { +func (b *Builder) constructFilter(conditions []memo.GroupID) memo.GroupID { switch len(conditions) { case 0: return b.factory.ConstructTrue() @@ -329,8 +330,8 @@ func (b *Builder) constructFilter(conditions []opt.GroupID) opt.GroupID { } func (b *Builder) constructJoin( - joinType sqlbase.JoinType, left, right, filter opt.GroupID, -) opt.GroupID { + joinType sqlbase.JoinType, left, right, filter memo.GroupID, +) memo.GroupID { switch joinType { case sqlbase.InnerJoin: return b.factory.ConstructInnerJoin(left, right, filter) diff --git a/pkg/sql/opt/optbuilder/limit.go b/pkg/sql/opt/optbuilder/limit.go index a3eea65a7cdc..46e8fc557216 100644 --- a/pkg/sql/opt/optbuilder/limit.go +++ b/pkg/sql/opt/optbuilder/limit.go @@ -15,7 +15,7 @@ package optbuilder import ( - "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) @@ -27,8 +27,8 @@ import ( // SELECT k FROM kv LIMIT k // are not valid. func (b *Builder) buildLimit( - limit *tree.Limit, parentScope *scope, in opt.GroupID, inScope *scope, -) (out opt.GroupID, outScope *scope) { + limit *tree.Limit, parentScope *scope, in memo.GroupID, inScope *scope, +) (out memo.GroupID, outScope *scope) { out, outScope = in, inScope ordering := inScope.ordering diff --git a/pkg/sql/opt/optbuilder/orderby.go b/pkg/sql/opt/optbuilder/orderby.go index d93d7a3f3b52..0308bf0329df 100644 --- a/pkg/sql/opt/optbuilder/orderby.go +++ b/pkg/sql/opt/optbuilder/orderby.go @@ -16,6 +16,7 @@ package optbuilder import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" @@ -38,15 +39,19 @@ import ( // properties later become part of the required physical properties returned // by Build. func (b *Builder) buildOrderBy( - orderBy tree.OrderBy, in opt.GroupID, projections []opt.GroupID, inScope, projectionsScope *scope, -) (out opt.GroupID, outScope *scope) { + orderBy tree.OrderBy, + in memo.GroupID, + projections []memo.GroupID, + inScope, + projectionsScope *scope, +) (out memo.GroupID, outScope *scope) { if orderBy == nil { return in, nil } orderByScope := inScope.push() - orderByScope.ordering = make(opt.Ordering, 0, len(orderBy)) - orderByProjections := make([]opt.GroupID, 0, len(orderBy)) + orderByScope.ordering = make(memo.Ordering, 0, len(orderBy)) + orderByProjections := make([]memo.GroupID, 0, len(orderBy)) // TODO(rytaft): rewrite ORDER BY if it uses ORDER BY INDEX tbl@idx or // ORDER BY PRIMARY KEY syntax. @@ -70,8 +75,8 @@ func (b *Builder) buildOrderBy( // The projections are appended to the projections slice (and the resulting // slice is returned). Corresponding columns are added to the orderByScope. func (b *Builder) buildOrdering( - order *tree.Order, projections []opt.GroupID, inScope, projectionsScope, orderByScope *scope, -) []opt.GroupID { + order *tree.Order, projections []memo.GroupID, inScope, projectionsScope, orderByScope *scope, +) []memo.GroupID { // Unwrap parenthesized expressions like "((a))" to "a". expr := tree.StripParens(order.Expr) @@ -157,15 +162,15 @@ func (b *Builder) buildOrdering( // buildOrderByProject simply returns the input -- it does not construct // a "pass through" projection. func (b *Builder) buildOrderByProject( - in opt.GroupID, - projections, orderByProjections []opt.GroupID, + in memo.GroupID, + projections, orderByProjections []memo.GroupID, inScope, projectionsScope, orderByScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { outScope = inScope.push() outScope.cols = make([]columnProps, 0, len(projectionsScope.cols)+len(orderByScope.cols)) outScope.appendColumns(projectionsScope) - combined := make([]opt.GroupID, 0, len(projectionsScope.cols)+len(orderByScope.cols)) + combined := make([]memo.GroupID, 0, len(projectionsScope.cols)+len(orderByScope.cols)) combined = append(combined, projections...) for i := range orderByScope.cols { diff --git a/pkg/sql/opt/optbuilder/project.go b/pkg/sql/opt/optbuilder/project.go index 97d635452001..45d1f873b1e9 100644 --- a/pkg/sql/opt/optbuilder/project.go +++ b/pkg/sql/opt/optbuilder/project.go @@ -15,8 +15,7 @@ package optbuilder import ( - "github.com/cockroachdb/cockroach/pkg/sql/opt" - + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) @@ -32,8 +31,8 @@ import ( // (scope.groupby.aggs) func (b *Builder) buildProjectionList( selects tree.SelectExprs, inScope *scope, outScope *scope, -) (projections []opt.GroupID) { - projections = make([]opt.GroupID, 0, len(selects)) +) (projections []memo.GroupID) { + projections = make([]memo.GroupID, 0, len(selects)) for _, e := range selects { subset := b.buildProjection(e.Expr, string(e.As), inScope, outScope) projections = append(projections, subset...) @@ -60,13 +59,13 @@ func (b *Builder) buildProjectionList( // buildProjectionList). func (b *Builder) buildProjection( projection tree.Expr, label string, inScope, outScope *scope, -) (projections []opt.GroupID) { +) (projections []memo.GroupID) { exprs := b.expandStarAndResolveType(projection, inScope) if len(exprs) > 1 && label != "" { panic(errorf("\"%s\" cannot be aliased", projection)) } - projections = make([]opt.GroupID, 0, len(exprs)) + projections = make([]memo.GroupID, 0, len(exprs)) for _, e := range exprs { projections = append(projections, b.buildScalarProjection(e, label, inScope, outScope)) } @@ -91,7 +90,7 @@ func (b *Builder) buildProjection( // buildProjectionList). func (b *Builder) buildScalarProjection( texpr tree.TypedExpr, label string, inScope, outScope *scope, -) opt.GroupID { +) memo.GroupID { // NB: The case statements are sorted lexicographically. switch t := texpr.(type) { case *columnProps: @@ -131,7 +130,7 @@ func (b *Builder) buildScalarProjection( // buildProjectionList). func (b *Builder) buildVariableProjection( col *columnProps, label string, inScope, outScope *scope, -) opt.GroupID { +) memo.GroupID { if inScope.inGroupingContext() && !inScope.groupby.inAgg && !inScope.groupby.aggInScope.hasColumn(col.index) { panic(groupingError(col.String())) } @@ -170,8 +169,8 @@ func (b *Builder) buildVariableProjection( // the newly bound variables are appended to a growing list to be returned by // buildProjectionList). func (b *Builder) buildDefaultScalarProjection( - texpr tree.TypedExpr, group opt.GroupID, label string, inScope, outScope *scope, -) opt.GroupID { + texpr tree.TypedExpr, group memo.GroupID, label string, inScope, outScope *scope, +) memo.GroupID { if inScope.inGroupingContext() && !inScope.groupby.inAgg { if len(inScope.groupby.varsUsed) > 0 { if _, ok := inScope.groupby.groupStrs[symbolicExprStr(texpr)]; !ok { diff --git a/pkg/sql/opt/optbuilder/scalar.go b/pkg/sql/opt/optbuilder/scalar.go index 9135a047250a..22b645760aa9 100644 --- a/pkg/sql/opt/optbuilder/scalar.go +++ b/pkg/sql/opt/optbuilder/scalar.go @@ -17,7 +17,7 @@ package optbuilder import ( "context" - "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/coltypes" @@ -25,8 +25,8 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) -type unaryFactoryFunc func(f *xform.Factory, input opt.GroupID) opt.GroupID -type binaryFactoryFunc func(f *xform.Factory, left, right opt.GroupID) opt.GroupID +type unaryFactoryFunc func(f *xform.Factory, input memo.GroupID) memo.GroupID +type binaryFactoryFunc func(f *xform.Factory, left, right memo.GroupID) memo.GroupID // Map from tree.ComparisonOperator to Factory constructor function. var comparisonOpMap = [tree.NumComparisonOperators]binaryFactoryFunc{ @@ -51,7 +51,7 @@ var comparisonOpMap = [tree.NumComparisonOperators]binaryFactoryFunc{ tree.IsDistinctFrom: (*xform.Factory).ConstructIsNot, tree.IsNotDistinctFrom: (*xform.Factory).ConstructIs, tree.Contains: (*xform.Factory).ConstructContains, - tree.ContainedBy: func(f *xform.Factory, left, right opt.GroupID) opt.GroupID { + tree.ContainedBy: func(f *xform.Factory, left, right memo.GroupID) memo.GroupID { // This is just syntatic sugar that reverses the operands. return f.ConstructContains(right, left) }, @@ -85,7 +85,7 @@ var unaryOpMap = [tree.NumUnaryOperators]unaryFactoryFunc{ // // See Builder.buildStmt for a description of the remaining input and // return values. -func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.GroupID) { +func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out memo.GroupID) { inGroupingContext := inScope.inGroupingContext() && !inScope.groupby.inAgg varsUsedIn := len(inScope.groupby.varsUsed) switch t := scalar.(type) { @@ -98,7 +98,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr case *tree.AndExpr: left := b.buildScalar(t.TypedLeft(), inScope) right := b.buildScalar(t.TypedRight(), inScope) - conditions := b.factory.InternList([]opt.GroupID{left, right}) + conditions := b.factory.InternList([]memo.GroupID{left, right}) out = b.factory.ConstructAnd(conditions) case *tree.BinaryExpr: @@ -116,7 +116,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr case *tree.CaseExpr: var condType types.T - var input opt.GroupID + var input memo.GroupID if t.Expr != nil { condType = types.Any input = b.buildScalar(inScope.resolveType(t.Expr, types.Any), inScope) @@ -125,7 +125,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr input = b.factory.ConstructTrue() } - whens := make([]opt.GroupID, 0, len(t.Whens)+1) + whens := make([]memo.GroupID, 0, len(t.Whens)+1) for i := range t.Whens { cond := b.buildScalar(inScope.resolveType(t.Whens[i].Cond, condType), inScope) val := b.buildScalar(inScope.resolveType(t.Whens[i].Val, types.Any), inScope) @@ -146,7 +146,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr out = b.factory.ConstructCast(arg, b.factory.InternPrivate(typ)) case *tree.CoalesceExpr: - args := make([]opt.GroupID, len(t.Exprs)) + args := make([]memo.GroupID, len(t.Exprs)) for i := range args { args[i] = b.buildScalar(t.TypedExprAt(i), inScope) } @@ -174,7 +174,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr } case *tree.DTuple: - list := make([]opt.GroupID, len(t.D)) + list := make([]memo.GroupID, len(t.D)) for i := range t.D { list[i] = b.buildScalar(t.D[i], inScope) } @@ -196,7 +196,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr case *tree.OrExpr: left := b.buildScalar(t.TypedLeft(), inScope) right := b.buildScalar(t.TypedRight(), inScope) - conditions := b.factory.InternList([]opt.GroupID{left, right}) + conditions := b.factory.InternList([]memo.GroupID{left, right}) out = b.factory.ConstructOr(conditions) case *tree.ParenExpr: @@ -222,7 +222,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr out = b.buildRangeCond(t.Not, t.Symmetric, input, from, to) case *tree.Tuple: - list := make([]opt.GroupID, len(t.Exprs)) + list := make([]memo.GroupID, len(t.Exprs)) for i := range t.Exprs { list[i] = b.buildScalar(t.Exprs[i].(tree.TypedExpr), inScope) } @@ -265,7 +265,7 @@ func (b *Builder) buildScalar(scalar tree.TypedExpr, inScope *scope) (out opt.Gr } // buildDatum maps certain datums to separate operators, for easier matching. -func (b *Builder) buildDatum(d tree.Datum) opt.GroupID { +func (b *Builder) buildDatum(d tree.Datum) memo.GroupID { if d == tree.DNull { return b.factory.ConstructNull(b.factory.InternPrivate(types.Unknown)) } @@ -292,19 +292,19 @@ func (b *Builder) buildDatum(d tree.Datum) opt.GroupID { // return values. func (b *Builder) buildFunction( f *tree.FuncExpr, label string, inScope *scope, -) (out opt.GroupID, col *columnProps) { +) (out memo.GroupID, col *columnProps) { def, err := f.Func.Resolve(b.semaCtx.SearchPath) if err != nil { panic(builderError{err}) } - funcDef := opt.FuncOpDef{Name: def.Name, Type: f.ResolvedType(), Overload: f.ResolvedBuiltin()} + funcDef := memo.FuncOpDef{Name: def.Name, Type: f.ResolvedType(), Overload: f.ResolvedBuiltin()} if isAggregate(def) { return b.buildAggregateFunction(f, funcDef, label, inScope) } - argList := make([]opt.GroupID, len(f.Exprs)) + argList := make([]memo.GroupID, len(f.Exprs)) for i, pexpr := range f.Exprs { argList[i] = b.buildScalar(pexpr.(tree.TypedExpr), inScope) } @@ -325,11 +325,11 @@ func (b *Builder) buildFunction( // push down the negation). // TODO(radu): this doesn't work when the expressions have side-effects. func (b *Builder) buildRangeCond( - not bool, symmetric bool, input, from, to opt.GroupID, -) opt.GroupID { + not bool, symmetric bool, input, from, to memo.GroupID, +) memo.GroupID { // Build "input >= from AND input <= to". out := b.factory.ConstructAnd( - b.factory.InternList([]opt.GroupID{ + b.factory.InternList([]memo.GroupID{ b.factory.ConstructGe(input, from), b.factory.ConstructLe(input, to), }), @@ -339,13 +339,13 @@ func (b *Builder) buildRangeCond( // Build "(input >= from AND input <= to) OR (input >= to AND input <= from)". lhs := out rhs := b.factory.ConstructAnd( - b.factory.InternList([]opt.GroupID{ + b.factory.InternList([]memo.GroupID{ b.factory.ConstructGe(input, to), b.factory.ConstructLe(input, from), }), ) out = b.factory.ConstructOr( - b.factory.InternList([]opt.GroupID{lhs, rhs}), + b.factory.InternList([]memo.GroupID{lhs, rhs}), ) } @@ -396,7 +396,7 @@ func NewScalar( // Build a memo structure from a TypedExpr: the root group represents a scalar // expression equivalent to expr. -func (sb *ScalarBuilder) Build(expr tree.TypedExpr) (root opt.GroupID, err error) { +func (sb *ScalarBuilder) Build(expr tree.TypedExpr) (root memo.GroupID, err error) { defer func() { if r := recover(); r != nil { // This code allows us to propagate builder errors without adding diff --git a/pkg/sql/opt/optbuilder/scope.go b/pkg/sql/opt/optbuilder/scope.go index 895791cbab87..2f162e8f7577 100644 --- a/pkg/sql/opt/optbuilder/scope.go +++ b/pkg/sql/opt/optbuilder/scope.go @@ -15,13 +15,13 @@ package optbuilder import ( - "context" - "strings" - "bytes" + "context" "fmt" + "strings" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" @@ -37,8 +37,8 @@ type scope struct { parent *scope cols []columnProps groupby groupby - ordering opt.Ordering - presentation opt.Presentation + ordering memo.Ordering + presentation memo.Presentation } // groupByStrSet is a set of stringified GROUP BY expressions. @@ -149,7 +149,7 @@ func (s *scope) findAggregate(agg aggregateInfo) *columnProps { // findGrouping finds the given grouping expression among the bound variables // in the groupingsScope. Returns nil if the grouping is not found. -func (s *scope) findGrouping(grouping opt.GroupID) *columnProps { +func (s *scope) findGrouping(grouping memo.GroupID) *columnProps { for i, g := range s.groupby.groupings { if g == grouping { // Grouping already exists, so return information about the diff --git a/pkg/sql/opt/optbuilder/select.go b/pkg/sql/opt/optbuilder/select.go index 3a52f0426b09..b24717951cd7 100644 --- a/pkg/sql/opt/optbuilder/select.go +++ b/pkg/sql/opt/optbuilder/select.go @@ -16,6 +16,7 @@ package optbuilder import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) @@ -32,7 +33,7 @@ import ( // return values. func (b *Builder) buildTable( texpr tree.TableExpr, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { // NB: The case statements are sorted lexicographically. switch source := texpr.(type) { case *tree.AliasedTableExpr: @@ -108,9 +109,9 @@ func (b *Builder) renameSource(as tree.AliasClause, scope *scope) { // return values. func (b *Builder) buildScan( tbl opt.Table, tn *tree.TableName, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { tblIndex := b.factory.Metadata().AddTable(tbl) - scanOpDef := opt.ScanOpDef{Table: tblIndex} + scanOpDef := memo.ScanOpDef{Table: tblIndex} outScope = inScope.push() for i := 0; i < tbl.ColumnCount(); i++ { @@ -141,7 +142,7 @@ func (b *Builder) buildScan( // return values. func (b *Builder) buildSelect( stmt *tree.Select, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { wrapped := stmt.Select orderBy := stmt.OrderBy limit := stmt.Limit @@ -176,7 +177,7 @@ func (b *Builder) buildSelect( if outScope.ordering == nil && orderBy != nil { projectionsScope := outScope.push() projectionsScope.cols = make([]columnProps, 0, len(outScope.cols)) - projections := make([]opt.GroupID, 0, len(outScope.cols)) + projections := make([]memo.GroupID, 0, len(outScope.cols)) for i := range outScope.cols { p := b.buildScalarProjection(&outScope.cols[i], "", outScope, projectionsScope) projections = append(projections, p) @@ -202,14 +203,14 @@ func (b *Builder) buildSelect( // return values. func (b *Builder) buildSelectClause( stmt *tree.Select, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { sel := stmt.Select.(*tree.SelectClause) var fromScope *scope out, fromScope = b.buildFrom(sel.From, sel.Where, inScope) outScope = fromScope - var projections []opt.GroupID + var projections []memo.GroupID var projectionsScope *scope if b.needsAggregation(sel) { out, outScope, projections, projectionsScope = b.buildAggregation(sel, out, fromScope) @@ -247,8 +248,8 @@ func (b *Builder) buildSelectClause( // return values. func (b *Builder) buildFrom( from *tree.From, where *tree.Where, inScope *scope, -) (out opt.GroupID, outScope *scope) { - var left, right opt.GroupID +) (out memo.GroupID, outScope *scope) { + var left, right memo.GroupID for _, table := range from.Tables { var rightScope *scope @@ -268,7 +269,7 @@ func (b *Builder) buildFrom( if left == 0 { // TODO(peter): This should be a table with 1 row and 0 columns to match // current cockroach behavior. - rows := []opt.GroupID{b.factory.ConstructTuple(b.factory.InternList(nil))} + rows := []memo.GroupID{b.factory.ConstructTuple(b.factory.InternList(nil))} out = b.factory.ConstructValues( b.factory.InternList(rows), b.factory.InternPrivate(&opt.ColList{}), diff --git a/pkg/sql/opt/optbuilder/union.go b/pkg/sql/opt/optbuilder/union.go index dfe782f5aaa6..416363e82daa 100644 --- a/pkg/sql/opt/optbuilder/union.go +++ b/pkg/sql/opt/optbuilder/union.go @@ -16,6 +16,7 @@ package optbuilder import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) @@ -27,7 +28,7 @@ import ( // return values. func (b *Builder) buildUnion( clause *tree.UnionClause, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { left, leftScope := b.buildSelect(clause.Left, inScope) right, rightScope := b.buildSelect(clause.Right, inScope) outScope = leftScope @@ -95,7 +96,7 @@ func (b *Builder) buildUnion( } else { newCols = leftCols } - setOpColMap := opt.SetOpColMap{Left: leftCols, Right: rightCols, Out: newCols} + setOpColMap := memo.SetOpColMap{Left: leftCols, Right: rightCols, Out: newCols} private := b.factory.InternPrivate(&setOpColMap) if clause.All { diff --git a/pkg/sql/opt/optbuilder/util.go b/pkg/sql/opt/optbuilder/util.go index cb322e75fbdb..6382ed8a9da9 100644 --- a/pkg/sql/opt/optbuilder/util.go +++ b/pkg/sql/opt/optbuilder/util.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" @@ -128,8 +129,8 @@ func (b *Builder) synthesizeColumn( // constructList invokes the factory to create one of the operators that contain // a list of groups: ProjectionsOp and AggregationsOp. func (b *Builder) constructList( - op opt.Operator, items []opt.GroupID, cols []columnProps, -) opt.GroupID { + op opt.Operator, items []memo.GroupID, cols []columnProps, +) memo.GroupID { colList := make(opt.ColList, len(cols)) for i := range cols { colList[i] = cols[i].index @@ -295,8 +296,8 @@ func findColByIndex(cols []columnProps, colIndex opt.ColumnIndex) *columnProps { return nil } -func makePresentation(cols []columnProps) opt.Presentation { - presentation := make(opt.Presentation, len(cols)) +func makePresentation(cols []columnProps) memo.Presentation { + presentation := make(memo.Presentation, len(cols)) for i := range cols { col := &cols[i] presentation[i] = opt.LabeledColumn{Label: string(col.name), Index: col.index} diff --git a/pkg/sql/opt/optbuilder/values.go b/pkg/sql/opt/optbuilder/values.go index 10fc6ed79f05..b6de49522a76 100644 --- a/pkg/sql/opt/optbuilder/values.go +++ b/pkg/sql/opt/optbuilder/values.go @@ -17,7 +17,7 @@ package optbuilder import ( "fmt" - "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) @@ -29,7 +29,7 @@ import ( // return values. func (b *Builder) buildValuesClause( values *tree.ValuesClause, inScope *scope, -) (out opt.GroupID, outScope *scope) { +) (out memo.GroupID, outScope *scope) { var numCols int if len(values.Tuples) > 0 { numCols = len(values.Tuples[0].Exprs) @@ -39,11 +39,11 @@ func (b *Builder) buildValuesClause( for i := range colTypes { colTypes[i] = types.Unknown } - rows := make([]opt.GroupID, 0, len(values.Tuples)) + rows := make([]memo.GroupID, 0, len(values.Tuples)) // elems is used to store tuple values, and can be allocated once and reused // repeatedly, since InternList will copy values to memo storage. - elems := make([]opt.GroupID, numCols) + elems := make([]memo.GroupID, numCols) for _, tuple := range values.Tuples { if numCols != len(tuple.Exprs) { diff --git a/pkg/sql/opt/optgen/cmd/optgen/exprs_gen.go b/pkg/sql/opt/optgen/cmd/optgen/exprs_gen.go index 42f749f13ec5..0b45cabfc5c3 100644 --- a/pkg/sql/opt/optgen/cmd/optgen/exprs_gen.go +++ b/pkg/sql/opt/optgen/cmd/optgen/exprs_gen.go @@ -32,7 +32,7 @@ func (g *exprsGen) generate(compiled *lang.CompiledExpr, w io.Writer) { g.compiled = compiled g.w = w - fmt.Fprintf(g.w, "package xform\n\n") + fmt.Fprintf(g.w, "package memo\n\n") fmt.Fprintf(g.w, "import (\n") fmt.Fprintf(g.w, " \"github.com/cockroachdb/cockroach/pkg/sql/opt\"\n") @@ -104,8 +104,8 @@ func (g *exprsGen) genTagLookup() { } } -// genIsTag generates IsXXX tag methods on ExprView and memoExpr for every -// unique tag. +// genIsTag generates IsXXX tag methods on ExprView and Expr for every unique +// tag. func (g *exprsGen) genIsTag() { for _, tag := range g.compiled.DefineTags { fmt.Fprintf(g.w, "func (ev ExprView) Is%s() bool {\n", tag) @@ -114,8 +114,8 @@ func (g *exprsGen) genIsTag() { } for _, tag := range g.compiled.DefineTags { - fmt.Fprintf(g.w, "func (me *memoExpr) is%s() bool {\n", tag) - fmt.Fprintf(g.w, " return is%sLookup[me.op]\n", tag) + fmt.Fprintf(g.w, "func (e *Expr) Is%s() bool {\n", tag) + fmt.Fprintf(g.w, " return is%sLookup[e.op]\n", tag) fmt.Fprintf(g.w, "}\n\n") } } @@ -124,21 +124,21 @@ func (g *exprsGen) genIsTag() { // constructor function. func (g *exprsGen) genExprType(define *lang.DefineExpr) { opType := fmt.Sprintf("%sOp", define.Name) - exprType := fmt.Sprintf("%sExpr", unTitle(string(define.Name))) + exprType := fmt.Sprintf("%sExpr", define.Name) // Generate comment for the expression type. generateDefineComments(g.w, define, exprType) // Generate the expression type. - fmt.Fprintf(g.w, "type %s memoExpr\n\n", exprType) + fmt.Fprintf(g.w, "type %s Expr\n\n", exprType) // Generate a strongly-typed constructor function for the type. - fmt.Fprintf(g.w, "func make%sExpr(", define.Name) + fmt.Fprintf(g.w, "func Make%s(", exprType) for i, field := range define.Fields { if i != 0 { fmt.Fprint(g.w, ", ") } - fmt.Fprintf(g.w, "%s opt.%s", unTitle(string(field.Name)), mapType(string(field.Type))) + fmt.Fprintf(g.w, "%s %s", unTitle(string(field.Name)), mapType(string(field.Type))) } fmt.Fprintf(g.w, ") %s {\n", exprType) fmt.Fprintf(g.w, " return %s{op: opt.%s, state: exprState{", exprType, opType) @@ -164,32 +164,31 @@ func (g *exprsGen) genExprType(define *lang.DefineExpr) { // genExprFuncs generates the expression's accessor functions, one for each // field in the type. func (g *exprsGen) genExprFuncs(define *lang.DefineExpr) { - exprType := fmt.Sprintf("%sExpr", unTitle(string(define.Name))) + exprType := fmt.Sprintf("%sExpr", define.Name) // Generate the strongly-typed accessor methods. stateIndex := 0 for _, field := range define.Fields { - fieldName := unTitle(string(field.Name)) fieldType := mapType(string(field.Type)) - fmt.Fprintf(g.w, "func (e *%s) %s() opt.%s {\n", exprType, fieldName, fieldType) + fmt.Fprintf(g.w, "func (e *%s) %s() %s {\n", exprType, field.Name, fieldType) if isListType(string(field.Type)) { - format := " return opt.ListID{Offset: e.state[%d], Length: e.state[%d]}\n" + format := " return ListID{Offset: e.state[%d], Length: e.state[%d]}\n" fmt.Fprintf(g.w, format, stateIndex, stateIndex+1) stateIndex += 2 } else if isPrivateType(string(field.Type)) { - fmt.Fprintf(g.w, " return opt.PrivateID(e.state[%d])\n", stateIndex) + fmt.Fprintf(g.w, " return PrivateID(e.state[%d])\n", stateIndex) stateIndex++ } else { - fmt.Fprintf(g.w, " return opt.GroupID(e.state[%d])\n", stateIndex) + fmt.Fprintf(g.w, " return GroupID(e.state[%d])\n", stateIndex) stateIndex++ } fmt.Fprintf(g.w, "}\n\n") } // Generate the fingerprint method. - fmt.Fprintf(g.w, "func (e *%s) fingerprint() fingerprint {\n", exprType) - fmt.Fprintf(g.w, " return fingerprint(*e)\n") + fmt.Fprintf(g.w, "func (e *%s) Fingerprint() Fingerprint {\n", exprType) + fmt.Fprintf(g.w, " return Fingerprint(*e)\n") fmt.Fprintf(g.w, "}\n\n") } @@ -197,15 +196,15 @@ func (g *exprsGen) genExprFuncs(define *lang.DefineExpr) { // each more specialized expression type. func (g *exprsGen) genMemoFuncs(define *lang.DefineExpr) { opType := fmt.Sprintf("%sOp", define.Name) - exprType := fmt.Sprintf("%sExpr", unTitle(string(define.Name))) + exprType := fmt.Sprintf("%sExpr", define.Name) - // Generate a conversion method from memoExpr to the more specialized + // Generate a conversion method from Expr to the more specialized // expression type. - fmt.Fprintf(g.w, "func (m *memoExpr) as%s() *%s {\n", define.Name, exprType) - fmt.Fprintf(g.w, " if m.op != opt.%s {\n", opType) + fmt.Fprintf(g.w, "func (e *Expr) As%s() *%s {\n", define.Name, exprType) + fmt.Fprintf(g.w, " if e.op != opt.%s {\n", opType) fmt.Fprintf(g.w, " return nil\n") fmt.Fprintf(g.w, " }\n") - fmt.Fprintf(g.w, " return (*%s)(m)\n", exprType) + fmt.Fprintf(g.w, " return (*%s)(e)\n", exprType) fmt.Fprintf(g.w, "}\n\n") } diff --git a/pkg/sql/opt/optgen/cmd/optgen/factory_gen.go b/pkg/sql/opt/optgen/cmd/optgen/factory_gen.go index 653855a27071..26c42f0208fc 100644 --- a/pkg/sql/opt/optgen/cmd/optgen/factory_gen.go +++ b/pkg/sql/opt/optgen/cmd/optgen/factory_gen.go @@ -38,6 +38,7 @@ func (g *factoryGen) generate(compiled *lang.CompiledExpr, w io.Writer) { g.w.nest("import (\n") g.w.writeIndent("\"github.com/cockroachdb/cockroach/pkg/sql/opt\"\n") + g.w.writeIndent("\"github.com/cockroachdb/cockroach/pkg/sql/opt/memo\"\n") g.w.unnest(")\n\n") g.genConstructFuncs() @@ -57,12 +58,12 @@ func (g *factoryGen) genConstructFuncs() { for _, field := range define.Fields { fieldName := unTitle(string(field.Name)) - g.w.writeIndent(" %s opt.%s,\n", fieldName, mapType(string(field.Type))) + g.w.writeIndent(" %s memo.%s,\n", fieldName, mapType(string(field.Type))) } - g.w.nest(") opt.GroupID {\n") + g.w.nest(") memo.GroupID {\n") - g.w.writeIndent("%s := make%sExpr(", varName, define.Name) + g.w.writeIndent("%s := memo.Make%sExpr(", varName, define.Name) for i, field := range define.Fields { if i != 0 { @@ -72,13 +73,13 @@ func (g *factoryGen) genConstructFuncs() { } g.w.write(")\n") - g.w.writeIndent("_group := _f.mem.lookupGroupByFingerprint(%s.fingerprint())\n", varName) + g.w.writeIndent("_group := _f.mem.GroupByFingerprint(%s.Fingerprint())\n", varName) g.w.nest("if _group != 0 {\n") g.w.writeIndent("return _group\n") g.w.unnest("}\n\n") g.w.nest("if !_f.o.allowOptimizations() {\n") - g.w.writeIndent("return _f.mem.memoizeNormExpr(memoExpr(%s))\n", varName) + g.w.writeIndent("return _f.mem.MemoizeNormExpr(memo.Expr(%s))\n", varName) g.w.unnest("}\n\n") found := false @@ -94,7 +95,7 @@ func (g *factoryGen) genConstructFuncs() { g.w.newline() } - g.w.writeIndent("return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(%s)))\n", varName) + g.w.writeIndent("return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(%s)))\n", varName) g.w.unnest("}\n\n") } } @@ -119,7 +120,7 @@ func (g *factoryGen) genRule(rule *lang.RuleExpr) { g.w.writeIndent("_group = ") g.genNestedExpr(rule.Replace) g.w.newline() - g.w.writeIndent("_f.mem.addAltFingerprint(%s.fingerprint(), _group)\n", varName) + g.w.writeIndent("_f.mem.AddAltFingerprint(%s.Fingerprint(), _group)\n", varName) g.w.writeIndent("return _group\n") g.w.unnestToMarker(marker, "}\n") @@ -138,10 +139,10 @@ func (g *factoryGen) genRule(rule *lang.RuleExpr) { // expression that is bound to the expression that is currently being matched // against. For example: // -// for i, _listArg := range _f.mem.lookupList(projections) { -// _innerJoinExpr := _f.mem.lookupNormExpr(_listArg).asInnerJoin() +// for i, _listArg := range _f.mem.LookupList(projections) { +// _innerJoinExpr := _f.mem.NormExpr(_listArg).AsInnerJoin() // if _innerJoinExpr != nil { -// _selectExpr := _f.mem.lookupNormExpr(_innerJoinExpr.left()).asSelect() +// _selectExpr := _f.mem.NormExpr(_innerJoinExpr.left()).AsSelect() // ... // } // } @@ -194,9 +195,9 @@ func (g *factoryGen) genMatch(match lang.Expr, contextName string, noMatch bool) case *lang.StringExpr: if noMatch { - g.w.nest("if %s != m.mem.internPrivate(%s) {\n", contextName, t) + g.w.nest("if %s != m.mem.InternPrivate(%s) {\n", contextName, t) } else { - g.w.nest("if %s == m.mem.internPrivate(%s) {\n", contextName, t) + g.w.nest("if %s == m.mem.InternPrivate(%s) {\n", contextName, t) } case *lang.MatchAnyExpr: @@ -208,7 +209,7 @@ func (g *factoryGen) genMatch(match lang.Expr, contextName string, noMatch bool) if noMatch { panic("noMatch is not yet supported by the list match any op") } - g.w.nest("for _, _item := range _f.mem.lookupList(%s) {\n", contextName) + g.w.nest("for _, _item := range _f.mem.LookupList(%s) {\n", contextName) g.genMatch(t.MatchItem, "_item", noMatch) case *lang.MatchListFirstExpr: @@ -216,7 +217,7 @@ func (g *factoryGen) genMatch(match lang.Expr, contextName string, noMatch bool) panic("noMatch is not yet supported by the list match first op") } g.w.nest("if %s.Length > 0 {\n", contextName) - g.w.writeIndent("_item := _f.mem.lookupList(%s)[0]\n", contextName) + g.w.writeIndent("_item := _f.mem.LookupList(%s)[0]\n", contextName) g.genMatch(t.MatchItem, "_item", noMatch) case *lang.MatchListLastExpr: @@ -224,7 +225,7 @@ func (g *factoryGen) genMatch(match lang.Expr, contextName string, noMatch bool) panic("noMatch is not yet supported by the list match last op") } g.w.nest("if %s.Length > 0 {\n", contextName) - g.w.writeIndent("_item := _f.mem.lookupList(%s)[%s.Length-1]\n", contextName, contextName) + g.w.writeIndent("_item := _f.mem.LookupList(%s)[%s.Length-1]\n", contextName, contextName) g.genMatch(t.MatchItem, "_item", noMatch) case *lang.MatchListSingleExpr: @@ -235,7 +236,7 @@ func (g *factoryGen) genMatch(match lang.Expr, contextName string, noMatch bool) g.w.nest("if %s.Length != 1 {\n", contextName) } else { g.w.nest("if %s.Length == 1 {\n", contextName) - g.w.writeIndent("_item := _f.mem.lookupList(%s)[0]\n", contextName) + g.w.writeIndent("_item := _f.mem.LookupList(%s)[0]\n", contextName) g.genMatch(t.MatchItem, "_item", noMatch) } @@ -334,14 +335,14 @@ func (g *factoryGen) genMatchNameAndChildren( // genConstantMatch is called when the MatchExpr has only one define name // to match (i.e. no tags). In this case, the type of the expression to match // is statically known, and so the generated code can directly manipulate -// strongly-typed expression structs (e.g. selectExpr, innerJoinExpr, etc). +// strongly-typed expression structs (e.g. SelectExpr, InnerJoinExpr, etc). func (g *factoryGen) genConstantMatch( match *lang.MatchExpr, opName string, contextName string, noMatch bool, ) { varName := g.uniquifier.makeUnique(fmt.Sprintf("_%s", unTitle(opName))) // Match expression name. - g.w.writeIndent("%s := _f.mem.lookupNormExpr(%s).as%s()\n", varName, contextName, opName) + g.w.writeIndent("%s := _f.mem.NormExpr(%s).As%s()\n", varName, contextName, opName) if noMatch { g.w.nest("if %s == nil {\n", varName) @@ -357,7 +358,7 @@ func (g *factoryGen) genConstantMatch( // operator. If there are fewer arguments than there are children, then // only the first N children need to be matched. for index, matchArg := range match.Args { - fieldName := unTitle(string(g.compiled.LookupDefine(opName).Fields[index].Name)) + fieldName := g.compiled.LookupDefine(opName).Fields[index].Name g.genMatch(matchArg, fmt.Sprintf("%s.%s()", varName, fieldName), false /* noMatch */) } } @@ -370,7 +371,7 @@ func (g *factoryGen) genDynamicMatch( ) { // Match expression name. normName := g.uniquifier.makeUnique("_norm") - g.w.writeIndent("%s := _f.mem.lookupNormExpr(%s)\n", normName, contextName) + g.w.writeIndent("%s := _f.mem.NormExpr(%s)\n", normName, contextName) var buf bytes.Buffer for i, name := range names { @@ -381,10 +382,10 @@ func (g *factoryGen) genDynamicMatch( define := g.compiled.LookupDefine(string(name)) if define != nil { // Match operator name. - fmt.Fprintf(&buf, "%s.op == opt.%sOp", normName, name) + fmt.Fprintf(&buf, "%s.Operator() == opt.%sOp", normName, name) } else { // Match tag name. - fmt.Fprintf(&buf, "%s.is%s()", normName, name) + fmt.Fprintf(&buf, "%s.Is%s()", normName, name) } } @@ -403,7 +404,7 @@ func (g *factoryGen) genDynamicMatch( // operator. If there are fewer arguments than there are children, then // only the first N children need to be matched. for index, matchArg := range match.Args { - childGroup := fmt.Sprintf("%s.childGroup(_f.mem, %d)", normName, index) + childGroup := fmt.Sprintf("%s.ChildGroup(_f.mem, %d)", normName, index) g.genMatch(matchArg, childGroup, false /* noMatch */) } } @@ -437,7 +438,7 @@ func (g *factoryGen) genNestedExpr(e lang.Expr) { // Handle OpName function that couldn't be statically resolved by // looking up op name at runtime. ref := t.Args[0].(*lang.RefExpr) - g.w.write("_f.mem.lookupNormExpr(%s).op", ref.Label) + g.w.write("_f.mem.NormExpr(%s).Operator()", ref.Label) } else { funcName := unTitle(string(t.Name)) g.w.write("_f.%s(", funcName) @@ -455,7 +456,7 @@ func (g *factoryGen) genNestedExpr(e lang.Expr) { case *lang.StringExpr: // Literal string expressions construct DString datums. - g.w.write("m.mem.internPrivate(tree.NewDString(%s))", t) + g.w.write("m.mem.InternPrivate(tree.NewDString(%s))", t) case *lang.NameExpr: // OpName literal expressions construct an op identifier like SelectOp, @@ -486,14 +487,14 @@ func (g *factoryGen) genConstruct(construct *lang.ConstructExpr) { // Construct expression based on dynamic type of referenced op. ref := t.Args[0].(*lang.RefExpr) g.w.write( - "_f.DynamicConstruct(_f.mem.lookupNormExpr(%s).op, opt.DynamicOperands{", + "_f.DynamicConstruct(_f.mem.NormExpr(%s).Operator(), DynamicOperands{", ref.Label, ) for i, arg := range construct.Args { if i != 0 { g.w.write(", ") } - g.w.write("opt.DynamicID(") + g.w.write("DynamicID(") g.genNestedExpr(arg) g.w.write(")") } @@ -506,7 +507,7 @@ func (g *factoryGen) genConstruct(construct *lang.ConstructExpr) { // genConstructList generates code to construct an interned list of items. func (g *factoryGen) genConstructList(list *lang.ConstructListExpr) { - g.w.write("_f.mem.internList([]opt.GroupID{") + g.w.write("_f.mem.InternList([]memo.GroupID{") for i, item := range list.Items { if i != 0 { g.w.write(", ") @@ -522,7 +523,7 @@ func (g *factoryGen) genConstructList(list *lang.ConstructListExpr) { func (g *factoryGen) genDynamicConstructLookup() { defines := filterEnforcerDefines(g.compiled.Defines) - funcType := "func(f *Factory, operands opt.DynamicOperands) opt.GroupID" + funcType := "func(f *Factory, operands DynamicOperands) memo.GroupID" g.w.writeIndent("type dynConstructLookupFunc %s\n", funcType) g.w.writeIndent("var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc\n\n") @@ -546,9 +547,9 @@ func (g *factoryGen) genDynamicConstructLookup() { if isListType(string(field.Type)) { g.w.write("operands[%d].ListID()", i) } else if isPrivateType(string(field.Type)) { - g.w.write("opt.PrivateID(operands[%d])", i) + g.w.write("memo.PrivateID(operands[%d])", i) } else { - g.w.write("opt.GroupID(operands[%d])", i) + g.w.write("memo.GroupID(operands[%d])", i) } } g.w.write(")\n") @@ -558,8 +559,8 @@ func (g *factoryGen) genDynamicConstructLookup() { g.w.unnest("}\n\n") - args := "op opt.Operator, operands opt.DynamicOperands" - g.w.nest("func (f *Factory) DynamicConstruct(%s) opt.GroupID {\n", args) + args := "op opt.Operator, operands DynamicOperands" + g.w.nest("func (f *Factory) DynamicConstruct(%s) memo.GroupID {\n", args) g.w.writeIndent("return dynConstructLookup[op](f, operands)\n") g.w.unnest("}\n") } diff --git a/pkg/sql/opt/optgen/cmd/optgen/testdata/exprs b/pkg/sql/opt/optgen/cmd/optgen/testdata/exprs index 7066416cd6f8..5d29b953dc70 100644 --- a/pkg/sql/opt/optgen/cmd/optgen/testdata/exprs +++ b/pkg/sql/opt/optgen/cmd/optgen/testdata/exprs @@ -11,7 +11,7 @@ define FuncCall { ---- // Code generated by optgen; [omitted] -package xform +package memo import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" @@ -22,33 +22,33 @@ var opLayoutTable = [...]opLayout{ opt.FuncCallOp: makeOpLayout(1 /*base*/, 2 /*list*/, 4 /*priv*/), } -type funcCallExpr memoExpr +type FuncCallExpr Expr -func makeFuncCallExpr(name opt.GroupID, args opt.ListID, def opt.PrivateID) funcCallExpr { - return funcCallExpr{op: opt.FuncCallOp, state: exprState{uint32(name), args.Offset, args.Length, uint32(def)}} +func MakeFuncCallExpr(name GroupID, args ListID, def PrivateID) FuncCallExpr { + return FuncCallExpr{op: opt.FuncCallOp, state: exprState{uint32(name), args.Offset, args.Length, uint32(def)}} } -func (e *funcCallExpr) name() opt.GroupID { - return opt.GroupID(e.state[0]) +func (e *FuncCallExpr) Name() GroupID { + return GroupID(e.state[0]) } -func (e *funcCallExpr) args() opt.ListID { - return opt.ListID{Offset: e.state[1], Length: e.state[2]} +func (e *FuncCallExpr) Args() ListID { + return ListID{Offset: e.state[1], Length: e.state[2]} } -func (e *funcCallExpr) def() opt.PrivateID { - return opt.PrivateID(e.state[3]) +func (e *FuncCallExpr) Def() PrivateID { + return PrivateID(e.state[3]) } -func (e *funcCallExpr) fingerprint() fingerprint { - return fingerprint(*e) +func (e *FuncCallExpr) Fingerprint() Fingerprint { + return Fingerprint(*e) } -func (m *memoExpr) asFuncCall() *funcCallExpr { - if m.op != opt.FuncCallOp { +func (e *Expr) AsFuncCall() *FuncCallExpr { + if e.op != opt.FuncCallOp { return nil } - return (*funcCallExpr)(m) + return (*FuncCallExpr)(e) } ---- ---- @@ -65,7 +65,7 @@ define Sort { ---- // Code generated by optgen; [omitted] -package xform +package memo import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" @@ -86,8 +86,8 @@ func (ev ExprView) IsEnforcer() bool { return isEnforcerLookup[ev.op] } -func (me *memoExpr) isEnforcer() bool { - return isEnforcerLookup[me.op] +func (e *Expr) IsEnforcer() bool { + return isEnforcerLookup[e.op] } ---- ---- diff --git a/pkg/sql/opt/optgen/cmd/optgen/testdata/factory b/pkg/sql/opt/optgen/cmd/optgen/testdata/factory index 6d7f64a1d578..18ffaa39eedc 100644 --- a/pkg/sql/opt/optgen/cmd/optgen/testdata/factory +++ b/pkg/sql/opt/optgen/cmd/optgen/testdata/factory @@ -27,68 +27,69 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructNot constructs an expression for the Not operator. // Not is a negate operator. func (_f *Factory) ConstructNot( - input opt.GroupID, -) opt.GroupID { - _notExpr := makeNotExpr(input) - _group := _f.mem.lookupGroupByFingerprint(_notExpr.fingerprint()) + input memo.GroupID, +) memo.GroupID { + _notExpr := memo.MakeNotExpr(input) + _group := _f.mem.GroupByFingerprint(_notExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notExpr))) } // ConstructFuncCall constructs an expression for the FuncCall operator. func (_f *Factory) ConstructFuncCall( - name opt.GroupID, - args opt.ListID, - def opt.PrivateID, -) opt.GroupID { - _funcCallExpr := makeFuncCallExpr(name, args, def) - _group := _f.mem.lookupGroupByFingerprint(_funcCallExpr.fingerprint()) + name memo.GroupID, + args memo.ListID, + def memo.PrivateID, +) memo.GroupID { + _funcCallExpr := memo.MakeFuncCallExpr(name, args, def) + _group := _f.mem.GroupByFingerprint(_funcCallExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_funcCallExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_funcCallExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_funcCallExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_funcCallExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // NotOp - dynConstructLookup[opt.NotOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNot(opt.GroupID(operands[0])) + dynConstructLookup[opt.NotOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNot(memo.GroupID(operands[0])) } // FuncCallOp - dynConstructLookup[opt.FuncCallOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFuncCall(opt.GroupID(operands[0]), operands[1].ListID(), opt.PrivateID(operands[2])) + dynConstructLookup[opt.FuncCallOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFuncCall(memo.GroupID(operands[0]), operands[1].ListID(), memo.PrivateID(operands[2])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -113,21 +114,22 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructInnerJoin constructs an expression for the InnerJoin operator. func (_f *Factory) ConstructInnerJoin( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _innerJoinExpr := makeInnerJoinExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_innerJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _innerJoinExpr := memo.MakeInnerJoinExpr(left, right) + _group := _f.mem.GroupByFingerprint(_innerJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_innerJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_innerJoinExpr)) } // [CommuteJoin] @@ -136,31 +138,31 @@ func (_f *Factory) ConstructInnerJoin( s := right _f.o.reportOptimization(CommuteJoin) _group = _f.ConstructInnerJoin(s, r) - _f.mem.addAltFingerprint(_innerJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinExpr.Fingerprint(), _group) return _group } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_innerJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_innerJoinExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // InnerJoinOp - dynConstructLookup[opt.InnerJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructInnerJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.InnerJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructInnerJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -215,39 +217,40 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructEq constructs an expression for the Eq operator. func (_f *Factory) ConstructEq( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _eqExpr := makeEqExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_eqExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _eqExpr := memo.MakeEqExpr(left, right) + _group := _f.mem.GroupByFingerprint(_eqExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_eqExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_eqExpr)) } // [NormalizeVarPlus] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() - _const := _f.mem.lookupNormExpr(_plus.left()).asConst() + leftLeft := _plus.Left() + _const := _f.mem.NormExpr(_plus.Left()).AsConst() if _const == nil { - leftRight := _plus.right() - _const2 := _f.mem.lookupNormExpr(_plus.right()).asConst() + leftRight := _plus.Right() + _const2 := _f.mem.NormExpr(_plus.Right()).AsConst() if _const2 != nil { - _const3 := _f.mem.lookupNormExpr(right).asConst() + _const3 := _f.mem.NormExpr(right).AsConst() if _const3 != nil { if !_f.isInvalidBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeVarPlus) _group = _f.ConstructEq(leftLeft, _f.constructBinary(opt.MinusOp, right, leftRight)) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -256,40 +259,40 @@ func (_f *Factory) ConstructEq( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_eqExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_eqExpr))) } // ConstructLt constructs an expression for the Lt operator. func (_f *Factory) ConstructLt( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _ltExpr := makeLtExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_ltExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _ltExpr := memo.MakeLtExpr(left, right) + _group := _f.mem.GroupByFingerprint(_ltExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_ltExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_ltExpr)) } // [NormalizeVarPlus] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() - _const := _f.mem.lookupNormExpr(_plus.left()).asConst() + leftLeft := _plus.Left() + _const := _f.mem.NormExpr(_plus.Left()).AsConst() if _const == nil { - leftRight := _plus.right() - _const2 := _f.mem.lookupNormExpr(_plus.right()).asConst() + leftRight := _plus.Right() + _const2 := _f.mem.NormExpr(_plus.Right()).AsConst() if _const2 != nil { - _const3 := _f.mem.lookupNormExpr(right).asConst() + _const3 := _f.mem.NormExpr(right).AsConst() if _const3 != nil { if !_f.isInvalidBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeVarPlus) _group = _f.ConstructLt(leftLeft, _f.constructBinary(opt.MinusOp, right, leftRight)) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } @@ -298,98 +301,98 @@ func (_f *Factory) ConstructLt( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_ltExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_ltExpr))) } // ConstructPlus constructs an expression for the Plus operator. func (_f *Factory) ConstructPlus( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _plusExpr := makePlusExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_plusExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _plusExpr := memo.MakePlusExpr(left, right) + _group := _f.mem.GroupByFingerprint(_plusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_plusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_plusExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_plusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_plusExpr))) } // ConstructMinus constructs an expression for the Minus operator. func (_f *Factory) ConstructMinus( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _minusExpr := makeMinusExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_minusExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _minusExpr := memo.MakeMinusExpr(left, right) + _group := _f.mem.GroupByFingerprint(_minusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_minusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_minusExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_minusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_minusExpr))) } // ConstructConst constructs an expression for the Const operator. -func (_f *Factory) ConstructConst() opt.GroupID { - _constExpr := makeConstExpr() - _group := _f.mem.lookupGroupByFingerprint(_constExpr.fingerprint()) +func (_f *Factory) ConstructConst() memo.GroupID { + _constExpr := memo.MakeConstExpr() + _group := _f.mem.GroupByFingerprint(_constExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_constExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_constExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_constExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_constExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // EqOp - dynConstructLookup[opt.EqOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructEq(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.EqOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructEq(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // LtOp - dynConstructLookup[opt.LtOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLt(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.LtOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLt(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // PlusOp - dynConstructLookup[opt.PlusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructPlus(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.PlusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructPlus(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // MinusOp - dynConstructLookup[opt.MinusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructMinus(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.MinusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructMinus(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ConstOp - dynConstructLookup[opt.ConstOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.ConstOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructConst() } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -421,34 +424,35 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructFunc constructs an expression for the Func operator. func (_f *Factory) ConstructFunc( - name opt.GroupID, - args opt.ListID, -) opt.GroupID { - _funcExpr := makeFuncExpr(name, args) - _group := _f.mem.lookupGroupByFingerprint(_funcExpr.fingerprint()) + name memo.GroupID, + args memo.ListID, +) memo.GroupID { + _funcExpr := memo.MakeFuncExpr(name, args) + _group := _f.mem.GroupByFingerprint(_funcExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_funcExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_funcExpr)) } // [Concat] { - if name == m.mem.internPrivate("concat") { - for _, _item := range _f.mem.lookupList(args) { + if name == m.mem.InternPrivate("concat") { + for _, _item := range _f.mem.LookupList(args) { item := _item - _variable := _f.mem.lookupNormExpr(_item).asVariable() + _variable := _f.mem.NormExpr(_item).AsVariable() if _variable == nil { if _f.isEmpty(item) { _f.o.reportOptimization(Concat) - _group = _f.ConstructFunc(m.mem.internPrivate(tree.NewDString("concat")), _f.removeListItem(args, item)) - _f.mem.addAltFingerprint(_funcExpr.fingerprint(), _group) + _group = _f.ConstructFunc(m.mem.InternPrivate(tree.NewDString("concat")), _f.removeListItem(args, item)) + _f.mem.AddAltFingerprint(_funcExpr.Fingerprint(), _group) return _group } } @@ -456,49 +460,49 @@ func (_f *Factory) ConstructFunc( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_funcExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_funcExpr))) } // ConstructVariable constructs an expression for the Variable operator. func (_f *Factory) ConstructVariable( - col opt.PrivateID, -) opt.GroupID { - _variableExpr := makeVariableExpr(col) - _group := _f.mem.lookupGroupByFingerprint(_variableExpr.fingerprint()) + col memo.PrivateID, +) memo.GroupID { + _variableExpr := memo.MakeVariableExpr(col) + _group := _f.mem.GroupByFingerprint(_variableExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_variableExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_variableExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_variableExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_variableExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // FuncOp - dynConstructLookup[opt.FuncOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFunc(opt.GroupID(operands[0]), operands[1].ListID()) + dynConstructLookup[opt.FuncOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFunc(memo.GroupID(operands[0]), operands[1].ListID()) } // VariableOp - dynConstructLookup[opt.VariableOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructVariable(opt.PrivateID(operands[0])) + dynConstructLookup[opt.VariableOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructVariable(memo.PrivateID(operands[0])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -552,163 +556,164 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructSelect constructs an expression for the Select operator. func (_f *Factory) ConstructSelect( - input opt.GroupID, - filter opt.GroupID, -) opt.GroupID { - _selectExpr := makeSelectExpr(input, filter) - _group := _f.mem.lookupGroupByFingerprint(_selectExpr.fingerprint()) + input memo.GroupID, + filter memo.GroupID, +) memo.GroupID { + _selectExpr := memo.MakeSelectExpr(input, filter) + _group := _f.mem.GroupByFingerprint(_selectExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_selectExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_selectExpr)) } // [Test] { _match := false - _norm := _f.mem.lookupNormExpr(input) - if _norm.isJoin() || _norm.op == opt.UnionOp { - r := _norm.childGroup(_f.mem, 0) - s := _norm.childGroup(_f.mem, 1) + _norm := _f.mem.NormExpr(input) + if _norm.IsJoin() || _norm.Operator() == opt.UnionOp { + r := _norm.ChildGroup(_f.mem, 0) + s := _norm.ChildGroup(_f.mem, 1) _match = true } if !_match { args := filter - for _, _item := range _f.mem.lookupList(filter) { + for _, _item := range _f.mem.LookupList(filter) { item := _item - _norm2 := _f.mem.lookupNormExpr(_item) - if _norm2.isJoin() { - t := _norm2.childGroup(_f.mem, 0) - u := _norm2.childGroup(_f.mem, 1) + _norm2 := _f.mem.NormExpr(_item) + if _norm2.IsJoin() { + t := _norm2.ChildGroup(_f.mem, 0) + u := _norm2.ChildGroup(_f.mem, 1) _f.o.reportOptimization(Test) - _group = _f.DynamicConstruct(_f.mem.lookupNormExpr(item).op, opt.DynamicOperands{opt.DynamicID(_f.ConstructSelect(t, u)), opt.DynamicID(_f.custom(item, opt.SelectOp))}) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _group = _f.DynamicConstruct(_f.mem.NormExpr(item).Operator(), DynamicOperands{DynamicID(_f.ConstructSelect(t, u)), DynamicID(_f.custom(item, opt.SelectOp))}) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_selectExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_selectExpr))) } // ConstructInnerJoin constructs an expression for the InnerJoin operator. func (_f *Factory) ConstructInnerJoin( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _innerJoinExpr := makeInnerJoinExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_innerJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _innerJoinExpr := memo.MakeInnerJoinExpr(left, right) + _group := _f.mem.GroupByFingerprint(_innerJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_innerJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_innerJoinExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_innerJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_innerJoinExpr))) } // ConstructFullJoin constructs an expression for the FullJoin operator. func (_f *Factory) ConstructFullJoin( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _fullJoinExpr := makeFullJoinExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_fullJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _fullJoinExpr := memo.MakeFullJoinExpr(left, right) + _group := _f.mem.GroupByFingerprint(_fullJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fullJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fullJoinExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fullJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fullJoinExpr))) } // ConstructUnion constructs an expression for the Union operator. func (_f *Factory) ConstructUnion( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _unionExpr := makeUnionExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_unionExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _unionExpr := memo.MakeUnionExpr(left, right) + _group := _f.mem.GroupByFingerprint(_unionExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_unionExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_unionExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_unionExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_unionExpr))) } // ConstructAnd constructs an expression for the And operator. func (_f *Factory) ConstructAnd( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _andExpr := makeAndExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_andExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _andExpr := memo.MakeAndExpr(left, right) + _group := _f.mem.GroupByFingerprint(_andExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_andExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_andExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_andExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_andExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // SelectOp - dynConstructLookup[opt.SelectOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructSelect(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.SelectOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructSelect(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // InnerJoinOp - dynConstructLookup[opt.InnerJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructInnerJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.InnerJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructInnerJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FullJoinOp - dynConstructLookup[opt.FullJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFullJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.FullJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFullJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // UnionOp - dynConstructLookup[opt.UnionOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructUnion(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.UnionOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructUnion(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // AndOp - dynConstructLookup[opt.AndOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructAnd(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.AndOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructAnd(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -746,48 +751,49 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructList constructs an expression for the List operator. func (_f *Factory) ConstructList( - items opt.ListID, -) opt.GroupID { - _listExpr := makeListExpr(items) - _group := _f.mem.lookupGroupByFingerprint(_listExpr.fingerprint()) + items memo.ListID, +) memo.GroupID { + _listExpr := memo.MakeListExpr(items) + _group := _f.mem.GroupByFingerprint(_listExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_listExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_listExpr)) } // [List] { any := items - for _, _item := range _f.mem.lookupList(items) { - _list := _f.mem.lookupNormExpr(_item).asList() + for _, _item := range _f.mem.LookupList(items) { + _list := _f.mem.NormExpr(_item).AsList() if _list != nil { - first := _list.items() - if _list.items().Length > 0 { - _item := _f.mem.lookupList(_list.items())[0] - _list2 := _f.mem.lookupNormExpr(_item).asList() + first := _list.Items() + if _list.Items().Length > 0 { + _item := _f.mem.LookupList(_list.Items())[0] + _list2 := _f.mem.NormExpr(_item).AsList() if _list2 != nil { - last := _list2.items() - if _list2.items().Length > 0 { - _item := _f.mem.lookupList(_list2.items())[_list2.items().Length-1] - _list3 := _f.mem.lookupNormExpr(_item).asList() + last := _list2.Items() + if _list2.Items().Length > 0 { + _item := _f.mem.LookupList(_list2.Items())[_list2.Items().Length-1] + _list3 := _f.mem.NormExpr(_item).AsList() if _list3 != nil { - single := _list3.items() - if _list3.items().Length == 1 { - _item := _f.mem.lookupList(_list3.items())[0] - _list4 := _f.mem.lookupNormExpr(_item).asList() + single := _list3.Items() + if _list3.Items().Length == 1 { + _item := _f.mem.LookupList(_list3.Items())[0] + _list4 := _f.mem.NormExpr(_item).AsList() if _list4 != nil { - empty := _list4.items() - if _list4.items().Length == 0 { + empty := _list4.Items() + if _list4.Items().Length == 0 { _f.o.reportOptimization(List) _group = _f.construct(any, first, last, single, empty) - _f.mem.addAltFingerprint(_listExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_listExpr.Fingerprint(), _group) return _group } } @@ -800,27 +806,27 @@ func (_f *Factory) ConstructList( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_listExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_listExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // ListOp - dynConstructLookup[opt.ListOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.ListOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructList(operands[0].ListID()) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -848,53 +854,54 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructJoin constructs an expression for the Join operator. func (_f *Factory) ConstructJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _joinExpr := makeJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_joinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _joinExpr := memo.MakeJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_joinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_joinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_joinExpr)) } // [ConstructList] { _f.o.reportOptimization(ConstructList) - _group = _f.construct(_f.mem.internList([]opt.GroupID{}), _f.mem.internList([]opt.GroupID{left}), _f.mem.internList([]opt.GroupID{left, right}), _f.mem.internList([]opt.GroupID{_f.mem.internList([]opt.GroupID{on})})) - _f.mem.addAltFingerprint(_joinExpr.fingerprint(), _group) + _group = _f.construct(_f.mem.InternList([]memo.GroupID{}), _f.mem.InternList([]memo.GroupID{left}), _f.mem.InternList([]memo.GroupID{left, right}), _f.mem.InternList([]memo.GroupID{_f.mem.InternList([]memo.GroupID{on})})) + _f.mem.AddAltFingerprint(_joinExpr.Fingerprint(), _group) return _group } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_joinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_joinExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // JoinOp - dynConstructLookup[opt.JoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.JoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -927,51 +934,52 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructList constructs an expression for the List operator. func (_f *Factory) ConstructList( - items opt.ListID, -) opt.GroupID { - _listExpr := makeListExpr(items) - _group := _f.mem.lookupGroupByFingerprint(_listExpr.fingerprint()) + items memo.ListID, +) memo.GroupID { + _listExpr := memo.MakeListExpr(items) + _group := _f.mem.GroupByFingerprint(_listExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_listExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_listExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_listExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_listExpr))) } // ConstructOp constructs an expression for the Op operator. func (_f *Factory) ConstructOp( - empty opt.GroupID, - single opt.GroupID, -) opt.GroupID { - _opExpr := makeOpExpr(empty, single) - _group := _f.mem.lookupGroupByFingerprint(_opExpr.fingerprint()) + empty memo.GroupID, + single memo.GroupID, +) memo.GroupID { + _opExpr := memo.MakeOpExpr(empty, single) + _group := _f.mem.GroupByFingerprint(_opExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_opExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_opExpr)) } // [ListNot] { - _list := _f.mem.lookupNormExpr(empty).asList() + _list := _f.mem.NormExpr(empty).AsList() if _list != nil { - if _list.items().Length != 0 { - _list2 := _f.mem.lookupNormExpr(single).asList() + if _list.Items().Length != 0 { + _list2 := _f.mem.NormExpr(single).AsList() if _list2 != nil { - if _list2.items().Length != 1 { + if _list2.Items().Length != 1 { _f.o.reportOptimization(ListNot) _group = _f.ConstructOp(empty, single) - _f.mem.addAltFingerprint(_opExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_opExpr.Fingerprint(), _group) return _group } } @@ -979,32 +987,32 @@ func (_f *Factory) ConstructOp( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_opExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_opExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // ListOp - dynConstructLookup[opt.ListOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.ListOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructList(operands[0].ListID()) } // OpOp - dynConstructLookup[opt.OpOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructOp(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.OpOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructOp(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -1048,37 +1056,38 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructEq constructs an expression for the Eq operator. func (_f *Factory) ConstructEq( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _eqExpr := makeEqExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_eqExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _eqExpr := memo.MakeEqExpr(left, right) + _group := _f.mem.GroupByFingerprint(_eqExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_eqExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_eqExpr)) } // [Constant] { - _eq := _f.mem.lookupNormExpr(left).asEq() + _eq := _f.mem.NormExpr(left).AsEq() if _eq != nil { - _eq2 := _f.mem.lookupNormExpr(_eq.left()).asEq() + _eq2 := _f.mem.NormExpr(_eq.Left()).AsEq() if _eq2 != nil { - _eq3 := _f.mem.lookupNormExpr(_eq.right()).asEq() + _eq3 := _f.mem.NormExpr(_eq.Right()).AsEq() if _eq3 == nil { _match := false - _eq4 := _f.mem.lookupNormExpr(right).asEq() + _eq4 := _f.mem.NormExpr(right).AsEq() if _eq4 != nil { - _eq5 := _f.mem.lookupNormExpr(_eq4.left()).asEq() + _eq5 := _f.mem.NormExpr(_eq4.Left()).AsEq() if _eq5 != nil { - _eq6 := _f.mem.lookupNormExpr(_eq4.right()).asEq() + _eq6 := _f.mem.NormExpr(_eq4.Right()).AsEq() if _eq6 == nil { _match = true } @@ -1087,8 +1096,8 @@ func (_f *Factory) ConstructEq( if !_match { _f.o.reportOptimization(Constant) - _group = m.mem.internPrivate(tree.NewDString("foo")) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _group = m.mem.InternPrivate(tree.NewDString("foo")) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -1096,39 +1105,39 @@ func (_f *Factory) ConstructEq( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_eqExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_eqExpr))) } // ConstructNe constructs an expression for the Ne operator. func (_f *Factory) ConstructNe( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _neExpr := makeNeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_neExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _neExpr := memo.MakeNeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_neExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_neExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_neExpr)) } // [Dynamic] { - _norm := _f.mem.lookupNormExpr(left) - if _norm.op == opt.EqOp || _norm.op == opt.NeOp { - _norm2 := _f.mem.lookupNormExpr(_norm.childGroup(_f.mem, 0)) - if _norm2.op == opt.EqOp || _norm2.op == opt.NeOp { - _norm3 := _f.mem.lookupNormExpr(_norm.childGroup(_f.mem, 1)) - if !(_norm3.op == opt.EqOp || _norm3.op == opt.NeOp) { + _norm := _f.mem.NormExpr(left) + if _norm.Operator() == opt.EqOp || _norm.Operator() == opt.NeOp { + _norm2 := _f.mem.NormExpr(_norm.ChildGroup(_f.mem, 0)) + if _norm2.Operator() == opt.EqOp || _norm2.Operator() == opt.NeOp { + _norm3 := _f.mem.NormExpr(_norm.ChildGroup(_f.mem, 1)) + if !(_norm3.Operator() == opt.EqOp || _norm3.Operator() == opt.NeOp) { _match := false - _norm4 := _f.mem.lookupNormExpr(right) - if _norm4.op == opt.EqOp || _norm4.op == opt.NeOp { - _norm5 := _f.mem.lookupNormExpr(_norm4.childGroup(_f.mem, 0)) - if _norm5.op == opt.EqOp || _norm5.op == opt.NeOp { - _norm6 := _f.mem.lookupNormExpr(_norm4.childGroup(_f.mem, 1)) - if !(_norm6.op == opt.EqOp || _norm6.op == opt.NeOp) { + _norm4 := _f.mem.NormExpr(right) + if _norm4.Operator() == opt.EqOp || _norm4.Operator() == opt.NeOp { + _norm5 := _f.mem.NormExpr(_norm4.ChildGroup(_f.mem, 0)) + if _norm5.Operator() == opt.EqOp || _norm5.Operator() == opt.NeOp { + _norm6 := _f.mem.NormExpr(_norm4.ChildGroup(_f.mem, 1)) + if !(_norm6.Operator() == opt.EqOp || _norm6.Operator() == opt.NeOp) { _match = true } } @@ -1136,8 +1145,8 @@ func (_f *Factory) ConstructNe( if !_match { _f.o.reportOptimization(Dynamic) - _group = m.mem.internPrivate(tree.NewDString("foo")) - _f.mem.addAltFingerprint(_neExpr.fingerprint(), _group) + _group = m.mem.InternPrivate(tree.NewDString("foo")) + _f.mem.AddAltFingerprint(_neExpr.Fingerprint(), _group) return _group } } @@ -1145,32 +1154,32 @@ func (_f *Factory) ConstructNe( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_neExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_neExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // EqOp - dynConstructLookup[opt.EqOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructEq(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.EqOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructEq(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NeOp - dynConstructLookup[opt.NeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNe(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNe(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -1209,113 +1218,114 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructPlus constructs an expression for the Plus operator. func (_f *Factory) ConstructPlus( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _plusExpr := makePlusExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_plusExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _plusExpr := memo.MakePlusExpr(left, right) + _group := _f.mem.GroupByFingerprint(_plusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_plusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_plusExpr)) } // [Fold] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { - if !_f.hasNullableArgs(opt.PlusOp, _f.anotherFunc(_f.mem.lookupNormExpr(left).op)) { + if !_f.hasNullableArgs(opt.PlusOp, _f.anotherFunc(_f.mem.NormExpr(left).Operator())) { _f.o.reportOptimization(Fold) _group = _f.ConstructNull() - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_plusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_plusExpr))) } // ConstructMinus constructs an expression for the Minus operator. func (_f *Factory) ConstructMinus( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _minusExpr := makeMinusExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_minusExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _minusExpr := memo.MakeMinusExpr(left, right) + _group := _f.mem.GroupByFingerprint(_minusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_minusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_minusExpr)) } // [Fold] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { - if !_f.hasNullableArgs(opt.MinusOp, _f.anotherFunc(_f.mem.lookupNormExpr(left).op)) { + if !_f.hasNullableArgs(opt.MinusOp, _f.anotherFunc(_f.mem.NormExpr(left).Operator())) { _f.o.reportOptimization(Fold) _group = _f.ConstructNull() - _f.mem.addAltFingerprint(_minusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_minusExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_minusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_minusExpr))) } // ConstructNull constructs an expression for the Null operator. -func (_f *Factory) ConstructNull() opt.GroupID { - _nullExpr := makeNullExpr() - _group := _f.mem.lookupGroupByFingerprint(_nullExpr.fingerprint()) +func (_f *Factory) ConstructNull() memo.GroupID { + _nullExpr := memo.MakeNullExpr() + _group := _f.mem.GroupByFingerprint(_nullExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_nullExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_nullExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_nullExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_nullExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // PlusOp - dynConstructLookup[opt.PlusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructPlus(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.PlusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructPlus(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // MinusOp - dynConstructLookup[opt.MinusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructMinus(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.MinusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructMinus(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NullOp - dynConstructLookup[opt.NullOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.NullOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructNull() } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- @@ -1359,130 +1369,131 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructLt constructs an expression for the Lt operator. func (_f *Factory) ConstructLt( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _ltExpr := makeLtExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_ltExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _ltExpr := memo.MakeLtExpr(left, right) + _group := _f.mem.GroupByFingerprint(_ltExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_ltExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_ltExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_ltExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_ltExpr))) } // ConstructGt constructs an expression for the Gt operator. func (_f *Factory) ConstructGt( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _gtExpr := makeGtExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_gtExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _gtExpr := memo.MakeGtExpr(left, right) + _group := _f.mem.GroupByFingerprint(_gtExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_gtExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_gtExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_gtExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_gtExpr))) } // ConstructContains constructs an expression for the Contains operator. func (_f *Factory) ConstructContains( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _containsExpr := makeContainsExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_containsExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _containsExpr := memo.MakeContainsExpr(left, right) + _group := _f.mem.GroupByFingerprint(_containsExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_containsExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_containsExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_containsExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_containsExpr))) } // ConstructNot constructs an expression for the Not operator. func (_f *Factory) ConstructNot( - input opt.GroupID, -) opt.GroupID { - _notExpr := makeNotExpr(input) - _group := _f.mem.lookupGroupByFingerprint(_notExpr.fingerprint()) + input memo.GroupID, +) memo.GroupID { + _notExpr := memo.MakeNotExpr(input) + _group := _f.mem.GroupByFingerprint(_notExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notExpr)) } // [Invert] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.isComparison() { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - _contains := _f.mem.lookupNormExpr(input).asContains() + _norm := _f.mem.NormExpr(input) + if _norm.IsComparison() { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + _contains := _f.mem.NormExpr(input).AsContains() if _contains == nil { if _f.someOtherCondition(input) { _f.o.reportOptimization(Invert) - _group = _f.invert(_f.mem.lookupNormExpr(input).op, left, right) - _f.mem.addAltFingerprint(_notExpr.fingerprint(), _group) + _group = _f.invert(_f.mem.NormExpr(input).Operator(), left, right) + _f.mem.AddAltFingerprint(_notExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // LtOp - dynConstructLookup[opt.LtOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLt(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.LtOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLt(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // GtOp - dynConstructLookup[opt.GtOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructGt(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.GtOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructGt(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ContainsOp - dynConstructLookup[opt.ContainsOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructContains(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.ContainsOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructContains(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotOp - dynConstructLookup[opt.NotOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNot(opt.GroupID(operands[0])) + dynConstructLookup[opt.NotOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNot(memo.GroupID(operands[0])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } ---- diff --git a/pkg/sql/opt/testutils/opt_tester.go b/pkg/sql/opt/testutils/opt_tester.go index a39356510cba..a9187dd4eef5 100644 --- a/pkg/sql/opt/testutils/opt_tester.go +++ b/pkg/sql/opt/testutils/opt_tester.go @@ -26,6 +26,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/exec" "github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/parser" @@ -72,14 +73,14 @@ func NewExecutor(catalog opt.Catalog, sql string) *OptTester { // OptBuild constructs an opt expression tree for the SQL query, with no // transformations applied to it. The untouched output of the optbuilder is the // final expression tree. -func (e *OptTester) OptBuild() (xform.ExprView, error) { +func (e *OptTester) OptBuild() (memo.ExprView, error) { return e.optimizeExpr(xform.OptimizeNone) } // Optimize constructs an opt expression tree for the SQL query, with all // transformations applied to it. The result is the memo expression tree with // the lowest estimated cost. -func (e *OptTester) Optimize() (xform.ExprView, error) { +func (e *OptTester) Optimize() (memo.ExprView, error) { return e.optimizeExpr(xform.OptimizeAll) } @@ -182,7 +183,7 @@ func (e *OptTester) Exec(eng exec.TestEngine) (sqlbase.ResultColumns, []tree.Dat func (e *OptTester) buildExpr( factory *xform.Factory, -) (root opt.GroupID, required *opt.PhysicalProps, _ error) { +) (root memo.GroupID, required *memo.PhysicalProps, _ error) { stmt, err := parser.ParseOne(e.sql) if err != nil { return 0, nil, err @@ -193,12 +194,12 @@ func (e *OptTester) buildExpr( return b.Build() } -func (e *OptTester) optimizeExpr(maxSteps xform.OptimizeSteps) (xform.ExprView, error) { +func (e *OptTester) optimizeExpr(maxSteps xform.OptimizeSteps) (memo.ExprView, error) { o := xform.NewOptimizer(&e.evalCtx) o.MaxSteps = maxSteps root, required, err := e.buildExpr(o.Factory()) if err != nil { - return xform.ExprView{}, err + return memo.ExprView{}, err } return o.Optimize(root, required), nil } diff --git a/pkg/sql/opt/xform/factory.go b/pkg/sql/opt/xform/factory.go index fb8c72a1e457..a17a120540bf 100644 --- a/pkg/sql/opt/xform/factory.go +++ b/pkg/sql/opt/xform/factory.go @@ -19,12 +19,33 @@ import ( "sort" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) //go:generate optgen -out factory.og.go factory ../ops/*.opt rules/*.opt +// DynamicID is used when dynamically creating operators using the factory's +// DynamicConstruct method. Each operand, whether it be a group, a private, or +// a list, is first converted to a DynamicID and then passed as one of the +// DynamicOperands. +type DynamicID uint64 + +// MakeDynamicListID constructs a DynamicID from a ListID. +func MakeDynamicListID(id memo.ListID) DynamicID { + return (DynamicID(id.Offset) << 32) | DynamicID(id.Length) +} + +// ListID converts the DynamicID to a ListID. +func (id DynamicID) ListID() memo.ListID { + return memo.ListID{Offset: uint32(id >> 32), Length: uint32(id & 0xffffffff)} +} + +// DynamicOperands is the list of operands passed to the factory's +// DynamicConstruct method in order to dynamically create an operator. +type DynamicOperands [opt.MaxOperands]DynamicID + // Factory constructs a normalized expression tree within the memo. As each // kind of expression is constructed by the factory, it transitively runs // normalization transformations defined for that expression type. This may @@ -40,7 +61,7 @@ import ( // step, in order to allow any custom manual code to execute. type Factory struct { o *Optimizer - mem *memo + mem *memo.Memo evalCtx *tree.EvalContext } @@ -53,26 +74,26 @@ func newFactory(o *Optimizer) *Factory { // Metadata returns the query-specific metadata, which includes information // about the columns and tables used in this particular query. func (f *Factory) Metadata() *opt.Metadata { - return f.mem.metadata + return f.mem.Metadata() } // InternList adds the given list of group IDs to memo storage and returns an // ID that can be used for later lookup. If the same list was added previously, // this method is a no-op and returns the ID of the previous value. -func (f *Factory) InternList(items []opt.GroupID) opt.ListID { - return f.mem.internList(items) +func (f *Factory) InternList(items []memo.GroupID) memo.ListID { + return f.mem.InternList(items) } // InternPrivate adds the given private value to the memo and returns an ID // that can be used for later lookup. If the same value was added previously, // this method is a no-op and returns the ID of the previous value. -func (f *Factory) InternPrivate(private interface{}) opt.PrivateID { - return f.mem.internPrivate(private) +func (f *Factory) InternPrivate(private interface{}) memo.PrivateID { + return f.mem.InternPrivate(private) } // onConstruct is called as a final step by each factory construction method, // so that any custom manual pattern matching/replacement code can be run. -func (f *Factory) onConstruct(group opt.GroupID) opt.GroupID { +func (f *Factory) onConstruct(group memo.GroupID) memo.GroupID { return group } @@ -83,8 +104,8 @@ func (f *Factory) onConstruct(group opt.GroupID) opt.GroupID { // // ---------------------------------------------------------------------- -func (f *Factory) extractColList(private opt.PrivateID) opt.ColList { - return *f.mem.lookupPrivate(private).(*opt.ColList) +func (f *Factory) extractColList(private memo.PrivateID) opt.ColList { + return *f.mem.LookupPrivate(private).(*opt.ColList) } // ---------------------------------------------------------------------- @@ -97,13 +118,13 @@ func (f *Factory) extractColList(private opt.PrivateID) opt.ColList { // listOnlyHasNulls if every item in the given list is a Null op. If the list // is empty, listOnlyHasNulls returns false. -func (f *Factory) listOnlyHasNulls(list opt.ListID) bool { +func (f *Factory) listOnlyHasNulls(list memo.ListID) bool { if list.Length == 0 { return false } - for _, item := range f.mem.lookupList(list) { - if f.mem.lookupNormExpr(item).op != opt.NullOp { + for _, item := range f.mem.LookupList(list) { + if f.mem.NormExpr(item).Operator() != opt.NullOp { return false } } @@ -113,8 +134,8 @@ func (f *Factory) listOnlyHasNulls(list opt.ListID) bool { // isSortedUniqueList returns true if the list is in sorted order, with no // duplicates. See the comment for listSorter.compare for comparison rule // details. -func (f *Factory) isSortedUniqueList(list opt.ListID) bool { - ls := listSorter{f: f, list: f.mem.lookupList(list)} +func (f *Factory) isSortedUniqueList(list memo.ListID) bool { + ls := listSorter{f: f, list: f.mem.LookupList(list)} for i := 0; i < int(list.Length-1); i++ { if !ls.less(i, i+1) { return false @@ -126,10 +147,10 @@ func (f *Factory) isSortedUniqueList(list opt.ListID) bool { // constructSortedUniqueList sorts the given list and removes duplicates, and // returns the resulting list. See the comment for listSorter.compare for // comparison rule details. -func (f *Factory) constructSortedUniqueList(list opt.ListID) opt.ListID { +func (f *Factory) constructSortedUniqueList(list memo.ListID) memo.ListID { // Make a copy of the list, since it needs to stay immutable. - newList := make([]opt.GroupID, list.Length) - copy(newList, f.mem.lookupList(list)) + newList := make([]memo.GroupID, list.Length) + copy(newList, f.mem.LookupList(list)) ls := listSorter{f: f, list: newList} // Sort the list. @@ -143,14 +164,14 @@ func (f *Factory) constructSortedUniqueList(list opt.ListID) opt.ListID { n++ } } - return f.mem.internList(newList[:n]) + return f.mem.InternList(newList[:n]) } // listSorter is a helper struct that implements the sort.Slice "less" // comparison function. type listSorter struct { f *Factory - list []opt.GroupID + list []memo.GroupID } // less returns true if item i in the list compares less than item j. @@ -165,16 +186,16 @@ func (s listSorter) less(i, j int) bool { // are sorted and uniquified by GroupID (arbitrary, but stable). func (s listSorter) compare(i, j int) int { // If both are constant values, then use datum comparison. - isLeftConst := s.f.mem.lookupNormExpr(s.list[i]).isConstValue() - isRightConst := s.f.mem.lookupNormExpr(s.list[j]).isConstValue() + isLeftConst := s.f.mem.NormExpr(s.list[i]).IsConstValue() + isRightConst := s.f.mem.NormExpr(s.list[j]).IsConstValue() if isLeftConst { if !isRightConst { // Constant always sorts before non-constant return -1 } - leftD := ExtractConstDatum(makeNormExprView(s.f.mem, s.list[i])) - rightD := ExtractConstDatum(makeNormExprView(s.f.mem, s.list[j])) + leftD := memo.ExtractConstDatum(memo.MakeNormExprView(s.f.mem, s.list[i])) + rightD := memo.ExtractConstDatum(memo.MakeNormExprView(s.f.mem, s.list[j])) return leftD.Compare(s.f.evalCtx, rightD) } else if isRightConst { // Non-constant always sorts after constant. @@ -200,24 +221,23 @@ func (s listSorter) compare(i, j int) int { // hasType returns true if the given expression has a static type that's // equivalent to the requested type. -func (f *Factory) hasType(group opt.GroupID, typ opt.PrivateID) bool { - groupType := f.mem.lookupGroup(group).logical.Scalar.Type - requestedType := f.mem.lookupPrivate(typ).(types.T) +func (f *Factory) hasType(group memo.GroupID, typ memo.PrivateID) bool { + groupType := f.lookupScalar(group).Type + requestedType := f.mem.LookupPrivate(typ).(types.T) return groupType.Equivalent(requestedType) } -func (f *Factory) boolType() opt.PrivateID { +func (f *Factory) boolType() memo.PrivateID { return f.InternPrivate(types.Bool) } // canConstructBinary returns true if (op left right) has a valid binary op // overload and is therefore legal to construct. For example, while // (Minus <date> <int>) is valid, (Minus <int> <date>) is not. -func (f *Factory) canConstructBinary(op opt.Operator, left, right opt.GroupID) bool { - leftType := f.mem.lookupGroup(left).logical.Scalar.Type - rightType := f.mem.lookupGroup(right).logical.Scalar.Type - _, ok := findBinaryOverload(opt.MinusOp, rightType, leftType) - return ok +func (f *Factory) canConstructBinary(op opt.Operator, left, right memo.GroupID) bool { + leftType := f.lookupScalar(left).Type + rightType := f.lookupScalar(right).Type + return memo.BinaryOverloadExists(opt.MinusOp, rightType, leftType) } // ---------------------------------------------------------------------- @@ -229,20 +249,25 @@ func (f *Factory) canConstructBinary(op opt.Operator, left, right opt.GroupID) b // ---------------------------------------------------------------------- // lookupLogical returns the given group's logical properties. -func (f *Factory) lookupLogical(group opt.GroupID) *LogicalProps { - return &f.mem.lookupGroup(group).logical +func (f *Factory) lookupLogical(group memo.GroupID) *memo.LogicalProps { + return f.mem.GroupProperties(group) } // lookupRelational returns the given group's logical relational properties. -func (f *Factory) lookupRelational(group opt.GroupID) *RelationalProps { - return f.mem.lookupGroup(group).logical.Relational +func (f *Factory) lookupRelational(group memo.GroupID) *memo.RelationalProps { + return f.lookupLogical(group).Relational +} + +// lookupScalar returns the given group's logical scalar properties. +func (f *Factory) lookupScalar(group memo.GroupID) *memo.ScalarProps { + return f.lookupLogical(group).Scalar } // outputCols is a helper function that extracts the set of columns projected // by the given operator. In addition to extracting columns from any relational // operator, outputCols can also extract columns from the Projections and // Aggregations scalar operators, which are used with Project and GroupBy. -func (f *Factory) outputCols(group opt.GroupID) opt.ColSet { +func (f *Factory) outputCols(group memo.GroupID) opt.ColSet { // Handle columns projected by relational operators. logical := f.lookupLogical(group) if logical.Relational != nil { @@ -250,15 +275,15 @@ func (f *Factory) outputCols(group opt.GroupID) opt.ColSet { } // Handle columns projected by Aggregations and Projections operators. - var colList opt.PrivateID - expr := f.mem.lookupNormExpr(group) - switch expr.op { + var colList memo.PrivateID + expr := f.mem.NormExpr(group) + switch expr.Operator() { case opt.AggregationsOp: - colList = expr.asAggregations().cols() + colList = expr.AsAggregations().Cols() case opt.ProjectionsOp: - colList = expr.asProjections().cols() + colList = expr.AsProjections().Cols() default: - panic(fmt.Sprintf("outputCols doesn't support op %s", expr.op)) + panic(fmt.Sprintf("outputCols doesn't support op %s", expr.Operator())) } return opt.ColListToSet(f.extractColList(colList)) @@ -266,21 +291,21 @@ func (f *Factory) outputCols(group opt.GroupID) opt.ColSet { // outerCols returns the set of outer columns associated with the given group, // whether it be a relational or scalar operator. -func (f *Factory) outerCols(group opt.GroupID) opt.ColSet { +func (f *Factory) outerCols(group memo.GroupID) opt.ColSet { return f.lookupLogical(group).OuterCols() } // onlyConstants returns true if the scalar expression is a "constant // expression tree", meaning that it will always evaluate to the same result. // See the CommuteConst pattern comment for more details. -func (f *Factory) onlyConstants(group opt.GroupID) bool { +func (f *Factory) onlyConstants(group memo.GroupID) bool { // TODO(andyk): Consider impact of "impure" functions with side effects. - return f.mem.lookupGroup(group).logical.Scalar.OuterCols.Empty() + return f.lookupScalar(group).OuterCols.Empty() } // hasSameCols returns true if the two groups have an identical set of output // columns. -func (f *Factory) hasSameCols(left, right opt.GroupID) bool { +func (f *Factory) hasSameCols(left, right memo.GroupID) bool { return f.outputCols(left).Equals(f.outputCols(right)) } @@ -293,17 +318,17 @@ func (f *Factory) hasSameCols(left, right opt.GroupID) bool { // neededCols returns the set of columns needed by the given group. It is an // alias for outerCols that's used for clarity with the UnusedCols patterns. -func (f *Factory) neededCols(group opt.GroupID) opt.ColSet { +func (f *Factory) neededCols(group memo.GroupID) opt.ColSet { return f.outerCols(group) } // neededCols2 unions the set of columns needed by either of the given groups. -func (f *Factory) neededCols2(left, right opt.GroupID) opt.ColSet { +func (f *Factory) neededCols2(left, right memo.GroupID) opt.ColSet { return f.outerCols(left).Union(f.outerCols(right)) } // neededCols3 unions the set of columns needed by any of the given groups. -func (f *Factory) neededCols3(group1, group2, group3 opt.GroupID) opt.ColSet { +func (f *Factory) neededCols3(group1, group2, group3 memo.GroupID) opt.ColSet { cols := f.outerCols(group1) cols.UnionWith(f.outerCols(group2)) cols.UnionWith(f.outerCols(group3)) @@ -313,16 +338,16 @@ func (f *Factory) neededCols3(group1, group2, group3 opt.GroupID) opt.ColSet { // neededColsGroupBy unions the columns needed by either of a GroupBy's // operands - either aggregations or groupingCols. This case doesn't fit any // of the neededCols methods because groupingCols is a private, not a group. -func (f *Factory) neededColsGroupBy(aggs opt.GroupID, groupingCols opt.PrivateID) opt.ColSet { - colSet := *f.mem.lookupPrivate(groupingCols).(*opt.ColSet) +func (f *Factory) neededColsGroupBy(aggs memo.GroupID, groupingCols memo.PrivateID) opt.ColSet { + colSet := *f.mem.LookupPrivate(groupingCols).(*opt.ColSet) return f.outerCols(aggs).Union(colSet) } // neededColsLimit unions the columns needed by Projections with the columns in // the Ordering of a Limit/Offset operator. -func (f *Factory) neededColsLimit(projections opt.GroupID, ordering opt.PrivateID) opt.ColSet { +func (f *Factory) neededColsLimit(projections memo.GroupID, ordering memo.PrivateID) opt.ColSet { colSet := f.outerCols(projections).Copy() - for _, col := range *f.mem.lookupPrivate(ordering).(*opt.Ordering) { + for _, col := range *f.mem.LookupPrivate(ordering).(*memo.Ordering) { colSet.Add(int(col.Index())) } return colSet @@ -330,7 +355,7 @@ func (f *Factory) neededColsLimit(projections opt.GroupID, ordering opt.PrivateI // hasUnusedColumns returns true if the target group has additional columns // that are not part of the neededCols set. -func (f *Factory) hasUnusedColumns(target opt.GroupID, neededCols opt.ColSet) bool { +func (f *Factory) hasUnusedColumns(target memo.GroupID, neededCols opt.ColSet) bool { return !f.outputCols(target).Difference(neededCols).Empty() } @@ -339,9 +364,9 @@ func (f *Factory) hasUnusedColumns(target opt.GroupID, neededCols opt.ColSet) bo // column filtering (like Scan, Values, Projections, etc.), then create a new // instance of that operator that does the filtering. Otherwise, construct a // Project operator that wraps the operator and does the filtering. -func (f *Factory) filterUnusedColumns(target opt.GroupID, neededCols opt.ColSet) opt.GroupID { - targetExpr := f.mem.lookupNormExpr(target) - switch targetExpr.op { +func (f *Factory) filterUnusedColumns(target memo.GroupID, neededCols opt.ColSet) memo.GroupID { + targetExpr := f.mem.NormExpr(target) + switch targetExpr.Operator() { case opt.ScanOp: return f.filterUnusedScanColumns(target, neededCols) @@ -357,20 +382,20 @@ func (f *Factory) filterUnusedColumns(target opt.GroupID, neededCols opt.ColSet) // Create a new list of groups to project, along with the list of column // indexes to be projected. These will become inputs to the construction of // the Projections or Aggregations operator. - groupList := make([]opt.GroupID, 0, cnt) + groupList := make([]memo.GroupID, 0, cnt) colList := make(opt.ColList, 0, cnt) - switch targetExpr.op { + switch targetExpr.Operator() { case opt.ProjectionsOp, opt.AggregationsOp: // Get groups from existing lists. - var existingList []opt.GroupID + var existingList []memo.GroupID var existingCols opt.ColList - if targetExpr.op == opt.ProjectionsOp { - existingList = f.mem.lookupList(targetExpr.asProjections().elems()) - existingCols = f.extractColList(targetExpr.asProjections().cols()) + if targetExpr.Operator() == opt.ProjectionsOp { + existingList = f.mem.LookupList(targetExpr.AsProjections().Elems()) + existingCols = f.extractColList(targetExpr.AsProjections().Cols()) } else { - existingList = f.mem.lookupList(targetExpr.asAggregations().aggs()) - existingCols = f.extractColList(targetExpr.asAggregations().cols()) + existingList = f.mem.LookupList(targetExpr.AsAggregations().Aggs()) + existingCols = f.extractColList(targetExpr.AsAggregations().Cols()) } for i, group := range existingList { @@ -390,12 +415,12 @@ func (f *Factory) filterUnusedColumns(target opt.GroupID, neededCols opt.ColSet) }) } - if targetExpr.op == opt.AggregationsOp { + if targetExpr.Operator() == opt.AggregationsOp { return f.ConstructAggregations(f.InternList(groupList), f.InternPrivate(&colList)) } projections := f.ConstructProjections(f.InternList(groupList), f.InternPrivate(&colList)) - if targetExpr.op == opt.ProjectionsOp { + if targetExpr.Operator() == opt.ProjectionsOp { return projections } @@ -405,24 +430,26 @@ func (f *Factory) filterUnusedColumns(target opt.GroupID, neededCols opt.ColSet) // filterUnusedScanColumns constructs a new Scan operator based on the given // existing Scan operator, but projecting only the needed columns. -func (f *Factory) filterUnusedScanColumns(scan opt.GroupID, neededCols opt.ColSet) opt.GroupID { +func (f *Factory) filterUnusedScanColumns(scan memo.GroupID, neededCols opt.ColSet) memo.GroupID { colSet := f.outputCols(scan).Intersection(neededCols) - scanExpr := f.mem.lookupNormExpr(scan).asScan() - existing := f.mem.lookupPrivate(scanExpr.def()).(*opt.ScanOpDef) - new := opt.ScanOpDef{Table: existing.Table, Cols: colSet} - return f.ConstructScan(f.mem.internPrivate(&new)) + scanExpr := f.mem.NormExpr(scan).AsScan() + existing := f.mem.LookupPrivate(scanExpr.Def()).(*memo.ScanOpDef) + new := memo.ScanOpDef{Table: existing.Table, Cols: colSet} + return f.ConstructScan(f.mem.InternPrivate(&new)) } // filterUnusedValuesColumns constructs a new Values operator based on the // given existing Values operator. The new operator will have the same set of // rows, but containing only the needed columns. Other columns are discarded. -func (f *Factory) filterUnusedValuesColumns(values opt.GroupID, neededCols opt.ColSet) opt.GroupID { - valuesExpr := f.mem.lookupNormExpr(values).asValues() - existingCols := f.extractColList(valuesExpr.cols()) +func (f *Factory) filterUnusedValuesColumns( + values memo.GroupID, neededCols opt.ColSet, +) memo.GroupID { + valuesExpr := f.mem.NormExpr(values).AsValues() + existingCols := f.extractColList(valuesExpr.Cols()) newCols := make(opt.ColList, 0, neededCols.Len()) - existingRows := f.mem.lookupList(valuesExpr.rows()) - newRows := make([]opt.GroupID, 0, len(existingRows)) + existingRows := f.mem.LookupList(valuesExpr.Rows()) + newRows := make([]memo.GroupID, 0, len(existingRows)) // Create new list of columns that only contains needed columns. for _, colIndex := range existingCols { @@ -434,10 +461,10 @@ func (f *Factory) filterUnusedValuesColumns(values opt.GroupID, neededCols opt.C // newElems is used to store tuple values, and can be allocated once and // reused repeatedly, since InternList will copy values to memo storage. - newElems := make([]opt.GroupID, len(newCols)) + newElems := make([]memo.GroupID, len(newCols)) for _, row := range existingRows { - existingElems := f.mem.lookupList(f.mem.lookupNormExpr(row).asTuple().elems()) + existingElems := f.mem.LookupList(f.mem.NormExpr(row).AsTuple().Elems()) n := 0 for i, elem := range existingElems { @@ -464,8 +491,8 @@ func (f *Factory) filterUnusedValuesColumns(values opt.GroupID, neededCols opt.C // emptyGroupingCols returns true if the given grouping columns for a GroupBy // operator are empty. -func (f *Factory) emptyGroupingCols(cols opt.PrivateID) bool { - return f.mem.lookupPrivate(cols).(*opt.ColSet).Empty() +func (f *Factory) emptyGroupingCols(cols memo.PrivateID) bool { + return f.mem.LookupPrivate(cols).(*opt.ColSet).Empty() } // isCorrelated returns true if variables in the source expression reference @@ -479,7 +506,7 @@ func (f *Factory) emptyGroupingCols(cols opt.PrivateID) bool { // The (Eq) expression is correlated with the (Scan a) expression because it // references one of its columns. But the (Eq) expression is not correlated // with the (Scan b) expression. -func (f *Factory) isCorrelated(src, dst opt.GroupID) bool { +func (f *Factory) isCorrelated(src, dst memo.GroupID) bool { return f.outerCols(src).Intersects(f.outputCols(dst)) } @@ -498,65 +525,65 @@ func (f *Factory) isCorrelated(src, dst opt.GroupID) bool { // Calling extractCorrelatedConditions with the filter conditions list and // (Scan b) as the destination would extract the (Eq) expression, since it // references columns from b. -func (f *Factory) extractCorrelatedConditions(list opt.ListID, dst opt.GroupID) opt.ListID { - extracted := make([]opt.GroupID, 0, list.Length) - for _, item := range f.mem.lookupList(list) { +func (f *Factory) extractCorrelatedConditions(list memo.ListID, dst memo.GroupID) memo.ListID { + extracted := make([]memo.GroupID, 0, list.Length) + for _, item := range f.mem.LookupList(list) { if f.isCorrelated(item, dst) { extracted = append(extracted, item) } } - return f.mem.internList(extracted) + return f.mem.InternList(extracted) } // extractUncorrelatedConditions is the inverse of extractCorrelatedConditions. // Instead of extracting correlated expressions, it extracts list expressions // that are *not* correlated with the destination. -func (f *Factory) extractUncorrelatedConditions(list opt.ListID, dst opt.GroupID) opt.ListID { - extracted := make([]opt.GroupID, 0, list.Length) - for _, item := range f.mem.lookupList(list) { +func (f *Factory) extractUncorrelatedConditions(list memo.ListID, dst memo.GroupID) memo.ListID { + extracted := make([]memo.GroupID, 0, list.Length) + for _, item := range f.mem.LookupList(list) { if !f.isCorrelated(item, dst) { extracted = append(extracted, item) } } - return f.mem.internList(extracted) + return f.mem.InternList(extracted) } // concatFilters creates a new Filters operator that contains conditions from // both the left and right boolean filter expressions. If the left or right // expression is itself a Filters operator, then it is "flattened" by merging // its conditions into the new Filters operator. -func (f *Factory) concatFilters(left, right opt.GroupID) opt.GroupID { - leftExpr := f.mem.lookupNormExpr(left) - rightExpr := f.mem.lookupNormExpr(right) +func (f *Factory) concatFilters(left, right memo.GroupID) memo.GroupID { + leftExpr := f.mem.NormExpr(left) + rightExpr := f.mem.NormExpr(right) // Handle cases where left/right filters are constant boolean values. - if leftExpr.op == opt.TrueOp || rightExpr.op == opt.FalseOp { + if leftExpr.Operator() == opt.TrueOp || rightExpr.Operator() == opt.FalseOp { return right } - if rightExpr.op == opt.TrueOp || leftExpr.op == opt.FalseOp { + if rightExpr.Operator() == opt.TrueOp || leftExpr.Operator() == opt.FalseOp { return left } // Determine how large to make the conditions slice (at least 2 slots). cnt := 2 - leftFiltersExpr := leftExpr.asFilters() + leftFiltersExpr := leftExpr.AsFilters() if leftFiltersExpr != nil { - cnt += int(leftFiltersExpr.conditions().Length) - 1 + cnt += int(leftFiltersExpr.Conditions().Length) - 1 } - rightFiltersExpr := rightExpr.asFilters() + rightFiltersExpr := rightExpr.AsFilters() if rightFiltersExpr != nil { - cnt += int(rightFiltersExpr.conditions().Length) - 1 + cnt += int(rightFiltersExpr.Conditions().Length) - 1 } // Create the conditions slice and populate it. - conditions := make([]opt.GroupID, 0, cnt) + conditions := make([]memo.GroupID, 0, cnt) if leftFiltersExpr != nil { - conditions = append(conditions, f.mem.lookupList(leftFiltersExpr.conditions())...) + conditions = append(conditions, f.mem.LookupList(leftFiltersExpr.Conditions())...) } else { conditions = append(conditions, left) } if rightFiltersExpr != nil { - conditions = append(conditions, f.mem.lookupList(rightFiltersExpr.conditions())...) + conditions = append(conditions, f.mem.LookupList(rightFiltersExpr.Conditions())...) } else { conditions = append(conditions, right) } @@ -576,15 +603,15 @@ func (f *Factory) concatFilters(left, right opt.GroupID) opt.GroupID { // level of flattening is necessary, since this pattern would have already // matched any And operator children. If, after simplification, no operands // remain, then simplifyAnd returns True. -func (f *Factory) simplifyAnd(conditions opt.ListID) opt.GroupID { - list := make([]opt.GroupID, 0, conditions.Length+1) - for _, item := range f.mem.lookupList(conditions) { - itemExpr := f.mem.lookupNormExpr(item) +func (f *Factory) simplifyAnd(conditions memo.ListID) memo.GroupID { + list := make([]memo.GroupID, 0, conditions.Length+1) + for _, item := range f.mem.LookupList(conditions) { + itemExpr := f.mem.NormExpr(item) - switch itemExpr.op { + switch itemExpr.Operator() { case opt.AndOp: // Flatten nested And operands. - list = append(list, f.mem.lookupList(itemExpr.asAnd().conditions())...) + list = append(list, f.mem.LookupList(itemExpr.AsAnd().Conditions())...) case opt.TrueOp: // And operator skips True operands. @@ -601,7 +628,7 @@ func (f *Factory) simplifyAnd(conditions opt.ListID) opt.GroupID { if len(list) == 0 { return f.ConstructTrue() } - return f.ConstructAnd(f.mem.internList(list)) + return f.ConstructAnd(f.mem.InternList(list)) } // simplifyOr removes False operands from an Or operator, and eliminates the Or @@ -610,15 +637,15 @@ func (f *Factory) simplifyAnd(conditions opt.ListID) opt.GroupID { // level of flattening is necessary, since this pattern would have already // matched any Or operator children. If, after simplification, no operands // remain, then simplifyOr returns False. -func (f *Factory) simplifyOr(conditions opt.ListID) opt.GroupID { - list := make([]opt.GroupID, 0, conditions.Length+1) - for _, item := range f.mem.lookupList(conditions) { - itemExpr := f.mem.lookupNormExpr(item) +func (f *Factory) simplifyOr(conditions memo.ListID) memo.GroupID { + list := make([]memo.GroupID, 0, conditions.Length+1) + for _, item := range f.mem.LookupList(conditions) { + itemExpr := f.mem.NormExpr(item) - switch itemExpr.op { + switch itemExpr.Operator() { case opt.OrOp: // Flatten nested Or operands. - list = append(list, f.mem.lookupList(itemExpr.asOr().conditions())...) + list = append(list, f.mem.LookupList(itemExpr.AsOr().Conditions())...) case opt.FalseOp: // Or operator skips False operands. @@ -635,7 +662,7 @@ func (f *Factory) simplifyOr(conditions opt.ListID) opt.GroupID { if len(list) == 0 { return f.ConstructFalse() } - return f.ConstructOr(f.mem.internList(list)) + return f.ConstructOr(f.mem.InternList(list)) } // simplifyFilters behaves the same way as simplifyAnd, with one addition: if @@ -643,15 +670,15 @@ func (f *Factory) simplifyOr(conditions opt.ListID) opt.GroupID { // expression is False. This works because the Filters expression only appears // as a Select or Join filter condition, both of which treat a Null filter // conjunct exactly as if it were False. -func (f *Factory) simplifyFilters(conditions opt.ListID) opt.GroupID { - list := make([]opt.GroupID, 0, conditions.Length+1) - for _, item := range f.mem.lookupList(conditions) { - itemExpr := f.mem.lookupNormExpr(item) +func (f *Factory) simplifyFilters(conditions memo.ListID) memo.GroupID { + list := make([]memo.GroupID, 0, conditions.Length+1) + for _, item := range f.mem.LookupList(conditions) { + itemExpr := f.mem.NormExpr(item) - switch itemExpr.op { + switch itemExpr.Operator() { case opt.AndOp: // Flatten nested And operands. - list = append(list, f.mem.lookupList(itemExpr.asAnd().conditions())...) + list = append(list, f.mem.LookupList(itemExpr.AsAnd().Conditions())...) case opt.TrueOp: // Filters operator skips True operands. @@ -672,24 +699,23 @@ func (f *Factory) simplifyFilters(conditions opt.ListID) opt.GroupID { if len(list) == 0 { return f.ConstructTrue() } - return f.ConstructFilters(f.mem.internList(list)) + return f.ConstructFilters(f.mem.InternList(list)) } -// negateConditions negates the given conditions and puts them in a new list. -func (f *Factory) negateConditions(conditions opt.ListID) opt.ListID { - list := f.mem.lookupList(conditions) - negCond := make([]opt.GroupID, len(list)) +func (f *Factory) negateConditions(conditions memo.ListID) memo.ListID { + list := f.mem.LookupList(conditions) + negCond := make([]memo.GroupID, len(list)) for i := range list { negCond[i] = f.ConstructNot(list[i]) } - return f.mem.internList(negCond) + return f.mem.InternList(negCond) } // negateComparison negates a comparison op like: // a.x = 5 // to: // a.x <> 5 -func (f *Factory) negateComparison(cmp opt.Operator, left, right opt.GroupID) opt.GroupID { +func (f *Factory) negateComparison(cmp opt.Operator, left, right memo.GroupID) memo.GroupID { switch cmp { case opt.EqOp: return f.ConstructNe(left, right) @@ -741,7 +767,7 @@ func (f *Factory) negateComparison(cmp opt.Operator, left, right opt.GroupID) op // 5 < x // to: // x > 5 -func (f *Factory) commuteInequality(op opt.Operator, left, right opt.GroupID) opt.GroupID { +func (f *Factory) commuteInequality(op opt.Operator, left, right memo.GroupID) memo.GroupID { switch op { case opt.GeOp: return f.ConstructLe(right, left) @@ -767,14 +793,14 @@ func (f *Factory) commuteInequality(op opt.Operator, left, right opt.GroupID) op // (a, b, c) = (x, y, z) // into this: // (a = x) AND (b = y) AND (c = z) -func (f *Factory) normalizeTupleEquality(left, right opt.ListID) opt.GroupID { +func (f *Factory) normalizeTupleEquality(left, right memo.ListID) memo.GroupID { if left.Length != right.Length { panic("tuple length mismatch") } - leftList := f.mem.lookupList(left) - rightList := f.mem.lookupList(right) - conditions := make([]opt.GroupID, left.Length) + leftList := f.mem.LookupList(left) + rightList := f.mem.LookupList(right) + conditions := make([]memo.GroupID, left.Length) for i := range conditions { conditions[i] = f.ConstructEq(leftList[i], rightList[i]) } @@ -790,17 +816,17 @@ func (f *Factory) normalizeTupleEquality(left, right opt.ListID) opt.GroupID { // simplifyCoalesce discards any leading null operands, and then if the next // operand is a constant, replaces with that constant. -func (f *Factory) simplifyCoalesce(args opt.ListID) opt.GroupID { - argList := f.mem.lookupList(args) +func (f *Factory) simplifyCoalesce(args memo.ListID) memo.GroupID { + argList := f.mem.LookupList(args) for i := 0; i < int(args.Length-1); i++ { // If item is not a constant value, then its value may turn out to be // null, so no more folding. Return operands from then on. - item := f.mem.lookupNormExpr(argList[i]) - if !item.isConstValue() { + item := f.mem.NormExpr(argList[i]) + if !item.IsConstValue() { return f.ConstructCoalesce(f.InternList(argList[i:])) } - if item.op != opt.NullOp { + if item.Operator() != opt.NullOp { return argList[i] } } @@ -813,29 +839,25 @@ func (f *Factory) simplifyCoalesce(args opt.ListID) opt.GroupID { // allowNullArgs returns true if the binary operator with the given inputs // allows one of those inputs to be null. If not, then the binary operator will // simply be replaced by null. -func (f *Factory) allowNullArgs(op opt.Operator, left, right opt.GroupID) bool { - leftType := f.mem.lookupGroup(left).logical.Scalar.Type - rightType := f.mem.lookupGroup(right).logical.Scalar.Type - overload, ok := findBinaryOverload(op, leftType, rightType) - if !ok { - panic(fmt.Sprintf("could not find overload for binary expression %s", op)) - } - return overload.allowNullArgs +func (f *Factory) allowNullArgs(op opt.Operator, left, right memo.GroupID) bool { + leftType := f.lookupScalar(left).Type + rightType := f.lookupScalar(right).Type + return memo.BinaryAllowsNullArgs(op, leftType, rightType) } // foldNullUnary replaces the unary operator with a typed null value having the // same type as the unary operator would have. -func (f *Factory) foldNullUnary(op opt.Operator, input opt.GroupID) opt.GroupID { - typ := f.mem.lookupGroup(input).logical.Scalar.Type - return f.ConstructNull(f.InternPrivate(inferUnaryType(op, typ))) +func (f *Factory) foldNullUnary(op opt.Operator, input memo.GroupID) memo.GroupID { + typ := f.lookupScalar(input).Type + return f.ConstructNull(f.InternPrivate(memo.InferUnaryType(op, typ))) } // foldNullBinary replaces the binary operator with a typed null value having // the same type as the binary operator would have. -func (f *Factory) foldNullBinary(op opt.Operator, left, right opt.GroupID) opt.GroupID { - leftType := f.mem.lookupGroup(left).logical.Scalar.Type - rightType := f.mem.lookupGroup(right).logical.Scalar.Type - return f.ConstructNull(f.InternPrivate(inferBinaryType(op, leftType, rightType))) +func (f *Factory) foldNullBinary(op opt.Operator, left, right memo.GroupID) memo.GroupID { + leftType := f.lookupScalar(left).Type + rightType := f.lookupScalar(right).Type + return f.ConstructNull(f.InternPrivate(memo.InferBinaryType(op, leftType, rightType))) } // ---------------------------------------------------------------------- @@ -847,8 +869,8 @@ func (f *Factory) foldNullBinary(op opt.Operator, left, right opt.GroupID) opt.G // isZero returns true if the input expression is a numeric constant with a // value of zero. -func (f *Factory) isZero(input opt.GroupID) bool { - d := f.mem.lookupPrivate(f.mem.lookupNormExpr(input).asConst().value()).(tree.Datum) +func (f *Factory) isZero(input memo.GroupID) bool { + d := f.mem.LookupPrivate(f.mem.NormExpr(input).AsConst().Value()).(tree.Datum) switch t := d.(type) { case *tree.DDecimal: return t.Decimal.Sign() == 0 @@ -862,8 +884,8 @@ func (f *Factory) isZero(input opt.GroupID) bool { // isOne returns true if the input expression is a numeric constant with a // value of one. -func (f *Factory) isOne(input opt.GroupID) bool { - d := f.mem.lookupPrivate(f.mem.lookupNormExpr(input).asConst().value()).(tree.Datum) +func (f *Factory) isOne(input memo.GroupID) bool { + d := f.mem.LookupPrivate(f.mem.NormExpr(input).AsConst().Value()).(tree.Datum) switch t := d.(type) { case *tree.DDecimal: return t.Decimal.Cmp(&tree.DecimalOne.Decimal) == 0 diff --git a/pkg/sql/opt/xform/factory.og.go b/pkg/sql/opt/xform/factory.og.go index a222e46a6116..79833c1daeaa 100644 --- a/pkg/sql/opt/xform/factory.og.go +++ b/pkg/sql/opt/xform/factory.og.go @@ -4,6 +4,7 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // ConstructScan constructs an expression for the Scan operator. @@ -13,19 +14,19 @@ import ( // expected to have any particular ordering unless a physical property requires // it. func (_f *Factory) ConstructScan( - def opt.PrivateID, -) opt.GroupID { - _scanExpr := makeScanExpr(def) - _group := _f.mem.lookupGroupByFingerprint(_scanExpr.fingerprint()) + def memo.PrivateID, +) memo.GroupID { + _scanExpr := memo.MakeScanExpr(def) + _group := _f.mem.GroupByFingerprint(_scanExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_scanExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_scanExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_scanExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_scanExpr))) } // ConstructValues constructs an expression for the Values operator. @@ -39,20 +40,20 @@ func (_f *Factory) ConstructScan( // The Cols field contains the set of column indices returned by each row // as a *ColList. It is legal for Cols to be empty. func (_f *Factory) ConstructValues( - rows opt.ListID, - cols opt.PrivateID, -) opt.GroupID { - _valuesExpr := makeValuesExpr(rows, cols) - _group := _f.mem.lookupGroupByFingerprint(_valuesExpr.fingerprint()) + rows memo.ListID, + cols memo.PrivateID, +) memo.GroupID { + _valuesExpr := memo.MakeValuesExpr(rows, cols) + _group := _f.mem.GroupByFingerprint(_valuesExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_valuesExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_valuesExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_valuesExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_valuesExpr))) } // ConstructSelect constructs an expression for the Select operator. @@ -62,82 +63,82 @@ func (_f *Factory) ConstructValues( // typically convert it to a Filters operator in order to make conjunction list // matching easier. func (_f *Factory) ConstructSelect( - input opt.GroupID, - filter opt.GroupID, -) opt.GroupID { - _selectExpr := makeSelectExpr(input, filter) - _group := _f.mem.lookupGroupByFingerprint(_selectExpr.fingerprint()) + input memo.GroupID, + filter memo.GroupID, +) memo.GroupID { + _selectExpr := memo.MakeSelectExpr(input, filter) + _group := _f.mem.GroupByFingerprint(_selectExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_selectExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_selectExpr)) } // [EnsureSelectFiltersAnd] { - _and := _f.mem.lookupNormExpr(filter).asAnd() + _and := _f.mem.NormExpr(filter).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureSelectFiltersAnd) _group = _f.ConstructSelect(input, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } // [EnsureSelectFilters] { - _norm := _f.mem.lookupNormExpr(filter) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(filter) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureSelectFilters) - _group = _f.ConstructSelect(input, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _group = _f.ConstructSelect(input, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } // [EliminateSelect] { - _true := _f.mem.lookupNormExpr(filter).asTrue() + _true := _f.mem.NormExpr(filter).AsTrue() if _true != nil { _f.o.reportOptimization(EliminateSelect) _group = input - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } // [MergeSelects] { - _select := _f.mem.lookupNormExpr(input).asSelect() + _select := _f.mem.NormExpr(input).AsSelect() if _select != nil { - input := _select.input() - innerFilter := _select.filter() + input := _select.Input() + innerFilter := _select.Filter() _f.o.reportOptimization(MergeSelects) _group = _f.ConstructSelect(input, _f.concatFilters(innerFilter, filter)) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } // [PushDownSelectJoinLeft] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.op == opt.InnerJoinOp || _norm.op == opt.InnerJoinApplyOp || _norm.op == opt.LeftJoinOp || _norm.op == opt.LeftJoinApplyOp { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - on := _norm.childGroup(_f.mem, 2) - _filters := _f.mem.lookupNormExpr(filter).asFilters() + _norm := _f.mem.NormExpr(input) + if _norm.Operator() == opt.InnerJoinOp || _norm.Operator() == opt.InnerJoinApplyOp || _norm.Operator() == opt.LeftJoinOp || _norm.Operator() == opt.LeftJoinApplyOp { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + on := _norm.ChildGroup(_f.mem, 2) + _filters := _f.mem.NormExpr(filter).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, right) { _f.o.reportOptimization(PushDownSelectJoinLeft) - _group = _f.ConstructSelect(_f.DynamicConstruct(_f.mem.lookupNormExpr(input).op, opt.DynamicOperands{opt.DynamicID(_f.ConstructSelect(left, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, right)))), opt.DynamicID(right), opt.DynamicID(on)}), _f.ConstructFilters(_f.extractCorrelatedConditions(list, right))) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _group = _f.ConstructSelect(_f.DynamicConstruct(_f.mem.NormExpr(input).Operator(), DynamicOperands{DynamicID(_f.ConstructSelect(left, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, right)))), DynamicID(right), DynamicID(on)}), _f.ConstructFilters(_f.extractCorrelatedConditions(list, right))) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } @@ -147,20 +148,20 @@ func (_f *Factory) ConstructSelect( // [PushDownSelectJoinRight] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.op == opt.InnerJoinOp || _norm.op == opt.InnerJoinApplyOp || _norm.op == opt.RightJoinOp || _norm.op == opt.RightJoinApplyOp { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - on := _norm.childGroup(_f.mem, 2) - _filters := _f.mem.lookupNormExpr(filter).asFilters() + _norm := _f.mem.NormExpr(input) + if _norm.Operator() == opt.InnerJoinOp || _norm.Operator() == opt.InnerJoinApplyOp || _norm.Operator() == opt.RightJoinOp || _norm.Operator() == opt.RightJoinApplyOp { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + on := _norm.ChildGroup(_f.mem, 2) + _filters := _f.mem.NormExpr(filter).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, left) { _f.o.reportOptimization(PushDownSelectJoinRight) - _group = _f.ConstructSelect(_f.DynamicConstruct(_f.mem.lookupNormExpr(input).op, opt.DynamicOperands{opt.DynamicID(left), opt.DynamicID(_f.ConstructSelect(right, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, left)))), opt.DynamicID(on)}), _f.ConstructFilters(_f.extractCorrelatedConditions(list, left))) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _group = _f.ConstructSelect(_f.DynamicConstruct(_f.mem.NormExpr(input).Operator(), DynamicOperands{DynamicID(left), DynamicID(_f.ConstructSelect(right, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, left)))), DynamicID(on)}), _f.ConstructFilters(_f.extractCorrelatedConditions(list, left))) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } @@ -170,35 +171,35 @@ func (_f *Factory) ConstructSelect( // [MergeSelectInnerJoin] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.op == opt.InnerJoinOp || _norm.op == opt.InnerJoinApplyOp { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - on := _norm.childGroup(_f.mem, 2) + _norm := _f.mem.NormExpr(input) + if _norm.Operator() == opt.InnerJoinOp || _norm.Operator() == opt.InnerJoinApplyOp { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + on := _norm.ChildGroup(_f.mem, 2) _f.o.reportOptimization(MergeSelectInnerJoin) - _group = _f.DynamicConstruct(_f.mem.lookupNormExpr(input).op, opt.DynamicOperands{opt.DynamicID(left), opt.DynamicID(right), opt.DynamicID(_f.concatFilters(on, filter))}) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _group = _f.DynamicConstruct(_f.mem.NormExpr(input).Operator(), DynamicOperands{DynamicID(left), DynamicID(right), DynamicID(_f.concatFilters(on, filter))}) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } // [PushDownSelectGroupBy] { - _groupBy := _f.mem.lookupNormExpr(input).asGroupBy() + _groupBy := _f.mem.NormExpr(input).AsGroupBy() if _groupBy != nil { - input := _groupBy.input() - aggregations := _groupBy.aggregations() - groupingCols := _groupBy.groupingCols() + input := _groupBy.Input() + aggregations := _groupBy.Aggregations() + groupingCols := _groupBy.GroupingCols() if !_f.emptyGroupingCols(groupingCols) { - _filters := _f.mem.lookupNormExpr(filter).asFilters() + _filters := _f.mem.NormExpr(filter).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, aggregations) { _f.o.reportOptimization(PushDownSelectGroupBy) _group = _f.ConstructSelect(_f.ConstructGroupBy(_f.ConstructSelect(input, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, aggregations))), aggregations, groupingCols), _f.ConstructFilters(_f.extractCorrelatedConditions(list, aggregations))) - _f.mem.addAltFingerprint(_selectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_selectExpr.Fingerprint(), _group) return _group } } @@ -207,7 +208,7 @@ func (_f *Factory) ConstructSelect( } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_selectExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_selectExpr))) } // ConstructProject constructs an expression for the Project operator. @@ -217,17 +218,17 @@ func (_f *Factory) ConstructSelect( // the list of expressions that describe the output columns. The Cols field of // the Projections operator provides the indexes of each of the output columns. func (_f *Factory) ConstructProject( - input opt.GroupID, - projections opt.GroupID, -) opt.GroupID { - _projectExpr := makeProjectExpr(input, projections) - _group := _f.mem.lookupGroupByFingerprint(_projectExpr.fingerprint()) + input memo.GroupID, + projections memo.GroupID, +) memo.GroupID { + _projectExpr := memo.MakeProjectExpr(input, projections) + _group := _f.mem.GroupByFingerprint(_projectExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_projectExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_projectExpr)) } // [EliminateProject] @@ -235,21 +236,21 @@ func (_f *Factory) ConstructProject( if _f.hasSameCols(input, projections) { _f.o.reportOptimization(EliminateProject) _group = input - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } // [FilterUnusedProjectCols] { - _project := _f.mem.lookupNormExpr(input).asProject() + _project := _f.mem.NormExpr(input).AsProject() if _project != nil { - innerInput := _project.input() - innerProjections := _project.projections() + innerInput := _project.Input() + innerProjections := _project.Projections() if _f.hasUnusedColumns(innerProjections, _f.neededCols(projections)) { _f.o.reportOptimization(FilterUnusedProjectCols) _group = _f.ConstructProject(_f.ConstructProject(innerInput, _f.filterUnusedColumns(innerProjections, _f.neededCols(projections))), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -257,12 +258,12 @@ func (_f *Factory) ConstructProject( // [FilterUnusedScanCols] { - _scan := _f.mem.lookupNormExpr(input).asScan() + _scan := _f.mem.NormExpr(input).AsScan() if _scan != nil { if _f.hasUnusedColumns(input, _f.neededCols(projections)) { _f.o.reportOptimization(FilterUnusedScanCols) _group = _f.ConstructProject(_f.filterUnusedColumns(input, _f.neededCols(projections)), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -270,14 +271,14 @@ func (_f *Factory) ConstructProject( // [FilterUnusedSelectCols] { - _select := _f.mem.lookupNormExpr(input).asSelect() + _select := _f.mem.NormExpr(input).AsSelect() if _select != nil { - innerInput := _select.input() - filter := _select.filter() + innerInput := _select.Input() + filter := _select.Filter() if _f.hasUnusedColumns(innerInput, _f.neededCols2(projections, filter)) { _f.o.reportOptimization(FilterUnusedSelectCols) _group = _f.ConstructProject(_f.ConstructSelect(_f.filterUnusedColumns(innerInput, _f.neededCols2(projections, filter)), filter), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -285,15 +286,15 @@ func (_f *Factory) ConstructProject( // [FilterUnusedLimitCols] { - _limit := _f.mem.lookupNormExpr(input).asLimit() + _limit := _f.mem.NormExpr(input).AsLimit() if _limit != nil { - input := _limit.input() - limit := _limit.limit() - ordering := _limit.ordering() + input := _limit.Input() + limit := _limit.Limit() + ordering := _limit.Ordering() if _f.hasUnusedColumns(input, _f.neededColsLimit(projections, ordering)) { _f.o.reportOptimization(FilterUnusedLimitCols) _group = _f.ConstructProject(_f.ConstructLimit(_f.filterUnusedColumns(input, _f.neededColsLimit(projections, ordering)), limit, ordering), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -301,15 +302,15 @@ func (_f *Factory) ConstructProject( // [FilterUnusedOffsetCols] { - _offset := _f.mem.lookupNormExpr(input).asOffset() + _offset := _f.mem.NormExpr(input).AsOffset() if _offset != nil { - input := _offset.input() - offset := _offset.offset() - ordering := _offset.ordering() + input := _offset.Input() + offset := _offset.Offset() + ordering := _offset.Ordering() if _f.hasUnusedColumns(input, _f.neededColsLimit(projections, ordering)) { _f.o.reportOptimization(FilterUnusedOffsetCols) _group = _f.ConstructProject(_f.ConstructOffset(_f.filterUnusedColumns(input, _f.neededColsLimit(projections, ordering)), offset, ordering), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -317,15 +318,15 @@ func (_f *Factory) ConstructProject( // [FilterUnusedJoinLeftCols] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.isJoin() { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - on := _norm.childGroup(_f.mem, 2) + _norm := _f.mem.NormExpr(input) + if _norm.IsJoin() { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + on := _norm.ChildGroup(_f.mem, 2) if _f.hasUnusedColumns(left, _f.neededCols3(projections, right, on)) { _f.o.reportOptimization(FilterUnusedJoinLeftCols) - _group = _f.ConstructProject(_f.DynamicConstruct(_f.mem.lookupNormExpr(input).op, opt.DynamicOperands{opt.DynamicID(_f.filterUnusedColumns(left, _f.neededCols3(projections, right, on))), opt.DynamicID(right), opt.DynamicID(on)}), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _group = _f.ConstructProject(_f.DynamicConstruct(_f.mem.NormExpr(input).Operator(), DynamicOperands{DynamicID(_f.filterUnusedColumns(left, _f.neededCols3(projections, right, on))), DynamicID(right), DynamicID(on)}), projections) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -333,15 +334,15 @@ func (_f *Factory) ConstructProject( // [FilterUnusedJoinRightCols] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.isJoin() { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - on := _norm.childGroup(_f.mem, 2) + _norm := _f.mem.NormExpr(input) + if _norm.IsJoin() { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + on := _norm.ChildGroup(_f.mem, 2) if _f.hasUnusedColumns(right, _f.neededCols2(projections, on)) { _f.o.reportOptimization(FilterUnusedJoinRightCols) - _group = _f.ConstructProject(_f.DynamicConstruct(_f.mem.lookupNormExpr(input).op, opt.DynamicOperands{opt.DynamicID(left), opt.DynamicID(_f.filterUnusedColumns(right, _f.neededCols2(projections, on))), opt.DynamicID(on)}), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _group = _f.ConstructProject(_f.DynamicConstruct(_f.mem.NormExpr(input).Operator(), DynamicOperands{DynamicID(left), DynamicID(_f.filterUnusedColumns(right, _f.neededCols2(projections, on))), DynamicID(on)}), projections) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -349,15 +350,15 @@ func (_f *Factory) ConstructProject( // [FilterUnusedAggCols] { - _groupBy := _f.mem.lookupNormExpr(input).asGroupBy() + _groupBy := _f.mem.NormExpr(input).AsGroupBy() if _groupBy != nil { - innerInput := _groupBy.input() - aggregations := _groupBy.aggregations() - groupingCols := _groupBy.groupingCols() + innerInput := _groupBy.Input() + aggregations := _groupBy.Aggregations() + groupingCols := _groupBy.GroupingCols() if _f.hasUnusedColumns(aggregations, _f.neededCols(projections)) { _f.o.reportOptimization(FilterUnusedAggCols) _group = _f.ConstructProject(_f.ConstructGroupBy(innerInput, _f.filterUnusedColumns(aggregations, _f.neededCols(projections)), groupingCols), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } @@ -365,18 +366,18 @@ func (_f *Factory) ConstructProject( // [FilterUnusedValueCols] { - _values := _f.mem.lookupNormExpr(input).asValues() + _values := _f.mem.NormExpr(input).AsValues() if _values != nil { if _f.hasUnusedColumns(input, _f.neededCols(projections)) { _f.o.reportOptimization(FilterUnusedValueCols) _group = _f.ConstructProject(_f.filterUnusedColumns(input, _f.neededCols(projections)), projections) - _f.mem.addAltFingerprint(_projectExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_projectExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_projectExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_projectExpr))) } // ConstructInnerJoin constructs an expression for the InnerJoin operator. @@ -386,28 +387,28 @@ func (_f *Factory) ConstructProject( // columns projected by either the left or right inputs, the inputs are not // allowed to refer to the other's projected columns. func (_f *Factory) ConstructInnerJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _innerJoinExpr := makeInnerJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_innerJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _innerJoinExpr := memo.MakeInnerJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_innerJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_innerJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_innerJoinExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructInnerJoin(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_innerJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinExpr.Fingerprint(), _group) return _group } } @@ -415,26 +416,26 @@ func (_f *Factory) ConstructInnerJoin( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructInnerJoin(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_innerJoinExpr.fingerprint(), _group) + _group = _f.ConstructInnerJoin(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_innerJoinExpr.Fingerprint(), _group) return _group } } // [PushDownJoinLeft] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, right) { _f.o.reportOptimization(PushDownJoinLeft) _group = _f.ConstructInnerJoin(_f.ConstructSelect(left, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, right))), right, _f.ConstructFilters(_f.extractCorrelatedConditions(list, right))) - _f.mem.addAltFingerprint(_innerJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinExpr.Fingerprint(), _group) return _group } } @@ -443,48 +444,48 @@ func (_f *Factory) ConstructInnerJoin( // [PushDownJoinRight] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, left) { _f.o.reportOptimization(PushDownJoinRight) _group = _f.ConstructInnerJoin(left, _f.ConstructSelect(right, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, left))), _f.ConstructFilters(_f.extractCorrelatedConditions(list, left))) - _f.mem.addAltFingerprint(_innerJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_innerJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_innerJoinExpr))) } // ConstructLeftJoin constructs an expression for the LeftJoin operator. func (_f *Factory) ConstructLeftJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _leftJoinExpr := makeLeftJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_leftJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _leftJoinExpr := memo.MakeLeftJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_leftJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_leftJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_leftJoinExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructLeftJoin(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_leftJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leftJoinExpr.Fingerprint(), _group) return _group } } @@ -492,59 +493,59 @@ func (_f *Factory) ConstructLeftJoin( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructLeftJoin(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_leftJoinExpr.fingerprint(), _group) + _group = _f.ConstructLeftJoin(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_leftJoinExpr.Fingerprint(), _group) return _group } } // [PushDownJoinRight] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, left) { _f.o.reportOptimization(PushDownJoinRight) _group = _f.ConstructLeftJoin(left, _f.ConstructSelect(right, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, left))), _f.ConstructFilters(_f.extractCorrelatedConditions(list, left))) - _f.mem.addAltFingerprint(_leftJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leftJoinExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_leftJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_leftJoinExpr))) } // ConstructRightJoin constructs an expression for the RightJoin operator. func (_f *Factory) ConstructRightJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _rightJoinExpr := makeRightJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_rightJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _rightJoinExpr := memo.MakeRightJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_rightJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_rightJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_rightJoinExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructRightJoin(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_rightJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_rightJoinExpr.Fingerprint(), _group) return _group } } @@ -552,59 +553,59 @@ func (_f *Factory) ConstructRightJoin( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructRightJoin(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_rightJoinExpr.fingerprint(), _group) + _group = _f.ConstructRightJoin(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_rightJoinExpr.Fingerprint(), _group) return _group } } // [PushDownJoinLeft] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, right) { _f.o.reportOptimization(PushDownJoinLeft) _group = _f.ConstructRightJoin(_f.ConstructSelect(left, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, right))), right, _f.ConstructFilters(_f.extractCorrelatedConditions(list, right))) - _f.mem.addAltFingerprint(_rightJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_rightJoinExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_rightJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_rightJoinExpr))) } // ConstructFullJoin constructs an expression for the FullJoin operator. func (_f *Factory) ConstructFullJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _fullJoinExpr := makeFullJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_fullJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _fullJoinExpr := memo.MakeFullJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_fullJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fullJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fullJoinExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructFullJoin(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_fullJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fullJoinExpr.Fingerprint(), _group) return _group } } @@ -612,42 +613,42 @@ func (_f *Factory) ConstructFullJoin( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructFullJoin(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_fullJoinExpr.fingerprint(), _group) + _group = _f.ConstructFullJoin(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_fullJoinExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fullJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fullJoinExpr))) } // ConstructSemiJoin constructs an expression for the SemiJoin operator. func (_f *Factory) ConstructSemiJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _semiJoinExpr := makeSemiJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_semiJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _semiJoinExpr := memo.MakeSemiJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_semiJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_semiJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_semiJoinExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructSemiJoin(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_semiJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_semiJoinExpr.Fingerprint(), _group) return _group } } @@ -655,42 +656,42 @@ func (_f *Factory) ConstructSemiJoin( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructSemiJoin(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_semiJoinExpr.fingerprint(), _group) + _group = _f.ConstructSemiJoin(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_semiJoinExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_semiJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_semiJoinExpr))) } // ConstructAntiJoin constructs an expression for the AntiJoin operator. func (_f *Factory) ConstructAntiJoin( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _antiJoinExpr := makeAntiJoinExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_antiJoinExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _antiJoinExpr := memo.MakeAntiJoinExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_antiJoinExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_antiJoinExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_antiJoinExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructAntiJoin(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_antiJoinExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_antiJoinExpr.Fingerprint(), _group) return _group } } @@ -698,16 +699,16 @@ func (_f *Factory) ConstructAntiJoin( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructAntiJoin(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_antiJoinExpr.fingerprint(), _group) + _group = _f.ConstructAntiJoin(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_antiJoinExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_antiJoinExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_antiJoinExpr))) } // ConstructInnerJoinApply constructs an expression for the InnerJoinApply operator. @@ -715,28 +716,28 @@ func (_f *Factory) ConstructAntiJoin( // InnerJoin, it allows the right input to refer to columns projected by the // left input. func (_f *Factory) ConstructInnerJoinApply( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _innerJoinApplyExpr := makeInnerJoinApplyExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_innerJoinApplyExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _innerJoinApplyExpr := memo.MakeInnerJoinApplyExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_innerJoinApplyExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_innerJoinApplyExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_innerJoinApplyExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructInnerJoinApply(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_innerJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -744,26 +745,26 @@ func (_f *Factory) ConstructInnerJoinApply( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructInnerJoinApply(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_innerJoinApplyExpr.fingerprint(), _group) + _group = _f.ConstructInnerJoinApply(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_innerJoinApplyExpr.Fingerprint(), _group) return _group } } // [PushDownJoinLeft] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, right) { _f.o.reportOptimization(PushDownJoinLeft) _group = _f.ConstructInnerJoinApply(_f.ConstructSelect(left, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, right))), right, _f.ConstructFilters(_f.extractCorrelatedConditions(list, right))) - _f.mem.addAltFingerprint(_innerJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -772,48 +773,48 @@ func (_f *Factory) ConstructInnerJoinApply( // [PushDownJoinRight] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, left) { _f.o.reportOptimization(PushDownJoinRight) _group = _f.ConstructInnerJoinApply(left, _f.ConstructSelect(right, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, left))), _f.ConstructFilters(_f.extractCorrelatedConditions(list, left))) - _f.mem.addAltFingerprint(_innerJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_innerJoinApplyExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_innerJoinApplyExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_innerJoinApplyExpr))) } // ConstructLeftJoinApply constructs an expression for the LeftJoinApply operator. func (_f *Factory) ConstructLeftJoinApply( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _leftJoinApplyExpr := makeLeftJoinApplyExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_leftJoinApplyExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _leftJoinApplyExpr := memo.MakeLeftJoinApplyExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_leftJoinApplyExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_leftJoinApplyExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_leftJoinApplyExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructLeftJoinApply(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_leftJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leftJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -821,59 +822,59 @@ func (_f *Factory) ConstructLeftJoinApply( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructLeftJoinApply(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_leftJoinApplyExpr.fingerprint(), _group) + _group = _f.ConstructLeftJoinApply(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_leftJoinApplyExpr.Fingerprint(), _group) return _group } } // [PushDownJoinRight] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, left) { _f.o.reportOptimization(PushDownJoinRight) _group = _f.ConstructLeftJoinApply(left, _f.ConstructSelect(right, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, left))), _f.ConstructFilters(_f.extractCorrelatedConditions(list, left))) - _f.mem.addAltFingerprint(_leftJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leftJoinApplyExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_leftJoinApplyExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_leftJoinApplyExpr))) } // ConstructRightJoinApply constructs an expression for the RightJoinApply operator. func (_f *Factory) ConstructRightJoinApply( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _rightJoinApplyExpr := makeRightJoinApplyExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_rightJoinApplyExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _rightJoinApplyExpr := memo.MakeRightJoinApplyExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_rightJoinApplyExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_rightJoinApplyExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_rightJoinApplyExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructRightJoinApply(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_rightJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_rightJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -881,59 +882,59 @@ func (_f *Factory) ConstructRightJoinApply( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructRightJoinApply(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_rightJoinApplyExpr.fingerprint(), _group) + _group = _f.ConstructRightJoinApply(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_rightJoinApplyExpr.Fingerprint(), _group) return _group } } // [PushDownJoinLeft] { - _filters := _f.mem.lookupNormExpr(on).asFilters() + _filters := _f.mem.NormExpr(on).AsFilters() if _filters != nil { - list := _filters.conditions() - for _, _item := range _f.mem.lookupList(_filters.conditions()) { + list := _filters.Conditions() + for _, _item := range _f.mem.LookupList(_filters.Conditions()) { condition := _item if !_f.isCorrelated(condition, right) { _f.o.reportOptimization(PushDownJoinLeft) _group = _f.ConstructRightJoinApply(_f.ConstructSelect(left, _f.ConstructFilters(_f.extractUncorrelatedConditions(list, right))), right, _f.ConstructFilters(_f.extractCorrelatedConditions(list, right))) - _f.mem.addAltFingerprint(_rightJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_rightJoinApplyExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_rightJoinApplyExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_rightJoinApplyExpr))) } // ConstructFullJoinApply constructs an expression for the FullJoinApply operator. func (_f *Factory) ConstructFullJoinApply( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _fullJoinApplyExpr := makeFullJoinApplyExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_fullJoinApplyExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _fullJoinApplyExpr := memo.MakeFullJoinApplyExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_fullJoinApplyExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fullJoinApplyExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fullJoinApplyExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructFullJoinApply(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_fullJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fullJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -941,42 +942,42 @@ func (_f *Factory) ConstructFullJoinApply( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructFullJoinApply(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_fullJoinApplyExpr.fingerprint(), _group) + _group = _f.ConstructFullJoinApply(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_fullJoinApplyExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fullJoinApplyExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fullJoinApplyExpr))) } // ConstructSemiJoinApply constructs an expression for the SemiJoinApply operator. func (_f *Factory) ConstructSemiJoinApply( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _semiJoinApplyExpr := makeSemiJoinApplyExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_semiJoinApplyExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _semiJoinApplyExpr := memo.MakeSemiJoinApplyExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_semiJoinApplyExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_semiJoinApplyExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_semiJoinApplyExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructSemiJoinApply(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_semiJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_semiJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -984,42 +985,42 @@ func (_f *Factory) ConstructSemiJoinApply( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructSemiJoinApply(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_semiJoinApplyExpr.fingerprint(), _group) + _group = _f.ConstructSemiJoinApply(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_semiJoinApplyExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_semiJoinApplyExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_semiJoinApplyExpr))) } // ConstructAntiJoinApply constructs an expression for the AntiJoinApply operator. func (_f *Factory) ConstructAntiJoinApply( - left opt.GroupID, - right opt.GroupID, - on opt.GroupID, -) opt.GroupID { - _antiJoinApplyExpr := makeAntiJoinApplyExpr(left, right, on) - _group := _f.mem.lookupGroupByFingerprint(_antiJoinApplyExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + on memo.GroupID, +) memo.GroupID { + _antiJoinApplyExpr := memo.MakeAntiJoinApplyExpr(left, right, on) + _group := _f.mem.GroupByFingerprint(_antiJoinApplyExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_antiJoinApplyExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_antiJoinApplyExpr)) } // [EnsureJoinFiltersAnd] { - _and := _f.mem.lookupNormExpr(on).asAnd() + _and := _f.mem.NormExpr(on).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(EnsureJoinFiltersAnd) _group = _f.ConstructAntiJoinApply(left, right, _f.ConstructFilters(conditions)) - _f.mem.addAltFingerprint(_antiJoinApplyExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_antiJoinApplyExpr.Fingerprint(), _group) return _group } } @@ -1027,16 +1028,16 @@ func (_f *Factory) ConstructAntiJoinApply( // [EnsureJoinFilters] { filter := on - _norm := _f.mem.lookupNormExpr(on) - if !(_norm.op == opt.FiltersOp || _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp) { + _norm := _f.mem.NormExpr(on) + if !(_norm.Operator() == opt.FiltersOp || _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp) { _f.o.reportOptimization(EnsureJoinFilters) - _group = _f.ConstructAntiJoinApply(left, right, _f.ConstructFilters(_f.mem.internList([]opt.GroupID{filter}))) - _f.mem.addAltFingerprint(_antiJoinApplyExpr.fingerprint(), _group) + _group = _f.ConstructAntiJoinApply(left, right, _f.ConstructFilters(_f.mem.InternList([]memo.GroupID{filter}))) + _f.mem.AddAltFingerprint(_antiJoinApplyExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_antiJoinApplyExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_antiJoinApplyExpr))) } // ConstructGroupBy constructs an expression for the GroupBy operator. @@ -1046,18 +1047,18 @@ func (_f *Factory) ConstructAntiJoinApply( // aggregations as described by Aggregations (which is always an Aggregations // operator). The arguments of the aggregations are columns from the input. func (_f *Factory) ConstructGroupBy( - input opt.GroupID, - aggregations opt.GroupID, - groupingCols opt.PrivateID, -) opt.GroupID { - _groupByExpr := makeGroupByExpr(input, aggregations, groupingCols) - _group := _f.mem.lookupGroupByFingerprint(_groupByExpr.fingerprint()) + input memo.GroupID, + aggregations memo.GroupID, + groupingCols memo.PrivateID, +) memo.GroupID { + _groupByExpr := memo.MakeGroupByExpr(input, aggregations, groupingCols) + _group := _f.mem.GroupByFingerprint(_groupByExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_groupByExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_groupByExpr)) } // [FilterUnusedGroupByCols] @@ -1065,12 +1066,12 @@ func (_f *Factory) ConstructGroupBy( if _f.hasUnusedColumns(input, _f.neededColsGroupBy(aggregations, groupingCols)) { _f.o.reportOptimization(FilterUnusedGroupByCols) _group = _f.ConstructGroupBy(_f.filterUnusedColumns(input, _f.neededColsGroupBy(aggregations, groupingCols)), aggregations, groupingCols) - _f.mem.addAltFingerprint(_groupByExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_groupByExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_groupByExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_groupByExpr))) } // ConstructUnion constructs an expression for the Union operator. @@ -1080,21 +1081,21 @@ func (_f *Factory) ConstructGroupBy( // of the Union with the output columns. See the comment above opt.SetOpColMap // for more details. func (_f *Factory) ConstructUnion( - left opt.GroupID, - right opt.GroupID, - colMap opt.PrivateID, -) opt.GroupID { - _unionExpr := makeUnionExpr(left, right, colMap) - _group := _f.mem.lookupGroupByFingerprint(_unionExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + colMap memo.PrivateID, +) memo.GroupID { + _unionExpr := memo.MakeUnionExpr(left, right, colMap) + _group := _f.mem.GroupByFingerprint(_unionExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_unionExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_unionExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_unionExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_unionExpr))) } // ConstructIntersect constructs an expression for the Intersect operator. @@ -1106,21 +1107,21 @@ func (_f *Factory) ConstructUnion( // of the Intersect with the output columns. See the comment above // opt.SetOpColMap for more details. func (_f *Factory) ConstructIntersect( - left opt.GroupID, - right opt.GroupID, - colMap opt.PrivateID, -) opt.GroupID { - _intersectExpr := makeIntersectExpr(left, right, colMap) - _group := _f.mem.lookupGroupByFingerprint(_intersectExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + colMap memo.PrivateID, +) memo.GroupID { + _intersectExpr := memo.MakeIntersectExpr(left, right, colMap) + _group := _f.mem.GroupByFingerprint(_intersectExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_intersectExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_intersectExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_intersectExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_intersectExpr))) } // ConstructExcept constructs an expression for the Except operator. @@ -1131,21 +1132,21 @@ func (_f *Factory) ConstructIntersect( // of the Except with the output columns. See the comment above opt.SetOpColMap // for more details. func (_f *Factory) ConstructExcept( - left opt.GroupID, - right opt.GroupID, - colMap opt.PrivateID, -) opt.GroupID { - _exceptExpr := makeExceptExpr(left, right, colMap) - _group := _f.mem.lookupGroupByFingerprint(_exceptExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + colMap memo.PrivateID, +) memo.GroupID { + _exceptExpr := memo.MakeExceptExpr(left, right, colMap) + _group := _f.mem.GroupByFingerprint(_exceptExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_exceptExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_exceptExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_exceptExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_exceptExpr))) } // ConstructUnionAll constructs an expression for the UnionAll operator. @@ -1166,21 +1167,21 @@ func (_f *Factory) ConstructExcept( // of the UnionAll with the output columns. See the comment above // opt.SetOpColMap for more details. func (_f *Factory) ConstructUnionAll( - left opt.GroupID, - right opt.GroupID, - colMap opt.PrivateID, -) opt.GroupID { - _unionAllExpr := makeUnionAllExpr(left, right, colMap) - _group := _f.mem.lookupGroupByFingerprint(_unionAllExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + colMap memo.PrivateID, +) memo.GroupID { + _unionAllExpr := memo.MakeUnionAllExpr(left, right, colMap) + _group := _f.mem.GroupByFingerprint(_unionAllExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_unionAllExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_unionAllExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_unionAllExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_unionAllExpr))) } // ConstructIntersectAll constructs an expression for the IntersectAll operator. @@ -1203,21 +1204,21 @@ func (_f *Factory) ConstructUnionAll( // of the IntersectAll with the output columns. See the comment above // opt.SetOpColMap for more details. func (_f *Factory) ConstructIntersectAll( - left opt.GroupID, - right opt.GroupID, - colMap opt.PrivateID, -) opt.GroupID { - _intersectAllExpr := makeIntersectAllExpr(left, right, colMap) - _group := _f.mem.lookupGroupByFingerprint(_intersectAllExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + colMap memo.PrivateID, +) memo.GroupID { + _intersectAllExpr := memo.MakeIntersectAllExpr(left, right, colMap) + _group := _f.mem.GroupByFingerprint(_intersectAllExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_intersectAllExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_intersectAllExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_intersectAllExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_intersectAllExpr))) } // ConstructExceptAll constructs an expression for the ExceptAll operator. @@ -1240,21 +1241,21 @@ func (_f *Factory) ConstructIntersectAll( // of the ExceptAll with the output columns. See the comment above // opt.SetOpColMap for more details. func (_f *Factory) ConstructExceptAll( - left opt.GroupID, - right opt.GroupID, - colMap opt.PrivateID, -) opt.GroupID { - _exceptAllExpr := makeExceptAllExpr(left, right, colMap) - _group := _f.mem.lookupGroupByFingerprint(_exceptAllExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, + colMap memo.PrivateID, +) memo.GroupID { + _exceptAllExpr := memo.MakeExceptAllExpr(left, right, colMap) + _group := _f.mem.GroupByFingerprint(_exceptAllExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_exceptAllExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_exceptAllExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_exceptAllExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_exceptAllExpr))) } // ConstructLimit constructs an expression for the Limit operator. @@ -1263,98 +1264,98 @@ func (_f *Factory) ConstructExceptAll( // rows. The private field is an *opt.Ordering which indicates the desired // row ordering (the first rows with respect to this ordering are returned). func (_f *Factory) ConstructLimit( - input opt.GroupID, - limit opt.GroupID, - ordering opt.PrivateID, -) opt.GroupID { - _limitExpr := makeLimitExpr(input, limit, ordering) - _group := _f.mem.lookupGroupByFingerprint(_limitExpr.fingerprint()) + input memo.GroupID, + limit memo.GroupID, + ordering memo.PrivateID, +) memo.GroupID { + _limitExpr := memo.MakeLimitExpr(input, limit, ordering) + _group := _f.mem.GroupByFingerprint(_limitExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_limitExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_limitExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_limitExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_limitExpr))) } // ConstructOffset constructs an expression for the Offset operator. // Offset filters out the first Offset rows of the input relation; used in // conjunction with Limit. func (_f *Factory) ConstructOffset( - input opt.GroupID, - offset opt.GroupID, - ordering opt.PrivateID, -) opt.GroupID { - _offsetExpr := makeOffsetExpr(input, offset, ordering) - _group := _f.mem.lookupGroupByFingerprint(_offsetExpr.fingerprint()) + input memo.GroupID, + offset memo.GroupID, + ordering memo.PrivateID, +) memo.GroupID { + _offsetExpr := memo.MakeOffsetExpr(input, offset, ordering) + _group := _f.mem.GroupByFingerprint(_offsetExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_offsetExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_offsetExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_offsetExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_offsetExpr))) } // ConstructSubquery constructs an expression for the Subquery operator. func (_f *Factory) ConstructSubquery( - input opt.GroupID, - projection opt.GroupID, -) opt.GroupID { - _subqueryExpr := makeSubqueryExpr(input, projection) - _group := _f.mem.lookupGroupByFingerprint(_subqueryExpr.fingerprint()) + input memo.GroupID, + projection memo.GroupID, +) memo.GroupID { + _subqueryExpr := memo.MakeSubqueryExpr(input, projection) + _group := _f.mem.GroupByFingerprint(_subqueryExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_subqueryExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_subqueryExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_subqueryExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_subqueryExpr))) } // ConstructVariable constructs an expression for the Variable operator. // Variable is the typed scalar value of a column in the query. The private // field is a Metadata.ColumnIndex that references the column by index. func (_f *Factory) ConstructVariable( - col opt.PrivateID, -) opt.GroupID { - _variableExpr := makeVariableExpr(col) - _group := _f.mem.lookupGroupByFingerprint(_variableExpr.fingerprint()) + col memo.PrivateID, +) memo.GroupID { + _variableExpr := memo.MakeVariableExpr(col) + _group := _f.mem.GroupByFingerprint(_variableExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_variableExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_variableExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_variableExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_variableExpr))) } // ConstructConst constructs an expression for the Const operator. // Const is a typed scalar constant value. The private field is a tree.Datum // value having any datum type that's legal in the expression's context. func (_f *Factory) ConstructConst( - value opt.PrivateID, -) opt.GroupID { - _constExpr := makeConstExpr(value) - _group := _f.mem.lookupGroupByFingerprint(_constExpr.fingerprint()) + value memo.PrivateID, +) memo.GroupID { + _constExpr := memo.MakeConstExpr(value) + _group := _f.mem.GroupByFingerprint(_constExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_constExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_constExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_constExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_constExpr))) } // ConstructNull constructs an expression for the Null operator. @@ -1375,89 +1376,89 @@ func (_f *Factory) ConstructConst( // and replacement easier and more efficient, as patterns can contain (Null) // expressions. func (_f *Factory) ConstructNull( - typ opt.PrivateID, -) opt.GroupID { - _nullExpr := makeNullExpr(typ) - _group := _f.mem.lookupGroupByFingerprint(_nullExpr.fingerprint()) + typ memo.PrivateID, +) memo.GroupID { + _nullExpr := memo.MakeNullExpr(typ) + _group := _f.mem.GroupByFingerprint(_nullExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_nullExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_nullExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_nullExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_nullExpr))) } // ConstructTrue constructs an expression for the True operator. // True is the boolean true value that is equivalent to the tree.DBoolTrue datum // value. It is a separate operator to make matching and replacement simpler and // more efficient, as patterns can contain (True) expressions. -func (_f *Factory) ConstructTrue() opt.GroupID { - _trueExpr := makeTrueExpr() - _group := _f.mem.lookupGroupByFingerprint(_trueExpr.fingerprint()) +func (_f *Factory) ConstructTrue() memo.GroupID { + _trueExpr := memo.MakeTrueExpr() + _group := _f.mem.GroupByFingerprint(_trueExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_trueExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_trueExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_trueExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_trueExpr))) } // ConstructFalse constructs an expression for the False operator. // False is the boolean false value that is equivalent to the tree.DBoolFalse // datum value. It is a separate operator to make matching and replacement // simpler and more efficient, as patterns can contain (False) expressions. -func (_f *Factory) ConstructFalse() opt.GroupID { - _falseExpr := makeFalseExpr() - _group := _f.mem.lookupGroupByFingerprint(_falseExpr.fingerprint()) +func (_f *Factory) ConstructFalse() memo.GroupID { + _falseExpr := memo.MakeFalseExpr() + _group := _f.mem.GroupByFingerprint(_falseExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_falseExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_falseExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_falseExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_falseExpr))) } // ConstructPlaceholder constructs an expression for the Placeholder operator. func (_f *Factory) ConstructPlaceholder( - value opt.PrivateID, -) opt.GroupID { - _placeholderExpr := makePlaceholderExpr(value) - _group := _f.mem.lookupGroupByFingerprint(_placeholderExpr.fingerprint()) + value memo.PrivateID, +) memo.GroupID { + _placeholderExpr := memo.MakePlaceholderExpr(value) + _group := _f.mem.GroupByFingerprint(_placeholderExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_placeholderExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_placeholderExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_placeholderExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_placeholderExpr))) } // ConstructTuple constructs an expression for the Tuple operator. func (_f *Factory) ConstructTuple( - elems opt.ListID, -) opt.GroupID { - _tupleExpr := makeTupleExpr(elems) - _group := _f.mem.lookupGroupByFingerprint(_tupleExpr.fingerprint()) + elems memo.ListID, +) memo.GroupID { + _tupleExpr := memo.MakeTupleExpr(elems) + _group := _f.mem.GroupByFingerprint(_tupleExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_tupleExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_tupleExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_tupleExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_tupleExpr))) } // ConstructProjections constructs an expression for the Projections operator. @@ -1466,20 +1467,20 @@ func (_f *Factory) ConstructTuple( // the list of column indexes returned by the expression, as a *opt.ColList. It // is not legal for Cols to be empty. func (_f *Factory) ConstructProjections( - elems opt.ListID, - cols opt.PrivateID, -) opt.GroupID { - _projectionsExpr := makeProjectionsExpr(elems, cols) - _group := _f.mem.lookupGroupByFingerprint(_projectionsExpr.fingerprint()) + elems memo.ListID, + cols memo.PrivateID, +) memo.GroupID { + _projectionsExpr := memo.MakeProjectionsExpr(elems, cols) + _group := _f.mem.GroupByFingerprint(_projectionsExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_projectionsExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_projectionsExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_projectionsExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_projectionsExpr))) } // ConstructAggregations constructs an expression for the Aggregations operator. @@ -1488,37 +1489,37 @@ func (_f *Factory) ConstructProjections( // the list of column indexes returned by the expression, as a *ColList. It // is legal for Cols to be empty. func (_f *Factory) ConstructAggregations( - aggs opt.ListID, - cols opt.PrivateID, -) opt.GroupID { - _aggregationsExpr := makeAggregationsExpr(aggs, cols) - _group := _f.mem.lookupGroupByFingerprint(_aggregationsExpr.fingerprint()) + aggs memo.ListID, + cols memo.PrivateID, +) memo.GroupID { + _aggregationsExpr := memo.MakeAggregationsExpr(aggs, cols) + _group := _f.mem.GroupByFingerprint(_aggregationsExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_aggregationsExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_aggregationsExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_aggregationsExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_aggregationsExpr))) } // ConstructExists constructs an expression for the Exists operator. func (_f *Factory) ConstructExists( - input opt.GroupID, -) opt.GroupID { - _existsExpr := makeExistsExpr(input) - _group := _f.mem.lookupGroupByFingerprint(_existsExpr.fingerprint()) + input memo.GroupID, +) memo.GroupID { + _existsExpr := memo.MakeExistsExpr(input) + _group := _f.mem.GroupByFingerprint(_existsExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_existsExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_existsExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_existsExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_existsExpr))) } // ConstructFilters constructs an expression for the Filters operator. @@ -1534,16 +1535,16 @@ func (_f *Factory) ConstructExists( // when matching, even in the case where there is only one condition. The // semantics of the Filters operator are identical to those of the And operator. func (_f *Factory) ConstructFilters( - conditions opt.ListID, -) opt.GroupID { - _filtersExpr := makeFiltersExpr(conditions) - _group := _f.mem.lookupGroupByFingerprint(_filtersExpr.fingerprint()) + conditions memo.ListID, +) memo.GroupID { + _filtersExpr := memo.MakeFiltersExpr(conditions) + _group := _f.mem.GroupByFingerprint(_filtersExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_filtersExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_filtersExpr)) } // [EliminateEmptyAnd] @@ -1551,25 +1552,25 @@ func (_f *Factory) ConstructFilters( if conditions.Length == 0 { _f.o.reportOptimization(EliminateEmptyAnd) _group = _f.ConstructTrue() - _f.mem.addAltFingerprint(_filtersExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_filtersExpr.Fingerprint(), _group) return _group } } // [SimplifyFilters] { - for _, _item := range _f.mem.lookupList(conditions) { - _norm := _f.mem.lookupNormExpr(_item) - if _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp || _norm.op == opt.NullOp { + for _, _item := range _f.mem.LookupList(conditions) { + _norm := _f.mem.NormExpr(_item) + if _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp || _norm.Operator() == opt.NullOp { _f.o.reportOptimization(SimplifyFilters) _group = _f.simplifyFilters(conditions) - _f.mem.addAltFingerprint(_filtersExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_filtersExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_filtersExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_filtersExpr))) } // ConstructAnd constructs an expression for the And operator. @@ -1577,16 +1578,16 @@ func (_f *Factory) ConstructFilters( // conditions evaluate to true. If the conditions list is empty, it evalutes to // true. func (_f *Factory) ConstructAnd( - conditions opt.ListID, -) opt.GroupID { - _andExpr := makeAndExpr(conditions) - _group := _f.mem.lookupGroupByFingerprint(_andExpr.fingerprint()) + conditions memo.ListID, +) memo.GroupID { + _andExpr := memo.MakeAndExpr(conditions) + _group := _f.mem.GroupByFingerprint(_andExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_andExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_andExpr)) } // [EliminateEmptyAnd] @@ -1594,7 +1595,7 @@ func (_f *Factory) ConstructAnd( if conditions.Length == 0 { _f.o.reportOptimization(EliminateEmptyAnd) _group = _f.ConstructTrue() - _f.mem.addAltFingerprint(_andExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_andExpr.Fingerprint(), _group) return _group } } @@ -1602,23 +1603,23 @@ func (_f *Factory) ConstructAnd( // [EliminateSingletonAndOr] { if conditions.Length == 1 { - _item := _f.mem.lookupList(conditions)[0] + _item := _f.mem.LookupList(conditions)[0] item := _item _f.o.reportOptimization(EliminateSingletonAndOr) _group = item - _f.mem.addAltFingerprint(_andExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_andExpr.Fingerprint(), _group) return _group } } // [SimplifyAnd] { - for _, _item := range _f.mem.lookupList(conditions) { - _norm := _f.mem.lookupNormExpr(_item) - if _norm.op == opt.AndOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp { + for _, _item := range _f.mem.LookupList(conditions) { + _norm := _f.mem.NormExpr(_item) + if _norm.Operator() == opt.AndOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp { _f.o.reportOptimization(SimplifyAnd) _group = _f.simplifyAnd(conditions) - _f.mem.addAltFingerprint(_andExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_andExpr.Fingerprint(), _group) return _group } } @@ -1627,20 +1628,20 @@ func (_f *Factory) ConstructAnd( // [FoldNullAndOr] { if conditions.Length > 0 { - _item := _f.mem.lookupList(conditions)[0] - _null := _f.mem.lookupNormExpr(_item).asNull() + _item := _f.mem.LookupList(conditions)[0] + _null := _f.mem.NormExpr(_item).AsNull() if _null != nil { if _f.listOnlyHasNulls(conditions) { _f.o.reportOptimization(FoldNullAndOr) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_andExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_andExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_andExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_andExpr))) } // ConstructOr constructs an expression for the Or operator. @@ -1648,16 +1649,16 @@ func (_f *Factory) ConstructAnd( // conditions evaluate to true. If the conditions list is empty, it evaluates to // false. func (_f *Factory) ConstructOr( - conditions opt.ListID, -) opt.GroupID { - _orExpr := makeOrExpr(conditions) - _group := _f.mem.lookupGroupByFingerprint(_orExpr.fingerprint()) + conditions memo.ListID, +) memo.GroupID { + _orExpr := memo.MakeOrExpr(conditions) + _group := _f.mem.GroupByFingerprint(_orExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_orExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_orExpr)) } // [EliminateEmptyOr] @@ -1665,7 +1666,7 @@ func (_f *Factory) ConstructOr( if conditions.Length == 0 { _f.o.reportOptimization(EliminateEmptyOr) _group = _f.ConstructFalse() - _f.mem.addAltFingerprint(_orExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_orExpr.Fingerprint(), _group) return _group } } @@ -1673,23 +1674,23 @@ func (_f *Factory) ConstructOr( // [EliminateSingletonAndOr] { if conditions.Length == 1 { - _item := _f.mem.lookupList(conditions)[0] + _item := _f.mem.LookupList(conditions)[0] item := _item _f.o.reportOptimization(EliminateSingletonAndOr) _group = item - _f.mem.addAltFingerprint(_orExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_orExpr.Fingerprint(), _group) return _group } } // [SimplifyOr] { - for _, _item := range _f.mem.lookupList(conditions) { - _norm := _f.mem.lookupNormExpr(_item) - if _norm.op == opt.OrOp || _norm.op == opt.TrueOp || _norm.op == opt.FalseOp { + for _, _item := range _f.mem.LookupList(conditions) { + _norm := _f.mem.NormExpr(_item) + if _norm.Operator() == opt.OrOp || _norm.Operator() == opt.TrueOp || _norm.Operator() == opt.FalseOp { _f.o.reportOptimization(SimplifyOr) _group = _f.simplifyOr(conditions) - _f.mem.addAltFingerprint(_orExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_orExpr.Fingerprint(), _group) return _group } } @@ -1698,49 +1699,49 @@ func (_f *Factory) ConstructOr( // [FoldNullAndOr] { if conditions.Length > 0 { - _item := _f.mem.lookupList(conditions)[0] - _null := _f.mem.lookupNormExpr(_item).asNull() + _item := _f.mem.LookupList(conditions)[0] + _null := _f.mem.NormExpr(_item).AsNull() if _null != nil { if _f.listOnlyHasNulls(conditions) { _f.o.reportOptimization(FoldNullAndOr) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_orExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_orExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_orExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_orExpr))) } // ConstructNot constructs an expression for the Not operator. // Not is the boolean negation operator that evaluates to true if its input // evalutes to false. func (_f *Factory) ConstructNot( - input opt.GroupID, -) opt.GroupID { - _notExpr := makeNotExpr(input) - _group := _f.mem.lookupGroupByFingerprint(_notExpr.fingerprint()) + input memo.GroupID, +) memo.GroupID { + _notExpr := memo.MakeNotExpr(input) + _group := _f.mem.GroupByFingerprint(_notExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notExpr)) } // [NegateComparison] { - _norm := _f.mem.lookupNormExpr(input) - if _norm.isComparison() { - left := _norm.childGroup(_f.mem, 0) - right := _norm.childGroup(_f.mem, 1) - _contains := _f.mem.lookupNormExpr(input).asContains() + _norm := _f.mem.NormExpr(input) + if _norm.IsComparison() { + left := _norm.ChildGroup(_f.mem, 0) + right := _norm.ChildGroup(_f.mem, 1) + _contains := _f.mem.NormExpr(input).AsContains() if _contains == nil { _f.o.reportOptimization(NegateComparison) - _group = _f.negateComparison(_f.mem.lookupNormExpr(input).op, left, right) - _f.mem.addAltFingerprint(_notExpr.fingerprint(), _group) + _group = _f.negateComparison(_f.mem.NormExpr(input).Operator(), left, right) + _f.mem.AddAltFingerprint(_notExpr.Fingerprint(), _group) return _group } } @@ -1748,71 +1749,71 @@ func (_f *Factory) ConstructNot( // [EliminateNot] { - _not := _f.mem.lookupNormExpr(input).asNot() + _not := _f.mem.NormExpr(input).AsNot() if _not != nil { - input := _not.input() + input := _not.Input() _f.o.reportOptimization(EliminateNot) _group = input - _f.mem.addAltFingerprint(_notExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notExpr.Fingerprint(), _group) return _group } } // [NegateAnd] { - _and := _f.mem.lookupNormExpr(input).asAnd() + _and := _f.mem.NormExpr(input).AsAnd() if _and != nil { - conditions := _and.conditions() + conditions := _and.Conditions() _f.o.reportOptimization(NegateAnd) _group = _f.ConstructOr(_f.negateConditions(conditions)) - _f.mem.addAltFingerprint(_notExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notExpr.Fingerprint(), _group) return _group } } // [NegateOr] { - _or := _f.mem.lookupNormExpr(input).asOr() + _or := _f.mem.NormExpr(input).AsOr() if _or != nil { - conditions := _or.conditions() + conditions := _or.Conditions() _f.o.reportOptimization(NegateOr) _group = _f.ConstructAnd(_f.negateConditions(conditions)) - _f.mem.addAltFingerprint(_notExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notExpr))) } // ConstructEq constructs an expression for the Eq operator. func (_f *Factory) ConstructEq( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _eqExpr := makeEqExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_eqExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _eqExpr := memo.MakeEqExpr(left, right) + _group := _f.mem.GroupByFingerprint(_eqExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_eqExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_eqExpr)) } // [NormalizeCmpPlusConst] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() + leftLeft := _plus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _plus.right() + leftRight := _plus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpPlusConst) _group = _f.ConstructEq(leftLeft, _f.ConstructMinus(right, leftRight)) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -1823,17 +1824,17 @@ func (_f *Factory) ConstructEq( // [NormalizeCmpMinusConst] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.PlusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpMinusConst) _group = _f.ConstructEq(leftLeft, _f.ConstructPlus(right, leftRight)) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -1844,17 +1845,17 @@ func (_f *Factory) ConstructEq( // [NormalizeCmpConstMinus] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if _f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if !_f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, leftLeft, right) { _f.o.reportOptimization(NormalizeCmpConstMinus) _group = _f.ConstructEq(_f.ConstructMinus(leftLeft, right), leftRight) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -1865,15 +1866,15 @@ func (_f *Factory) ConstructEq( // [NormalizeTupleEquality] { - _tuple := _f.mem.lookupNormExpr(left).asTuple() + _tuple := _f.mem.NormExpr(left).AsTuple() if _tuple != nil { - left := _tuple.elems() - _tuple2 := _f.mem.lookupNormExpr(right).asTuple() + left := _tuple.Elems() + _tuple2 := _f.mem.NormExpr(right).AsTuple() if _tuple2 != nil { - right := _tuple2.elems() + right := _tuple2.Elems() _f.o.reportOptimization(NormalizeTupleEquality) _group = _f.normalizeTupleEquality(left, right) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -1881,35 +1882,35 @@ func (_f *Factory) ConstructEq( // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructEq(right, left) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } @@ -1921,39 +1922,39 @@ func (_f *Factory) ConstructEq( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructEq(right, left) - _f.mem.addAltFingerprint(_eqExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_eqExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_eqExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_eqExpr))) } // ConstructLt constructs an expression for the Lt operator. func (_f *Factory) ConstructLt( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _ltExpr := makeLtExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_ltExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _ltExpr := memo.MakeLtExpr(left, right) + _group := _f.mem.GroupByFingerprint(_ltExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_ltExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_ltExpr)) } // [CommuteVarInequality] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVarInequality) _group = _f.commuteInequality(opt.LtOp, left, right) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } @@ -1965,7 +1966,7 @@ func (_f *Factory) ConstructLt( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConstInequality) _group = _f.commuteInequality(opt.LtOp, left, right) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } @@ -1973,17 +1974,17 @@ func (_f *Factory) ConstructLt( // [NormalizeCmpPlusConst] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() + leftLeft := _plus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _plus.right() + leftRight := _plus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpPlusConst) _group = _f.ConstructLt(leftLeft, _f.ConstructMinus(right, leftRight)) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } @@ -1994,17 +1995,17 @@ func (_f *Factory) ConstructLt( // [NormalizeCmpMinusConst] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.PlusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpMinusConst) _group = _f.ConstructLt(leftLeft, _f.ConstructPlus(right, leftRight)) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } @@ -2015,17 +2016,17 @@ func (_f *Factory) ConstructLt( // [NormalizeCmpConstMinus] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if _f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if !_f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, leftLeft, right) { _f.o.reportOptimization(NormalizeCmpConstMinus) _group = _f.ConstructLt(_f.ConstructMinus(leftLeft, right), leftRight) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } @@ -2036,53 +2037,53 @@ func (_f *Factory) ConstructLt( // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_ltExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_ltExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_ltExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_ltExpr))) } // ConstructGt constructs an expression for the Gt operator. func (_f *Factory) ConstructGt( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _gtExpr := makeGtExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_gtExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _gtExpr := memo.MakeGtExpr(left, right) + _group := _f.mem.GroupByFingerprint(_gtExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_gtExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_gtExpr)) } // [CommuteVarInequality] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVarInequality) _group = _f.commuteInequality(opt.GtOp, left, right) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } @@ -2094,7 +2095,7 @@ func (_f *Factory) ConstructGt( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConstInequality) _group = _f.commuteInequality(opt.GtOp, left, right) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } @@ -2102,17 +2103,17 @@ func (_f *Factory) ConstructGt( // [NormalizeCmpPlusConst] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() + leftLeft := _plus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _plus.right() + leftRight := _plus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpPlusConst) _group = _f.ConstructGt(leftLeft, _f.ConstructMinus(right, leftRight)) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } @@ -2123,17 +2124,17 @@ func (_f *Factory) ConstructGt( // [NormalizeCmpMinusConst] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.PlusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpMinusConst) _group = _f.ConstructGt(leftLeft, _f.ConstructPlus(right, leftRight)) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } @@ -2144,17 +2145,17 @@ func (_f *Factory) ConstructGt( // [NormalizeCmpConstMinus] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if _f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if !_f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, leftLeft, right) { _f.o.reportOptimization(NormalizeCmpConstMinus) _group = _f.ConstructGt(_f.ConstructMinus(leftLeft, right), leftRight) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } @@ -2165,53 +2166,53 @@ func (_f *Factory) ConstructGt( // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_gtExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_gtExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_gtExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_gtExpr))) } // ConstructLe constructs an expression for the Le operator. func (_f *Factory) ConstructLe( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _leExpr := makeLeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_leExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _leExpr := memo.MakeLeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_leExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_leExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_leExpr)) } // [CommuteVarInequality] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVarInequality) _group = _f.commuteInequality(opt.LeOp, left, right) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } @@ -2223,7 +2224,7 @@ func (_f *Factory) ConstructLe( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConstInequality) _group = _f.commuteInequality(opt.LeOp, left, right) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } @@ -2231,17 +2232,17 @@ func (_f *Factory) ConstructLe( // [NormalizeCmpPlusConst] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() + leftLeft := _plus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _plus.right() + leftRight := _plus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpPlusConst) _group = _f.ConstructLe(leftLeft, _f.ConstructMinus(right, leftRight)) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } @@ -2252,17 +2253,17 @@ func (_f *Factory) ConstructLe( // [NormalizeCmpMinusConst] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.PlusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpMinusConst) _group = _f.ConstructLe(leftLeft, _f.ConstructPlus(right, leftRight)) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } @@ -2273,17 +2274,17 @@ func (_f *Factory) ConstructLe( // [NormalizeCmpConstMinus] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if _f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if !_f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, leftLeft, right) { _f.o.reportOptimization(NormalizeCmpConstMinus) _group = _f.ConstructLe(_f.ConstructMinus(leftLeft, right), leftRight) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } @@ -2294,53 +2295,53 @@ func (_f *Factory) ConstructLe( // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_leExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_leExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_leExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_leExpr))) } // ConstructGe constructs an expression for the Ge operator. func (_f *Factory) ConstructGe( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _geExpr := makeGeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_geExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _geExpr := memo.MakeGeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_geExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_geExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_geExpr)) } // [CommuteVarInequality] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVarInequality) _group = _f.commuteInequality(opt.GeOp, left, right) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } @@ -2352,7 +2353,7 @@ func (_f *Factory) ConstructGe( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConstInequality) _group = _f.commuteInequality(opt.GeOp, left, right) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } @@ -2360,17 +2361,17 @@ func (_f *Factory) ConstructGe( // [NormalizeCmpPlusConst] { - _plus := _f.mem.lookupNormExpr(left).asPlus() + _plus := _f.mem.NormExpr(left).AsPlus() if _plus != nil { - leftLeft := _plus.left() + leftLeft := _plus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _plus.right() + leftRight := _plus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpPlusConst) _group = _f.ConstructGe(leftLeft, _f.ConstructMinus(right, leftRight)) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } @@ -2381,17 +2382,17 @@ func (_f *Factory) ConstructGe( // [NormalizeCmpMinusConst] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if !_f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if _f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.PlusOp, right, leftRight) { _f.o.reportOptimization(NormalizeCmpMinusConst) _group = _f.ConstructGe(leftLeft, _f.ConstructPlus(right, leftRight)) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } @@ -2402,17 +2403,17 @@ func (_f *Factory) ConstructGe( // [NormalizeCmpConstMinus] { - _minus := _f.mem.lookupNormExpr(left).asMinus() + _minus := _f.mem.NormExpr(left).AsMinus() if _minus != nil { - leftLeft := _minus.left() + leftLeft := _minus.Left() if _f.onlyConstants(leftLeft) { - leftRight := _minus.right() + leftRight := _minus.Right() if !_f.onlyConstants(leftRight) { if _f.onlyConstants(right) { if _f.canConstructBinary(opt.MinusOp, leftLeft, right) { _f.o.reportOptimization(NormalizeCmpConstMinus) _group = _f.ConstructGe(_f.ConstructMinus(leftLeft, right), leftRight) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } @@ -2423,75 +2424,75 @@ func (_f *Factory) ConstructGe( // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_geExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_geExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_geExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_geExpr))) } // ConstructNe constructs an expression for the Ne operator. func (_f *Factory) ConstructNe( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _neExpr := makeNeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_neExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _neExpr := memo.MakeNeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_neExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_neExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_neExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_neExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_neExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_neExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_neExpr.Fingerprint(), _group) return _group } } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructNe(right, left) - _f.mem.addAltFingerprint(_neExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_neExpr.Fingerprint(), _group) return _group } } @@ -2503,40 +2504,40 @@ func (_f *Factory) ConstructNe( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructNe(right, left) - _f.mem.addAltFingerprint(_neExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_neExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_neExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_neExpr))) } // ConstructIn constructs an expression for the In operator. func (_f *Factory) ConstructIn( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _inExpr := makeInExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_inExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _inExpr := memo.MakeInExpr(left, right) + _group := _f.mem.GroupByFingerprint(_inExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_inExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_inExpr)) } // [FoldNullInNonEmpty] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - if _tuple.elems().Length != 0 { + if _tuple.Elems().Length != 0 { _f.o.reportOptimization(FoldNullInNonEmpty) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_inExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_inExpr.Fingerprint(), _group) return _group } } @@ -2545,14 +2546,14 @@ func (_f *Factory) ConstructIn( // [FoldNullInEmpty] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - if _tuple.elems().Length == 0 { + if _tuple.Elems().Length == 0 { _f.o.reportOptimization(FoldNullInEmpty) _group = _f.ConstructFalse() - _f.mem.addAltFingerprint(_inExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_inExpr.Fingerprint(), _group) return _group } } @@ -2561,13 +2562,13 @@ func (_f *Factory) ConstructIn( // [NormalizeInConst] { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - elems := _tuple.elems() + elems := _tuple.Elems() if !_f.isSortedUniqueList(elems) { _f.o.reportOptimization(NormalizeInConst) _group = _f.ConstructIn(left, _f.ConstructTuple(_f.constructSortedUniqueList(elems))) - _f.mem.addAltFingerprint(_inExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_inExpr.Fingerprint(), _group) return _group } } @@ -2575,49 +2576,49 @@ func (_f *Factory) ConstructIn( // [FoldInNull] { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - if _tuple.elems().Length == 1 { - _item := _f.mem.lookupList(_tuple.elems())[0] - _null := _f.mem.lookupNormExpr(_item).asNull() + if _tuple.Elems().Length == 1 { + _item := _f.mem.LookupList(_tuple.Elems())[0] + _null := _f.mem.NormExpr(_item).AsNull() if _null != nil { _f.o.reportOptimization(FoldInNull) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_inExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_inExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_inExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_inExpr))) } // ConstructNotIn constructs an expression for the NotIn operator. func (_f *Factory) ConstructNotIn( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _notInExpr := makeNotInExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_notInExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _notInExpr := memo.MakeNotInExpr(left, right) + _group := _f.mem.GroupByFingerprint(_notInExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notInExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notInExpr)) } // [FoldNullInNonEmpty] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - if _tuple.elems().Length != 0 { + if _tuple.Elems().Length != 0 { _f.o.reportOptimization(FoldNullInNonEmpty) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notInExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notInExpr.Fingerprint(), _group) return _group } } @@ -2626,14 +2627,14 @@ func (_f *Factory) ConstructNotIn( // [FoldNullNotInEmpty] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - if _tuple.elems().Length == 0 { + if _tuple.Elems().Length == 0 { _f.o.reportOptimization(FoldNullNotInEmpty) _group = _f.ConstructTrue() - _f.mem.addAltFingerprint(_notInExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notInExpr.Fingerprint(), _group) return _group } } @@ -2642,13 +2643,13 @@ func (_f *Factory) ConstructNotIn( // [NormalizeInConst] { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - elems := _tuple.elems() + elems := _tuple.Elems() if !_f.isSortedUniqueList(elems) { _f.o.reportOptimization(NormalizeInConst) _group = _f.ConstructNotIn(left, _f.ConstructTuple(_f.constructSortedUniqueList(elems))) - _f.mem.addAltFingerprint(_notInExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notInExpr.Fingerprint(), _group) return _group } } @@ -2656,448 +2657,448 @@ func (_f *Factory) ConstructNotIn( // [FoldInNull] { - _tuple := _f.mem.lookupNormExpr(right).asTuple() + _tuple := _f.mem.NormExpr(right).AsTuple() if _tuple != nil { - if _tuple.elems().Length == 1 { - _item := _f.mem.lookupList(_tuple.elems())[0] - _null := _f.mem.lookupNormExpr(_item).asNull() + if _tuple.Elems().Length == 1 { + _item := _f.mem.LookupList(_tuple.Elems())[0] + _null := _f.mem.NormExpr(_item).AsNull() if _null != nil { _f.o.reportOptimization(FoldInNull) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notInExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notInExpr.Fingerprint(), _group) return _group } } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notInExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notInExpr))) } // ConstructLike constructs an expression for the Like operator. func (_f *Factory) ConstructLike( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _likeExpr := makeLikeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_likeExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _likeExpr := memo.MakeLikeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_likeExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_likeExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_likeExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_likeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_likeExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_likeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_likeExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_likeExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_likeExpr))) } // ConstructNotLike constructs an expression for the NotLike operator. func (_f *Factory) ConstructNotLike( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _notLikeExpr := makeNotLikeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_notLikeExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _notLikeExpr := memo.MakeNotLikeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_notLikeExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notLikeExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notLikeExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notLikeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notLikeExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notLikeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notLikeExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notLikeExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notLikeExpr))) } // ConstructILike constructs an expression for the ILike operator. func (_f *Factory) ConstructILike( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _iLikeExpr := makeILikeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_iLikeExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _iLikeExpr := memo.MakeILikeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_iLikeExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_iLikeExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_iLikeExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_iLikeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_iLikeExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_iLikeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_iLikeExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_iLikeExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_iLikeExpr))) } // ConstructNotILike constructs an expression for the NotILike operator. func (_f *Factory) ConstructNotILike( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _notILikeExpr := makeNotILikeExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_notILikeExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _notILikeExpr := memo.MakeNotILikeExpr(left, right) + _group := _f.mem.GroupByFingerprint(_notILikeExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notILikeExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notILikeExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notILikeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notILikeExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notILikeExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notILikeExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notILikeExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notILikeExpr))) } // ConstructSimilarTo constructs an expression for the SimilarTo operator. func (_f *Factory) ConstructSimilarTo( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _similarToExpr := makeSimilarToExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_similarToExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _similarToExpr := memo.MakeSimilarToExpr(left, right) + _group := _f.mem.GroupByFingerprint(_similarToExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_similarToExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_similarToExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_similarToExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_similarToExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_similarToExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_similarToExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_similarToExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_similarToExpr))) } // ConstructNotSimilarTo constructs an expression for the NotSimilarTo operator. func (_f *Factory) ConstructNotSimilarTo( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _notSimilarToExpr := makeNotSimilarToExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_notSimilarToExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _notSimilarToExpr := memo.MakeNotSimilarToExpr(left, right) + _group := _f.mem.GroupByFingerprint(_notSimilarToExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notSimilarToExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notSimilarToExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notSimilarToExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notSimilarToExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notSimilarToExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notSimilarToExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notSimilarToExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notSimilarToExpr))) } // ConstructRegMatch constructs an expression for the RegMatch operator. func (_f *Factory) ConstructRegMatch( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _regMatchExpr := makeRegMatchExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_regMatchExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _regMatchExpr := memo.MakeRegMatchExpr(left, right) + _group := _f.mem.GroupByFingerprint(_regMatchExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_regMatchExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_regMatchExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_regMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_regMatchExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_regMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_regMatchExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_regMatchExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_regMatchExpr))) } // ConstructNotRegMatch constructs an expression for the NotRegMatch operator. func (_f *Factory) ConstructNotRegMatch( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _notRegMatchExpr := makeNotRegMatchExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_notRegMatchExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _notRegMatchExpr := memo.MakeNotRegMatchExpr(left, right) + _group := _f.mem.GroupByFingerprint(_notRegMatchExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notRegMatchExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notRegMatchExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notRegMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notRegMatchExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notRegMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notRegMatchExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notRegMatchExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notRegMatchExpr))) } // ConstructRegIMatch constructs an expression for the RegIMatch operator. func (_f *Factory) ConstructRegIMatch( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _regIMatchExpr := makeRegIMatchExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_regIMatchExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _regIMatchExpr := memo.MakeRegIMatchExpr(left, right) + _group := _f.mem.GroupByFingerprint(_regIMatchExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_regIMatchExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_regIMatchExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_regIMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_regIMatchExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_regIMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_regIMatchExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_regIMatchExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_regIMatchExpr))) } // ConstructNotRegIMatch constructs an expression for the NotRegIMatch operator. func (_f *Factory) ConstructNotRegIMatch( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _notRegIMatchExpr := makeNotRegIMatchExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_notRegIMatchExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _notRegIMatchExpr := memo.MakeNotRegIMatchExpr(left, right) + _group := _f.mem.GroupByFingerprint(_notRegIMatchExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_notRegIMatchExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_notRegIMatchExpr)) } // [FoldNullComparisonLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonLeft) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notRegIMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notRegIMatchExpr.Fingerprint(), _group) return _group } } // [FoldNullComparisonRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullComparisonRight) _group = _f.ConstructNull(_f.boolType()) - _f.mem.addAltFingerprint(_notRegIMatchExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_notRegIMatchExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_notRegIMatchExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_notRegIMatchExpr))) } // ConstructIs constructs an expression for the Is operator. func (_f *Factory) ConstructIs( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _isExpr := makeIsExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_isExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _isExpr := memo.MakeIsExpr(left, right) + _group := _f.mem.GroupByFingerprint(_isExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_isExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_isExpr)) } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructIs(right, left) - _f.mem.addAltFingerprint(_isExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_isExpr.Fingerprint(), _group) return _group } } @@ -3109,39 +3110,39 @@ func (_f *Factory) ConstructIs( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructIs(right, left) - _f.mem.addAltFingerprint(_isExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_isExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_isExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_isExpr))) } // ConstructIsNot constructs an expression for the IsNot operator. func (_f *Factory) ConstructIsNot( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _isNotExpr := makeIsNotExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_isNotExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _isNotExpr := memo.MakeIsNotExpr(left, right) + _group := _f.mem.GroupByFingerprint(_isNotExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_isNotExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_isNotExpr)) } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructIsNot(right, left) - _f.mem.addAltFingerprint(_isNotExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_isNotExpr.Fingerprint(), _group) return _group } } @@ -3153,57 +3154,57 @@ func (_f *Factory) ConstructIsNot( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructIsNot(right, left) - _f.mem.addAltFingerprint(_isNotExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_isNotExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_isNotExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_isNotExpr))) } // ConstructContains constructs an expression for the Contains operator. func (_f *Factory) ConstructContains( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _containsExpr := makeContainsExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_containsExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _containsExpr := memo.MakeContainsExpr(left, right) + _group := _f.mem.GroupByFingerprint(_containsExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_containsExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_containsExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_containsExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_containsExpr))) } // ConstructBitand constructs an expression for the Bitand operator. func (_f *Factory) ConstructBitand( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _bitandExpr := makeBitandExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_bitandExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _bitandExpr := memo.MakeBitandExpr(left, right) + _group := _f.mem.GroupByFingerprint(_bitandExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_bitandExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_bitandExpr)) } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructBitand(right, left) - _f.mem.addAltFingerprint(_bitandExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitandExpr.Fingerprint(), _group) return _group } } @@ -3215,7 +3216,7 @@ func (_f *Factory) ConstructBitand( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructBitand(right, left) - _f.mem.addAltFingerprint(_bitandExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitandExpr.Fingerprint(), _group) return _group } } @@ -3223,12 +3224,12 @@ func (_f *Factory) ConstructBitand( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.BitandOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.BitandOp, left, right) - _f.mem.addAltFingerprint(_bitandExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitandExpr.Fingerprint(), _group) return _group } } @@ -3236,44 +3237,44 @@ func (_f *Factory) ConstructBitand( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.BitandOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.BitandOp, left, right) - _f.mem.addAltFingerprint(_bitandExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitandExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_bitandExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_bitandExpr))) } // ConstructBitor constructs an expression for the Bitor operator. func (_f *Factory) ConstructBitor( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _bitorExpr := makeBitorExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_bitorExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _bitorExpr := memo.MakeBitorExpr(left, right) + _group := _f.mem.GroupByFingerprint(_bitorExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_bitorExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_bitorExpr)) } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructBitor(right, left) - _f.mem.addAltFingerprint(_bitorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitorExpr.Fingerprint(), _group) return _group } } @@ -3285,7 +3286,7 @@ func (_f *Factory) ConstructBitor( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructBitor(right, left) - _f.mem.addAltFingerprint(_bitorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitorExpr.Fingerprint(), _group) return _group } } @@ -3293,12 +3294,12 @@ func (_f *Factory) ConstructBitor( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.BitorOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.BitorOp, left, right) - _f.mem.addAltFingerprint(_bitorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitorExpr.Fingerprint(), _group) return _group } } @@ -3306,44 +3307,44 @@ func (_f *Factory) ConstructBitor( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.BitorOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.BitorOp, left, right) - _f.mem.addAltFingerprint(_bitorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitorExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_bitorExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_bitorExpr))) } // ConstructBitxor constructs an expression for the Bitxor operator. func (_f *Factory) ConstructBitxor( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _bitxorExpr := makeBitxorExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_bitxorExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _bitxorExpr := memo.MakeBitxorExpr(left, right) + _group := _f.mem.GroupByFingerprint(_bitxorExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_bitxorExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_bitxorExpr)) } // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructBitxor(right, left) - _f.mem.addAltFingerprint(_bitxorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitxorExpr.Fingerprint(), _group) return _group } } @@ -3355,7 +3356,7 @@ func (_f *Factory) ConstructBitxor( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructBitxor(right, left) - _f.mem.addAltFingerprint(_bitxorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitxorExpr.Fingerprint(), _group) return _group } } @@ -3363,12 +3364,12 @@ func (_f *Factory) ConstructBitxor( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.BitxorOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.BitxorOp, left, right) - _f.mem.addAltFingerprint(_bitxorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitxorExpr.Fingerprint(), _group) return _group } } @@ -3376,43 +3377,43 @@ func (_f *Factory) ConstructBitxor( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.BitxorOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.BitxorOp, left, right) - _f.mem.addAltFingerprint(_bitxorExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_bitxorExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_bitxorExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_bitxorExpr))) } // ConstructPlus constructs an expression for the Plus operator. func (_f *Factory) ConstructPlus( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _plusExpr := makePlusExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_plusExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _plusExpr := memo.MakePlusExpr(left, right) + _group := _f.mem.GroupByFingerprint(_plusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_plusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_plusExpr)) } // [FoldPlusZero] { - _const := _f.mem.lookupNormExpr(right).asConst() + _const := _f.mem.NormExpr(right).AsConst() if _const != nil { if _f.isZero(right) { _f.o.reportOptimization(FoldPlusZero) _group = left - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } @@ -3420,12 +3421,12 @@ func (_f *Factory) ConstructPlus( // [FoldZeroPlus] { - _const := _f.mem.lookupNormExpr(left).asConst() + _const := _f.mem.NormExpr(left).AsConst() if _const != nil { if _f.isZero(left) { _f.o.reportOptimization(FoldZeroPlus) _group = right - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } @@ -3433,13 +3434,13 @@ func (_f *Factory) ConstructPlus( // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructPlus(right, left) - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } @@ -3451,7 +3452,7 @@ func (_f *Factory) ConstructPlus( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructPlus(right, left) - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } @@ -3459,12 +3460,12 @@ func (_f *Factory) ConstructPlus( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.PlusOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.PlusOp, left, right) - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } @@ -3472,43 +3473,43 @@ func (_f *Factory) ConstructPlus( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.PlusOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.PlusOp, left, right) - _f.mem.addAltFingerprint(_plusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_plusExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_plusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_plusExpr))) } // ConstructMinus constructs an expression for the Minus operator. func (_f *Factory) ConstructMinus( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _minusExpr := makeMinusExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_minusExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _minusExpr := memo.MakeMinusExpr(left, right) + _group := _f.mem.GroupByFingerprint(_minusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_minusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_minusExpr)) } // [FoldMinusZero] { - _const := _f.mem.lookupNormExpr(right).asConst() + _const := _f.mem.NormExpr(right).AsConst() if _const != nil { if _f.isZero(right) { _f.o.reportOptimization(FoldMinusZero) _group = left - _f.mem.addAltFingerprint(_minusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_minusExpr.Fingerprint(), _group) return _group } } @@ -3516,12 +3517,12 @@ func (_f *Factory) ConstructMinus( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.MinusOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.MinusOp, left, right) - _f.mem.addAltFingerprint(_minusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_minusExpr.Fingerprint(), _group) return _group } } @@ -3529,43 +3530,43 @@ func (_f *Factory) ConstructMinus( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.MinusOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.MinusOp, left, right) - _f.mem.addAltFingerprint(_minusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_minusExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_minusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_minusExpr))) } // ConstructMult constructs an expression for the Mult operator. func (_f *Factory) ConstructMult( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _multExpr := makeMultExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_multExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _multExpr := memo.MakeMultExpr(left, right) + _group := _f.mem.GroupByFingerprint(_multExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_multExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_multExpr)) } // [FoldMultOne] { - _const := _f.mem.lookupNormExpr(right).asConst() + _const := _f.mem.NormExpr(right).AsConst() if _const != nil { if _f.isOne(right) { _f.o.reportOptimization(FoldMultOne) _group = left - _f.mem.addAltFingerprint(_multExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_multExpr.Fingerprint(), _group) return _group } } @@ -3573,12 +3574,12 @@ func (_f *Factory) ConstructMult( // [FoldOneMult] { - _const := _f.mem.lookupNormExpr(left).asConst() + _const := _f.mem.NormExpr(left).AsConst() if _const != nil { if _f.isOne(left) { _f.o.reportOptimization(FoldOneMult) _group = right - _f.mem.addAltFingerprint(_multExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_multExpr.Fingerprint(), _group) return _group } } @@ -3586,13 +3587,13 @@ func (_f *Factory) ConstructMult( // [CommuteVar] { - _variable := _f.mem.lookupNormExpr(left).asVariable() + _variable := _f.mem.NormExpr(left).AsVariable() if _variable == nil { - _variable2 := _f.mem.lookupNormExpr(right).asVariable() + _variable2 := _f.mem.NormExpr(right).AsVariable() if _variable2 != nil { _f.o.reportOptimization(CommuteVar) _group = _f.ConstructMult(right, left) - _f.mem.addAltFingerprint(_multExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_multExpr.Fingerprint(), _group) return _group } } @@ -3604,7 +3605,7 @@ func (_f *Factory) ConstructMult( if !_f.onlyConstants(right) { _f.o.reportOptimization(CommuteConst) _group = _f.ConstructMult(right, left) - _f.mem.addAltFingerprint(_multExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_multExpr.Fingerprint(), _group) return _group } } @@ -3612,12 +3613,12 @@ func (_f *Factory) ConstructMult( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.MultOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.MultOp, left, right) - _f.mem.addAltFingerprint(_multExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_multExpr.Fingerprint(), _group) return _group } } @@ -3625,43 +3626,43 @@ func (_f *Factory) ConstructMult( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.MultOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.MultOp, left, right) - _f.mem.addAltFingerprint(_multExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_multExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_multExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_multExpr))) } // ConstructDiv constructs an expression for the Div operator. func (_f *Factory) ConstructDiv( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _divExpr := makeDivExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_divExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _divExpr := memo.MakeDivExpr(left, right) + _group := _f.mem.GroupByFingerprint(_divExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_divExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_divExpr)) } // [FoldDivOne] { - _const := _f.mem.lookupNormExpr(right).asConst() + _const := _f.mem.NormExpr(right).AsConst() if _const != nil { if _f.isOne(right) { _f.o.reportOptimization(FoldDivOne) _group = left - _f.mem.addAltFingerprint(_divExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_divExpr.Fingerprint(), _group) return _group } } @@ -3669,12 +3670,12 @@ func (_f *Factory) ConstructDiv( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.DivOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.DivOp, left, right) - _f.mem.addAltFingerprint(_divExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_divExpr.Fingerprint(), _group) return _group } } @@ -3682,43 +3683,43 @@ func (_f *Factory) ConstructDiv( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.DivOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.DivOp, left, right) - _f.mem.addAltFingerprint(_divExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_divExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_divExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_divExpr))) } // ConstructFloorDiv constructs an expression for the FloorDiv operator. func (_f *Factory) ConstructFloorDiv( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _floorDivExpr := makeFloorDivExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_floorDivExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _floorDivExpr := memo.MakeFloorDivExpr(left, right) + _group := _f.mem.GroupByFingerprint(_floorDivExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_floorDivExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_floorDivExpr)) } // [FoldDivOne] { - _const := _f.mem.lookupNormExpr(right).asConst() + _const := _f.mem.NormExpr(right).AsConst() if _const != nil { if _f.isOne(right) { _f.o.reportOptimization(FoldDivOne) _group = left - _f.mem.addAltFingerprint(_floorDivExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_floorDivExpr.Fingerprint(), _group) return _group } } @@ -3726,12 +3727,12 @@ func (_f *Factory) ConstructFloorDiv( // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.FloorDivOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.FloorDivOp, left, right) - _f.mem.addAltFingerprint(_floorDivExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_floorDivExpr.Fingerprint(), _group) return _group } } @@ -3739,43 +3740,43 @@ func (_f *Factory) ConstructFloorDiv( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.FloorDivOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.FloorDivOp, left, right) - _f.mem.addAltFingerprint(_floorDivExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_floorDivExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_floorDivExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_floorDivExpr))) } // ConstructMod constructs an expression for the Mod operator. func (_f *Factory) ConstructMod( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _modExpr := makeModExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_modExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _modExpr := memo.MakeModExpr(left, right) + _group := _f.mem.GroupByFingerprint(_modExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_modExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_modExpr)) } // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.ModOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.ModOp, left, right) - _f.mem.addAltFingerprint(_modExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_modExpr.Fingerprint(), _group) return _group } } @@ -3783,43 +3784,43 @@ func (_f *Factory) ConstructMod( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.ModOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.ModOp, left, right) - _f.mem.addAltFingerprint(_modExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_modExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_modExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_modExpr))) } // ConstructPow constructs an expression for the Pow operator. func (_f *Factory) ConstructPow( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _powExpr := makePowExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_powExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _powExpr := memo.MakePowExpr(left, right) + _group := _f.mem.GroupByFingerprint(_powExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_powExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_powExpr)) } // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.PowOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.PowOp, left, right) - _f.mem.addAltFingerprint(_powExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_powExpr.Fingerprint(), _group) return _group } } @@ -3827,43 +3828,43 @@ func (_f *Factory) ConstructPow( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.PowOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.PowOp, left, right) - _f.mem.addAltFingerprint(_powExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_powExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_powExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_powExpr))) } // ConstructConcat constructs an expression for the Concat operator. func (_f *Factory) ConstructConcat( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _concatExpr := makeConcatExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_concatExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _concatExpr := memo.MakeConcatExpr(left, right) + _group := _f.mem.GroupByFingerprint(_concatExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_concatExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_concatExpr)) } // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.ConcatOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.ConcatOp, left, right) - _f.mem.addAltFingerprint(_concatExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_concatExpr.Fingerprint(), _group) return _group } } @@ -3871,43 +3872,43 @@ func (_f *Factory) ConstructConcat( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.ConcatOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.ConcatOp, left, right) - _f.mem.addAltFingerprint(_concatExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_concatExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_concatExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_concatExpr))) } // ConstructLShift constructs an expression for the LShift operator. func (_f *Factory) ConstructLShift( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _lShiftExpr := makeLShiftExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_lShiftExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _lShiftExpr := memo.MakeLShiftExpr(left, right) + _group := _f.mem.GroupByFingerprint(_lShiftExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_lShiftExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_lShiftExpr)) } // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.LShiftOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.LShiftOp, left, right) - _f.mem.addAltFingerprint(_lShiftExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_lShiftExpr.Fingerprint(), _group) return _group } } @@ -3915,43 +3916,43 @@ func (_f *Factory) ConstructLShift( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.LShiftOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.LShiftOp, left, right) - _f.mem.addAltFingerprint(_lShiftExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_lShiftExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_lShiftExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_lShiftExpr))) } // ConstructRShift constructs an expression for the RShift operator. func (_f *Factory) ConstructRShift( - left opt.GroupID, - right opt.GroupID, -) opt.GroupID { - _rShiftExpr := makeRShiftExpr(left, right) - _group := _f.mem.lookupGroupByFingerprint(_rShiftExpr.fingerprint()) + left memo.GroupID, + right memo.GroupID, +) memo.GroupID { + _rShiftExpr := memo.MakeRShiftExpr(left, right) + _group := _f.mem.GroupByFingerprint(_rShiftExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_rShiftExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_rShiftExpr)) } // [FoldNullBinaryLeft] { - _null := _f.mem.lookupNormExpr(left).asNull() + _null := _f.mem.NormExpr(left).AsNull() if _null != nil { if !_f.allowNullArgs(opt.RShiftOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.RShiftOp, left, right) - _f.mem.addAltFingerprint(_rShiftExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_rShiftExpr.Fingerprint(), _group) return _group } } @@ -3959,45 +3960,45 @@ func (_f *Factory) ConstructRShift( // [FoldNullBinaryRight] { - _null := _f.mem.lookupNormExpr(right).asNull() + _null := _f.mem.NormExpr(right).AsNull() if _null != nil { if !_f.allowNullArgs(opt.RShiftOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.RShiftOp, left, right) - _f.mem.addAltFingerprint(_rShiftExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_rShiftExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_rShiftExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_rShiftExpr))) } // ConstructFetchVal constructs an expression for the FetchVal operator. func (_f *Factory) ConstructFetchVal( - json opt.GroupID, - index opt.GroupID, -) opt.GroupID { - _fetchValExpr := makeFetchValExpr(json, index) - _group := _f.mem.lookupGroupByFingerprint(_fetchValExpr.fingerprint()) + json memo.GroupID, + index memo.GroupID, +) memo.GroupID { + _fetchValExpr := memo.MakeFetchValExpr(json, index) + _group := _f.mem.GroupByFingerprint(_fetchValExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fetchValExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fetchValExpr)) } // [FoldNullBinaryLeft] { left := json - _null := _f.mem.lookupNormExpr(json).asNull() + _null := _f.mem.NormExpr(json).AsNull() if _null != nil { right := index if !_f.allowNullArgs(opt.FetchValOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.FetchValOp, left, right) - _f.mem.addAltFingerprint(_fetchValExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchValExpr.Fingerprint(), _group) return _group } } @@ -4007,45 +4008,45 @@ func (_f *Factory) ConstructFetchVal( { left := json right := index - _null := _f.mem.lookupNormExpr(index).asNull() + _null := _f.mem.NormExpr(index).AsNull() if _null != nil { if !_f.allowNullArgs(opt.FetchValOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.FetchValOp, left, right) - _f.mem.addAltFingerprint(_fetchValExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchValExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fetchValExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fetchValExpr))) } // ConstructFetchText constructs an expression for the FetchText operator. func (_f *Factory) ConstructFetchText( - json opt.GroupID, - index opt.GroupID, -) opt.GroupID { - _fetchTextExpr := makeFetchTextExpr(json, index) - _group := _f.mem.lookupGroupByFingerprint(_fetchTextExpr.fingerprint()) + json memo.GroupID, + index memo.GroupID, +) memo.GroupID { + _fetchTextExpr := memo.MakeFetchTextExpr(json, index) + _group := _f.mem.GroupByFingerprint(_fetchTextExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fetchTextExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fetchTextExpr)) } // [FoldNullBinaryLeft] { left := json - _null := _f.mem.lookupNormExpr(json).asNull() + _null := _f.mem.NormExpr(json).AsNull() if _null != nil { right := index if !_f.allowNullArgs(opt.FetchTextOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.FetchTextOp, left, right) - _f.mem.addAltFingerprint(_fetchTextExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchTextExpr.Fingerprint(), _group) return _group } } @@ -4055,45 +4056,45 @@ func (_f *Factory) ConstructFetchText( { left := json right := index - _null := _f.mem.lookupNormExpr(index).asNull() + _null := _f.mem.NormExpr(index).AsNull() if _null != nil { if !_f.allowNullArgs(opt.FetchTextOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.FetchTextOp, left, right) - _f.mem.addAltFingerprint(_fetchTextExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchTextExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fetchTextExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fetchTextExpr))) } // ConstructFetchValPath constructs an expression for the FetchValPath operator. func (_f *Factory) ConstructFetchValPath( - json opt.GroupID, - path opt.GroupID, -) opt.GroupID { - _fetchValPathExpr := makeFetchValPathExpr(json, path) - _group := _f.mem.lookupGroupByFingerprint(_fetchValPathExpr.fingerprint()) + json memo.GroupID, + path memo.GroupID, +) memo.GroupID { + _fetchValPathExpr := memo.MakeFetchValPathExpr(json, path) + _group := _f.mem.GroupByFingerprint(_fetchValPathExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fetchValPathExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fetchValPathExpr)) } // [FoldNullBinaryLeft] { left := json - _null := _f.mem.lookupNormExpr(json).asNull() + _null := _f.mem.NormExpr(json).AsNull() if _null != nil { right := path if !_f.allowNullArgs(opt.FetchValPathOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.FetchValPathOp, left, right) - _f.mem.addAltFingerprint(_fetchValPathExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchValPathExpr.Fingerprint(), _group) return _group } } @@ -4103,45 +4104,45 @@ func (_f *Factory) ConstructFetchValPath( { left := json right := path - _null := _f.mem.lookupNormExpr(path).asNull() + _null := _f.mem.NormExpr(path).AsNull() if _null != nil { if !_f.allowNullArgs(opt.FetchValPathOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.FetchValPathOp, left, right) - _f.mem.addAltFingerprint(_fetchValPathExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchValPathExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fetchValPathExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fetchValPathExpr))) } // ConstructFetchTextPath constructs an expression for the FetchTextPath operator. func (_f *Factory) ConstructFetchTextPath( - json opt.GroupID, - path opt.GroupID, -) opt.GroupID { - _fetchTextPathExpr := makeFetchTextPathExpr(json, path) - _group := _f.mem.lookupGroupByFingerprint(_fetchTextPathExpr.fingerprint()) + json memo.GroupID, + path memo.GroupID, +) memo.GroupID { + _fetchTextPathExpr := memo.MakeFetchTextPathExpr(json, path) + _group := _f.mem.GroupByFingerprint(_fetchTextPathExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_fetchTextPathExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_fetchTextPathExpr)) } // [FoldNullBinaryLeft] { left := json - _null := _f.mem.lookupNormExpr(json).asNull() + _null := _f.mem.NormExpr(json).AsNull() if _null != nil { right := path if !_f.allowNullArgs(opt.FetchTextPathOp, left, right) { _f.o.reportOptimization(FoldNullBinaryLeft) _group = _f.foldNullBinary(opt.FetchTextPathOp, left, right) - _f.mem.addAltFingerprint(_fetchTextPathExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchTextPathExpr.Fingerprint(), _group) return _group } } @@ -4151,44 +4152,44 @@ func (_f *Factory) ConstructFetchTextPath( { left := json right := path - _null := _f.mem.lookupNormExpr(path).asNull() + _null := _f.mem.NormExpr(path).AsNull() if _null != nil { if !_f.allowNullArgs(opt.FetchTextPathOp, left, right) { _f.o.reportOptimization(FoldNullBinaryRight) _group = _f.foldNullBinary(opt.FetchTextPathOp, left, right) - _f.mem.addAltFingerprint(_fetchTextPathExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_fetchTextPathExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_fetchTextPathExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_fetchTextPathExpr))) } // ConstructUnaryMinus constructs an expression for the UnaryMinus operator. func (_f *Factory) ConstructUnaryMinus( - input opt.GroupID, -) opt.GroupID { - _unaryMinusExpr := makeUnaryMinusExpr(input) - _group := _f.mem.lookupGroupByFingerprint(_unaryMinusExpr.fingerprint()) + input memo.GroupID, +) memo.GroupID { + _unaryMinusExpr := memo.MakeUnaryMinusExpr(input) + _group := _f.mem.GroupByFingerprint(_unaryMinusExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_unaryMinusExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_unaryMinusExpr)) } // [InvertMinus] { - _minus := _f.mem.lookupNormExpr(input).asMinus() + _minus := _f.mem.NormExpr(input).AsMinus() if _minus != nil { - left := _minus.left() - right := _minus.right() + left := _minus.Left() + right := _minus.Right() if _f.canConstructBinary(opt.MinusOp, right, left) { _f.o.reportOptimization(InvertMinus) _group = _f.ConstructMinus(right, left) - _f.mem.addAltFingerprint(_unaryMinusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_unaryMinusExpr.Fingerprint(), _group) return _group } } @@ -4196,71 +4197,71 @@ func (_f *Factory) ConstructUnaryMinus( // [EliminateUnaryMinus] { - _unaryMinus := _f.mem.lookupNormExpr(input).asUnaryMinus() + _unaryMinus := _f.mem.NormExpr(input).AsUnaryMinus() if _unaryMinus != nil { - input := _unaryMinus.input() + input := _unaryMinus.Input() _f.o.reportOptimization(EliminateUnaryMinus) _group = input - _f.mem.addAltFingerprint(_unaryMinusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_unaryMinusExpr.Fingerprint(), _group) return _group } } // [FoldNullUnary] { - _null := _f.mem.lookupNormExpr(input).asNull() + _null := _f.mem.NormExpr(input).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullUnary) _group = _f.foldNullUnary(opt.UnaryMinusOp, input) - _f.mem.addAltFingerprint(_unaryMinusExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_unaryMinusExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_unaryMinusExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_unaryMinusExpr))) } // ConstructUnaryComplement constructs an expression for the UnaryComplement operator. func (_f *Factory) ConstructUnaryComplement( - input opt.GroupID, -) opt.GroupID { - _unaryComplementExpr := makeUnaryComplementExpr(input) - _group := _f.mem.lookupGroupByFingerprint(_unaryComplementExpr.fingerprint()) + input memo.GroupID, +) memo.GroupID { + _unaryComplementExpr := memo.MakeUnaryComplementExpr(input) + _group := _f.mem.GroupByFingerprint(_unaryComplementExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_unaryComplementExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_unaryComplementExpr)) } // [FoldNullUnary] { - _null := _f.mem.lookupNormExpr(input).asNull() + _null := _f.mem.NormExpr(input).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullUnary) _group = _f.foldNullUnary(opt.UnaryComplementOp, input) - _f.mem.addAltFingerprint(_unaryComplementExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_unaryComplementExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_unaryComplementExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_unaryComplementExpr))) } // ConstructCast constructs an expression for the Cast operator. func (_f *Factory) ConstructCast( - input opt.GroupID, - typ opt.PrivateID, -) opt.GroupID { - _castExpr := makeCastExpr(input, typ) - _group := _f.mem.lookupGroupByFingerprint(_castExpr.fingerprint()) + input memo.GroupID, + typ memo.PrivateID, +) memo.GroupID { + _castExpr := memo.MakeCastExpr(input, typ) + _group := _f.mem.GroupByFingerprint(_castExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_castExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_castExpr)) } // [EliminateCast] @@ -4268,23 +4269,23 @@ func (_f *Factory) ConstructCast( if _f.hasType(input, typ) { _f.o.reportOptimization(EliminateCast) _group = input - _f.mem.addAltFingerprint(_castExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_castExpr.Fingerprint(), _group) return _group } } // [FoldNullCast] { - _null := _f.mem.lookupNormExpr(input).asNull() + _null := _f.mem.NormExpr(input).AsNull() if _null != nil { _f.o.reportOptimization(FoldNullCast) _group = _f.ConstructNull(typ) - _f.mem.addAltFingerprint(_castExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_castExpr.Fingerprint(), _group) return _group } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_castExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_castExpr))) } // ConstructCase constructs an expression for the Case operator. @@ -4305,20 +4306,20 @@ func (_f *Factory) ConstructCast( // branches as well as the ELSE statement if it exists. It is of the form: // [(When <condval1> <expr1>),(When <condval2> <expr2>),...,<expr>] func (_f *Factory) ConstructCase( - input opt.GroupID, - whens opt.ListID, -) opt.GroupID { - _caseExpr := makeCaseExpr(input, whens) - _group := _f.mem.lookupGroupByFingerprint(_caseExpr.fingerprint()) + input memo.GroupID, + whens memo.ListID, +) memo.GroupID { + _caseExpr := memo.MakeCaseExpr(input, whens) + _group := _f.mem.GroupByFingerprint(_caseExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_caseExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_caseExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_caseExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_caseExpr))) } // ConstructWhen constructs an expression for the When operator. @@ -4326,20 +4327,20 @@ func (_f *Factory) ConstructCase( // It is the type of each list item in Whens (except for the last item which is // a raw expression for the ELSE statement). func (_f *Factory) ConstructWhen( - condition opt.GroupID, - value opt.GroupID, -) opt.GroupID { - _whenExpr := makeWhenExpr(condition, value) - _group := _f.mem.lookupGroupByFingerprint(_whenExpr.fingerprint()) + condition memo.GroupID, + value memo.GroupID, +) memo.GroupID { + _whenExpr := memo.MakeWhenExpr(condition, value) + _group := _f.mem.GroupByFingerprint(_whenExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_whenExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_whenExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_whenExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_whenExpr))) } // ConstructFunction constructs an expression for the Function operator. @@ -4347,44 +4348,44 @@ func (_f *Factory) ConstructWhen( // arguments. The private field is an opt.FuncOpDef struct that provides the // name of the function as well as a pointer to the builtin overload definition. func (_f *Factory) ConstructFunction( - args opt.ListID, - def opt.PrivateID, -) opt.GroupID { - _functionExpr := makeFunctionExpr(args, def) - _group := _f.mem.lookupGroupByFingerprint(_functionExpr.fingerprint()) + args memo.ListID, + def memo.PrivateID, +) memo.GroupID { + _functionExpr := memo.MakeFunctionExpr(args, def) + _group := _f.mem.GroupByFingerprint(_functionExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_functionExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_functionExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_functionExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_functionExpr))) } // ConstructCoalesce constructs an expression for the Coalesce operator. func (_f *Factory) ConstructCoalesce( - args opt.ListID, -) opt.GroupID { - _coalesceExpr := makeCoalesceExpr(args) - _group := _f.mem.lookupGroupByFingerprint(_coalesceExpr.fingerprint()) + args memo.ListID, +) memo.GroupID { + _coalesceExpr := memo.MakeCoalesceExpr(args) + _group := _f.mem.GroupByFingerprint(_coalesceExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_coalesceExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_coalesceExpr)) } // [EliminateCoalesce] { if args.Length == 1 { - _item := _f.mem.lookupList(args)[0] + _item := _f.mem.LookupList(args)[0] item := _item _f.o.reportOptimization(EliminateCoalesce) _group = item - _f.mem.addAltFingerprint(_coalesceExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_coalesceExpr.Fingerprint(), _group) return _group } } @@ -4392,481 +4393,481 @@ func (_f *Factory) ConstructCoalesce( // [SimplifyCoalesce] { if args.Length > 0 { - _item := _f.mem.lookupList(args)[0] - _norm := _f.mem.lookupNormExpr(_item) - if _norm.isConstValue() { + _item := _f.mem.LookupList(args)[0] + _norm := _f.mem.NormExpr(_item) + if _norm.IsConstValue() { _f.o.reportOptimization(SimplifyCoalesce) _group = _f.simplifyCoalesce(args) - _f.mem.addAltFingerprint(_coalesceExpr.fingerprint(), _group) + _f.mem.AddAltFingerprint(_coalesceExpr.Fingerprint(), _group) return _group } } } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_coalesceExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_coalesceExpr))) } // ConstructUnsupportedExpr constructs an expression for the UnsupportedExpr operator. // UnsupportedExpr is used for interfacing with the old planner code. It can // encapsulate a TypedExpr that is otherwise not supported by the optimizer. func (_f *Factory) ConstructUnsupportedExpr( - value opt.PrivateID, -) opt.GroupID { - _unsupportedExprExpr := makeUnsupportedExprExpr(value) - _group := _f.mem.lookupGroupByFingerprint(_unsupportedExprExpr.fingerprint()) + value memo.PrivateID, +) memo.GroupID { + _unsupportedExprExpr := memo.MakeUnsupportedExprExpr(value) + _group := _f.mem.GroupByFingerprint(_unsupportedExprExpr.Fingerprint()) if _group != 0 { return _group } if !_f.o.allowOptimizations() { - return _f.mem.memoizeNormExpr(memoExpr(_unsupportedExprExpr)) + return _f.mem.MemoizeNormExpr(memo.Expr(_unsupportedExprExpr)) } - return _f.onConstruct(_f.mem.memoizeNormExpr(memoExpr(_unsupportedExprExpr))) + return _f.onConstruct(_f.mem.MemoizeNormExpr(memo.Expr(_unsupportedExprExpr))) } -type dynConstructLookupFunc func(f *Factory, operands opt.DynamicOperands) opt.GroupID +type dynConstructLookupFunc func(f *Factory, operands DynamicOperands) memo.GroupID var dynConstructLookup [opt.NumOperators]dynConstructLookupFunc func init() { // UnknownOp - dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.UnknownOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { panic("op type not initialized") } // ScanOp - dynConstructLookup[opt.ScanOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructScan(opt.PrivateID(operands[0])) + dynConstructLookup[opt.ScanOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructScan(memo.PrivateID(operands[0])) } // ValuesOp - dynConstructLookup[opt.ValuesOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructValues(operands[0].ListID(), opt.PrivateID(operands[1])) + dynConstructLookup[opt.ValuesOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructValues(operands[0].ListID(), memo.PrivateID(operands[1])) } // SelectOp - dynConstructLookup[opt.SelectOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructSelect(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.SelectOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructSelect(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ProjectOp - dynConstructLookup[opt.ProjectOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructProject(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.ProjectOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructProject(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // InnerJoinOp - dynConstructLookup[opt.InnerJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructInnerJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.InnerJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructInnerJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // LeftJoinOp - dynConstructLookup[opt.LeftJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLeftJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.LeftJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLeftJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // RightJoinOp - dynConstructLookup[opt.RightJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructRightJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.RightJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructRightJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // FullJoinOp - dynConstructLookup[opt.FullJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFullJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.FullJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFullJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // SemiJoinOp - dynConstructLookup[opt.SemiJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructSemiJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.SemiJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructSemiJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // AntiJoinOp - dynConstructLookup[opt.AntiJoinOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructAntiJoin(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.AntiJoinOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructAntiJoin(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // InnerJoinApplyOp - dynConstructLookup[opt.InnerJoinApplyOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructInnerJoinApply(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.InnerJoinApplyOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructInnerJoinApply(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // LeftJoinApplyOp - dynConstructLookup[opt.LeftJoinApplyOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLeftJoinApply(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.LeftJoinApplyOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLeftJoinApply(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // RightJoinApplyOp - dynConstructLookup[opt.RightJoinApplyOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructRightJoinApply(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.RightJoinApplyOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructRightJoinApply(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // FullJoinApplyOp - dynConstructLookup[opt.FullJoinApplyOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFullJoinApply(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.FullJoinApplyOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFullJoinApply(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // SemiJoinApplyOp - dynConstructLookup[opt.SemiJoinApplyOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructSemiJoinApply(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.SemiJoinApplyOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructSemiJoinApply(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // AntiJoinApplyOp - dynConstructLookup[opt.AntiJoinApplyOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructAntiJoinApply(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.GroupID(operands[2])) + dynConstructLookup[opt.AntiJoinApplyOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructAntiJoinApply(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.GroupID(operands[2])) } // GroupByOp - dynConstructLookup[opt.GroupByOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructGroupBy(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.GroupByOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructGroupBy(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // UnionOp - dynConstructLookup[opt.UnionOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructUnion(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.UnionOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructUnion(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // IntersectOp - dynConstructLookup[opt.IntersectOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructIntersect(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.IntersectOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructIntersect(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // ExceptOp - dynConstructLookup[opt.ExceptOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructExcept(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.ExceptOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructExcept(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // UnionAllOp - dynConstructLookup[opt.UnionAllOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructUnionAll(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.UnionAllOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructUnionAll(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // IntersectAllOp - dynConstructLookup[opt.IntersectAllOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructIntersectAll(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.IntersectAllOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructIntersectAll(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // ExceptAllOp - dynConstructLookup[opt.ExceptAllOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructExceptAll(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.ExceptAllOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructExceptAll(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // LimitOp - dynConstructLookup[opt.LimitOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLimit(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.LimitOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLimit(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // OffsetOp - dynConstructLookup[opt.OffsetOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructOffset(opt.GroupID(operands[0]), opt.GroupID(operands[1]), opt.PrivateID(operands[2])) + dynConstructLookup[opt.OffsetOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructOffset(memo.GroupID(operands[0]), memo.GroupID(operands[1]), memo.PrivateID(operands[2])) } // SubqueryOp - dynConstructLookup[opt.SubqueryOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructSubquery(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.SubqueryOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructSubquery(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // VariableOp - dynConstructLookup[opt.VariableOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructVariable(opt.PrivateID(operands[0])) + dynConstructLookup[opt.VariableOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructVariable(memo.PrivateID(operands[0])) } // ConstOp - dynConstructLookup[opt.ConstOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructConst(opt.PrivateID(operands[0])) + dynConstructLookup[opt.ConstOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructConst(memo.PrivateID(operands[0])) } // NullOp - dynConstructLookup[opt.NullOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNull(opt.PrivateID(operands[0])) + dynConstructLookup[opt.NullOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNull(memo.PrivateID(operands[0])) } // TrueOp - dynConstructLookup[opt.TrueOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.TrueOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructTrue() } // FalseOp - dynConstructLookup[opt.FalseOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.FalseOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructFalse() } // PlaceholderOp - dynConstructLookup[opt.PlaceholderOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructPlaceholder(opt.PrivateID(operands[0])) + dynConstructLookup[opt.PlaceholderOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructPlaceholder(memo.PrivateID(operands[0])) } // TupleOp - dynConstructLookup[opt.TupleOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.TupleOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructTuple(operands[0].ListID()) } // ProjectionsOp - dynConstructLookup[opt.ProjectionsOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructProjections(operands[0].ListID(), opt.PrivateID(operands[1])) + dynConstructLookup[opt.ProjectionsOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructProjections(operands[0].ListID(), memo.PrivateID(operands[1])) } // AggregationsOp - dynConstructLookup[opt.AggregationsOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructAggregations(operands[0].ListID(), opt.PrivateID(operands[1])) + dynConstructLookup[opt.AggregationsOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructAggregations(operands[0].ListID(), memo.PrivateID(operands[1])) } // ExistsOp - dynConstructLookup[opt.ExistsOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructExists(opt.GroupID(operands[0])) + dynConstructLookup[opt.ExistsOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructExists(memo.GroupID(operands[0])) } // FiltersOp - dynConstructLookup[opt.FiltersOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.FiltersOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructFilters(operands[0].ListID()) } // AndOp - dynConstructLookup[opt.AndOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.AndOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructAnd(operands[0].ListID()) } // OrOp - dynConstructLookup[opt.OrOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.OrOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructOr(operands[0].ListID()) } // NotOp - dynConstructLookup[opt.NotOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNot(opt.GroupID(operands[0])) + dynConstructLookup[opt.NotOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNot(memo.GroupID(operands[0])) } // EqOp - dynConstructLookup[opt.EqOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructEq(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.EqOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructEq(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // LtOp - dynConstructLookup[opt.LtOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLt(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.LtOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLt(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // GtOp - dynConstructLookup[opt.GtOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructGt(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.GtOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructGt(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // LeOp - dynConstructLookup[opt.LeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLe(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.LeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLe(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // GeOp - dynConstructLookup[opt.GeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructGe(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.GeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructGe(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NeOp - dynConstructLookup[opt.NeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNe(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNe(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // InOp - dynConstructLookup[opt.InOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructIn(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.InOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructIn(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotInOp - dynConstructLookup[opt.NotInOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNotIn(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NotInOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNotIn(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // LikeOp - dynConstructLookup[opt.LikeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLike(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.LikeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLike(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotLikeOp - dynConstructLookup[opt.NotLikeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNotLike(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NotLikeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNotLike(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ILikeOp - dynConstructLookup[opt.ILikeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructILike(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.ILikeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructILike(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotILikeOp - dynConstructLookup[opt.NotILikeOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNotILike(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NotILikeOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNotILike(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // SimilarToOp - dynConstructLookup[opt.SimilarToOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructSimilarTo(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.SimilarToOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructSimilarTo(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotSimilarToOp - dynConstructLookup[opt.NotSimilarToOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNotSimilarTo(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NotSimilarToOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNotSimilarTo(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // RegMatchOp - dynConstructLookup[opt.RegMatchOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructRegMatch(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.RegMatchOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructRegMatch(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotRegMatchOp - dynConstructLookup[opt.NotRegMatchOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNotRegMatch(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NotRegMatchOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNotRegMatch(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // RegIMatchOp - dynConstructLookup[opt.RegIMatchOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructRegIMatch(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.RegIMatchOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructRegIMatch(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // NotRegIMatchOp - dynConstructLookup[opt.NotRegIMatchOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructNotRegIMatch(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.NotRegIMatchOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructNotRegIMatch(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // IsOp - dynConstructLookup[opt.IsOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructIs(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.IsOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructIs(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // IsNotOp - dynConstructLookup[opt.IsNotOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructIsNot(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.IsNotOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructIsNot(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ContainsOp - dynConstructLookup[opt.ContainsOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructContains(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.ContainsOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructContains(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // BitandOp - dynConstructLookup[opt.BitandOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructBitand(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.BitandOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructBitand(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // BitorOp - dynConstructLookup[opt.BitorOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructBitor(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.BitorOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructBitor(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // BitxorOp - dynConstructLookup[opt.BitxorOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructBitxor(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.BitxorOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructBitxor(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // PlusOp - dynConstructLookup[opt.PlusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructPlus(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.PlusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructPlus(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // MinusOp - dynConstructLookup[opt.MinusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructMinus(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.MinusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructMinus(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // MultOp - dynConstructLookup[opt.MultOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructMult(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.MultOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructMult(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // DivOp - dynConstructLookup[opt.DivOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructDiv(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.DivOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructDiv(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FloorDivOp - dynConstructLookup[opt.FloorDivOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFloorDiv(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.FloorDivOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFloorDiv(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ModOp - dynConstructLookup[opt.ModOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructMod(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.ModOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructMod(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // PowOp - dynConstructLookup[opt.PowOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructPow(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.PowOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructPow(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // ConcatOp - dynConstructLookup[opt.ConcatOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructConcat(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.ConcatOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructConcat(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // LShiftOp - dynConstructLookup[opt.LShiftOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructLShift(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.LShiftOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructLShift(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // RShiftOp - dynConstructLookup[opt.RShiftOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructRShift(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.RShiftOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructRShift(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FetchValOp - dynConstructLookup[opt.FetchValOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFetchVal(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.FetchValOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFetchVal(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FetchTextOp - dynConstructLookup[opt.FetchTextOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFetchText(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.FetchTextOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFetchText(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FetchValPathOp - dynConstructLookup[opt.FetchValPathOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFetchValPath(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.FetchValPathOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFetchValPath(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FetchTextPathOp - dynConstructLookup[opt.FetchTextPathOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFetchTextPath(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.FetchTextPathOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFetchTextPath(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // UnaryMinusOp - dynConstructLookup[opt.UnaryMinusOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructUnaryMinus(opt.GroupID(operands[0])) + dynConstructLookup[opt.UnaryMinusOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructUnaryMinus(memo.GroupID(operands[0])) } // UnaryComplementOp - dynConstructLookup[opt.UnaryComplementOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructUnaryComplement(opt.GroupID(operands[0])) + dynConstructLookup[opt.UnaryComplementOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructUnaryComplement(memo.GroupID(operands[0])) } // CastOp - dynConstructLookup[opt.CastOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructCast(opt.GroupID(operands[0]), opt.PrivateID(operands[1])) + dynConstructLookup[opt.CastOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructCast(memo.GroupID(operands[0]), memo.PrivateID(operands[1])) } // CaseOp - dynConstructLookup[opt.CaseOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructCase(opt.GroupID(operands[0]), operands[1].ListID()) + dynConstructLookup[opt.CaseOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructCase(memo.GroupID(operands[0]), operands[1].ListID()) } // WhenOp - dynConstructLookup[opt.WhenOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructWhen(opt.GroupID(operands[0]), opt.GroupID(operands[1])) + dynConstructLookup[opt.WhenOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructWhen(memo.GroupID(operands[0]), memo.GroupID(operands[1])) } // FunctionOp - dynConstructLookup[opt.FunctionOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructFunction(operands[0].ListID(), opt.PrivateID(operands[1])) + dynConstructLookup[opt.FunctionOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructFunction(operands[0].ListID(), memo.PrivateID(operands[1])) } // CoalesceOp - dynConstructLookup[opt.CoalesceOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { + dynConstructLookup[opt.CoalesceOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { return f.ConstructCoalesce(operands[0].ListID()) } // UnsupportedExprOp - dynConstructLookup[opt.UnsupportedExprOp] = func(f *Factory, operands opt.DynamicOperands) opt.GroupID { - return f.ConstructUnsupportedExpr(opt.PrivateID(operands[0])) + dynConstructLookup[opt.UnsupportedExprOp] = func(f *Factory, operands DynamicOperands) memo.GroupID { + return f.ConstructUnsupportedExpr(memo.PrivateID(operands[0])) } } -func (f *Factory) DynamicConstruct(op opt.Operator, operands opt.DynamicOperands) opt.GroupID { +func (f *Factory) DynamicConstruct(op opt.Operator, operands DynamicOperands) memo.GroupID { return dynConstructLookup[op](f, operands) } diff --git a/pkg/sql/opt/xform/factory_test.go b/pkg/sql/opt/xform/factory_test.go index 4ad6af25ae82..394f3f1b8e42 100644 --- a/pkg/sql/opt/xform/factory_test.go +++ b/pkg/sql/opt/xform/factory_test.go @@ -19,12 +19,22 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" ) +func TestDynamicListID(t *testing.T) { + listID := memo.ListID{Offset: 1, Length: 2} + dynID := xform.MakeDynamicListID(listID) + roundtripID := dynID.ListID() + if listID != roundtripID { + t.Errorf("invalid ListID/DynamicID conversions") + } +} + // TestSimplifyFilters tests factory.simplifyFilters. It's hard to fully test // using SQL, as And operator rules simplify the expression before the Filters // operator is created. @@ -42,35 +52,35 @@ func TestSimplifyFilters(t *testing.T) { eq := f.ConstructEq(variable, constant) // Filters expression evaluates to False if any operand is False. - conditions := []opt.GroupID{eq, f.ConstructFalse(), eq} + conditions := []memo.GroupID{eq, f.ConstructFalse(), eq} result := f.ConstructFilters(f.InternList(conditions)) - ev := o.Optimize(result, &opt.PhysicalProps{}) + ev := o.Optimize(result, &memo.PhysicalProps{}) if ev.Operator() != opt.FalseOp { t.Fatalf("result should have been False") } // Filters expression evaluates to False if any operand is Null. - conditions = []opt.GroupID{f.ConstructNull(f.InternPrivate(types.Unknown)), eq, eq} + conditions = []memo.GroupID{f.ConstructNull(f.InternPrivate(types.Unknown)), eq, eq} result = f.ConstructFilters(f.InternList(conditions)) - ev = o.Optimize(result, &opt.PhysicalProps{}) + ev = o.Optimize(result, &memo.PhysicalProps{}) if ev.Operator() != opt.FalseOp { t.Fatalf("result should have been False") } // Filters operator skips True operands. - conditions = []opt.GroupID{eq, f.ConstructTrue(), eq, f.ConstructTrue()} + conditions = []memo.GroupID{eq, f.ConstructTrue(), eq, f.ConstructTrue()} result = f.ConstructFilters(f.InternList(conditions)) - ev = o.Optimize(result, &opt.PhysicalProps{}) + ev = o.Optimize(result, &memo.PhysicalProps{}) if ev.Operator() != opt.FiltersOp || ev.ChildCount() != 2 { t.Fatalf("filters result should have filtered True operators") } // Filters operator flattens nested And operands. - conditions = []opt.GroupID{eq, eq} + conditions = []memo.GroupID{eq, eq} and := f.ConstructAnd(f.InternList(conditions)) - conditions = []opt.GroupID{and, eq, and} + conditions = []memo.GroupID{and, eq, and} result = f.ConstructFilters(f.InternList(conditions)) - ev = o.Optimize(result, &opt.PhysicalProps{}) + ev = o.Optimize(result, &memo.PhysicalProps{}) if ev.Operator() != opt.FiltersOp || ev.ChildCount() != 5 { t.Fatalf("result should have flattened And operators") } diff --git a/pkg/sql/opt/xform/match.go b/pkg/sql/opt/xform/match.go index 45b4e7f30d9e..702615f02526 100644 --- a/pkg/sql/opt/xform/match.go +++ b/pkg/sql/opt/xform/match.go @@ -19,11 +19,12 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // MatchesTupleOfConstants returns true if the expression is a TupleOp with // ConstValue children. -func MatchesTupleOfConstants(ev ExprView) bool { +func MatchesTupleOfConstants(ev memo.ExprView) bool { if ev.Operator() != opt.TupleOp { return false } diff --git a/pkg/sql/opt/xform/optimizer.go b/pkg/sql/opt/xform/optimizer.go index 11df2c4ffb47..cffca1ed2b8e 100644 --- a/pkg/sql/opt/xform/optimizer.go +++ b/pkg/sql/opt/xform/optimizer.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/util" "golang.org/x/tools/container/intsets" @@ -58,7 +59,7 @@ const ( // output expression tree with the lowest cost. type Optimizer struct { evalCtx *tree.EvalContext - mem *memo + mem *memo.Memo f *Factory // stateMap allocates temporary storage that's used to speed up optimization. @@ -83,7 +84,7 @@ type Optimizer struct { func NewOptimizer(evalCtx *tree.EvalContext) *Optimizer { o := &Optimizer{ evalCtx: evalCtx, - mem: newMemo(), + mem: memo.New(), stateMap: make(map[optStateKey]int), // By default, search exhaustively for best plan. @@ -107,9 +108,7 @@ func (o *Optimizer) LastRuleName() RuleName { } // Memo returns the memo structure that the optimizer is using to optimize. -// TODO(andyk): Until the memo is exported, return Stringer, since it's only -// used to print the memo for now. -func (o *Optimizer) Memo() fmt.Stringer { +func (o *Optimizer) Memo() *memo.Memo { return o.mem } @@ -117,10 +116,10 @@ func (o *Optimizer) Memo() fmt.Stringer { // properties at the lowest possible execution cost, but is still logically // equivalent to the given expression. If there is a cost "tie", then any one // of the qualifying lowest cost expressions may be selected by the optimizer. -func (o *Optimizer) Optimize(root opt.GroupID, requiredProps *opt.PhysicalProps) ExprView { - required := o.mem.internPhysicalProps(requiredProps) +func (o *Optimizer) Optimize(root memo.GroupID, requiredProps *memo.PhysicalProps) memo.ExprView { + required := o.mem.InternPhysicalProps(requiredProps) state := o.optimizeGroup(root, required) - return makeExprView(o.mem, state.best) + return memo.MakeExprView(o.mem, state.best) } // optimizeGroup enumerates expression trees rooted in the given memo group and @@ -158,7 +157,7 @@ func (o *Optimizer) Optimize(root opt.GroupID, requiredProps *opt.PhysicalProps) // recursively invoking optimizeGroup on the same group #1, but this time // without the ordering requirement. The Scan operator is capable of meeting // these reduced requirements, so it is costed and added as the current lowest -// cost expression (bestExpr) for that group for that set of properties (i.e. +// cost expression (BestExpr) for that group for that set of properties (i.e. // the empty set). // // memo @@ -266,7 +265,7 @@ func (o *Optimizer) Optimize(root opt.GroupID, requiredProps *opt.PhysicalProps) // ├── variable: a.x [type=int] // └── const: 1 [type=int] // -func (o *Optimizer) optimizeGroup(group opt.GroupID, required opt.PhysicalPropsID) *optState { +func (o *Optimizer) optimizeGroup(group memo.GroupID, required memo.PhysicalPropsID) *optState { // If this group is already fully optimized, then return the already // prepared best expression (won't ever get better than this). state := o.ensureOptState(group, required) @@ -276,9 +275,8 @@ func (o *Optimizer) optimizeGroup(group opt.GroupID, required opt.PhysicalPropsI groupFullyOptimized := true - mgrp := o.mem.lookupGroup(group) - for i := 0; i < mgrp.exprCount(); i++ { - eid := exprID{group: group, expr: exprOrdinal(i)} + for i := 0; i < o.mem.ExprCount(group); i++ { + eid := memo.ExprID{Group: group, Expr: memo.ExprOrdinal(i)} // If this expression has already been fully optimized for the given // required properties, then skip it, since it won't get better. @@ -312,7 +310,7 @@ func (o *Optimizer) optimizeGroup(group opt.GroupID, required opt.PhysicalPropsI // calls enforceProps to check whether enforcers can provide the required // properties at a lower cost. The lowest cost expression is saved to the memo // group. -func (o *Optimizer) optimizeExpr(eid exprID, required opt.PhysicalPropsID) *optState { +func (o *Optimizer) optimizeExpr(eid memo.ExprID, required memo.PhysicalPropsID) *optState { fullyOptimized := true // If the expression cannot provide the required properties, then don't @@ -322,10 +320,10 @@ func (o *Optimizer) optimizeExpr(eid exprID, required opt.PhysicalPropsID) *optS // enforcers to provide the remainder. physPropsFactory := &physicalPropsFactory{mem: o.mem} if physPropsFactory.canProvide(eid, required) { - e := o.mem.lookupExpr(eid) - candidateBest := makeBestExpr(e.op, eid, required) - for child := 0; child < e.childCount(); child++ { - childGroup := e.childGroup(o.mem, child) + e := o.mem.Expr(eid) + candidateBest := memo.MakeBestExpr(e.Operator(), eid, required) + for child := 0; child < e.ChildCount(); child++ { + childGroup := e.ChildGroup(o.mem, child) // Given required parent properties, get the properties required from // the nth child. @@ -337,7 +335,7 @@ func (o *Optimizer) optimizeExpr(eid exprID, required opt.PhysicalPropsID) *optS // Remember best child in BestExpr in case this becomes the lowest // cost expression. - candidateBest.addChild(childState.best) + candidateBest.AddChild(childState.best) // If any child expression is not fully optimized, then the parent // expression is also not fully optimized. @@ -347,7 +345,7 @@ func (o *Optimizer) optimizeExpr(eid exprID, required opt.PhysicalPropsID) *optS } // Check whether this is the new lowest cost expression. - o.ratchetCost(eid.group, &candidateBest) + o.ratchetCost(eid.Group, &candidateBest) } // Compute the cost for enforcers to provide the required properties. This @@ -359,7 +357,7 @@ func (o *Optimizer) optimizeExpr(eid exprID, required opt.PhysicalPropsID) *optS // Get the lowest cost expression after considering enforcers, and mark it // as fully optimized if all the combinations have been considered. - state := o.lookupOptState(eid.group, required) + state := o.lookupOptState(eid.Group, required) if fullyOptimized { state.markExprAsFullyOptimized(eid) } @@ -379,10 +377,12 @@ func (o *Optimizer) optimizeExpr(eid exprID, required opt.PhysicalPropsID) *optS // Note that enforceProps will recursively optimize this same group, but with // one less required physical property. The recursive call will eventually make // its way back here, at which point another physical property will be stripped -// off, and so on. Afterwards, the group will have computed a bestExpr for each +// off, and so on. Afterwards, the group will have computed a BestExpr for each // sublist of physical properties, from all down to none. -func (o *Optimizer) enforceProps(eid exprID, required opt.PhysicalPropsID) (fullyOptimized bool) { - props := o.mem.lookupPhysicalProps(required) +func (o *Optimizer) enforceProps( + eid memo.ExprID, required memo.PhysicalPropsID, +) (fullyOptimized bool) { + props := o.mem.LookupPhysicalProps(required) innerProps := *props // Ignore the Presentation property, since any relational or enforcer @@ -407,15 +407,15 @@ func (o *Optimizer) enforceProps(eid exprID, required opt.PhysicalPropsID) (full // Recursively optimize the same group, but now with respect to the "inner" // properties (which are a sublist of the required properties). - innerRequired := o.mem.internPhysicalProps(&innerProps) - innerState := o.optimizeGroup(eid.group, innerRequired) + innerRequired := o.mem.InternPhysicalProps(&innerProps) + innerState := o.optimizeGroup(eid.Group, innerRequired) fullyOptimized = innerState.fullyOptimized // Check whether this is the new lowest cost expression with the enforcer // added. - candidateBest := makeBestExpr(enforcerOp, eid, required) - candidateBest.addChild(innerState.best) - o.ratchetCost(eid.group, &candidateBest) + candidateBest := memo.MakeBestExpr(enforcerOp, eid, required) + candidateBest.AddChild(innerState.best) + o.ratchetCost(eid.Group, &candidateBest) // Enforcer expression is fully optimized if its input expression is fully // optimized. @@ -426,9 +426,9 @@ func (o *Optimizer) enforceProps(eid exprID, required opt.PhysicalPropsID) (full // whether it's lower than the cost of the existing best expression in the // group. If so, then the candidate becomes the new lowest cost expression. // TODO(andyk): Actually run the costing function in the future. -func (o *Optimizer) ratchetCost(group opt.GroupID, candidate *bestExpr) { - best := o.lookupOptState(group, candidate.required).best - o.mem.ratchetBestExpr(best, candidate) +func (o *Optimizer) ratchetCost(group memo.GroupID, candidate *memo.BestExpr) { + best := o.lookupOptState(group, candidate.Required()).best + o.mem.RatchetBestExpr(best, candidate) } // allowOptimizations returns true if optimizations are currently enabled. Each @@ -452,7 +452,7 @@ func (o *Optimizer) reportOptimization(name RuleName) { // properties. If no state exists yet, then lookupOptState returns nil. // NOTE: The returned optState reference is only valid until the next call to // ensureOptState, since it may cause a resize of the optState slice. -func (o *Optimizer) lookupOptState(group opt.GroupID, required opt.PhysicalPropsID) *optState { +func (o *Optimizer) lookupOptState(group memo.GroupID, required memo.PhysicalPropsID) *optState { index, ok := o.stateMap[optStateKey{group: group, required: required}] if !ok { return nil @@ -463,12 +463,11 @@ func (o *Optimizer) lookupOptState(group opt.GroupID, required opt.PhysicalProps // ensureOptState looks up the state associated with the given group and // properties. If none is associated yet, then ensureOptState allocates new // state and returns it. -func (o *Optimizer) ensureOptState(group opt.GroupID, required opt.PhysicalPropsID) *optState { +func (o *Optimizer) ensureOptState(group memo.GroupID, required memo.PhysicalPropsID) *optState { key := optStateKey{group: group, required: required} index, ok := o.stateMap[key] if !ok { - mgrp := o.mem.lookupGroup(group) - best := mgrp.ensureBestExpr(required) + best := o.mem.EnsureBestExpr(group, required) index = len(o.state) o.state = append(o.state, optState{best: best}) o.stateMap[key] = index @@ -479,8 +478,8 @@ func (o *Optimizer) ensureOptState(group opt.GroupID, required opt.PhysicalProps // optStateKey associates optState with a group that is being optimized with // respect to a set of physical properties. type optStateKey struct { - group opt.GroupID - required opt.PhysicalPropsID + group memo.GroupID + required memo.PhysicalPropsID } // optState is temporary storage that's associated with each group that's @@ -491,7 +490,7 @@ type optStateKey struct { type optState struct { // best identifies the lowest cost expression in the memo group for a given // set of physical properties. - best bestExprID + best memo.BestExprID // fullyOptimized is set to true once the lowest cost expression has been // found for a memo group, with respect to the required properties. A lower @@ -509,19 +508,19 @@ type optState struct { // isExprFullyOptimized returns true if the given expression has been fully // optimized for the required properties. The expression never needs to be // recosted, no matter how many additional optimization passes are made. -func (os *optState) isExprFullyOptimized(eid exprID) bool { - return os.fullyOptimizedExprs.Contains(int(eid.expr)) +func (os *optState) isExprFullyOptimized(eid memo.ExprID) bool { + return os.fullyOptimizedExprs.Contains(int(eid.Expr)) } // markExprAsFullyOptimized marks the given expression as fully optimized for // the required properties. The expression never needs to be recosted, no // matter how many additional optimization passes are made. -func (os *optState) markExprAsFullyOptimized(eid exprID) { +func (os *optState) markExprAsFullyOptimized(eid memo.ExprID) { if os.fullyOptimized { panic("best expression is already fully optimized") } if os.isExprFullyOptimized(eid) { panic("memo expression is already fully optimized for required physical properties") } - os.fullyOptimizedExprs.Add(int(eid.expr)) + os.fullyOptimizedExprs.Add(int(eid.Expr)) } diff --git a/pkg/sql/opt/xform/physical_props_factory.go b/pkg/sql/opt/xform/physical_props_factory.go index e37d73c5260d..82f81b489cb6 100644 --- a/pkg/sql/opt/xform/physical_props_factory.go +++ b/pkg/sql/opt/xform/physical_props_factory.go @@ -16,6 +16,7 @@ package xform import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" ) // physicalPropsFactory determines what physical properties a given expression @@ -31,13 +32,13 @@ import ( // NOTE: The factory is defined as an empty struct with methods rather than as // functions in order to keep the methods grouped and self-contained. type physicalPropsFactory struct { - mem *memo + mem *memo.Memo } // canProvide returns true if the given expression can provide the required // physical properties. -func (f physicalPropsFactory) canProvide(eid exprID, required opt.PhysicalPropsID) bool { - requiredProps := f.mem.lookupPhysicalProps(required) +func (f physicalPropsFactory) canProvide(eid memo.ExprID, required memo.PhysicalPropsID) bool { + requiredProps := f.mem.LookupPhysicalProps(required) if requiredProps.Presentation.Defined() { if !f.canProvidePresentation(eid, requiredProps.Presentation) { @@ -57,9 +58,11 @@ func (f physicalPropsFactory) canProvide(eid exprID, required opt.PhysicalPropsI // canProvidePresentation returns true if the given expression can provide the // required presentation property. Currently, all relational operators are // capable of doing this. -func (f physicalPropsFactory) canProvidePresentation(eid exprID, required opt.Presentation) bool { - mexpr := f.mem.lookupExpr(eid) - if !mexpr.isRelational() { +func (f physicalPropsFactory) canProvidePresentation( + eid memo.ExprID, required memo.Presentation, +) bool { + mexpr := f.mem.Expr(eid) + if !mexpr.IsRelational() { panic("presentation property doesn't apply to non-relational operators") } @@ -69,13 +72,13 @@ func (f physicalPropsFactory) canProvidePresentation(eid exprID, required opt.Pr // canProvideOrdering returns true if the given expression can provide the // required ordering property. -func (f physicalPropsFactory) canProvideOrdering(eid exprID, required opt.Ordering) bool { - mexpr := f.mem.lookupExpr(eid) - if !mexpr.isRelational() { +func (f physicalPropsFactory) canProvideOrdering(eid memo.ExprID, required memo.Ordering) bool { + mexpr := f.mem.Expr(eid) + if !mexpr.IsRelational() { panic("ordering property doesn't apply to non-relational operators") } - switch mexpr.op { + switch mexpr.Operator() { case opt.SelectOp: // Select operator can always pass through ordering to its input. return true @@ -83,8 +86,8 @@ func (f physicalPropsFactory) canProvideOrdering(eid exprID, required opt.Orderi case opt.ProjectOp: // Project operator can pass through ordering if it operates only on // input columns. - input := mexpr.asProject().input() - inputCols := f.mem.lookupGroup(input).logical.Relational.OutputCols + input := mexpr.AsProject().Input() + inputCols := f.mem.GroupProperties(input).Relational.OutputCols for _, colOrder := range required { if colOrder < 0 { // Descending order, so recover original index. @@ -98,14 +101,14 @@ func (f physicalPropsFactory) canProvideOrdering(eid exprID, required opt.Orderi case opt.ScanOp: // Scan naturally orders according to the primary index. - def := mexpr.private(f.mem).(*opt.ScanOpDef) - primary := f.mem.metadata.Table(def.Table).Primary() + def := mexpr.Private(f.mem).(*memo.ScanOpDef) + primary := f.mem.Metadata().Table(def.Table).Primary() // Scan can project subset of columns. - ordering := make(opt.Ordering, 0, primary.ColumnCount()) + ordering := make(memo.Ordering, 0, primary.ColumnCount()) for i := 0; i < primary.ColumnCount(); i++ { primaryCol := primary.Column(i) - colIndex := f.mem.metadata.TableColumn(def.Table, primaryCol.Ordinal) + colIndex := f.mem.Metadata().TableColumn(def.Table, primaryCol.Ordinal) if def.Cols.Contains(int(colIndex)) { orderingCol := opt.MakeOrderingColumn(colIndex, primaryCol.Descending) ordering = append(ordering, orderingCol) @@ -116,11 +119,11 @@ func (f physicalPropsFactory) canProvideOrdering(eid exprID, required opt.Orderi case opt.LimitOp: // Limit can provide the same ordering it requires of its input. - return f.mem.lookupPrivate(mexpr.asLimit().ordering()).(*opt.Ordering).Provides(required) + return f.mem.LookupPrivate(mexpr.AsLimit().Ordering()).(*memo.Ordering).Provides(required) case opt.OffsetOp: // Offset can provide the same ordering it requires of its input. - return f.mem.lookupPrivate(mexpr.asOffset().ordering()).(*opt.Ordering).Provides(required) + return f.mem.LookupPrivate(mexpr.AsOffset().Ordering()).(*memo.Ordering).Provides(required) } return false @@ -132,29 +135,29 @@ func (f physicalPropsFactory) canProvideOrdering(eid exprID, required opt.Orderi // but provides any presentation requirement. This method is heavily called // during ExprView traversal, so performance is important. func (f physicalPropsFactory) constructChildProps( - parent exprID, required opt.PhysicalPropsID, nth int, -) opt.PhysicalPropsID { - mexpr := f.mem.lookupExpr(parent) + parent memo.ExprID, required memo.PhysicalPropsID, nth int, +) memo.PhysicalPropsID { + mexpr := f.mem.Expr(parent) - if required == opt.MinPhysPropsID { - switch mexpr.op { + if required == memo.MinPhysPropsID { + switch mexpr.Operator() { case opt.LimitOp, opt.OffsetOp: default: // Fast path taken in common case when no properties are required of // parent and the operator itself does not require any properties. - return opt.MinPhysPropsID + return memo.MinPhysPropsID } } - parentProps := f.mem.lookupPhysicalProps(required) + parentProps := f.mem.LookupPhysicalProps(required) - var childProps opt.PhysicalProps + var childProps memo.PhysicalProps // Presentation property is provided by all the relational operators, so // don't add it to childProps. // Ordering property. - switch mexpr.op { + switch mexpr.Operator() { case opt.SelectOp, opt.ProjectOp: if nth == 0 { // Pass through the ordering. @@ -164,13 +167,13 @@ func (f physicalPropsFactory) constructChildProps( case opt.LimitOp, opt.OffsetOp: // Limit/Offset require the ordering in their private. if nth == 0 { - var ordering opt.PrivateID - if mexpr.op == opt.LimitOp { - ordering = mexpr.asLimit().ordering() + var ordering memo.PrivateID + if mexpr.Operator() == opt.LimitOp { + ordering = mexpr.AsLimit().Ordering() } else { - ordering = mexpr.asOffset().ordering() + ordering = mexpr.AsOffset().Ordering() } - childProps.Ordering = *f.mem.lookupPrivate(ordering).(*opt.Ordering) + childProps.Ordering = *f.mem.LookupPrivate(ordering).(*memo.Ordering) } } @@ -179,5 +182,5 @@ func (f physicalPropsFactory) constructChildProps( return required } - return f.mem.internPhysicalProps(&childProps) + return f.mem.InternPhysicalProps(&childProps) } diff --git a/pkg/sql/opt/xform/rules_test.go b/pkg/sql/opt/xform/rules_test.go index a52b938a78e6..b1cb7410d884 100644 --- a/pkg/sql/opt/xform/rules_test.go +++ b/pkg/sql/opt/xform/rules_test.go @@ -19,6 +19,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sem/types" @@ -40,15 +41,15 @@ func TestRuleFoldNullInEmpty(t *testing.T) { f := o.Factory() null := f.ConstructNull(f.InternPrivate(types.Unknown)) - empty := f.ConstructTuple(opt.EmptyList) + empty := f.ConstructTuple(memo.EmptyList) in := f.ConstructIn(null, empty) - ev := o.Optimize(in, &opt.PhysicalProps{}) + ev := o.Optimize(in, &memo.PhysicalProps{}) if ev.Operator() != opt.FalseOp { t.Errorf("expected NULL IN () to fold to False") } notIn := f.ConstructNotIn(null, empty) - ev = o.Optimize(notIn, &opt.PhysicalProps{}) + ev = o.Optimize(notIn, &memo.PhysicalProps{}) if ev.Operator() != opt.TrueOp { t.Errorf("expected NULL NOT IN () to fold to True") } @@ -60,7 +61,7 @@ func TestRuleBinaryAssumption(t *testing.T) { fn := func(op opt.Operator) { for _, overload := range tree.BinOps[opt.BinaryOpReverseMap[op]] { binOp := overload.(tree.BinOp) - if !xform.BinaryOverloadExists(op, binOp.RightType, binOp.LeftType) { + if !memo.BinaryOverloadExists(op, binOp.RightType, binOp.LeftType) { t.Errorf("could not find inverse for overload: %+v", op) } } diff --git a/pkg/sql/opt_index_selection.go b/pkg/sql/opt_index_selection.go index 756f0ae5d3e2..30e87faf9b84 100644 --- a/pkg/sql/opt_index_selection.go +++ b/pkg/sql/opt_index_selection.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/idxconstraint" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" @@ -148,7 +149,7 @@ func (p *planner) selectIndex( if err != nil { return nil, err } - filterExpr := optimizer.Optimize(filterGroup, &opt.PhysicalProps{}) + filterExpr := optimizer.Optimize(filterGroup, &memo.PhysicalProps{}) for _, c := range candidates { if err := c.makeIndexConstraints( optimizer, filterExpr, p.EvalContext(), @@ -252,7 +253,7 @@ func (p *planner) selectIndex( s.origFilter = s.filter if s.filter != nil { remGroup := c.ic.RemainingFilter() - remEv := optimizer.Optimize(remGroup, &opt.PhysicalProps{}) + remEv := optimizer.Optimize(remGroup, &memo.PhysicalProps{}) if remEv.Operator() == opt.TrueOp { s.filter = nil } else { @@ -416,7 +417,7 @@ func (v indexInfoByCost) Sort() { // constraints. Initializes v.ic, as well as v.exactPrefix and v.cost (with a // baseline cost for the index). func (v *indexInfo) makeIndexConstraints( - optimizer *xform.Optimizer, filter xform.ExprView, evalCtx *tree.EvalContext, + optimizer *xform.Optimizer, filter memo.ExprView, evalCtx *tree.EvalContext, ) error { numIndexCols := len(v.index.ColumnIDs) diff --git a/pkg/sql/opt_index_selection_test.go b/pkg/sql/opt_index_selection_test.go index 653336747b67..5c70b910d4af 100644 --- a/pkg/sql/opt_index_selection_test.go +++ b/pkg/sql/opt_index_selection_test.go @@ -23,8 +23,8 @@ import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/settings/cluster" - "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/idxconstraint" + "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder" "github.com/cockroachdb/cockroach/pkg/sql/opt/xform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -110,7 +110,7 @@ func makeSpans( if err != nil { t.Fatal(err) } - filterExpr := o.Optimize(filterGroup, &opt.PhysicalProps{}) + filterExpr := o.Optimize(filterGroup, &memo.PhysicalProps{}) err = c.makeIndexConstraints(o, filterExpr, p.EvalContext()) if err != nil { t.Fatal(err)
7e2c7f4bcacfc13160746f91159dbdf798b330ca
2022-03-24 06:24:23
Oliver Tan
sql: implement COPY FROM ... ESCAPE ...
false
implement COPY FROM ... ESCAPE ...
sql
diff --git a/pkg/sql/copy.go b/pkg/sql/copy.go index 5ecbbc017a1f..da0b031f7189 100644 --- a/pkg/sql/copy.go +++ b/pkg/sql/copy.go @@ -59,6 +59,7 @@ type copyMachine struct { columns tree.NameList resultColumns colinfo.ResultColumns format tree.CopyFormat + csvEscape rune delimiter byte // textDelim is delimiter converted to a []byte so that we don't have to do that per row. textDelim []byte @@ -174,6 +175,24 @@ func newCopyMachine( return nil, err } } + if n.Options.Escape != nil { + s := n.Options.Escape.RawString() + if len(s) != 1 { + return nil, pgerror.Newf( + pgcode.FeatureNotSupported, + "ESCAPE must be a single rune", + ) + } + + if c.format != tree.CopyFormatCSV { + return nil, pgerror.Newf( + pgcode.FeatureNotSupported, + "ESCAPE can only be specified for CSV", + ) + } + + c.csvEscape, _ = utf8.DecodeRuneInString(s) + } flags := tree.ObjectLookupFlagsWithRequiredTableKind(tree.ResolveRequireTableDesc) _, tableDesc, err := resolver.ResolveExistingTableObject(ctx, &c.p, &n.Table, flags) @@ -250,6 +269,9 @@ func (c *copyMachine) run(ctx context.Context) error { c.csvReader.Comma = rune(c.delimiter) c.csvReader.ReuseRecord = true c.csvReader.FieldsPerRecord = len(c.resultColumns) + if c.csvEscape != 0 { + c.csvReader.Escape = c.csvEscape + } } Loop: diff --git a/pkg/sql/parser/parse_test.go b/pkg/sql/parser/parse_test.go index eca92f5b6608..39117955d34c 100644 --- a/pkg/sql/parser/parse_test.go +++ b/pkg/sql/parser/parse_test.go @@ -405,7 +405,6 @@ func TestUnimplementedSyntax(t *testing.T) { {`COPY t FROM STDIN HEADER`, 41608, `header`, ``}, {`COPY t FROM STDIN ENCODING 'utf-8'`, 41608, `encoding`, ``}, {`COPY t FROM STDIN QUOTE 'x'`, 41608, `quote`, ``}, - {`COPY t FROM STDIN ESCAPE 'x'`, 41608, `escape`, ``}, {`COPY t FROM STDIN FORCE QUOTE *`, 41608, `quote`, ``}, {`COPY t FROM STDIN FORCE NULL *`, 41608, `force null`, ``}, {`COPY t FROM STDIN FORCE NOT NULL *`, 41608, `force not null`, ``}, diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index b6d7c93edab0..6fa09501c756 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -3531,13 +3531,13 @@ copy_options: { return unimplementedWithIssueDetail(sqllex, 41608, "header") } -| QUOTE SCONST error +| QUOTE SCONST { return unimplementedWithIssueDetail(sqllex, 41608, "quote") } | ESCAPE SCONST error { - return unimplementedWithIssueDetail(sqllex, 41608, "escape") + $$.val = &tree.CopyOptions{Escape: tree.NewStrVal($2)} } | FORCE QUOTE error { diff --git a/pkg/sql/parser/testdata/copy b/pkg/sql/parser/testdata/copy index 9dc596dda89d..9d3fcbfe5e6b 100644 --- a/pkg/sql/parser/testdata/copy +++ b/pkg/sql/parser/testdata/copy @@ -77,3 +77,11 @@ COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ' ' destination = 'filename' -- n COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER (' ') destination = ('filename') -- fully parenthesized COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER '_' destination = '_' -- literals removed COPY _ (_, _, _) FROM STDIN WITH CSV DELIMITER ' ' destination = 'filename' -- identifiers removed + +parse +COPY t (a, b, c) FROM STDIN destination = 'filename' CSV DELIMITER ' ' ESCAPE 'x' +---- +COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER ' ' destination = 'filename' ESCAPE 'x' -- normalized! +COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER (' ') destination = ('filename') ESCAPE ('x') -- fully parenthesized +COPY t (a, b, c) FROM STDIN WITH CSV DELIMITER '_' destination = '_' ESCAPE '_' -- literals removed +COPY _ (_, _, _) FROM STDIN WITH CSV DELIMITER ' ' destination = 'filename' ESCAPE 'x' -- identifiers removed diff --git a/pkg/sql/pgwire/testdata/pgtest/copy b/pkg/sql/pgwire/testdata/pgtest/copy index 843d9a5eb54c..450307b52a01 100644 --- a/pkg/sql/pgwire/testdata/pgtest/copy +++ b/pkg/sql/pgwire/testdata/pgtest/copy @@ -46,6 +46,29 @@ ReadyForQuery {"Type":"CommandComplete","CommandTag":"SELECT 3"} {"Type":"ReadyForQuery","TxStatus":"I"} +# Invalid ESCAPE syntax. +send +Query {"String": "COPY t FROM STDIN ESCAPE 'xxx'"} +---- + +until +ErrorResponse +ReadyForQuery +---- +{"Type":"ErrorResponse","Code":"0A000"} +{"Type":"ReadyForQuery","TxStatus":"I"} + +send +Query {"String": "COPY t FROM STDIN ESCAPE 'x'"} +---- + +until +ErrorResponse +ReadyForQuery +---- +{"Type":"ErrorResponse","Code":"0A000"} +{"Type":"ReadyForQuery","TxStatus":"I"} + # Wrong number of columns. send Query {"String": "COPY t FROM STDIN"} @@ -63,12 +86,13 @@ ReadyForQuery {"Type":"ReadyForQuery","TxStatus":"I"} # Verify that only one COPY can run at once. -send +# This crashes PG, so only run on CRDB. +send crdb_only Query {"String": "COPY t FROM STDIN"} Query {"String": "COPY t FROM STDIN"} ---- -until +until crdb_only ErrorResponse ReadyForQuery ---- @@ -77,12 +101,13 @@ ReadyForQuery {"Type":"ReadyForQuery","TxStatus":"I"} # Verify that after a COPY has started another statement cannot run. -send +# This crashes PG, so only run on CRDB. +send crdb_only Query {"String": "COPY t FROM STDIN"} Query {"String": "SELECT 2"} ---- -until ignore=RowDescription +until ignore=RowDescription crdb_only ErrorResponse ReadyForQuery ---- @@ -248,6 +273,31 @@ ReadyForQuery {"Type":"CommandComplete","CommandTag":"SELECT 3"} {"Type":"ReadyForQuery","TxStatus":"I"} +send +Query {"String": "DELETE FROM t"} +Query {"String": "COPY t FROM STDIN CSV ESCAPE 'x'"} +CopyData {"Data": "1,\"x\"\"\n"} +CopyData {"Data": "1,\"xxx\",xx\"\n"} +CopyData {"Data": "\\.\n"} +CopyDone +Query {"String": "SELECT * FROM t ORDER BY i"} +---- + +until ignore=RowDescription +ReadyForQuery +ReadyForQuery +ReadyForQuery +---- +{"Type":"CommandComplete","CommandTag":"DELETE 3"} +{"Type":"ReadyForQuery","TxStatus":"I"} +{"Type":"CopyInResponse","ColumnFormatCodes":[0,0]} +{"Type":"CommandComplete","CommandTag":"COPY 2"} +{"Type":"ReadyForQuery","TxStatus":"I"} +{"Type":"DataRow","Values":[{"text":"1"},{"text":"\""}]} +{"Type":"DataRow","Values":[{"text":"1"},{"text":"x\",x"}]} +{"Type":"CommandComplete","CommandTag":"SELECT 2"} +{"Type":"ReadyForQuery","TxStatus":"I"} + send Query {"String": "COPY t FROM STDIN CSV"} CopyData {"Data": "1\n"} @@ -276,7 +326,7 @@ ReadyForQuery ReadyForQuery ReadyForQuery ---- -{"Type":"CommandComplete","CommandTag":"DELETE 3"} +{"Type":"CommandComplete","CommandTag":"DELETE 2"} {"Type":"ReadyForQuery","TxStatus":"I"} {"Type":"CopyInResponse","ColumnFormatCodes":[0,0]} {"Type":"CommandComplete","CommandTag":"COPY 3"} diff --git a/pkg/sql/sem/tree/copy.go b/pkg/sql/sem/tree/copy.go index 8e80314fba9c..a2af1539c345 100644 --- a/pkg/sql/sem/tree/copy.go +++ b/pkg/sql/sem/tree/copy.go @@ -29,6 +29,7 @@ type CopyOptions struct { CopyFormat CopyFormat Delimiter Expr Null Expr + Escape *StrVal } var _ NodeFormatter = &CopyOptions{} @@ -91,6 +92,11 @@ func (o *CopyOptions) Format(ctx *FmtCtx) { ctx.FormatNode(o.Destination) addSep = true } + if o.Escape != nil { + maybeAddSep() + ctx.WriteString("ESCAPE ") + ctx.FormatNode(o.Escape) + } } // IsDefault returns true if this struct has default value. @@ -125,6 +131,12 @@ func (o *CopyOptions) CombineWith(other *CopyOptions) error { } o.Null = other.Null } + if other.Escape != nil { + if o.Escape != nil { + return pgerror.Newf(pgcode.Syntax, "escape option specified multiple times") + } + o.Escape = other.Escape + } return nil }
0555a71a96eaa8a0da6fd3d9d98bf780372d9727
2023-02-24 03:12:56
Yahor Yuzefovich
colexec: always copy eval context in some places
false
always copy eval context in some places
colexec
diff --git a/pkg/sql/colexec/columnarizer.go b/pkg/sql/colexec/columnarizer.go index 7c93df68499f..5c3bd85fdd38 100644 --- a/pkg/sql/colexec/columnarizer.go +++ b/pkg/sql/colexec/columnarizer.go @@ -155,12 +155,9 @@ func newColumnarizer( c.ProcessorBaseNoHelper.Init( nil, /* self */ flowCtx, - // Similar to the materializer, the columnarizer will update the eval - // context when closed, so we give it a copy of the eval context to - // preserve the "global" eval context from being mutated. In practice, - // the columnarizer is closed only when DrainMeta() is called which - // occurs at the very end of the execution, yet we choose to be - // defensive here. + // The columnarizer will update the eval context when closed, so we give + // it a copy of the eval context to preserve the "global" eval context + // from being mutated. flowCtx.NewEvalCtx(), processorID, nil, /* output */ diff --git a/pkg/sql/colexec/materializer.go b/pkg/sql/colexec/materializer.go index 62b92c416024..73fd74a63c20 100644 --- a/pkg/sql/colexec/materializer.go +++ b/pkg/sql/colexec/materializer.go @@ -26,7 +26,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/execinfra/execreleasable" "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" - "github.com/cockroachdb/cockroach/pkg/sql/sem/eval" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/errors" @@ -164,38 +163,6 @@ func NewMaterializer( processorID int32, input colexecargs.OpWithMetaInfo, typs []*types.T, -) *Materializer { - // When the materializer is created in the middle of the chain of operators, - // it will modify the eval context when it is done draining, so we have to - // give it a copy to preserve the "global" eval context from being mutated. - return newMaterializerInternal(allocator, flowCtx, flowCtx.NewEvalCtx(), processorID, input, typs) -} - -// NewMaterializerNoEvalCtxCopy is the same as NewMaterializer but doesn't make -// a copy of the eval context (i.e. it'll use the "global" one coming from the -// flowCtx). -// -// This should only be used when the materializer is at the root of the operator -// tree which is acceptable because the root materializer is closed (which -// modifies the eval context) only when the whole flow is done, at which point -// the eval context won't be used anymore. -func NewMaterializerNoEvalCtxCopy( - allocator *colmem.Allocator, - flowCtx *execinfra.FlowCtx, - processorID int32, - input colexecargs.OpWithMetaInfo, - typs []*types.T, -) *Materializer { - return newMaterializerInternal(allocator, flowCtx, flowCtx.EvalCtx, processorID, input, typs) -} - -func newMaterializerInternal( - allocator *colmem.Allocator, - flowCtx *execinfra.FlowCtx, - evalCtx *eval.Context, - processorID int32, - input colexecargs.OpWithMetaInfo, - typs []*types.T, ) *Materializer { m := materializerPool.Get().(*Materializer) *m = Materializer{ @@ -212,7 +179,10 @@ func newMaterializerInternal( m.Init( m, flowCtx, - evalCtx, + // The materializer will update the eval context when closed, so we give + // it a copy of the eval context to preserve the "global" eval context + // from being mutated. + flowCtx.NewEvalCtx(), processorID, nil, /* output */ execinfra.ProcStateOpts{ diff --git a/pkg/sql/colflow/flow_coordinator.go b/pkg/sql/colflow/flow_coordinator.go index 752d1fb95f36..6ceefbb7d0f8 100644 --- a/pkg/sql/colflow/flow_coordinator.go +++ b/pkg/sql/colflow/flow_coordinator.go @@ -68,9 +68,10 @@ func NewFlowCoordinator( f.Init( f, flowCtx, - // FlowCoordinator doesn't modify the eval context, so it is safe to - // reuse the one from the flow context. - flowCtx.EvalCtx, + // The FlowCoordinator will update the eval context when closed, so we + // give it a copy of the eval context to preserve the "global" eval + // context from being mutated. + flowCtx.NewEvalCtx(), processorID, output, execinfra.ProcStateOpts{ diff --git a/pkg/sql/colflow/vectorized_flow.go b/pkg/sql/colflow/vectorized_flow.go index 36c29c47d7dc..799aa1f5b945 100644 --- a/pkg/sql/colflow/vectorized_flow.go +++ b/pkg/sql/colflow/vectorized_flow.go @@ -1080,7 +1080,7 @@ func (s *vectorizedFlowCreator) setupOutput( // We need to use the row receiving output. if input == nil { // We couldn't remove the columnarizer. - input = colexec.NewMaterializerNoEvalCtxCopy( + input = colexec.NewMaterializer( colmem.NewAllocator(ctx, s.monitorRegistry.NewStreamingMemAccount(flowCtx), factory), flowCtx, pspec.ProcessorID, diff --git a/pkg/sql/execinfra/flow_context.go b/pkg/sql/execinfra/flow_context.go index 451d300419b1..12bafaf9c2c8 100644 --- a/pkg/sql/execinfra/flow_context.go +++ b/pkg/sql/execinfra/flow_context.go @@ -114,6 +114,9 @@ type FlowCtx struct { // EvalContext, since it stores that EvalContext in its exprHelpers and mutates // them at runtime to ensure expressions are evaluated with the correct indexed // var context. +// TODO(yuzefovich): once we remove eval.Context.deprecatedContext, re-evaluate +// this since many processors don't modify the eval context except for that +// field. func (flowCtx *FlowCtx) NewEvalCtx() *eval.Context { evalCopy := flowCtx.EvalCtx.Copy() return evalCopy
2c3c06ba15b975c85f1a8db5d4020ff8da7b3f29
2019-05-27 02:13:42
Nathan VanBenschoten
kv: replace unexpected txn state assertion with error
false
replace unexpected txn state assertion with error
kv
diff --git a/pkg/kv/txn_coord_sender.go b/pkg/kv/txn_coord_sender.go index 86abfc195e38..392cd8c484b3 100644 --- a/pkg/kv/txn_coord_sender.go +++ b/pkg/kv/txn_coord_sender.go @@ -908,9 +908,8 @@ func (tc *TxnCoordSender) maybeRejectClientLocked( return roachpb.NewError(roachpb.NewTransactionRetryWithProtoRefreshError( abortedErr.Message, tc.mu.txn.ID, newTxn)) } - if tc.mu.txn.Status != roachpb.PENDING { - log.Fatalf(ctx, "unexpected txn state: %s", tc.mu.txn) + return roachpb.NewErrorf("(see issue #37866) unexpected txn state: %s", tc.mu.txn) } return nil }
d5e25c36577c53b1ef2c8bc6404c4fa1045ec357
2023-02-14 22:50:26
Shivam Saraf
opt: inverted-index accelerate queries with filters in the form json->'field'
false
inverted-index accelerate queries with filters in the form json->'field'
opt
diff --git a/pkg/sql/logictest/testdata/logic_test/inverted_index b/pkg/sql/logictest/testdata/logic_test/inverted_index index 89d04f30b8a2..81b3a410b980 100644 --- a/pkg/sql/logictest/testdata/logic_test/inverted_index +++ b/pkg/sql/logictest/testdata/logic_test/inverted_index @@ -808,7 +808,9 @@ INSERT INTO f VALUES (38, '[[0, 1, 2], {"b": "c"}]'), (39, '[[0, [1, 2]]]'), (40, '[[0, 1, 2]]'), - (41, '[[{"a": {"b": []}}]]') + (41, '[[{"a": {"b": []}}]]'), + (42, '{"a": "a"}'), + (43, '[[0, 1, 2], [0, 1, 2], "s"]') query T SELECT j FROM f@i WHERE j->0 @> '[0, 1, 2, 3]' ORDER BY k @@ -820,6 +822,7 @@ SELECT j FROM f@i WHERE j->0 @> '[0]' ORDER BY k [[0, 1, 2], {"b": "c"}] [[0, [1, 2]]] [[0, 1, 2]] +[[0, 1, 2], [0, 1, 2], "s"] query T @@ -968,6 +971,7 @@ SELECT j FROM f@i WHERE j->0->0 = '0' ORDER BY k [[0, 1, 2], {"b": "c"}] [[0, [1, 2]]] [[0, 1, 2]] +[[0, 1, 2], [0, 1, 2], "s"] query T SELECT j FROM f@i WHERE j->0->1 = '[1, 2]' ORDER BY k @@ -1292,6 +1296,86 @@ SELECT j FROM f@i WHERE j->'a'->'b' <@ '{"c": [1, 2], "d": 2}' OR j->'a'->'b' <@ {"a": {"b": "c"}, "d": "e"} {"a": {"b": []}} +# Testing the FetchVal with the IN operator. +query T +SELECT j FROM f@i WHERE j->'a' IN ('1', '2', '3') ORDER BY k +---- +{"a": 1} +{"a": 1, "b": 2} +{"a": 1, "c": 3} + +query T +SELECT j FROM f@i WHERE j->'a' IN ('"a"') ORDER BY k +---- +{"a": "a"} + +query T +SELECT j FROM f@i WHERE j->'a' IN ('"a"', 'null') ORDER BY k +---- +{"a": null} +{"a": "a"} + +query T +SELECT j FROM f@i WHERE j->'a' IN ('{"b": "c"}', '{"c": "d"}') ORDER BY k +---- +{"a": {"b": "c"}} +{"a": {"b": "c"}, "d": "e"} + +query T +SELECT j FROM f@i WHERE j->'a' IN ('{"b": "c"}', '"a"') ORDER BY k +---- +{"a": {"b": "c"}} +{"a": {"b": "c"}, "d": "e"} +{"a": "a"} + +query T +SELECT j FROM f@i WHERE j->'a' IN ('[1, 2]', '"a"') ORDER BY k +---- +{"a": [1, 2]} +{"a": "a"} + +query T +SELECT j FROM f@i WHERE j->0 IN ('1', '2', '3') ORDER BY k +---- +[1, 2, {"b": "c"}] + +query T +SELECT j FROM f@i WHERE j->1 IN ('1', '2', '3') ORDER BY k +---- +[1, 2, {"b": "c"}] + +query T +SELECT j FROM f@i WHERE j->0 IN ('1', '2', '3', '"d"') AND j->1 IN + ('"e"', '"d"') ORDER BY k +---- + +query T +SELECT j FROM f@i WHERE j->0 IN ('1', '2', '3', '"d"') OR j->1 IN + ('"e"', '"d"') ORDER BY k +---- +[1, 2, {"b": "c"}] +[{"a": {"b": "c"}}, "d", "e"] + +query T +SELECT j FROM f@i WHERE j->0 IN ('{"a": {"b": "c"}}', '{"a": [0, "b"]}') ORDER BY k +---- +[{"a": {"b": "c"}}, "d", "e"] +[{"a": [0, "b"]}, null, 1] + +query T +SELECT j FROM f@i WHERE j->0 IN ('{"a": {"b": "c"}}', '[]') ORDER BY k +---- +[{"a": {"b": "c"}}, "d", "e"] +[[]] + +query T +SELECT j FROM f@i WHERE j->0 IN ('[0, [1, 2]]', '[0, 1, 2]') ORDER BY k +---- +[[0, 1, 2], {"b": "c"}] +[[0, [1, 2]]] +[[0, 1, 2]] +[[0, 1, 2], [0, 1, 2], "s"] + # Regression test for #63180. This query should not cause an index out of range # error in the inverted filterer. query T diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_index b/pkg/sql/opt/exec/execbuilder/testdata/inverted_index index 9088ad3232f8..1af46468f878 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_index @@ -1699,6 +1699,356 @@ vectorized: true right columns: (a, b_inverted_key) right fixed values: 1 column +# Testing the FetchVal with the IN operator with a JSON string as +# the fetch value's index position. The query won't be index +# accelerated since the optimizer currently only expects constant +# JSON values to be part of the IN expression. Since "b->0" does +# not classify as a constant JSON value, inverted indexes won't +# be used. +query T +EXPLAIN (VERBOSE) SELECT b FROM d WHERE b->'a' IN (b->0, '"a"') +---- +distribution: local +vectorized: true +· +• filter +│ columns: (b) +│ estimated row count: 333 (missing stats) +│ filter: (b->'a') IN (b->0, '"a"') +│ +└── • scan + columns: (b) + estimated row count: 1,000 (missing stats) + table: d@d_pkey + spans: FULL SCAN + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->'a' IN ('"a"','"b"') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 2 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /"a"/"a"-/"a"/"a"/PrefixEnd /"a"/"b"-/"a"/"b"/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->'a' IN ('0','1') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 2 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /"a"/0-/"a"/0/PrefixEnd /"a"/1-/"a"/1/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->'a' IN ('{"a": "b"}', '[0, 1, 2]') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: (b->'a') IN ('[0, 1, 2]', '{"a": "b"}') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 4 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /"a"/Arr/0-/"a"/Arr/0/PrefixEnd /"a"/Arr/1-/"a"/Arr/1/PrefixEnd /"a"/Arr/2-/"a"/Arr/2/PrefixEnd /"a"/"a"/"b"-/"a"/"a"/"b"/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->'a' IN ('["a", "b"]', '[0, 1]') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: (b->'a') IN ('["a", "b"]', '[0, 1]') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 4 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /"a"/Arr/"a"-/"a"/Arr/"a"/PrefixEnd /"a"/Arr/"b"-/"a"/Arr/"b"/PrefixEnd /"a"/Arr/0-/"a"/Arr/0/PrefixEnd /"a"/Arr/1-/"a"/Arr/1/PrefixEnd + +# Testing the FetchVal with the IN operator with a JSON integer as +# the fetch value's index position. +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->0 IN ('"a"','"b"') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: (b->0) IN ('"a"', '"b"') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 2 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /Arr/"a"-/Arr/"a"/PrefixEnd /Arr/"b"-/Arr/"b"/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->0 IN ('0','1') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: (b->0) IN ('0', '1') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 2 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /Arr/0-/Arr/0/PrefixEnd /Arr/1-/Arr/1/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->0 IN ('{"a": "b"}', '[0, 1, 2]') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: (b->0) IN ('[0, 1, 2]', '{"a": "b"}') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 4 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /Arr/Arr/0-/Arr/Arr/0/PrefixEnd /Arr/Arr/1-/Arr/Arr/1/PrefixEnd /Arr/Arr/2-/Arr/Arr/2/PrefixEnd /Arr/"a"/"b"-/Arr/"a"/"b"/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->0 IN ('["a", "b"]', '[0, 1]') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: (b->0) IN ('["a", "b"]', '[0, 1]') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 4 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /Arr/Arr/"a"-/Arr/Arr/"a"/PrefixEnd /Arr/Arr/"b"-/Arr/Arr/"b"/PrefixEnd /Arr/Arr/0-/Arr/Arr/0/PrefixEnd /Arr/Arr/1-/Arr/Arr/1/PrefixEnd + + +# Testing the FetchVal with the IN operator with both JSON integers and strings as +# the fetch value's index position. +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->0->'a' IN ('["a", "b"]', '[0, 1]') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: ((b->0)->'a') IN ('["a", "b"]', '[0, 1]') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 4 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /Arr/"a"/Arr/"a"-/Arr/"a"/Arr/"a"/PrefixEnd /Arr/"a"/Arr/"b"-/Arr/"a"/Arr/"b"/PrefixEnd /Arr/"a"/Arr/0-/Arr/"a"/Arr/0/PrefixEnd /Arr/"a"/Arr/1-/Arr/"a"/Arr/1/PrefixEnd + +query T +EXPLAIN (VERBOSE) SELECT a FROM d WHERE b->'a'->0 IN ('["a", "b"]', '[0, 1]') +---- +distribution: local +vectorized: true +· +• project +│ columns: (a) +│ +└── • filter + │ columns: (a, b) + │ estimated row count: 333 (missing stats) + │ filter: ((b->'a')->0) IN ('["a", "b"]', '[0, 1]') + │ + └── • index join + │ columns: (a, b) + │ estimated row count: 111 (missing stats) + │ table: d@d_pkey + │ key columns: a + │ + └── • project + │ columns: (a) + │ + └── • inverted filter + │ columns: (a, b_inverted_key) + │ estimated row count: 111 (missing stats) + │ inverted column: b_inverted_key + │ num spans: 4 + │ + └── • scan + columns: (a, b_inverted_key) + estimated row count: 111 (missing stats) + table: d@foo_inv + spans: /"a"/Arr/Arr/"a"-/"a"/Arr/Arr/"a"/PrefixEnd /"a"/Arr/Arr/"b"-/"a"/Arr/Arr/"b"/PrefixEnd /"a"/Arr/Arr/0-/"a"/Arr/Arr/0/PrefixEnd /"a"/Arr/Arr/1-/"a"/Arr/Arr/1/PrefixEnd + # Stats reflect the following, with some histogram buckets removed: # insert into d select g, '[1,2]' from generate_series(1,1000) g(g); diff --git a/pkg/sql/opt/invertedidx/json_array.go b/pkg/sql/opt/invertedidx/json_array.go index 6a17f70bec8b..ce12ddc3cc08 100644 --- a/pkg/sql/opt/invertedidx/json_array.go +++ b/pkg/sql/opt/invertedidx/json_array.go @@ -392,6 +392,12 @@ func (j *jsonOrArrayFilterPlanner) extractInvertedFilterConditionFromLeaf( if fetch, ok := t.Left.(*memo.FetchValExpr); ok { invertedExpr = j.extractJSONFetchValEqCondition(ctx, evalCtx, fetch, t.Right) } + case *memo.InExpr: + if fetch, ok := t.Left.(*memo.FetchValExpr); ok { + if tuple, ok := t.Right.(*memo.TupleExpr); ok { + invertedExpr = j.extractJSONInCondition(ctx, evalCtx, fetch, tuple) + } + } case *memo.OverlapsExpr: invertedExpr = j.extractArrayOverlapsCondition(ctx, evalCtx, t.Left, t.Right) } @@ -412,6 +418,38 @@ func (j *jsonOrArrayFilterPlanner) extractInvertedFilterConditionFromLeaf( return invertedExpr, remainingFilters, nil } +// extractJSONInCondition extracts an InvertedExpression representing +// an inverted filter over the planner's inverted index, based on the +// give left and right expression arguments. If an +// InvertedExpression cannot be generated from the expression, an +// inverted.NonInvertedColExpression is returned. +func (j *jsonOrArrayFilterPlanner) extractJSONInCondition( + ctx context.Context, evalCtx *eval.Context, left *memo.FetchValExpr, right *memo.TupleExpr, +) inverted.Expression { + // The right side of the expression should be a constant JSON value. + if !memo.CanExtractConstDatum(right) { + return inverted.NonInvertedColExpression{} + } + var invertedExpr inverted.Expression + for i := range right.Elems { + scalarExprElem := right.Elems[i] + expr := j.extractJSONFetchValEqCondition(ctx, evalCtx, left, scalarExprElem) + if invertedExpr == nil { + invertedExpr = expr + } else { + invertedExpr = inverted.Or(invertedExpr, expr) + } + } + + if invertedExpr == nil { + // An inverted expression could not be extracted. + return inverted.NonInvertedColExpression{} + } + + return invertedExpr + +} + // extractArrayOverlapsCondition extracts an InvertedExpression // representing an inverted filter over the planner's inverted index, based // on the given left and right expression arguments. Returns an empty diff --git a/pkg/sql/opt/invertedidx/json_array_test.go b/pkg/sql/opt/invertedidx/json_array_test.go index dd1d3f9b4bd4..60b9095c6feb 100644 --- a/pkg/sql/opt/invertedidx/json_array_test.go +++ b/pkg/sql/opt/invertedidx/json_array_test.go @@ -933,6 +933,104 @@ func TestTryFilterJsonOrArrayIndex(t *testing.T) { unique: true, remainingFilters: "str <@ '{hello}' AND str @> '{hello}'", }, + { + // Testing the IN operator with the fetch value as a string + filters: "j->'a' IN ('1', '2', '3')", + indexOrd: jsonOrd, + ok: true, + tight: true, + unique: false, + remainingFilters: "", + }, + { + filters: `j->'a' IN ('"a"', '"b"')`, + indexOrd: jsonOrd, + ok: true, + tight: true, + unique: false, + remainingFilters: "", + }, + { + filters: `j->'a' IN ('{"a": "b"}', '"a"')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->'a' IN ('{"a": "b"}', '"a"')`, + }, + { + filters: `j->'a' IN ('[1,2,3]', '[1]')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->'a' IN ('[1,2,3]', '[1]')`, + }, + { + filters: `j->'a' IN ('[1,2,3]', '{"a": "b"}', '"a"', 'null')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->'a' IN ('[1,2,3]', '{"a": "b"}', '"a"', 'null')`, + }, + { + // Testing the IN operator with the fetch value as an integer + filters: "j->0->1 IN ('1', '2', '3')", + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: "j->0->1 IN ('1', '2', '3')", + }, + { + filters: `j->0 IN ('"a"', '"b"')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->0 IN ('"a"', '"b"')`, + }, + { + filters: `j->0->'a' IN ('{"a": "b"}', '"a"')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->0->'a' IN ('{"a": "b"}', '"a"')`, + }, + { + filters: `j->'a'->0 IN ('[1,2,3]', '[1]')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->'a'->0 IN ('[1,2,3]', '[1]')`, + }, + { + filters: `j->0 IN ('[1,2,3]', '{"a": "b"}', '"a"', 'null')`, + indexOrd: jsonOrd, + ok: true, + tight: false, + unique: false, + remainingFilters: `j->0 IN ('[1,2,3]', '{"a": "b"}', '"a"', 'null')`, + }, + { + // Testing the IN operator with non-constant JSON values inside the + // enclosing tuple. + filters: `j->0 IN (j->0, j->1)`, + indexOrd: jsonOrd, + ok: false, + tight: false, + unique: false, + }, + { + filters: `j->0 IN (j->0, '[1, 2, 3]')`, + indexOrd: jsonOrd, + ok: false, + tight: false, + unique: false, + }, } for _, tc := range testCases { diff --git a/pkg/sql/opt/xform/testdata/rules/select b/pkg/sql/opt/xform/testdata/rules/select index e0e529244c26..e5725f9057aa 100644 --- a/pkg/sql/opt/xform/testdata/rules/select +++ b/pkg/sql/opt/xform/testdata/rules/select @@ -2777,6 +2777,26 @@ select ├── j:4 <@ '{"a": [3]}' [outer=(4), immutable] └── j:4 <@ '[1, 2, 3]' [outer=(4), immutable] +# Query not using the fetch val but using the equality operator. +opt expect-not=GenerateInvertedIndexScans +SELECT k FROM b WHERE j = '"b"' +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4!null + ├── immutable + ├── key: (1) + ├── fd: ()-->(4) + ├── scan b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ └── fd: (1)-->(4) + └── filters + └── j:4 = '"b"' [outer=(4), immutable, constraints=(/4: [/'"b"' - /'"b"']; tight), fd=()-->(4)] + # Query using the fetch val and equality operators. opt expect=GenerateInvertedIndexScans SELECT k FROM b WHERE j->'a' = '"b"' @@ -3322,6 +3342,734 @@ project ├── key: (1) └── fd: (1)-->(7) +# Generate an inverted scan when the index of the fetch val operator is +# a string along with the IN operator consisting of JSON strings in +# the tuple. Since the inverted expression is tight, +# the original filter should not be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ('1', '2', '3') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── inverted-filter + ├── columns: k:1!null + ├── inverted expression: /7 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7a\x00\x01*\x02\x00", "7a\x00\x01*\x02\x00"] + │ ├── ["7a\x00\x01*\x04\x00", "7a\x00\x01*\x04\x00"] + │ └── ["7a\x00\x01*\x06\x00", "7a\x00\x01*\x06\x00"] + ├── key: (1) + └── scan b@j_inv_idx + ├── columns: k:1!null j_inverted_key:7!null + ├── inverted constraint: /7/1 + │ └── spans + │ ├── ["7a\x00\x01*\x02\x00", "7a\x00\x01*\x02\x00"] + │ ├── ["7a\x00\x01*\x04\x00", "7a\x00\x01*\x04\x00"] + │ └── ["7a\x00\x01*\x06\x00", "7a\x00\x01*\x06\x00"] + ├── key: (1) + └── fd: (1)-->(7) + + +# Query NOT using the fetch val and the IN operator. +# This should result in a full table scan (at the moment) +opt expect-not=GenerateInvertedIndexScans +SELECT k FROM b WHERE j IN ('1', '2', '3') +---- +project + ├── columns: k:1!null + ├── key: (1) + └── select + ├── columns: k:1!null j:4!null + ├── key: (1) + ├── fd: (1)-->(4) + ├── scan b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ └── fd: (1)-->(4) + └── filters + └── j:4 IN ('1', '2', '3') [outer=(4), constraints=(/4: [/'1' - /'1'] [/'2' - /'2'] [/'3' - /'3']; tight)] + +# Generate an inverted scan when the index of the fetch val operator is +# a string along with the IN operator consisting of JSON strings in +# the tuple. Since the inverted expression is tight, +# the original filter should not be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ('"a"', '"b"') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── inverted-filter + ├── columns: k:1!null + ├── inverted expression: /7 + │ ├── tight: true, unique: false + │ └── union spans + │ ├── ["7a\x00\x01\x12a\x00\x01", "7a\x00\x01\x12a\x00\x01"] + │ └── ["7a\x00\x01\x12b\x00\x01", "7a\x00\x01\x12b\x00\x01"] + ├── key: (1) + └── scan b@j_inv_idx + ├── columns: k:1!null j_inverted_key:7!null + ├── inverted constraint: /7/1 + │ └── spans + │ ├── ["7a\x00\x01\x12a\x00\x01", "7a\x00\x01\x12a\x00\x01"] + │ └── ["7a\x00\x01\x12b\x00\x01", "7a\x00\x01\x12b\x00\x01"] + ├── key: (1) + └── fd: (1)-->(7) + + +# Generate an inverted scan when the index of the fetch val operator is +# a string along with the IN operator consisting of JSON objects in +# the tuple. Since the inverted expression is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ('{"a": "b"}', '{"c": "d"}') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7a\x00\x02a\x00\x01\x12b\x00\x01", "7a\x00\x02a\x00\x01\x12b\x00\x01"] + │ │ └── ["7a\x00\x02c\x00\x01\x12d\x00\x01", "7a\x00\x02c\x00\x01\x12d\x00\x01"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7a\x00\x02a\x00\x01\x12b\x00\x01", "7a\x00\x02a\x00\x01\x12b\x00\x01"] + │ │ └── ["7a\x00\x02c\x00\x01\x12d\x00\x01", "7a\x00\x02c\x00\x01\x12d\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->'a') IN ('{"a": "b"}', '{"c": "d"}') [outer=(4), immutable] + +# Generate an inverted scan when the index of the fetch val operator is +# a string along with the IN operator consisting of a combination of JSON objects, +# JSON strings and JSON integers inside the tuple. Since the inverted expression generated +# is not tight, the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ('{"a": "b"}', '1', '"a"', 'null') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7a\x00\x01\x00", "7a\x00\x01\x00"] + │ │ ├── ["7a\x00\x01\x12a\x00\x01", "7a\x00\x01\x12a\x00\x01"] + │ │ ├── ["7a\x00\x01*\x02\x00", "7a\x00\x01*\x02\x00"] + │ │ └── ["7a\x00\x02a\x00\x01\x12b\x00\x01", "7a\x00\x02a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7a\x00\x01\x00", "7a\x00\x01\x00"] + │ │ ├── ["7a\x00\x01\x12a\x00\x01", "7a\x00\x01\x12a\x00\x01"] + │ │ ├── ["7a\x00\x01*\x02\x00", "7a\x00\x01*\x02\x00"] + │ │ └── ["7a\x00\x02a\x00\x01\x12b\x00\x01", "7a\x00\x02a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->'a') IN ('null', '"a"', '1', '{"a": "b"}') [outer=(4), immutable] + +# Generate an inverted scan when the index of the fetch val operator is +# a string along with the IN operator consisting of a combination of JSON objects, +# JSON strings,JSON integers and JSON arrays inside the tuple. Since the inverted expression +# generated is not tight, the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ('{"a": "b"}', '1', '"a"', 'null', '[1,2,3]') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ ├── union spans + │ │ │ ├── ["7a\x00\x01\x00", "7a\x00\x01\x00"] + │ │ │ ├── ["7a\x00\x01\x12a\x00\x01", "7a\x00\x01\x12a\x00\x01"] + │ │ │ ├── ["7a\x00\x01*\x02\x00", "7a\x00\x01*\x02\x00"] + │ │ │ └── ["7a\x00\x02a\x00\x01\x12b\x00\x01", "7a\x00\x02a\x00\x01\x12b\x00\x01"] + │ │ └── INTERSECTION + │ │ ├── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ ├── union spans: empty + │ │ │ └── INTERSECTION + │ │ │ ├── span expression + │ │ │ │ ├── tight: true, unique: true + │ │ │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x02\x00", "7a\x00\x02\x00\x03\x00\x01*\x02\x00"] + │ │ │ └── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x04\x00", "7a\x00\x02\x00\x03\x00\x01*\x04\x00"] + │ │ └── span expression + │ │ ├── tight: true, unique: true + │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x06\x00", "7a\x00\x02\x00\x03\x00\x01*\x06\x00"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7a\x00\x01\x00", "7a\x00\x01\x00"] + │ │ ├── ["7a\x00\x01\x12a\x00\x01", "7a\x00\x01\x12a\x00\x01"] + │ │ ├── ["7a\x00\x01*\x02\x00", "7a\x00\x01*\x02\x00"] + │ │ ├── ["7a\x00\x02\x00\x03\x00\x01*\x02\x00", "7a\x00\x02\x00\x03\x00\x01*\x02\x00"] + │ │ ├── ["7a\x00\x02\x00\x03\x00\x01*\x04\x00", "7a\x00\x02\x00\x03\x00\x01*\x04\x00"] + │ │ ├── ["7a\x00\x02\x00\x03\x00\x01*\x06\x00", "7a\x00\x02\x00\x03\x00\x01*\x06\x00"] + │ │ └── ["7a\x00\x02a\x00\x01\x12b\x00\x01", "7a\x00\x02a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->'a') IN ('null', '"a"', '1', '[1, 2, 3]', '{"a": "b"}') [outer=(4), immutable] + + +# Generate an inverted scan when the index of the fetch val operator is +# a string along with the IN operator consisting of JSON arrays in +# the tuple. Since the inverted expression is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ('[1,2,3]', '[1, 2]', '[1]') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ ├── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x02\x00", "7a\x00\x02\x00\x03\x00\x01*\x02\x00"] + │ │ └── UNION + │ │ ├── span expression + │ │ │ ├── tight: false, unique: false + │ │ │ ├── union spans: empty + │ │ │ └── INTERSECTION + │ │ │ ├── span expression + │ │ │ │ ├── tight: true, unique: true + │ │ │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x02\x00", "7a\x00\x02\x00\x03\x00\x01*\x02\x00"] + │ │ │ └── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x04\x00", "7a\x00\x02\x00\x03\x00\x01*\x04\x00"] + │ │ └── span expression + │ │ ├── tight: false, unique: true + │ │ ├── union spans: empty + │ │ └── INTERSECTION + │ │ ├── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ ├── union spans: empty + │ │ │ └── INTERSECTION + │ │ │ ├── span expression + │ │ │ │ ├── tight: true, unique: true + │ │ │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x02\x00", "7a\x00\x02\x00\x03\x00\x01*\x02\x00"] + │ │ │ └── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x04\x00", "7a\x00\x02\x00\x03\x00\x01*\x04\x00"] + │ │ └── span expression + │ │ ├── tight: true, unique: true + │ │ └── union spans: ["7a\x00\x02\x00\x03\x00\x01*\x06\x00", "7a\x00\x02\x00\x03\x00\x01*\x06\x00"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7a\x00\x02\x00\x03\x00\x01*\x02\x00", "7a\x00\x02\x00\x03\x00\x01*\x02\x00"] + │ │ ├── ["7a\x00\x02\x00\x03\x00\x01*\x04\x00", "7a\x00\x02\x00\x03\x00\x01*\x04\x00"] + │ │ └── ["7a\x00\x02\x00\x03\x00\x01*\x06\x00", "7a\x00\x02\x00\x03\x00\x01*\x06\x00"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->'a') IN ('[1]', '[1, 2]', '[1, 2, 3]') [outer=(4), immutable] + + +# Generate an inverted scan when the index of the fetch val operator is +# an integer along with the IN operator consisting of JSON integers in +# the tuple. Since the inverted expression is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0 in ('1', '2') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x01*\x02\x00"] + │ │ └── ["7\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x01*\x04\x00"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x01*\x02\x00"] + │ │ └── ["7\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x01*\x04\x00"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->0) IN ('1', '2') [outer=(4), immutable] + +# Generate an inverted scan when the index of the fetch val operator is +# an integer along with the IN operator consisting of JSON strings in +# the tuple. Since the generated inverted expression is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0 IN ('"a"', '"b"') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7\x00\x03\x00\x01\x12a\x00\x01", "7\x00\x03\x00\x01\x12a\x00\x01"] + │ │ └── ["7\x00\x03\x00\x01\x12b\x00\x01", "7\x00\x03\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7\x00\x03\x00\x01\x12a\x00\x01", "7\x00\x03\x00\x01\x12a\x00\x01"] + │ │ └── ["7\x00\x03\x00\x01\x12b\x00\x01", "7\x00\x03\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->0) IN ('"a"', '"b"') [outer=(4), immutable] + +# Generate an inverted scan when the index of the fetch val operator is +# an integer along with the IN operator consisting of JSON objects in +# the tuple. Since the generated inverted expression is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0 IN ('{"a": "b"}', '{"c": "d"}') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7\x00\x03a\x00\x01\x12b\x00\x01", "7\x00\x03a\x00\x01\x12b\x00\x01"] + │ │ └── ["7\x00\x03c\x00\x01\x12d\x00\x01", "7\x00\x03c\x00\x01\x12d\x00\x01"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7\x00\x03a\x00\x01\x12b\x00\x01", "7\x00\x03a\x00\x01\x12b\x00\x01"] + │ │ └── ["7\x00\x03c\x00\x01\x12d\x00\x01", "7\x00\x03c\x00\x01\x12d\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->0) IN ('{"a": "b"}', '{"c": "d"}') [outer=(4), immutable] + +# Do not generate an inverted scan when one of the elements of the tuple is not a constant +# JSON expression. +opt expect-not=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0 IN ('{"a": "b"}', j->0) +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── scan b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ └── fd: (1)-->(4) + └── filters + └── (j:4->0) IN ('{"a": "b"}', j:4->0) [outer=(4), immutable] + +# Do not generate inverted index scans when the IN operator is used with sub-queries. This is +# due to the fact that queries of the form, <scalar> IN (<subquery>), <scalar> NOT IN (<subquery>), +# <scalar> <cmp> {SOME|ANY}(<subquery>) and <scalar> <cmp> ALL(<subquery>) all map to the Any +# operator. +opt expect-not=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' IN ((SELECT j from b where v = 1 limit 1), (SELECT j FROM b WHERE v = 2 limit 1)) +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── scan b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ └── fd: (1)-->(4) + └── filters + └── in [outer=(4), immutable, subquery] + ├── j:4->'a' + └── tuple + ├── subquery + │ └── project + │ ├── columns: j:11 + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ ├── fd: ()-->(11) + │ └── limit + │ ├── columns: v:10!null j:11 + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ ├── fd: ()-->(10,11) + │ ├── index-join b + │ │ ├── columns: v:10!null j:11 + │ │ ├── lax-key: (11) + │ │ ├── fd: ()-->(10,11) + │ │ ├── limit hint: 1.00 + │ │ └── scan b@v + │ │ ├── columns: k:8!null v:10!null + │ │ ├── constraint: /10: [/1 - /1] + │ │ ├── cardinality: [0 - 1] + │ │ ├── key: () + │ │ ├── fd: ()-->(8,10) + │ │ └── limit hint: 1.00 + │ └── 1 + └── subquery + └── project + ├── columns: j:18 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(18) + └── limit + ├── columns: v:17!null j:18 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(17,18) + ├── index-join b + │ ├── columns: v:17!null j:18 + │ ├── lax-key: (18) + │ ├── fd: ()-->(17,18) + │ ├── limit hint: 1.00 + │ └── scan b@v + │ ├── columns: k:15!null v:17!null + │ ├── constraint: /17: [/2 - /2] + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ ├── fd: ()-->(15,17) + │ └── limit hint: 1.00 + └── 1 + +# Do not generate inverted index scans when the IN operator is used with sub-queries. This is +# due to the fact that queries of the form, <scalar> IN (<subquery>), <scalar> NOT IN (<subquery>), +# <scalar> <cmp> {SOME|ANY}(<subquery>) and <scalar> <cmp> ALL(<subquery>) all map to the Any +# operator. +opt expect-not=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->'a' NOT IN ((SELECT j from b where v = 1 limit 1), (SELECT j FROM b WHERE v = 2 limit 1)) +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── scan b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ └── fd: (1)-->(4) + └── filters + └── not-in [outer=(4), immutable, subquery] + ├── j:4->'a' + └── tuple + ├── subquery + │ └── project + │ ├── columns: j:11 + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ ├── fd: ()-->(11) + │ └── limit + │ ├── columns: v:10!null j:11 + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ ├── fd: ()-->(10,11) + │ ├── index-join b + │ │ ├── columns: v:10!null j:11 + │ │ ├── lax-key: (11) + │ │ ├── fd: ()-->(10,11) + │ │ ├── limit hint: 1.00 + │ │ └── scan b@v + │ │ ├── columns: k:8!null v:10!null + │ │ ├── constraint: /10: [/1 - /1] + │ │ ├── cardinality: [0 - 1] + │ │ ├── key: () + │ │ ├── fd: ()-->(8,10) + │ │ └── limit hint: 1.00 + │ └── 1 + └── subquery + └── project + ├── columns: j:18 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(18) + └── limit + ├── columns: v:17!null j:18 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(17,18) + ├── index-join b + │ ├── columns: v:17!null j:18 + │ ├── lax-key: (18) + │ ├── fd: ()-->(17,18) + │ ├── limit hint: 1.00 + │ └── scan b@v + │ ├── columns: k:15!null v:17!null + │ ├── constraint: /17: [/2 - /2] + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ ├── fd: ()-->(15,17) + │ └── limit hint: 1.00 + └── 1 + +# Generate an inverted scan when the index of the fetch val operator is +# an integer along with the IN operator consisting of a combination of JSON objects, +# JSON strings and JSON integers inside the tuple. Since the inverted expression generated +# is not tight, the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0 IN ('{"a": "b"}', '1', '"a"', 'null') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7\x00\x03\x00\x01\x00", "7\x00\x03\x00\x01\x00"] + │ │ ├── ["7\x00\x03\x00\x01\x12a\x00\x01", "7\x00\x03\x00\x01\x12a\x00\x01"] + │ │ ├── ["7\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x01*\x02\x00"] + │ │ └── ["7\x00\x03a\x00\x01\x12b\x00\x01", "7\x00\x03a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7\x00\x03\x00\x01\x00", "7\x00\x03\x00\x01\x00"] + │ │ ├── ["7\x00\x03\x00\x01\x12a\x00\x01", "7\x00\x03\x00\x01\x12a\x00\x01"] + │ │ ├── ["7\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x01*\x02\x00"] + │ │ └── ["7\x00\x03a\x00\x01\x12b\x00\x01", "7\x00\x03a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->0) IN ('null', '"a"', '1', '{"a": "b"}') [outer=(4), immutable] + + +# Generate an inverted scan when the index of the fetch val operator is +# an integer along with the IN operator consisting of JSON arrays. +# Since the inverted expression generated is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0 IN ('[1,2,3]', '[1]', '[1,2]') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ ├── union spans: ["7\x00\x03\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x03\x00\x01*\x02\x00"] + │ │ └── UNION + │ │ ├── span expression + │ │ │ ├── tight: false, unique: false + │ │ │ ├── union spans: empty + │ │ │ └── INTERSECTION + │ │ │ ├── span expression + │ │ │ │ ├── tight: true, unique: true + │ │ │ │ └── union spans: ["7\x00\x03\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x03\x00\x01*\x02\x00"] + │ │ │ └── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ └── union spans: ["7\x00\x03\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x03\x00\x01*\x04\x00"] + │ │ └── span expression + │ │ ├── tight: false, unique: true + │ │ ├── union spans: empty + │ │ └── INTERSECTION + │ │ ├── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ ├── union spans: empty + │ │ │ └── INTERSECTION + │ │ │ ├── span expression + │ │ │ │ ├── tight: true, unique: true + │ │ │ │ └── union spans: ["7\x00\x03\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x03\x00\x01*\x02\x00"] + │ │ │ └── span expression + │ │ │ ├── tight: true, unique: true + │ │ │ └── union spans: ["7\x00\x03\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x03\x00\x01*\x04\x00"] + │ │ └── span expression + │ │ ├── tight: true, unique: true + │ │ └── union spans: ["7\x00\x03\x00\x03\x00\x01*\x06\x00", "7\x00\x03\x00\x03\x00\x01*\x06\x00"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7\x00\x03\x00\x03\x00\x01*\x02\x00", "7\x00\x03\x00\x03\x00\x01*\x02\x00"] + │ │ ├── ["7\x00\x03\x00\x03\x00\x01*\x04\x00", "7\x00\x03\x00\x03\x00\x01*\x04\x00"] + │ │ └── ["7\x00\x03\x00\x03\x00\x01*\x06\x00", "7\x00\x03\x00\x03\x00\x01*\x06\x00"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── (j:4->0) IN ('[1]', '[1, 2]', '[1, 2, 3]') [outer=(4), immutable] + +# Generate an inverted scan when the index of the fetch val operator is +# a combination of an integer and a string along with the IN operator consisting of +# a combination of JSON arrays, JSON objects, JSON integers, JSON strings and null. +# Since the inverted expression generated is not tight, +# the original filter should be applied on top. +opt expect=GenerateInvertedIndexScans +SELECT k FROM b WHERE j->0->'a' IN ('{"a": "b"}', '1', '"a"', 'null') +---- +project + ├── columns: k:1!null + ├── immutable + ├── key: (1) + └── select + ├── columns: k:1!null j:4 + ├── immutable + ├── key: (1) + ├── fd: (1)-->(4) + ├── index-join b + │ ├── columns: k:1!null j:4 + │ ├── key: (1) + │ ├── fd: (1)-->(4) + │ └── inverted-filter + │ ├── columns: k:1!null + │ ├── inverted expression: /7 + │ │ ├── tight: false, unique: false + │ │ └── union spans + │ │ ├── ["7\x00\x03a\x00\x01\x00", "7\x00\x03a\x00\x01\x00"] + │ │ ├── ["7\x00\x03a\x00\x01\x12a\x00\x01", "7\x00\x03a\x00\x01\x12a\x00\x01"] + │ │ ├── ["7\x00\x03a\x00\x01*\x02\x00", "7\x00\x03a\x00\x01*\x02\x00"] + │ │ └── ["7\x00\x03a\x00\x02a\x00\x01\x12b\x00\x01", "7\x00\x03a\x00\x02a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── scan b@j_inv_idx + │ ├── columns: k:1!null j_inverted_key:7!null + │ ├── inverted constraint: /7/1 + │ │ └── spans + │ │ ├── ["7\x00\x03a\x00\x01\x00", "7\x00\x03a\x00\x01\x00"] + │ │ ├── ["7\x00\x03a\x00\x01\x12a\x00\x01", "7\x00\x03a\x00\x01\x12a\x00\x01"] + │ │ ├── ["7\x00\x03a\x00\x01*\x02\x00", "7\x00\x03a\x00\x01*\x02\x00"] + │ │ └── ["7\x00\x03a\x00\x02a\x00\x01\x12b\x00\x01", "7\x00\x03a\x00\x02a\x00\x01\x12b\x00\x01"] + │ ├── key: (1) + │ └── fd: (1)-->(7) + └── filters + └── ((j:4->0)->'a') IN ('null', '"a"', '1', '{"a": "b"}') [outer=(4), immutable] + + # Query using the fetch val and equality operators in a disjunction with a # contains operator. opt expect=GenerateInvertedIndexScans
5fae282c34be93e62656aa9b6ecd890a9ae84307
2020-08-24 19:58:42
David Taylor
backupccl: use year and month nested naming for full backups
false
use year and month nested naming for full backups
backupccl
diff --git a/pkg/ccl/backupccl/backup_destination.go b/pkg/ccl/backupccl/backup_destination.go index fda565ad9cb1..3c2ef8d8e504 100644 --- a/pkg/ccl/backupccl/backup_destination.go +++ b/pkg/ccl/backupccl/backup_destination.go @@ -126,7 +126,7 @@ func resolveDest( } // Pick a piece-specific suffix and update the destination path(s). - partName := endTime.GoTime().Format(dateBasedFolderName) + partName := endTime.GoTime().Format(dateBasedIncFolderName) partName = path.Join(chosenSuffix, partName) defaultURI, urisByLocalityKV, err = getURIsByLocalityKV(to, partName) if err != nil { @@ -260,7 +260,7 @@ func resolveBackupCollection( chosenSuffix = strings.TrimPrefix(subdir, "/") chosenSuffix = "/" + chosenSuffix } else { - chosenSuffix = endTime.GoTime().Format(dateBasedFolderName) + chosenSuffix = endTime.GoTime().Format(dateBasedIntoFolderName) } return collectionURI, chosenSuffix, nil } diff --git a/pkg/ccl/backupccl/backup_test.go b/pkg/ccl/backupccl/backup_test.go index 95b0f25cd94f..bef1e9e92c61 100644 --- a/pkg/ccl/backupccl/backup_test.go +++ b/pkg/ccl/backupccl/backup_test.go @@ -521,7 +521,7 @@ func TestBackupRestoreAppend(t *testing.T) { // Find the backup times in the collection and try RESTORE'ing to each, and // within each also check if we can restore to individual times captured with // incremental backups that were appended to that backup. - full1, full2 := findFullBackupPaths(tmpDir, path.Join(tmpDir, "[0-9]*", "[0-9]*", "BACKUP")) + full1, full2 := findFullBackupPaths(tmpDir, path.Join(tmpDir, "*/*/*/BACKUP")) runRestores(collections, full1, full2) // Find the full-backups written to the specified subdirectories, and within @@ -563,7 +563,7 @@ func TestBackupAndRestoreJobDescription(t *testing.T) { sqlDB.Exec(t, "BACKUP INTO $4 IN ($1, $2, $3)", append(collections, "subdir")...) // Find the subdirectory created by the full BACKUP INTO statement. - matches, err := filepath.Glob(path.Join(tmpDir, "[0-9]*", "[0-9]*", "BACKUP")) + matches, err := filepath.Glob(path.Join(tmpDir, "*/*/*/BACKUP")) require.NoError(t, err) require.Equal(t, 1, len(matches)) for i := range matches { @@ -2077,7 +2077,7 @@ CREATE TABLE d.t1 (x d.farewell); sqlDB.Exec(t, `DROP DATABASE d;`) sqlDB.Exec(t, fmt.Sprintf(` -RESTORE DATABASE d FROM 'nodelocal://0/rev-history-backup' +RESTORE DATABASE d FROM 'nodelocal://0/rev-history-backup' AS OF SYSTEM TIME %s `, ts1)) sqlDB.ExpectErr(t, `pq: type "d.public.farewell" already exists`, diff --git a/pkg/ccl/backupccl/manifest_handling.go b/pkg/ccl/backupccl/manifest_handling.go index ce224c2b36ec..3c63f5204e55 100644 --- a/pkg/ccl/backupccl/manifest_handling.go +++ b/pkg/ccl/backupccl/manifest_handling.go @@ -68,8 +68,9 @@ const ( // ZipType is the format of a GZipped compressed file. ZipType = "application/x-gzip" - dateBasedFolderName = "/20060102/150405.00" - latestFileName = "LATEST" + dateBasedIncFolderName = "/20060102/150405.00" + dateBasedIntoFolderName = "/2006/01/02-150405.00" + latestFileName = "LATEST" ) // BackupFileDescriptors is an alias on which to implement sort's interface. diff --git a/pkg/ccl/backupccl/show.go b/pkg/ccl/backupccl/show.go index 295800aa938c..c1ce63e548c0 100644 --- a/pkg/ccl/backupccl/show.go +++ b/pkg/ccl/backupccl/show.go @@ -438,7 +438,7 @@ func showBackupsInCollectionPlanHook( return errors.Wrapf(err, "connect to external storage") } defer store.Close() - res, err := store.ListFiles(ctx, "/*/*/BACKUP") + res, err := store.ListFiles(ctx, "/*/*/*/BACKUP") if err != nil { return err }
4344087e428f11749381e37b3d818d29a7731e59
2016-04-06 21:07:12
Peter Mattis
sql: add an experimental_uuid_v4 alias for uuid_v4
false
add an experimental_uuid_v4 alias for uuid_v4
sql
diff --git a/sql/parser/builtins.go b/sql/parser/builtins.go index 515d59b37436..b23fa35ae6ab 100644 --- a/sql/parser/builtins.go +++ b/sql/parser/builtins.go @@ -504,16 +504,8 @@ var Builtins = map[string][]Builtin{ }, }, - "uuid_v4": { - Builtin{ - Types: ArgTypes{}, - ReturnType: TypeBytes, - impure: true, - fn: func(_ EvalContext, args DTuple) (Datum, error) { - return DBytes(uuid.NewV4().GetBytes()), nil - }, - }, - }, + "experimental_uuid_v4": {uuidV4Impl}, + "uuid_v4": {uuidV4Impl}, "greatest": { Builtin{ @@ -1108,6 +1100,15 @@ var substringImpls = []Builtin{ }, } +var uuidV4Impl = Builtin{ + Types: ArgTypes{}, + ReturnType: TypeBytes, + impure: true, + fn: func(_ EvalContext, args DTuple) (Datum, error) { + return DBytes(uuid.NewV4().GetBytes()), nil + }, +} + var ceilImpl = []Builtin{ floatBuiltin1(func(x float64) (Datum, error) { return DFloat(math.Ceil(x)), nil
4633e505d9cc9e4c3aec232c8234b65c1f313ae4
2025-02-27 02:20:13
Rafi Shamim
multiregionccl: fix testing callback
false
fix testing callback
multiregionccl
diff --git a/pkg/sql/regionliveness/prober.go b/pkg/sql/regionliveness/prober.go index eb2ca99deac7..9a8d41b25a66 100644 --- a/pkg/sql/regionliveness/prober.go +++ b/pkg/sql/regionliveness/prober.go @@ -119,7 +119,7 @@ var testingUnavailableAtTTLOverride time.Duration func TestingSetProbeLivenessTimeout(probeCallbackFn func()) func() { testingProbeQueryCallbackFunc = probeCallbackFn return func() { - probeCallbackFn = nil + testingProbeQueryCallbackFunc = nil } }
9e397435f115b45d953f59159d1e30abdd04cfe6
2020-11-20 02:25:48
Bilal Akhtar
vendor: Bump pebble to 62f2e316b532, update x/sys
false
Bump pebble to 62f2e316b532, update x/sys
vendor
diff --git a/DEPS.bzl b/DEPS.bzl index f1049cf1ad68..6a51fd40fbfb 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -440,8 +440,8 @@ def go_deps(): name = "com_github_cockroachdb_pebble", build_file_proto_mode = "disable_global", importpath = "github.com/cockroachdb/pebble", - sum = "h1:SyU+66SkkE5wFIfUTFm8B4RKdbSrbkA5cTufPb2oyiQ=", - version = "v0.0.0-20201113231719-11399317ed18", + sum = "h1:W2qQOIPTgHOPrCK/8CSHGfPc3jX8XIvvuWYKlcq55oE=", + version = "v0.0.0-20201119153812-62f2e316b532", ) go_repository( name = "com_github_cockroachdb_redact", @@ -2980,8 +2980,8 @@ def go_deps(): name = "org_golang_x_sys", build_file_proto_mode = "disable_global", importpath = "golang.org/x/sys", - sum = "h1:WgqgiQvkiZWz7XLhphjt2GI2GcGCTIZs9jqXMWmH+oc=", - version = "v0.0.0-20201022201747-fb209a7c41cd", + sum = "h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=", + version = "v0.0.0-20201119102817-f84b799fce68", ) go_repository( name = "org_golang_x_text", diff --git a/go.mod b/go.mod index 2b4bf87ec769..ccfae3ecb44a 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55 github.com/cockroachdb/gostdlib v1.13.0 github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f - github.com/cockroachdb/pebble v0.0.0-20201113231719-11399317ed18 + github.com/cockroachdb/pebble v0.0.0-20201119153812-62f2e316b532 github.com/cockroachdb/redact v1.0.8 github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 @@ -153,7 +153,7 @@ require ( golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 - golang.org/x/sys v0.0.0-20201022201747-fb209a7c41cd + golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 golang.org/x/text v0.3.3 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/tools v0.0.0-20200702044944-0cc1aa72b347 diff --git a/go.sum b/go.sum index b13d28064522..9755e443e210 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,8 @@ github.com/cockroachdb/grpc-gateway v1.14.6-0.20200519165156-52697fc4a249 h1:pZu github.com/cockroachdb/grpc-gateway v1.14.6-0.20200519165156-52697fc4a249/go.mod h1:UJ0EZAp832vCd54Wev9N1BMKEyvcZ5+IM0AwDrnlkEc= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/pebble v0.0.0-20201113231719-11399317ed18 h1:SyU+66SkkE5wFIfUTFm8B4RKdbSrbkA5cTufPb2oyiQ= -github.com/cockroachdb/pebble v0.0.0-20201113231719-11399317ed18/go.mod h1:c3G8ud5zF3+nYHCWmVmtsA8eEtjrDSa6qeLtcRZyevE= +github.com/cockroachdb/pebble v0.0.0-20201119153812-62f2e316b532 h1:W2qQOIPTgHOPrCK/8CSHGfPc3jX8XIvvuWYKlcq55oE= +github.com/cockroachdb/pebble v0.0.0-20201119153812-62f2e316b532/go.mod h1:c3G8ud5zF3+nYHCWmVmtsA8eEtjrDSa6qeLtcRZyevE= github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd h1:KFOt5I9nEKZgCnOSmy8r4Oykh8BYQO8bFOTgHDS8YZA= @@ -840,8 +840,8 @@ golang.org/x/sys v0.0.0-20200121082415-34d275377bf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201022201747-fb209a7c41cd h1:WgqgiQvkiZWz7XLhphjt2GI2GcGCTIZs9jqXMWmH+oc= -golang.org/x/sys v0.0.0-20201022201747-fb209a7c41cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index 90b93dfd0df8..c811702f7d0f 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -339,6 +339,10 @@ func DefaultPebbleOptions() *pebble.Options { // memtable. This ensures that we can reclaim space even when there's no // activity on the database generating flushes. opts.Experimental.DeleteRangeFlushDelay = 10 * time.Second + // Enable deletion pacing. This helps prevent disk slowness events on some + // SSDs, that kick off an expensive GC if a lot of files are deleted at + // once. + opts.Experimental.MinDeletionRate = 128 << 20 // 128 MB for i := 0; i < len(opts.Levels); i++ { l := &opts.Levels[i] diff --git a/vendor b/vendor index d488ea092b94..ffdb284b1170 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit d488ea092b944fc553cd456d0307fc111f785190 +Subproject commit ffdb284b117071933a1717825293aa3c167c4358
6637b22d02de9e88a3ee093fe91a95230cfce7ed
2021-03-25 01:39:09
Rafi Shamim
sql: avoid extra descriptor lookup for DB privileges
false
avoid extra descriptor lookup for DB privileges
sql
diff --git a/pkg/bench/ddl_analysis/orm_queries_bench_test.go b/pkg/bench/ddl_analysis/orm_queries_bench_test.go index 2de13126ebac..7549a184f9e8 100644 --- a/pkg/bench/ddl_analysis/orm_queries_bench_test.go +++ b/pkg/bench/ddl_analysis/orm_queries_bench_test.go @@ -135,6 +135,30 @@ WHERE OR t.typinput = 'array_in(cstring,oid,integer)'::REGPROCEDURE OR t.typelem != 0`, }, + + { + name: "pg_type", + setup: `CREATE TABLE t1(a int primary key, b int);`, + stmt: `SELECT * FROM pg_type`, + }, + + { + name: "pg_class", + setup: `CREATE TABLE t1(a int primary key, b int);`, + stmt: `SELECT * FROM pg_class`, + }, + + { + name: "pg_namespace", + setup: `CREATE TABLE t1(a int primary key, b int);`, + stmt: `SELECT * FROM pg_namespace`, + }, + + { + name: "pg_attribute", + setup: `CREATE TABLE t1(a int primary key, b int);`, + stmt: `SELECT * FROM pg_attribute`, + }, } RunRoundTripBenchmark(b, tests) diff --git a/pkg/bench/ddl_analysis/testdata/benchmark_expectations b/pkg/bench/ddl_analysis/testdata/benchmark_expectations index 9e547637e52e..d8ad4ac5c1d2 100644 --- a/pkg/bench/ddl_analysis/testdata/benchmark_expectations +++ b/pkg/bench/ddl_analysis/testdata/benchmark_expectations @@ -52,10 +52,14 @@ exp,benchmark 42,Grant/grant_all_on_3_tables 21,GrantRole/grant_1_role 24,GrantRole/grant_2_roles -3,ORMQueries/activerecord_type_introspection_query +2,ORMQueries/activerecord_type_introspection_query 2,ORMQueries/django_table_introspection_1_table 2,ORMQueries/django_table_introspection_4_tables 2,ORMQueries/django_table_introspection_8_tables +2,ORMQueries/pg_attribute +2,ORMQueries/pg_class +2,ORMQueries/pg_namespace +2,ORMQueries/pg_type 24,Revoke/revoke_all_on_1_table 33,Revoke/revoke_all_on_2_tables 42,Revoke/revoke_all_on_3_tables diff --git a/pkg/sql/information_schema.go b/pkg/sql/information_schema.go index 90e0637b375c..f77e9e076a93 100755 --- a/pkg/sql/information_schema.go +++ b/pkg/sql/information_schema.go @@ -29,8 +29,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr" "github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc" "github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc" - "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" - "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/privilege" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" @@ -1851,27 +1849,20 @@ func forEachDatabaseDesc( } dbDescs = allDbDescs } else { - // We can't just use dbContext here because we need to fetch the descriptor - // with privileges from kv. - fetchedDbDesc, err := catalogkv.GetDatabaseDescriptorsFromIDs( - ctx, p.txn, p.ExecCfg().Codec, []descpb.ID{dbContext.GetID()}, - ) - if err != nil { - if errors.Is(err, catalog.ErrDescriptorNotFound) { - return pgerror.Newf(pgcode.UndefinedDatabase, "database %s does not exist", dbContext.GetName()) - } - return err - } - dbDescs = fetchedDbDesc + dbDescs = append(dbDescs, dbContext) } // Ignore databases that the user cannot see. for _, dbDesc := range dbDescs { - canSeeDescriptor, err := userCanSeeDescriptor(ctx, p, dbDesc, nil /* parentDBDesc */, false /* allowAdding */) - if err != nil { - return err + canSeeDescriptor := !requiresPrivileges + if requiresPrivileges { + var err error + canSeeDescriptor, err = userCanSeeDescriptor(ctx, p, dbDesc, nil /* parentDBDesc */, false /* allowAdding */) + if err != nil { + return err + } } - if !requiresPrivileges || canSeeDescriptor { + if canSeeDescriptor { if err := fn(dbDesc); err != nil { return err }
267304794df3a10f1ce0fa5c76ba1d588cf6bbb9
2018-03-28 22:45:54
Rebecca Taft
optbuilder: Fix bugs in ORDER BY and DISTINCT
false
Fix bugs in ORDER BY and DISTINCT
optbuilder
diff --git a/pkg/sql/opt/optbuilder/builder.go b/pkg/sql/opt/optbuilder/builder.go index 1e16663f538b..eb35d9f11b90 100644 --- a/pkg/sql/opt/optbuilder/builder.go +++ b/pkg/sql/opt/optbuilder/builder.go @@ -134,10 +134,10 @@ func errorf(format string, a ...interface{}) builderError { // buildPhysicalProps construct a set of required physical properties from the // given scope. func (b *Builder) buildPhysicalProps(scope *scope) *memo.PhysicalProps { - if scope.presentation == nil { - scope.presentation = makePresentation(scope.cols) + if scope.physicalProps.Presentation == nil { + scope.physicalProps.Presentation = makePresentation(scope.cols) } - return &memo.PhysicalProps{Presentation: scope.presentation, Ordering: scope.ordering} + return &scope.physicalProps } // buildStmt builds a set of memo groups that represent the given SQL diff --git a/pkg/sql/opt/optbuilder/distinct.go b/pkg/sql/opt/optbuilder/distinct.go index eadca239be5a..28242fba87e5 100644 --- a/pkg/sql/opt/optbuilder/distinct.go +++ b/pkg/sql/opt/optbuilder/distinct.go @@ -25,32 +25,37 @@ import ( // in contains the memo group ID of the input expression. // distinct is true if this is a DISTINCT expression. If distinct is false, // we just return `in, inScope`. -// byCols is the set of columns in the DISTINCT expression. Since -// DISTINCT is equivalent to GROUP BY without any aggregations, -// byCols are essentially the grouping columns. // // See Builder.buildStmt for a description of the remaining input and // return values. func (b *Builder) buildDistinct( - in memo.GroupID, distinct bool, byCols []columnProps, inScope *scope, + in memo.GroupID, distinct bool, inScope *scope, ) (out memo.GroupID, outScope *scope) { if !distinct { return in, inScope } - // After DISTINCT, FROM columns are no longer visible. As a side effect, - // ORDER BY cannot reference columns outside of the SELECT list. This - // will cause an error for queries like: - // SELECT DISTINCT a FROM t ORDER BY b - // TODO(rytaft): This is not valid syntax in Postgres, but it works in - // CockroachDB, so we may need to support it eventually. outScope = inScope.replace() + outScope.physicalProps = inScope.physicalProps // Distinct is equivalent to group by without any aggregations. var groupCols opt.ColSet - for i := range byCols { - groupCols.Add(int(byCols[i].id)) - outScope.cols = append(outScope.cols, byCols[i]) + for i := range inScope.cols { + if !inScope.cols[i].hidden { + groupCols.Add(int(inScope.cols[i].id)) + outScope.cols = append(outScope.cols, inScope.cols[i]) + } + } + + // Check that the ordering can be provided by the projected columns. + // This will cause an error for queries like: + // SELECT DISTINCT a FROM t ORDER BY b + // TODO(rytaft): This is not valid syntax in Postgres, but it works in + // CockroachDB, so we may need to support it eventually. + for _, col := range outScope.physicalProps.Ordering { + if !outScope.hasColumn(col.ID()) { + panic(errorf("for SELECT DISTINCT, ORDER BY expressions must appear in select list")) + } } aggList := b.constructList(opt.AggregationsOp, nil, nil) diff --git a/pkg/sql/opt/optbuilder/groupby.go b/pkg/sql/opt/optbuilder/groupby.go index 6c77132b1001..9478aa62db5d 100644 --- a/pkg/sql/opt/optbuilder/groupby.go +++ b/pkg/sql/opt/optbuilder/groupby.go @@ -146,7 +146,7 @@ func (b *Builder) hasAggregates(selects tree.SelectExprs) bool { // - the group with the aggregation operator and the corresponding scope // - post-projections with corresponding scope. func (b *Builder) buildAggregation( - sel *tree.SelectClause, fromGroup memo.GroupID, fromScope *scope, + sel *tree.SelectClause, orderBy tree.OrderBy, fromGroup memo.GroupID, fromScope *scope, ) (outGroup memo.GroupID, outScope *scope, projections []memo.GroupID, projectionsScope *scope) { // We use two scopes: // - aggInScope contains columns that are used as input by the @@ -203,6 +203,10 @@ func (b *Builder) buildAggregation( // called which adds columns to the aggInScope and aggOutScope. projections = b.buildProjectionList(sel.Exprs, fromScope, projectionsScope) + // Any additional columns or aggregates in the ORDER BY clause (if it exists) + // will be added here. + projections = b.buildOrderBy(orderBy, fromGroup, projections, fromScope, projectionsScope) + aggInfos := aggOutScope.groupby.aggs // Construct the pre-projection, which renders the grouping columns and the diff --git a/pkg/sql/opt/optbuilder/limit.go b/pkg/sql/opt/optbuilder/limit.go index 236a0c986259..b47df4d5b66b 100644 --- a/pkg/sql/opt/optbuilder/limit.go +++ b/pkg/sql/opt/optbuilder/limit.go @@ -31,7 +31,7 @@ func (b *Builder) buildLimit( ) (out memo.GroupID, outScope *scope) { out, outScope = in, inScope - ordering := inScope.ordering + ordering := inScope.physicalProps.Ordering orderingPrivID := b.factory.InternOrdering(ordering) if limit.Offset != nil { diff --git a/pkg/sql/opt/optbuilder/orderby.go b/pkg/sql/opt/optbuilder/orderby.go index a48de2aad85b..55c7c704ab5b 100644 --- a/pkg/sql/opt/optbuilder/orderby.go +++ b/pkg/sql/opt/optbuilder/orderby.go @@ -33,24 +33,24 @@ import ( // The `c` column must be retained in the projection (and the presentation // property then omits it). // -// buildOrderBy builds a projection combining the projected columns and -// order by columns (only if it's not a "pass through" projection), and sets -// the ordering and presentation properties on the output scope. These -// properties later become part of the required physical properties returned -// by Build. +// buildOrderBy returns a list of memo groups that combines projected columns +// from the SELECT list (the projections parameter) and any ORDER BY columns +// that are not already present in the SELECT list. buildOrderBy adds any new +// ORDER BY columns to the projectionsScope and sets the ordering and +// presentation properties on the projectionsScope. These properties later +// become part of the required physical properties returned by Build. func (b *Builder) buildOrderBy( orderBy tree.OrderBy, in memo.GroupID, projections []memo.GroupID, - inScope, - projectionsScope *scope, -) (out memo.GroupID, outScope *scope) { + inScope, projectionsScope *scope, +) []memo.GroupID { if orderBy == nil { - return in, nil + return projections } orderByScope := inScope.push() - orderByScope.ordering = make(memo.Ordering, 0, len(orderBy)) + orderByScope.physicalProps.Ordering = make(memo.Ordering, 0, len(orderBy)) orderByProjections := make([]memo.GroupID, 0, len(orderBy)) // TODO(rytaft): rewrite ORDER BY if it uses ORDER BY INDEX tbl@idx or @@ -62,11 +62,7 @@ func (b *Builder) buildOrderBy( ) } - out, outScope = b.buildOrderByProject( - in, projections, orderByProjections, inScope, projectionsScope, orderByScope, - ) - return out, outScope - + return b.buildOrderByProject(projections, orderByProjections, projectionsScope, orderByScope) } // buildOrdering sets up the projection(s) of a single ORDER BY argument. @@ -150,52 +146,35 @@ func (b *Builder) buildOrdering( orderByScope.cols[i].id, order.Direction == tree.Descending, ) - orderByScope.ordering = append(orderByScope.ordering, col) + orderByScope.physicalProps.Ordering = append(orderByScope.physicalProps.Ordering, col) } return projections } -// buildOrderByProject builds a projection that combines projected -// columns from a SELECT list and ORDER BY columns. -// If the combined set of output columns matches the set of input columns, -// buildOrderByProject simply returns the input -- it does not construct -// a "pass through" projection. +// buildOrderByProject returns a list of memo groups that combines projections +// and any items from orderByProjections that are not already present in +// projections. buildOrderByProject adds any new ORDER BY columns to the +// projectionsScope and sets the ordering and presentation properties on the +// projectionsScope. These properties later become part of the required +// physical properties returned by Build. func (b *Builder) buildOrderByProject( - in memo.GroupID, - projections, orderByProjections []memo.GroupID, - inScope, projectionsScope, orderByScope *scope, -) (out memo.GroupID, outScope *scope) { - outScope = inScope.replace() - - outScope.cols = make([]columnProps, 0, len(projectionsScope.cols)+len(orderByScope.cols)) - outScope.appendColumns(projectionsScope) - combined := make([]memo.GroupID, 0, len(projectionsScope.cols)+len(orderByScope.cols)) - combined = append(combined, projections...) - + projections, orderByProjections []memo.GroupID, projectionsScope, orderByScope *scope, +) []memo.GroupID { for i := range orderByScope.cols { col := &orderByScope.cols[i] // Only append order by columns that aren't already present. - if findColByIndex(outScope.cols, col.id) == nil { - outScope.cols = append(outScope.cols, *col) - outScope.cols[len(outScope.cols)-1].hidden = true - combined = append(combined, orderByProjections[i]) + if findColByIndex(projectionsScope.cols, col.id) == nil { + projectionsScope.cols = append(projectionsScope.cols, *col) + projectionsScope.cols[len(projectionsScope.cols)-1].hidden = true + projections = append(projections, orderByProjections[i]) } } - outScope.ordering = orderByScope.ordering - outScope.presentation = makePresentation(projectionsScope.cols) - - if outScope.hasSameColumns(inScope) { - // All order by and projection columns were already present, so no need to - // construct the projection expression. - return in, outScope - } - - p := b.constructList(opt.ProjectionsOp, combined, outScope.cols) - out = b.factory.ConstructProject(in, p) - return out, outScope + projectionsScope.physicalProps.Ordering = orderByScope.physicalProps.Ordering + projectionsScope.physicalProps.Presentation = makePresentation(projectionsScope.cols) + return projections } func ensureColumnOrderable(e tree.TypedExpr) { diff --git a/pkg/sql/opt/optbuilder/project.go b/pkg/sql/opt/optbuilder/project.go index 9d0f71badf70..eaacd467a3c9 100644 --- a/pkg/sql/opt/optbuilder/project.go +++ b/pkg/sql/opt/optbuilder/project.go @@ -15,10 +15,29 @@ package optbuilder import ( + "github.com/cockroachdb/cockroach/pkg/sql/opt" "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" ) +// constructProject constructs a projection if it will result in a different +// set of columns than its input. +func (b *Builder) constructProject( + projections []memo.GroupID, in memo.GroupID, projectionsScope, inScope *scope, +) (out memo.GroupID, outScope *scope) { + // Don't add an unnecessary "pass through" project expression. + if projectionsScope.hasSameColumns(inScope) { + out = in + } else { + p := b.constructList(opt.ProjectionsOp, projections, projectionsScope.cols) + out = b.factory.ConstructProject(in, p) + } + + // Return projectionsScope even if it has the same columns as inScope + // since the column names and hidden status may be different. + return out, projectionsScope +} + // buildProjectionList builds a set of memo groups that represent the given // list of select expressions. // diff --git a/pkg/sql/opt/optbuilder/scope.go b/pkg/sql/opt/optbuilder/scope.go index 8328c6d61679..6aaf792d0518 100644 --- a/pkg/sql/opt/optbuilder/scope.go +++ b/pkg/sql/opt/optbuilder/scope.go @@ -33,12 +33,11 @@ import ( // // See builder.go for more details. type scope struct { - builder *Builder - parent *scope - cols []columnProps - groupby groupby - ordering memo.Ordering - presentation memo.Presentation + builder *Builder + parent *scope + cols []columnProps + groupby groupby + physicalProps memo.PhysicalProps // Desired number of columns for subqueries found during name resolution and // type checking. This only applies to the top-level subqueries that are @@ -135,10 +134,14 @@ func (s *scope) resolveAndRequireType( // hasColumn returns true if the given column id is found within this scope. func (s *scope) hasColumn(id opt.ColumnID) bool { - for curr := s; curr != nil; curr = curr.parent { + // We only allow hidden columns in the current scope. Hidden columns + // in parent scopes are not accessible. + allowHidden := true + + for curr := s; curr != nil; curr, allowHidden = curr.parent, false { for i := range curr.cols { col := &curr.cols[i] - if col.id == id { + if col.id == id && (allowHidden || !col.hidden) { return true } } diff --git a/pkg/sql/opt/optbuilder/select.go b/pkg/sql/opt/optbuilder/select.go index 997b138372a9..49746b3d648a 100644 --- a/pkg/sql/opt/optbuilder/select.go +++ b/pkg/sql/opt/optbuilder/select.go @@ -169,7 +169,7 @@ func (b *Builder) buildSelect( // NB: The case statements are sorted lexicographically. switch t := stmt.Select.(type) { case *tree.SelectClause: - out, outScope = b.buildSelectClause(stmt, inScope) + out, outScope = b.buildSelectClause(t, orderBy, inScope) case *tree.UnionClause: out, outScope = b.buildUnion(t, inScope) @@ -181,7 +181,7 @@ func (b *Builder) buildSelect( panic(errorf("not yet implemented: select statement: %T", stmt.Select)) } - if outScope.ordering == nil && orderBy != nil { + if outScope.physicalProps.Ordering == nil && orderBy != nil { projectionsScope := outScope.replace() projectionsScope.cols = make([]columnProps, 0, len(outScope.cols)) projections := make([]memo.GroupID, 0, len(outScope.cols)) @@ -189,7 +189,8 @@ func (b *Builder) buildSelect( p := b.buildScalarProjection(&outScope.cols[i], "", outScope, projectionsScope) projections = append(projections, p) } - out, outScope = b.buildOrderBy(orderBy, out, projections, outScope, projectionsScope) + projections = b.buildOrderBy(orderBy, out, projections, outScope, projectionsScope) + out, outScope = b.constructProject(projections, out, projectionsScope, outScope) } if limit != nil { @@ -209,10 +210,8 @@ func (b *Builder) buildSelect( // See Builder.buildStmt for a description of the remaining input and // return values. func (b *Builder) buildSelectClause( - stmt *tree.Select, inScope *scope, + sel *tree.SelectClause, orderBy tree.OrderBy, inScope *scope, ) (out memo.GroupID, outScope *scope) { - sel := stmt.Select.(*tree.SelectClause) - var fromScope *scope out, fromScope = b.buildFrom(sel.From, sel.Where, inScope) outScope = fromScope @@ -220,34 +219,18 @@ func (b *Builder) buildSelectClause( var projections []memo.GroupID var projectionsScope *scope if b.needsAggregation(sel) { - out, outScope, projections, projectionsScope = b.buildAggregation(sel, out, fromScope) + out, outScope, projections, projectionsScope = b.buildAggregation(sel, orderBy, out, fromScope) } else { projectionsScope = fromScope.replace() projections = b.buildProjectionList(sel.Exprs, fromScope, projectionsScope) + projections = b.buildOrderBy(orderBy, out, projections, outScope, projectionsScope) } - if stmt.OrderBy != nil { - // Wrap with distinct operator if it exists. - out, outScope = b.buildDistinct(out, sel.Distinct, projectionsScope.cols, outScope) - - // OrderBy can reference columns from either the from/grouping clause or - // the projections clause. - out, outScope = b.buildOrderBy(stmt.OrderBy, out, projections, outScope, projectionsScope) - return out, outScope - } - - // Don't add an unnecessary "pass through" project expression. - if !projectionsScope.hasSameColumns(outScope) { - p := b.constructList(opt.ProjectionsOp, projections, projectionsScope.cols) - out = b.factory.ConstructProject(out, p) - } - - // Assign projectionsScope to outScope even if they have the same columns - // since the column names and hidden status may have changed. - outScope = projectionsScope + // Construct the projection. + out, outScope = b.constructProject(projections, out, projectionsScope, outScope) // Wrap with distinct operator if it exists. - out, outScope = b.buildDistinct(out, sel.Distinct, outScope.cols, outScope) + out, outScope = b.buildDistinct(out, sel.Distinct, outScope) return out, outScope } diff --git a/pkg/sql/opt/optbuilder/testdata/aggregate b/pkg/sql/opt/optbuilder/testdata/aggregate index 1eb6c431189b..e6f5fe8f5119 100644 --- a/pkg/sql/opt/optbuilder/testdata/aggregate +++ b/pkg/sql/opt/optbuilder/testdata/aggregate @@ -825,17 +825,73 @@ sort └── function: count [type=int] └── variable: kv.k [type=int] -# TODO(rytaft): This is a bug. This query is valid. build SELECT v, COUNT(k) FROM kv GROUP BY v ORDER BY COUNT(k) DESC ---- -error: column name "k" not found +sort + ├── columns: v:2(int) column5:5(int) + ├── ordering: -5 + └── group-by + ├── columns: kv.v:2(int) column5:5(int) + ├── grouping columns: kv.v:2(int) + ├── project + │ ├── columns: kv.v:2(int) kv.k:1(int!null) + │ ├── scan kv + │ │ └── columns: kv.k:1(int!null) kv.v:2(int) kv.w:3(int) kv.s:4(string) + │ └── projections + │ ├── variable: kv.v [type=int] + │ └── variable: kv.k [type=int] + └── aggregations + └── function: count [type=int] + └── variable: kv.k [type=int] -# TODO(rytaft): This is a bug. This query is valid. build SELECT v, COUNT(k) FROM kv GROUP BY v ORDER BY v-COUNT(k) ---- -error: column name "k" not found +sort + ├── columns: v:2(int) column5:5(int) + ├── ordering: +6 + └── project + ├── columns: kv.v:2(int) column5:5(int) column6:6(int) + ├── group-by + │ ├── columns: kv.v:2(int) column5:5(int) + │ ├── grouping columns: kv.v:2(int) + │ ├── project + │ │ ├── columns: kv.v:2(int) kv.k:1(int!null) + │ │ ├── scan kv + │ │ │ └── columns: kv.k:1(int!null) kv.v:2(int) kv.w:3(int) kv.s:4(string) + │ │ └── projections + │ │ ├── variable: kv.v [type=int] + │ │ └── variable: kv.k [type=int] + │ └── aggregations + │ └── function: count [type=int] + │ └── variable: kv.k [type=int] + └── projections + ├── variable: kv.v [type=int] + ├── variable: column5 [type=int] + └── minus [type=int] + ├── variable: kv.v [type=int] + └── variable: column5 [type=int] + +build +SELECT v FROM kv GROUP BY v ORDER BY SUM(k) +---- +sort + ├── columns: v:2(int) + ├── ordering: +5 + └── group-by + ├── columns: kv.v:2(int) column5:5(decimal) + ├── grouping columns: kv.v:2(int) + ├── project + │ ├── columns: kv.v:2(int) kv.k:1(int!null) + │ ├── scan kv + │ │ └── columns: kv.k:1(int!null) kv.v:2(int) kv.w:3(int) kv.s:4(string) + │ └── projections + │ ├── variable: kv.v [type=int] + │ └── variable: kv.k [type=int] + └── aggregations + └── function: sum [type=decimal] + └── variable: kv.k [type=int] build SELECT v, COUNT(k) FROM kv GROUP BY v ORDER BY 1 DESC @@ -1985,23 +2041,63 @@ project ├── variable: ab.b [type=int] └── variable: ab.a [type=int] -# TODO(rytaft): This is a bug. This query is valid. build SELECT v, COUNT(k) FROM kv GROUP BY v ORDER BY COUNT(k) ---- -error: column name "k" not found +sort + ├── columns: v:2(int) column5:5(int) + ├── ordering: +5 + └── group-by + ├── columns: kv.v:2(int) column5:5(int) + ├── grouping columns: kv.v:2(int) + ├── project + │ ├── columns: kv.v:2(int) kv.k:1(int!null) + │ ├── scan kv + │ │ └── columns: kv.k:1(int!null) kv.v:2(int) kv.w:3(int) kv.s:4(string) + │ └── projections + │ ├── variable: kv.v [type=int] + │ └── variable: kv.k [type=int] + └── aggregations + └── function: count [type=int] + └── variable: kv.k [type=int] -# TODO(rytaft): This is a bug. This query is valid. build SELECT v, COUNT(*) FROM kv GROUP BY v ORDER BY COUNT(*) ---- -error: aggregate function is not allowed in this context +sort + ├── columns: v:2(int) column5:5(int) + ├── ordering: +5 + └── group-by + ├── columns: kv.v:2(int) column5:5(int) + ├── grouping columns: kv.v:2(int) + ├── project + │ ├── columns: kv.v:2(int) + │ ├── scan kv + │ │ └── columns: kv.k:1(int!null) kv.v:2(int) kv.w:3(int) kv.s:4(string) + │ └── projections + │ └── variable: kv.v [type=int] + └── aggregations + └── function: count_rows [type=int] -# TODO(rytaft): This is a bug. This query is valid. build SELECT v, COUNT(1) FROM kv GROUP BY v ORDER BY COUNT(1) ---- -error: aggregate function is not allowed in this context +sort + ├── columns: v:2(int) column6:6(int) + ├── ordering: +6 + └── group-by + ├── columns: kv.v:2(int) column6:6(int) + ├── grouping columns: kv.v:2(int) + ├── project + │ ├── columns: kv.v:2(int) column5:5(int) + │ ├── scan kv + │ │ └── columns: kv.k:1(int!null) kv.v:2(int) kv.w:3(int) kv.s:4(string) + │ └── projections + │ ├── variable: kv.v [type=int] + │ └── const: 1 [type=int] + └── aggregations + └── function: count [type=int] + └── variable: column5 [type=int] build SELECT (k+v)/(v+w) FROM t.kv GROUP BY k+v, v+w; diff --git a/pkg/sql/opt/optbuilder/testdata/distinct b/pkg/sql/opt/optbuilder/testdata/distinct index 842ab5d050d2..b7700c75f8fd 100644 --- a/pkg/sql/opt/optbuilder/testdata/distinct +++ b/pkg/sql/opt/optbuilder/testdata/distinct @@ -80,8 +80,13 @@ sort └── group-by ├── columns: xyz.y:2(int) xyz.z:3(float) ├── grouping columns: xyz.y:2(int) xyz.z:3(float) - ├── scan xyz - │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + ├── project + │ ├── columns: xyz.y:2(int) xyz.z:3(float) + │ ├── scan xyz + │ │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + │ └── projections + │ ├── variable: xyz.y [type=int] + │ └── variable: xyz.z [type=float] └── aggregations build @@ -93,8 +98,13 @@ sort └── group-by ├── columns: xyz.y:2(int) xyz.z:3(float) ├── grouping columns: xyz.y:2(int) xyz.z:3(float) - ├── scan xyz - │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + ├── project + │ ├── columns: xyz.y:2(int) xyz.z:3(float) + │ ├── scan xyz + │ │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + │ └── projections + │ ├── variable: xyz.y [type=int] + │ └── variable: xyz.z [type=float] └── aggregations build @@ -106,8 +116,13 @@ sort └── group-by ├── columns: xyz.y:2(int) xyz.z:3(float) ├── grouping columns: xyz.y:2(int) xyz.z:3(float) - ├── scan xyz - │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + ├── project + │ ├── columns: xyz.y:2(int) xyz.z:3(float) + │ ├── scan xyz + │ │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + │ └── projections + │ ├── variable: xyz.y [type=int] + │ └── variable: xyz.z [type=float] └── aggregations # TODO(rytaft): This is a bug. This query is valid. @@ -126,19 +141,27 @@ error: unsupported binary operator: <int> + <float> # CockroachDB with the semantics: # SELECT y AS w FROM t GROUP BY y ORDER BY min(z); # We may decide to support this later, but for now this should cause an error. -# TODO(rytaft): Improve this error message to be more descriptive. E.g., the -# Postgres error message is "for SELECT DISTINCT, ORDER BY expressions must -# appear in select list". build SELECT DISTINCT y AS w FROM xyz ORDER by z ---- -error: column name "z" not found +error: for SELECT DISTINCT, ORDER BY expressions must appear in select list -# TODO(rytaft): This is a bug. This query is valid. build SELECT DISTINCT y AS w FROM xyz ORDER by y ---- -error: column name "y" not found +sort + ├── columns: w:2(int) + ├── ordering: +2 + └── group-by + ├── columns: xyz.y:2(int) + ├── grouping columns: xyz.y:2(int) + ├── project + │ ├── columns: xyz.y:2(int) + │ ├── scan xyz + │ │ └── columns: xyz.x:1(int!null) xyz.y:2(int) xyz.z:3(float) + │ └── projections + │ └── variable: xyz.y [type=int] + └── aggregations build SELECT DISTINCT (y,z) FROM t.xyz @@ -346,6 +369,12 @@ sort └── group-by ├── columns: abcd.b:2(int!null) abcd.d:4(int!null) column5:5(int) ├── grouping columns: abcd.b:2(int!null) abcd.d:4(int!null) column5:5(int) - ├── scan abcd - │ └── columns: abcd.a:1(int!null) abcd.b:2(int!null) abcd.c:3(int!null) abcd.d:4(int!null) + ├── project + │ ├── columns: column5:5(int) abcd.d:4(int!null) abcd.b:2(int!null) + │ ├── scan abcd + │ │ └── columns: abcd.a:1(int!null) abcd.b:2(int!null) abcd.c:3(int!null) abcd.d:4(int!null) + │ └── projections + │ ├── const: 1 [type=int] + │ ├── variable: abcd.d [type=int] + │ └── variable: abcd.b [type=int] └── aggregations diff --git a/pkg/sql/opt/optbuilder/testdata/limit b/pkg/sql/opt/optbuilder/testdata/limit index a3b8d38b1571..3a68f61a4b3f 100644 --- a/pkg/sql/opt/optbuilder/testdata/limit +++ b/pkg/sql/opt/optbuilder/testdata/limit @@ -177,8 +177,12 @@ limit │ └── group-by │ ├── columns: t.v:2(int) │ ├── grouping columns: t.v:2(int) - │ ├── scan t - │ │ └── columns: t.k:1(int!null) t.v:2(int) t.w:3(int) + │ ├── project + │ │ ├── columns: t.v:2(int) + │ │ ├── scan t + │ │ │ └── columns: t.k:1(int!null) t.v:2(int) t.w:3(int) + │ │ └── projections + │ │ └── variable: t.v [type=int] │ └── aggregations └── const: 10 [type=int] diff --git a/pkg/sql/opt/optbuilder/testdata/orderby b/pkg/sql/opt/optbuilder/testdata/orderby index 59b3397e9202..d497d548d7b7 100644 --- a/pkg/sql/opt/optbuilder/testdata/orderby +++ b/pkg/sql/opt/optbuilder/testdata/orderby @@ -103,13 +103,10 @@ sort # CockroachDB with the semantics: # SELECT c FROM t GROUP BY c ORDER BY max(b) DESC; # We may decide to support this later, but for now this should cause an error. -# TODO(rytaft): Improve this error message to be more descriptive. E.g., the -# Postgres error message is "for SELECT DISTINCT, ORDER BY expressions must -# appear in select list". build SELECT DISTINCT c FROM t ORDER BY b DESC ---- -error: column name "b" not found +error: for SELECT DISTINCT, ORDER BY expressions must appear in select list build SELECT a AS foo, b FROM t ORDER BY foo DESC diff --git a/pkg/sql/opt/optbuilder/util.go b/pkg/sql/opt/optbuilder/util.go index 07e855a7c48a..c8804089d14b 100644 --- a/pkg/sql/opt/optbuilder/util.go +++ b/pkg/sql/opt/optbuilder/util.go @@ -298,10 +298,12 @@ func findColByIndex(cols []columnProps, id opt.ColumnID) *columnProps { } func makePresentation(cols []columnProps) memo.Presentation { - presentation := make(memo.Presentation, len(cols)) + presentation := make(memo.Presentation, 0, len(cols)) for i := range cols { col := &cols[i] - presentation[i] = opt.LabeledColumn{Label: string(col.name), ID: col.id} + if !col.hidden { + presentation = append(presentation, opt.LabeledColumn{Label: string(col.name), ID: col.id}) + } } return presentation }
4a7de30199e57166db50e859f9b9e1fca16101b3
2022-09-23 03:05:23
Yahor Yuzefovich
sql: retry validation of unique constraint
false
retry validation of unique constraint
sql
diff --git a/pkg/sql/check.go b/pkg/sql/check.go index 2fb9a192db6d..ba48e5613c6d 100644 --- a/pkg/sql/check.go +++ b/pkg/sql/check.go @@ -15,6 +15,7 @@ import ( "context" "fmt" "strings" + "time" "github.com/cockroachdb/cockroach/pkg/jobs" "github.com/cockroachdb/cockroach/pkg/kv" @@ -24,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr" "github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc" + "github.com/cockroachdb/cockroach/pkg/sql/flowinfra" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -31,6 +33,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/sqlutil" "github.com/cockroachdb/cockroach/pkg/util" "github.com/cockroachdb/cockroach/pkg/util/log" + "github.com/cockroachdb/cockroach/pkg/util/retry" "github.com/cockroachdb/errors" pbtypes "github.com/gogo/protobuf/types" ) @@ -634,8 +637,34 @@ func validateUniqueConstraint( sessionDataOverride := sessiondata.NoSessionDataOverride sessionDataOverride.User = user - values, err := ie.QueryRowEx(ctx, "validate unique constraint", txn, sessionDataOverride, query) - if err != nil { + // We are likely to have performed a lot of work before getting here (e.g. + // importing the data), so we want to make an effort in order to run the + // validation query without error in order to not fail the whole operation. + // Thus, we allow up to 5 retries with an exponential backoff for an + // allowlist of errors. + // + // We choose to explicitly perform the retry here rather than propagate the + // error as "job retryable" and relying on the jobs framework to do the + // retries in order to not waste (a lot of) work that was performed before + // we got here. + var values tree.Datums + retryOptions := retry.Options{ + InitialBackoff: 20 * time.Millisecond, + Multiplier: 1.5, + MaxRetries: 5, + } + for r := retry.StartWithCtx(ctx, retryOptions); r.Next(); { + values, err = ie.QueryRowEx(ctx, "validate unique constraint", txn, sessionDataOverride, query) + if err == nil { + break + } + if pgerror.IsSQLRetryableError(err) || flowinfra.IsFlowRetryableError(err) { + // An example error that we want to retry is "no inbound stream" + // connection error which can occur if the node that is used for the + // distributed query goes down. + log.Infof(ctx, "retrying the validation query because of %v", err) + continue + } return err } if values.Len() > 0 {
4df6de271a8cf327b284e638321944e771e3b997
2021-03-01 15:03:39
Tharun
cli: Fix demo command's nodeName argument index while returning error
false
Fix demo command's nodeName argument index while returning error
cli
diff --git a/pkg/cli/sql.go b/pkg/cli/sql.go index e4544544ecac..a0e11979ed4a 100644 --- a/pkg/cli/sql.go +++ b/pkg/cli/sql.go @@ -546,7 +546,7 @@ func (c *cliState) handleDemo(cmd []string, nextState, errState cliStateEnum) cl } if len(cmd) != 2 { - return c.invalidSyntax(errState, `\demo expects 2 parameters`) + return c.invalidSyntax(errState, `\demo expects 2 parameters, but passed %v`, len(cmd)) } // Special case the add command it takes a string instead of a node number. @@ -588,7 +588,7 @@ func (c *cliState) handleDemoNodeCommands( return c.invalidSyntax( errState, "%s", - errors.Wrapf(err, "cannot convert %s to string", cmd[2]).Error(), + errors.Wrapf(err, "cannot convert %s to string", cmd[1]), ) } diff --git a/pkg/cli/sql_test.go b/pkg/cli/sql_test.go index 1d432bb6c134..53e3885c4c52 100644 --- a/pkg/cli/sql_test.go +++ b/pkg/cli/sql_test.go @@ -234,6 +234,18 @@ func TestHandleCliCmdSlashDInvalidSyntax(t *testing.T) { } } +func TestHandleDemoNodeCommandsInvalidNodeName(t *testing.T) { + defer leaktest.AfterTest(t)() + defer log.Scope(t).Close(t) + initCLIDefaults() + + demoNodeCommandTests := []string{"shutdown", "*"} + + c := setupTestCliState() + c.handleDemoNodeCommands(demoNodeCommandTests, cliStateEnum(0), cliStateEnum(1)) + assert.Equal(t, errInvalidSyntax, c.exitErr) +} + func setupTestCliState() cliState { c := cliState{} c.ins = noLineEditor
edf74084c34532701bfc5901c77e8d66a547de2d
2019-07-24 18:07:19
Nathan VanBenschoten
roachprod: add --all-mine flag to destroy command
false
add --all-mine flag to destroy command
roachprod
diff --git a/pkg/cmd/roachprod/main.go b/pkg/cmd/roachprod/main.go index 43010b914f40..41ec7f1aeb92 100644 --- a/pkg/cmd/roachprod/main.go +++ b/pkg/cmd/roachprod/main.go @@ -69,6 +69,7 @@ var ( numRacks int username string dryrun bool + destroyAllMine bool extendLifetime time.Duration wipePreserveCerts bool listDetails bool @@ -459,67 +460,116 @@ func cleanupFailedCreate(clusterName string) error { } var destroyCmd = &cobra.Command{ - Use: "destroy <cluster 1> [<cluster 2> ...]", + Use: "destroy [ --all-mine | <cluster 1> [<cluster 2> ...] ]", Short: "destroy clusters", Long: `Destroy one or more local or cloud-based clusters. +The destroy command accepts the names of the clusters to destroy. Alternatively, +the --all-mine flag can be provided to destroy all clusters that are owned by the +current user. + Destroying a cluster releases the resources for a cluster. For a cloud-based cluster the machine and associated disk resources are freed. For a local cluster, any processes started by roachprod are stopped, and the ${HOME}/local directory is removed. `, - Args: cobra.MinimumNArgs(1), + Args: cobra.ArbitraryArgs, Run: wrap(func(cmd *cobra.Command, args []string) error { - for _, arg := range args { - clusterName, err := verifyClusterName(arg) + switch len(args) { + case 0: + if !destroyAllMine { + return errors.New("no cluster name provided") + } + + destroyPattern, err := userClusterNameRegexp() if err != nil { return err } - if clusterName != config.Local { - cloud, err := cld.ListCloud() - if err != nil { - return err - } + cloud, err := cld.ListCloud() + if err != nil { + return err + } - c, ok := cloud.Clusters[clusterName] - if !ok { - return fmt.Errorf("cluster %s does not exist", clusterName) + var names []string + for name := range cloud.Clusters { + if destroyPattern.MatchString(name) { + names = append(names, name) } + } + sort.Strings(names) - fmt.Printf("Destroying cluster %s with %d nodes\n", clusterName, len(c.VMs)) - if err := cld.DestroyCluster(c); err != nil { + for _, clusterName := range names { + if err := destroyCluster(cloud, clusterName); err != nil { return err } - } else { - if _, ok := install.Clusters[clusterName]; !ok { - return fmt.Errorf("cluster %s does not exist", clusterName) - } - c, err := newCluster(clusterName) + } + default: + if destroyAllMine { + return errors.New("--all-mine cannot be combined with cluster names") + } + + var cloud *cld.Cloud + for _, arg := range args { + clusterName, err := verifyClusterName(arg) if err != nil { return err } - c.Wipe(false) - for _, i := range c.Nodes { - err := os.RemoveAll(fmt.Sprintf(os.ExpandEnv("${HOME}/local/%d"), i)) - if err != nil { + + if clusterName != config.Local { + if cloud == nil { + cloud, err = cld.ListCloud() + if err != nil { + return err + } + } + + if err := destroyCluster(cloud, clusterName); err != nil { + return err + } + } else { + if err := destroyLocalCluster(); err != nil { return err } - } - if err := os.Remove(filepath.Join(os.ExpandEnv(config.DefaultHostDir), c.Name)); err != nil { - return err } } } - fmt.Println("OK") return nil }), } +func destroyCluster(cloud *cld.Cloud, clusterName string) error { + c, ok := cloud.Clusters[clusterName] + if !ok { + return fmt.Errorf("cluster %s does not exist", clusterName) + } + fmt.Printf("Destroying cluster %s with %d nodes\n", clusterName, len(c.VMs)) + return cld.DestroyCluster(c) +} + +func destroyLocalCluster() error { + if _, ok := install.Clusters[config.Local]; !ok { + return fmt.Errorf("cluster %s does not exist", config.Local) + } + c, err := newCluster(config.Local) + if err != nil { + return err + } + c.Wipe(false) + for _, i := range c.Nodes { + err := os.RemoveAll(fmt.Sprintf(os.ExpandEnv("${HOME}/local/%d"), i)) + if err != nil { + return err + } + } + return os.Remove(filepath.Join(os.ExpandEnv(config.DefaultHostDir), c.Name)) +} + var cachedHostsCmd = &cobra.Command{ Use: "cached-hosts", Short: "list all clusters (and optionally their host numbers) from local cache", + Args: cobra.NoArgs, Run: wrap(func(cmd *cobra.Command, args []string) error { if err := loadClusters(); err != nil { return err @@ -595,31 +645,14 @@ The --json flag sets the format of the command output to json. Listing clusters has the side-effect of syncing ssh keys/configs and the local hosts file. `, + Args: cobra.RangeArgs(0, 1), Run: wrap(func(cmd *cobra.Command, args []string) error { listPattern := regexp.MustCompile(".*") switch len(args) { case 0: if listMine { - // In general, we expect that users will have the same - // account name across the services they're using, - // but we still want to function even if this is not - // the case. - seenAccounts := map[string]bool{} - accounts, err := vm.FindActiveAccounts() - if err != nil { - return err - } - pattern := "" - for _, account := range accounts { - if !seenAccounts[account] { - seenAccounts[account] = true - if len(pattern) > 0 { - pattern += "|" - } - pattern += fmt.Sprintf("(^%s-)", regexp.QuoteMeta(account)) - } - } - listPattern, err = regexp.Compile(pattern) + var err error + listPattern, err = userClusterNameRegexp() if err != nil { return err } @@ -705,6 +738,31 @@ hosts file. }), } +// userClusterNameRegexp returns a regexp that matches all clusters owned by the +// current user. +func userClusterNameRegexp() (*regexp.Regexp, error) { + // In general, we expect that users will have the same + // account name across the services they're using, + // but we still want to function even if this is not + // the case. + seenAccounts := map[string]bool{} + accounts, err := vm.FindActiveAccounts() + if err != nil { + return nil, err + } + pattern := "" + for _, account := range accounts { + if !seenAccounts[account] { + seenAccounts[account] = true + if len(pattern) > 0 { + pattern += "|" + } + pattern += fmt.Sprintf("(^%s-)", regexp.QuoteMeta(account)) + } + } + return regexp.Compile(pattern) +} + // TODO(peter): Do we need this command given that the "list" command syncs as // a side-effect. If you don't care about the list output, just "roachprod list // &>/dev/null". @@ -712,6 +770,7 @@ var syncCmd = &cobra.Command{ Use: "sync", Short: "sync ssh keys/config and hosts files", Long: ``, + Args: cobra.NoArgs, Run: wrap(func(cmd *cobra.Command, args []string) error { _, err := syncCloud(quiet) return err @@ -817,6 +876,7 @@ var gcCmd = &cobra.Command{ Destroys expired clusters, sending email if properly configured. Usually run hourly by a cronjob so it is not necessary to run manually. `, + Args: cobra.NoArgs, Run: wrap(func(cmd *cobra.Command, args []string) error { cloud, err := cld.ListCloud() if err != nil { @@ -1526,6 +1586,9 @@ func main() { p.Flags().ConfigureClusterFlags(createCmd.Flags(), vm.SingleProject) } + destroyCmd.Flags().BoolVarP(&destroyAllMine, + "all-mine", "m", false, "Destroy all clusters belonging to the current user") + extendCmd.Flags().DurationVarP(&extendLifetime, "lifetime", "l", 12*time.Hour, "Lifetime of the cluster")
9b07464bec3e056a2075d3166ef8c48199ac71e6
2024-10-15 00:43:02
Matt White
sql: support UPDATE on RBR tables under non-serializable isolations
false
support UPDATE on RBR tables under non-serializable isolations
sql
diff --git a/pkg/ccl/crosscluster/logical/lww_kv_processor.go b/pkg/ccl/crosscluster/logical/lww_kv_processor.go index 3da95396aaca..7534cb764a81 100644 --- a/pkg/ccl/crosscluster/logical/lww_kv_processor.go +++ b/pkg/ccl/crosscluster/logical/lww_kv_processor.go @@ -338,7 +338,7 @@ func newKVTableWriter( } rd := row.MakeDeleter(evalCtx.Codec, tableDesc, readCols, &evalCtx.Settings.SV, internal, nil) ru, err := row.MakeUpdater( - ctx, nil, evalCtx.Codec, tableDesc, readCols, writeCols, row.UpdaterDefault, a, &evalCtx.Settings.SV, internal, nil, + ctx, nil, evalCtx.Codec, tableDesc, nil /* uniqueWithTombstoneIndexes */, readCols, writeCols, row.UpdaterDefault, a, &evalCtx.Settings.SV, internal, nil, ) if err != nil { return nil, err diff --git a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit_read_committed b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit_read_committed index 60be771d48b1..9e035b0b789a 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit_read_committed +++ b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit_read_committed @@ -153,6 +153,15 @@ INSERT INTO t VALUES (1, 'one', 3, 6, 5) statement error pgcode 23505 pq: duplicate key value violates unique constraint "t_c_key" INSERT INTO t VALUES (2, 'three', 3, 4, 5) +statement ok +INSERT INTO t VALUES (2, 'four', 3, 6, 5) + +statement error pgcode 23505 pq: duplicate key value violates unique constraint "t_pkey" +UPDATE t SET pk = 1 WHERE c = 6; + +statement error pgcode 23505 pq: duplicate key value violates unique constraint "t_c_key" +UPDATE t SET c = 4 WHERE pk = 2 + query T SELECT message FROM [SHOW TRACE FOR SESSION] WHERE message LIKE 'CPut%' ---- @@ -183,3 +192,22 @@ CPut /Table/110/2/" "/4/0 -> nil (tombstone) CPut /Table/110/2/"@"/4/0 -> nil (tombstone) CPut /Table/110/2/"\xa0"/4/0 -> nil (tombstone) CPut /Table/110/2/"\xc0"/4/0 -> nil (tombstone) +CPut /Table/110/1/"\xa0"/2/0 -> /TUPLE/3:3:Int/3/1:4:Int/6/1:5:Int/5 +CPut /Table/110/1/" "/2/0 -> nil (tombstone) +CPut /Table/110/1/"@"/2/0 -> nil (tombstone) +CPut /Table/110/1/"\x80"/2/0 -> nil (tombstone) +CPut /Table/110/1/"\xc0"/2/0 -> nil (tombstone) +CPut /Table/110/2/" "/6/0 -> nil (tombstone) +CPut /Table/110/2/"@"/6/0 -> nil (tombstone) +CPut /Table/110/2/"\x80"/6/0 -> nil (tombstone) +CPut /Table/110/2/"\xc0"/6/0 -> nil (tombstone) +CPut /Table/110/1/"\xa0"/1/0 -> /TUPLE/3:3:Int/3/1:4:Int/6/1:5:Int/5 +CPut /Table/110/1/" "/1/0 -> nil (tombstone) +CPut /Table/110/1/"@"/1/0 -> nil (tombstone) +CPut /Table/110/1/"\x80"/1/0 -> nil (tombstone) +CPut /Table/110/1/"\xc0"/1/0 -> nil (tombstone) +CPut /Table/110/2/"\xa0"/4/0 -> /BYTES/0x8a (expecting does not exist) +CPut /Table/110/2/" "/4/0 -> nil (tombstone) +CPut /Table/110/2/"@"/4/0 -> nil (tombstone) +CPut /Table/110/2/"\x80"/4/0 -> nil (tombstone) +CPut /Table/110/2/"\xc0"/4/0 -> nil (tombstone) diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_read_committed b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_read_committed index b70febf8fa06..eac30ae7bf76 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_read_committed +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_read_committed @@ -78,7 +78,7 @@ CREATE TABLE river ( LOCALITY REGIONAL BY ROW AS region statement ok -GRANT INSERT ON TABLE university TO testuser +GRANT INSERT, UPDATE, SELECT ON TABLE university TO testuser # Test non-conflicting INSERT. @@ -117,10 +117,15 @@ INSERT INTO university (name, mascot, postal_code) VALUES ('Thompson Rivers', 'wolves', 'V2C 0C8'), ('Evergreen State', 'geoducks', '98505') ON CONFLICT (mascot) DO NOTHING +# TODO(mw5h): Temporary until ON CONFLICT works +statement ok +INSERT INTO university (name, mascot, postal_code) VALUES ('Evergreen State', 'geoducks', '98505') + query TTT SELECT name, mascot, postal_code FROM university ORDER BY name ---- -Western Oregon wolves 97361 +Evergreen State geoducks 98505 +Western Oregon wolves 97361 statement error pgcode 0A000 explicit unique checks are not yet supported under read committed isolation INSERT INTO volcano VALUES @@ -170,10 +175,10 @@ UPSERT INTO river VALUES ('us-east-1', 'Fraser', 'Salish Sea') # Test conflicting UPDATE. -statement error pgcode 0A000 explicit unique checks are not yet supported under read committed isolation +statement error pgcode 23505 pq: duplicate key value violates unique constraint "university_mascot_key" UPDATE university SET mascot = 'wolves' WHERE name = 'Evergreen State' -statement error pgcode 0A000 explicit unique checks are not yet supported under read committed isolation +statement ok UPDATE volcano SET origin = 'Fought over Loowit and was transformed by Saghalie.' WHERE name = 'Mount St. Helens' statement error pgcode 23505 pq: duplicate key value violates unique constraint "city_pkey"\nDETAIL: Key \(name, state_or_province\)=\('Vancouver', 'BC'\) already exists\. @@ -232,5 +237,41 @@ awaitstatement conflict query TTT SELECT name, mascot, postal_code FROM university ORDER BY name ---- -CMU Scottie Dog 15213 -Western Oregon wolves 97361 +CMU Scottie Dog 15213 +Evergreen State geoducks 98505 +Western Oregon wolves 97361 + +statement ok +INSERT INTO university VALUES ('Central Michigan University', 'Chippewas', '97858'); + +statement ok +UPDATE university SET name = 'Carnegie Mellon University' WHERE name = 'CMU'; + +statement ok +BEGIN + +statement ok +UPDATE university SET name = 'CMU' WHERE name = 'Carnegie Mellon University'; + +user testuser + +statement async conflict error pgcode 23505 pq: duplicate key value violates unique constraint "university_pkey" +UPDATE university SET name = 'CMU' WHERE name = 'Central Michigan University' + +user root + +statement ok +COMMIT + +awaitstatement conflict + +statement error pgcode 23505 pq: duplicate key value violates unique constraint "university_mascot_key" +UPDATE university SET mascot = 'wolves' WHERE name = 'CMU' + +query TTT +SELECT name, mascot, postal_code FROM university ORDER BY name +---- +CMU Scottie Dog 15213 +Central Michigan University Chippewas 97858 +Evergreen State geoducks 98505 +Western Oregon wolves 97361 diff --git a/pkg/sql/backfill/backfill.go b/pkg/sql/backfill/backfill.go index 97ce8c228b05..e9ac63607c47 100644 --- a/pkg/sql/backfill/backfill.go +++ b/pkg/sql/backfill/backfill.go @@ -297,6 +297,7 @@ func (cb *ColumnBackfiller) RunColumnBackfillChunk( txn, cb.evalCtx.Codec, tableDesc, + nil, /* uniqueWithTombstoneIndexes */ cb.updateCols, requestedCols, row.UpdaterOnlyColumns, diff --git a/pkg/sql/distsql_spec_exec_factory.go b/pkg/sql/distsql_spec_exec_factory.go index 4a69d09dcafc..4cd18e6e8369 100644 --- a/pkg/sql/distsql_spec_exec_factory.go +++ b/pkg/sql/distsql_spec_exec_factory.go @@ -997,6 +997,7 @@ func (e *distSQLSpecExecFactory) ConstructUpdate( returnCols exec.TableColumnOrdinalSet, checks exec.CheckOrdinalSet, passthrough colinfo.ResultColumns, + uniqueWithTombstoneIndexes cat.IndexOrdinals, autoCommit bool, ) (exec.Node, error) { return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning: update") diff --git a/pkg/sql/opt/exec/execbuilder/mutation.go b/pkg/sql/opt/exec/execbuilder/mutation.go index 77ce3e4ba98d..b46bb271f41e 100644 --- a/pkg/sql/opt/exec/execbuilder/mutation.go +++ b/pkg/sql/opt/exec/execbuilder/mutation.go @@ -441,6 +441,7 @@ func (b *Builder) buildUpdate(upd *memo.UpdateExpr) (_ execPlan, outputCols colO returnColOrds, checkOrds, passthroughCols, + upd.UniqueWithTombstoneIndexes, b.allowAutoCommit && len(upd.UniqueChecks) == 0 && len(upd.FKChecks) == 0 && len(upd.FKCascades) == 0, ) diff --git a/pkg/sql/opt/exec/explain/emit.go b/pkg/sql/opt/exec/explain/emit.go index b9593be68d7c..6763ff4f0332 100644 --- a/pkg/sql/opt/exec/explain/emit.go +++ b/pkg/sql/opt/exec/explain/emit.go @@ -961,6 +961,9 @@ func (e *emitter) emitNodeAttributes(n *Node) error { case updateOp: a := n.args.(*updateArgs) ob.Attrf("table", "%s", a.Table.Name()) + if uniqWithTombstoneIndexes := joinIndexNames(a.Table, a.UniqueWithTombstonesIndexes, ", "); uniqWithTombstoneIndexes != "" { + ob.Attr("uniqueness checks (tombstones)", uniqWithTombstoneIndexes) + } ob.Attr("set", printColumns(tableColumns(a.Table, a.UpdateCols))) if a.AutoCommit { ob.Attr("auto commit", "") diff --git a/pkg/sql/opt/exec/factory.opt b/pkg/sql/opt/exec/factory.opt index d92d6a2af7a5..5c1210a07cd7 100644 --- a/pkg/sql/opt/exec/factory.opt +++ b/pkg/sql/opt/exec/factory.opt @@ -520,6 +520,7 @@ define Update { ReturnCols exec.TableColumnOrdinalSet Checks exec.CheckOrdinalSet Passthrough colinfo.ResultColumns + UniqueWithTombstonesIndexes cat.IndexOrdinals # If set, the operator will commit the transaction as part of its execution. AutoCommit bool diff --git a/pkg/sql/opt/optbuilder/mutation_builder_unique.go b/pkg/sql/opt/optbuilder/mutation_builder_unique.go index 9003975d432c..f7fde1d64df4 100644 --- a/pkg/sql/opt/optbuilder/mutation_builder_unique.go +++ b/pkg/sql/opt/optbuilder/mutation_builder_unique.go @@ -102,6 +102,12 @@ func (mb *mutationBuilder) buildUniqueChecksForUpdate() { if !mb.uniqueColsUpdated(i) { continue } + // For non-serializable transactions, we guarantee uniqueness by writing tombstones in all + // partitions of a unique index with implicit partitioning columns. + if mb.b.evalCtx.TxnIsoLevel != isolation.Serializable && mb.tab.Unique(i).CanUseTombstones() { + mb.uniqueWithTombstoneIndexes.Add(i) + continue + } if h.init(mb, i) { // The insertion check works for updates too since it simply checks that // the unique columns in the newly inserted or updated rows do not match diff --git a/pkg/sql/opt_exec_factory.go b/pkg/sql/opt_exec_factory.go index 993e84249ff3..9ab2e30c0bde 100644 --- a/pkg/sql/opt_exec_factory.go +++ b/pkg/sql/opt_exec_factory.go @@ -1540,6 +1540,7 @@ func (ef *execFactory) ConstructUpdate( returnColOrdSet exec.TableColumnOrdinalSet, checks exec.CheckOrdinalSet, passthrough colinfo.ResultColumns, + uniqueWithTombstoneIndexes cat.IndexOrdinals, autoCommit bool, ) (exec.Node, error) { // TODO(radu): the execution code has an annoying limitation that the fetch @@ -1567,6 +1568,7 @@ func (ef *execFactory) ConstructUpdate( ef.planner.txn, ef.planner.ExecCfg().Codec, tabDesc, + ordinalsToIndexes(table, uniqueWithTombstoneIndexes), updateCols, fetchCols, row.UpdaterDefault, @@ -1671,6 +1673,7 @@ func (ef *execFactory) ConstructUpsert( ef.planner.txn, ef.planner.ExecCfg().Codec, tabDesc, + nil, /* uniqueWithTombstoneIndexes */ updateCols, fetchCols, row.UpdaterDefault, diff --git a/pkg/sql/row/updater.go b/pkg/sql/row/updater.go index 80f28e17f83e..55cb1e782c0b 100644 --- a/pkg/sql/row/updater.go +++ b/pkg/sql/row/updater.go @@ -19,6 +19,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/rowenc" "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" + "github.com/cockroachdb/cockroach/pkg/util/intsets" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/unique" "github.com/cockroachdb/errors" @@ -75,6 +76,7 @@ func MakeUpdater( txn *kv.Txn, codec keys.SQLCodec, tableDesc catalog.TableDescriptor, + uniqueWithTombstoneIndexes []catalog.Index, updateCols []catalog.Column, requestedCols []catalog.Column, updateType rowUpdaterType, @@ -161,7 +163,7 @@ func MakeUpdater( } ru := Updater{ - Helper: NewRowHelper(codec, tableDesc, includeIndexes, nil /* uniqueWithTombstoneIndexes */, sv, internal, metrics), + Helper: NewRowHelper(codec, tableDesc, includeIndexes, uniqueWithTombstoneIndexes, sv, internal, metrics), DeleteHelper: deleteOnlyHelper, FetchCols: requestedCols, FetchColIDtoRowIndex: ColIDtoRowIndexFromCols(requestedCols), @@ -177,7 +179,7 @@ func MakeUpdater( var err error ru.rd = MakeDeleter(codec, tableDesc, requestedCols, sv, internal, metrics) if ru.ri, err = MakeInserter( - ctx, txn, codec, tableDesc, nil /* uniqueWithTombstoneIndexes */, requestedCols, alloc, sv, internal, metrics, + ctx, txn, codec, tableDesc, uniqueWithTombstoneIndexes, requestedCols, alloc, sv, internal, metrics, ); err != nil { return Updater{}, err } @@ -375,6 +377,7 @@ func (ru *Updater) UpdateRow( // Update secondary indexes. // We're iterating through all of the indexes, which should have corresponding entries // in the new and old values. + var writtenIndexes intsets.Fast for i, index := range ru.Helper.Indexes { if index.GetType() == descpb.IndexDescriptor_FORWARD { oldIdx, newIdx := 0, 0 @@ -433,6 +436,7 @@ func (ru *Updater) UpdateRow( } batch.CPutAllowingIfNotExists(newEntry.Key, &newEntry.Value, expValue) } + writtenIndexes.Add(i) } else if oldEntry.Family < newEntry.Family { if oldEntry.Family == descpb.FamilyID(0) { return nil, errors.AssertionFailedf( @@ -468,6 +472,7 @@ func (ru *Updater) UpdateRow( } batch.CPut(newEntry.Key, &newEntry.Value, nil) } + writtenIndexes.Add(i) newIdx++ } } @@ -501,6 +506,7 @@ func (ru *Updater) UpdateRow( } batch.CPut(newEntry.Key, &newEntry.Value, nil) } + writtenIndexes.Add(i) newIdx++ } } else { @@ -522,10 +528,18 @@ func (ru *Updater) UpdateRow( } } + writtenIndexes.ForEach(func(idx int) { + if err == nil { + err = writeTombstones(ctx, &ru.Helper, ru.Helper.Indexes[idx], putter, ru.FetchColIDtoRowIndex, ru.newValues, traceKV) + } + }) + if err != nil { + return nil, err + } + // We're deleting indexes in a delete only state. We're bounding this by the number of indexes because inverted // indexed will be handled separately. if ru.DeleteHelper != nil { - // For determinism, add the entries for the secondary indexes in the same // order as they appear in the helper. for idx := range ru.DeleteHelper.Indexes {
9fc449fb290d1a33b925a1782a9667df331f6899
2020-01-08 13:20:10
Radu Berinde
opt: move unexported Private fields
false
move unexported Private fields
opt
diff --git a/pkg/sql/opt/memo/expr.go b/pkg/sql/opt/memo/expr.go index 1be66bd60f32..369e1a1876e0 100644 --- a/pkg/sql/opt/memo/expr.go +++ b/pkg/sql/opt/memo/expr.go @@ -434,6 +434,15 @@ func (jf JoinFlags) String() string { return b.String() } +func (lj *LookupJoinExpr) initUnexportedFields(mem *Memo) { + // lookupProps are initialized as necessary by the logical props builder. +} + +func (zj *ZigzagJoinExpr) initUnexportedFields(mem *Memo) { + // leftProps and rightProps are initialized as necessary by the logical props + // builder. +} + // WindowFrame denotes the definition of a window frame for an individual // window function, excluding the OFFSET expressions, if present. type WindowFrame struct { diff --git a/pkg/sql/opt/ops/relational.opt b/pkg/sql/opt/ops/relational.opt index aa703f835da1..2d789b107ba2 100644 --- a/pkg/sql/opt/ops/relational.opt +++ b/pkg/sql/opt/ops/relational.opt @@ -271,6 +271,11 @@ define LookupJoin { On FiltersExpr _ LookupJoinPrivate + + # lookupProps caches relational properties for the "table" side of the lookup + # join, treating it as if it were another relational input. This makes the + # lookup join appear more like other join operators. + lookupProps RelProps } [Private] @@ -307,11 +312,6 @@ define LookupJoinPrivate { # table (and thus each left row matches with at most one table row). LookupColsAreTableKey bool - # lookupProps caches relational properties for the "table" side of the lookup - # join, treating it as if it were another relational input. This makes the - # lookup join appear more like other join operators. - lookupProps RelProps - # ConstFilters contains the constant filters that are represented as equality # conditions on the KeyCols. These filters are needed by the statistics code to # correctly estimate selectivity. @@ -371,6 +371,13 @@ define ZigzagJoin { On FiltersExpr _ ZigzagJoinPrivate + + # leftProps and rightProps cache relational properties corresponding to an + # unconstrained scan on the respective indexes. By putting this in the + # expr, zigzag joins can reuse a lot of the logical property building code + # for joins. + leftProps RelProps + rightProps RelProps } [Private] @@ -408,13 +415,6 @@ define ZigzagJoinPrivate { # Cols is the set of columns produced by the zigzag join. This set can # contain columns from either side's index. Cols ColSet - - # leftProps and rightProps cache relational properties corresponding to an - # unconstrained scan on the respective indexes. By putting this in the - # expr, zigzag joins can reuse a lot of the logical property building code - # for joins. - leftProps RelProps - rightProps RelProps } # InnerJoinApply has the same join semantics as InnerJoin. However, unlike
39bbee13ac0ab2021cb7c1d1d724d67fc3c67905
2018-07-27 04:08:49
Andrei Matei
kv: add a test for not getting duplicate heartbeat loops
false
add a test for not getting duplicate heartbeat loops
kv
diff --git a/pkg/kv/txn_coord_sender.go b/pkg/kv/txn_coord_sender.go index 74b05edaf8c7..4e281e62116e 100644 --- a/pkg/kv/txn_coord_sender.go +++ b/pkg/kv/txn_coord_sender.go @@ -38,7 +38,6 @@ import ( const ( opTxnCoordSender = "txn coordinator" - opHeartbeatLoop = "heartbeat txn" ) // txnCoordState represents the state of the transaction coordinator. @@ -761,8 +760,6 @@ func (tc *TxnCoordSender) finalTxnStatsLocked() (duration, restarts int64, statu // stopping in the event the transaction is aborted or committed after // attempting to resolve the intents. When the heartbeat stops, the transaction // stats are updated based on its final disposition. -// -// TODO(wiz): Update (*DBServer).Batch to not use context.TODO(). func (tc *TxnCoordSender) heartbeatLoop(ctx context.Context) { var tickChan <-chan time.Time { @@ -771,12 +768,6 @@ func (tc *TxnCoordSender) heartbeatLoop(ctx context.Context) { defer ticker.Stop() } - // TODO(tschottdorf): this should join to the trace of the request - // which starts this goroutine. - sp := tc.AmbientContext.Tracer.StartSpan(opHeartbeatLoop) - defer sp.Finish() - ctx = opentracing.ContextWithSpan(ctx, sp) - defer func() { tc.mu.Lock() if tc.mu.txnEnd != nil { @@ -948,10 +939,15 @@ func (tc *TxnCoordSender) startHeartbeatLoopLocked(ctx context.Context) error { tc.mu.txnEnd = make(chan struct{}) // Create a new context so that the heartbeat loop doesn't inherit the // caller's cancelation. + // We want the loop to run in a span linked to the current one, though, so we + // put our span in the new context and expect RunAsyncTask to fork it + // immediately. hbCtx := tc.AnnotateCtx(context.Background()) + hbCtx = opentracing.ContextWithSpan(hbCtx, opentracing.SpanFromContext(ctx)) + if err := tc.stopper.RunAsyncTask( - ctx, "kv.TxnCoordSender: heartbeat loop", func(ctx context.Context) { - tc.heartbeatLoop(hbCtx) + hbCtx, "kv.TxnCoordSender: heartbeat loop", func(ctx context.Context) { + tc.heartbeatLoop(ctx) }); err != nil { // The system is already draining and we can't start the // heartbeat. We refuse new transactions for now because diff --git a/pkg/kv/txn_coord_sender_server_test.go b/pkg/kv/txn_coord_sender_server_test.go index 92dfc08ad71f..d8cad8d30eb5 100644 --- a/pkg/kv/txn_coord_sender_server_test.go +++ b/pkg/kv/txn_coord_sender_server_test.go @@ -17,6 +17,7 @@ package kv_test import ( "context" "fmt" + "strings" "testing" "time" @@ -29,6 +30,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/tracing" + opentracing "github.com/opentracing/opentracing-go" ) // Test that a transaction gets cleaned up when the heartbeat loop finds out @@ -121,3 +123,61 @@ func TestHeartbeatFindsOutAboutAbortedTransaction(t *testing.T) { t.Fatalf("expected aborted error, got: %s", err) } } + +// Test that, when a transaction restarts, we don't get a second heartbeat loop +// for it. This bug happened in the past. +// +// The test traces the restarting transaction and looks in it to see how many +// times a heartbeat loop was started. +func TestNoDuplicateHeartbeatLoops(t *testing.T) { + defer leaktest.AfterTest(t)() + + s, _, db := serverutils.StartServer(t, base.TestServerArgs{}) + ctx := context.Background() + defer s.Stopper().Stop(ctx) + + key := roachpb.Key("a") + + tracer := tracing.NewTracer() + sp := tracer.StartSpan("test", tracing.Recordable) + tracing.StartRecording(sp, tracing.SingleNodeRecording) + txnCtx := opentracing.ContextWithSpan(context.Background(), sp) + + push := func(ctx context.Context, key roachpb.Key) error { + return db.Put(ctx, key, "push") + } + + var attempts int + err := db.Txn(txnCtx, func(ctx context.Context, txn *client.Txn) error { + attempts++ + if attempts == 1 { + if err := push(context.Background() /* keep the contexts separate */, key); err != nil { + return err + } + } + if _, err := txn.Get(ctx, key); err != nil { + return err + } + return txn.Put(ctx, key, "val") + }) + if err != nil { + t.Fatal(err) + } + if attempts != 2 { + t.Fatalf("expected 2 attempts, got: %d", attempts) + } + sp.Finish() + recording := tracing.GetRecording(sp) + var foundHeartbeatLoop bool + for _, sp := range recording { + if strings.Contains(sp.Operation, "heartbeat loop") { + if foundHeartbeatLoop { + t.Fatal("second heartbeat loop found") + } + foundHeartbeatLoop = true + } + } + if !foundHeartbeatLoop { + t.Fatal("no heartbeat loop found. Test rotted?") + } +}
2af5d199f4519ab3390793bd2ee977627ced5144
2016-06-16 18:34:00
Raphael 'kena' Poss
cli: use pretty-formatted tables only with terminals or --pretty.
false
use pretty-formatted tables only with terminals or --pretty.
cli
diff --git a/cli/cli.go b/cli/cli.go index fa03b6c3dc51..28d983b8f076 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -23,6 +23,7 @@ import ( "text/tabwriter" "github.com/cockroachdb/cockroach/build" + "github.com/mattn/go-isatty" "github.com/spf13/cobra" ) @@ -60,6 +61,11 @@ var cockroachCmd = &cobra.Command{ Long: `CockroachDB command-line interface and server.`, } +// isInteractive indicates whether both stdin and stdout refer to the +// terminal. +var isInteractive = isatty.IsTerminal(os.Stdout.Fd()) && + isatty.IsTerminal(os.Stdin.Fd()) + func init() { cockroachCmd.AddCommand( startCmd, diff --git a/cli/cli_test.go b/cli/cli_test.go index 11de2527870b..aa35c9243d79 100644 --- a/cli/cli_test.go +++ b/cli/cli_test.go @@ -58,6 +58,7 @@ func newCLITest() cliTest { // pointer (because they are tied into the flags), but instead // overwrite the existing struct's values. baseCtx.InitDefaults() + cliCtx.InitCLIDefaults() osStderr = os.Stdout @@ -728,23 +729,31 @@ func Example_user() { defer c.stop() c.Run("user ls") + c.Run("user ls --pretty") + c.Run("user ls --pretty=false") c.Run("user set foo --password=bar") // Don't use get, since the output of hashedPassword is random. // c.Run("user get foo") - c.Run("user ls") + c.Run("user ls --pretty") c.Run("user rm foo") - c.Run("user ls") + c.Run("user ls --pretty") // Output: // user ls + // 0 rows + // username + // user ls --pretty // +----------+ // | username | // +----------+ // +----------+ // (0 rows) + // user ls --pretty=false + // 0 rows + // username // user set foo --password=bar // INSERT 1 - // user ls + // user ls --pretty // +----------+ // | username | // +----------+ @@ -753,7 +762,7 @@ func Example_user() { // (1 row) // user rm foo // DELETE 1 - // user ls + // user ls --pretty // +----------+ // | username | // +----------+ @@ -850,10 +859,15 @@ func Example_node() { } c.Run("node ls") + c.Run("node ls --pretty") c.Run("node status 10000") // Output: // node ls + // 1 row + // id + // 1 + // node ls --pretty // +----+ // | id | // +----+ @@ -904,13 +918,13 @@ func TestNodeStatus(t *testing.T) { t.Fatalf("couldn't write stats summaries: %s", err) } - out, err := c.RunWithCapture("node status 1") + out, err := c.RunWithCapture("node status 1 --pretty") if err != nil { t.Fatal(err) } checkNodeStatus(t, c, out, start) - out, err = c.RunWithCapture("node status") + out, err = c.RunWithCapture("node status --pretty") if err != nil { t.Fatal(err) } diff --git a/cli/context.go b/cli/context.go index 0712a58894fa..78a172b6969d 100644 --- a/cli/context.go +++ b/cli/context.go @@ -39,18 +39,27 @@ func (s *statementsValue) Set(value string) error { return nil } -type sqlContext struct { +type cliContext struct { // Embed the base context. *base.Context - // execStmts is a list of statements to execute. - execStmts statementsValue - // prettyFmt indicates whether tables should be pretty-formatted in // the output during non-interactive execution. prettyFmt bool } +func (ctx *cliContext) InitCLIDefaults() { + ctx.prettyFmt = false +} + +type sqlContext struct { + // Embed the cli context. + *cliContext + + // execStmts is a list of statements to execute. + execStmts statementsValue +} + type debugContext struct { startKey, endKey string raw bool diff --git a/cli/flags.go b/cli/flags.go index 88428007d3de..1dc158ecf078 100644 --- a/cli/flags.go +++ b/cli/flags.go @@ -45,7 +45,8 @@ var undoFreezeCluster bool var serverCtx = server.MakeContext() var baseCtx = serverCtx.Context -var sqlCtx = sqlContext{Context: baseCtx} +var cliCtx = cliContext{Context: baseCtx} +var sqlCtx = sqlContext{cliContext: &cliCtx} var debugCtx debugContext var cacheSize *bytesValue @@ -440,12 +441,16 @@ func init() { f.StringVar(&baseCtx.SSLCA, cliflags.CACertName, envutil.EnvOrDefaultString(cliflags.CACertName, baseCtx.SSLCA), usageEnv(cliflags.CACertName)) f.StringVar(&baseCtx.SSLCert, cliflags.CertName, envutil.EnvOrDefaultString(cliflags.CertName, baseCtx.SSLCert), usageEnv(cliflags.CertName)) f.StringVar(&baseCtx.SSLCertKey, cliflags.KeyName, envutil.EnvOrDefaultString(cliflags.KeyName, baseCtx.SSLCertKey), usageEnv(cliflags.KeyName)) + + // By default, client commands print their output as + // pretty-formatted tables on terminals, and TSV when redirected + // to a file. The user can override with --pretty. + f.BoolVar(&cliCtx.prettyFmt, cliflags.PrettyName, isInteractive, usageNoEnv(cliflags.PrettyName)) } { f := sqlShellCmd.Flags() f.VarP(&sqlCtx.execStmts, cliflags.ExecuteName, "e", usageNoEnv(cliflags.ExecuteName)) - f.BoolVar(&sqlCtx.prettyFmt, cliflags.PrettyName, false, usageNoEnv(cliflags.PrettyName)) } { f := freezeClusterCmd.PersistentFlags() diff --git a/cli/node.go b/cli/node.go index cd9edc42b6e5..67a1389a58fa 100644 --- a/cli/node.go +++ b/cli/node.go @@ -72,7 +72,7 @@ func runLsNodes(cmd *cobra.Command, args []string) error { }) } - printQueryOutput(os.Stdout, lsNodesColumnHeaders, rows, "", true) + printQueryOutput(os.Stdout, lsNodesColumnHeaders, rows, "", cliCtx.prettyFmt) return nil } @@ -141,7 +141,7 @@ func runStatusNode(cmd *cobra.Command, args []string) error { return util.Errorf("expected no arguments or a single node ID") } - printQueryOutput(os.Stdout, nodesColumnHeaders, nodeStatusesToRows(nodeStatuses), "", true) + printQueryOutput(os.Stdout, nodesColumnHeaders, nodeStatusesToRows(nodeStatuses), "", cliCtx.prettyFmt) return nil } diff --git a/cli/sql.go b/cli/sql.go index 2a976cd25f03..61c899f573cf 100644 --- a/cli/sql.go +++ b/cli/sql.go @@ -30,7 +30,6 @@ import ( "github.com/chzyer/readline" "github.com/cockroachdb/cockroach/util/envutil" "github.com/cockroachdb/cockroach/util/log" - "github.com/mattn/go-isatty" "github.com/spf13/cobra" ) @@ -222,9 +221,6 @@ func preparePrompts(dbURL string) (fullPrompt string, continuePrompt string) { func runInteractive(conn *sqlConn) (exitErr error) { fullPrompt, continuePrompt := preparePrompts(conn.url) - isInteractive := isatty.IsTerminal(os.Stdout.Fd()) && - isatty.IsTerminal(os.Stdin.Fd()) - if isInteractive { // We only enable history management when the terminal is actually // interactive. This saves on memory when e.g. piping a large SQL @@ -297,7 +293,7 @@ func runInteractive(conn *sqlConn) (exitErr error) { addHistory(strings.Join(stmt, " ")) } - if exitErr = runQueryAndFormatResults(conn, os.Stdout, makeQuery(fullStmt), true); exitErr != nil { + if exitErr = runQueryAndFormatResults(conn, os.Stdout, makeQuery(fullStmt), cliCtx.prettyFmt); exitErr != nil { fmt.Fprintln(osStderr, exitErr) } @@ -333,7 +329,7 @@ func runTerm(cmd *cobra.Command, args []string) error { if len(sqlCtx.execStmts) > 0 { // Single-line sql; run as simple as possible, without noise on stdout. - return runStatements(conn, sqlCtx.execStmts, sqlCtx.prettyFmt) + return runStatements(conn, sqlCtx.execStmts, cliCtx.prettyFmt) } return runInteractive(conn) } diff --git a/cli/user.go b/cli/user.go index bba967f53d80..85f3e63557dc 100644 --- a/cli/user.go +++ b/cli/user.go @@ -49,7 +49,7 @@ func runGetUser(cmd *cobra.Command, args []string) { } defer conn.Close() err = runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`SELECT * FROM system.users WHERE username=$1`, args[0]), true) + makeQuery(`SELECT * FROM system.users WHERE username=$1`, args[0]), cliCtx.prettyFmt) if err != nil { panic(err) } @@ -77,7 +77,7 @@ func runLsUsers(cmd *cobra.Command, args []string) { } defer conn.Close() err = runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`SELECT username FROM system.users`), true) + makeQuery(`SELECT username FROM system.users`), cliCtx.prettyFmt) if err != nil { panic(err) } @@ -105,7 +105,7 @@ func runRmUser(cmd *cobra.Command, args []string) { } defer conn.Close() err = runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`DELETE FROM system.users WHERE username=$1`, args[0]), true) + makeQuery(`DELETE FROM system.users WHERE username=$1`, args[0]), cliCtx.prettyFmt) if err != nil { panic(err) } @@ -177,7 +177,7 @@ func runSetUser(cmd *cobra.Command, args []string) { defer conn.Close() // TODO(marc): switch to UPSERT. err = runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`INSERT INTO system.users VALUES ($1, $2)`, args[0], hashed), true) + makeQuery(`INSERT INTO system.users VALUES ($1, $2)`, args[0], hashed), cliCtx.prettyFmt) if err != nil { panic(err) } diff --git a/cli/zone.go b/cli/zone.go index c15fd0203184..768b2fe0f37f 100644 --- a/cli/zone.go +++ b/cli/zone.go @@ -388,7 +388,7 @@ func runRmZone(cmd *cobra.Command, args []string) error { } if err := runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`DELETE FROM system.zones WHERE id=$1`, id), true); err != nil { + makeQuery(`DELETE FROM system.zones WHERE id=$1`, id), cliCtx.prettyFmt); err != nil { return err } return conn.Exec(`COMMIT`, nil) @@ -486,10 +486,10 @@ func runSetZone(cmd *cobra.Command, args []string) error { id := path[len(path)-1] if id == zoneID { err = runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`UPDATE system.zones SET config = $2 WHERE id = $1`, id, buf), true) + makeQuery(`UPDATE system.zones SET config = $2 WHERE id = $1`, id, buf), cliCtx.prettyFmt) } else { err = runQueryAndFormatResults(conn, os.Stdout, - makeQuery(`INSERT INTO system.zones VALUES ($1, $2)`, id, buf), true) + makeQuery(`INSERT INTO system.zones VALUES ($1, $2)`, id, buf), cliCtx.prettyFmt) } if err != nil { return err
ee23325c42c4464aa24e863d9cadf1a2e244a842
2021-04-30 01:29:51
Nathan VanBenschoten
roachpb: remove EndTxn's DeprecatedCanCommitAtHigherTimestamp field
false
remove EndTxn's DeprecatedCanCommitAtHigherTimestamp field
roachpb
diff --git a/pkg/kv/kvclient/kvcoord/dist_sender.go b/pkg/kv/kvclient/kvcoord/dist_sender.go index 66907a41fd2c..47d122bedcb0 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender.go @@ -659,17 +659,6 @@ func splitBatchAndCheckForRefreshSpans( }() if hasRefreshSpans { ba.CanForwardReadTimestamp = false - - // If the final part contains an EndTxn request, unset its - // DeprecatedCanCommitAtHigherTimestamp flag as well. - lastPart := parts[len(parts)-1] - if et := lastPart[len(lastPart)-1].GetEndTxn(); et != nil { - etCopy := *et - etCopy.DeprecatedCanCommitAtHigherTimestamp = false - lastPart = append([]roachpb.RequestUnion(nil), lastPart...) - lastPart[len(lastPart)-1].MustSetInner(&etCopy) - parts[len(parts)-1] = lastPart - } } } return parts @@ -692,19 +681,6 @@ func unsetCanForwardReadTimestampFlag(ctx context.Context, ba *roachpb.BatchRequ if roachpb.NeedsRefresh(req.GetInner()) { // Unset the flag. ba.CanForwardReadTimestamp = false - - // We would need to also unset the DeprecatedCanCommitAtHigherTimestamp - // flag on any EndTxn request in the batch, but it turns out that - // because we call this function when a batch is split across - // ranges, we'd already have bailed if the EndTxn wasn't a parallel - // commit — and if it was a parallel commit then we must not have - // any requests that need to refresh (see - // txnCommitter.canCommitInParallel). Assert this for our own - // sanity. - if _, ok := ba.GetArg(roachpb.EndTxn); ok { - log.Fatalf(ctx, "batch unexpected contained requests "+ - "that need to refresh and an EndTxn request: %s", ba.String()) - } return } } diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_committer.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_committer.go index 44c69b79e1a7..dbfc469b2ee1 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_committer.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_committer.go @@ -473,7 +473,6 @@ func makeTxnCommitExplicitLocked( et := roachpb.EndTxnRequest{Commit: true} et.Key = txn.Key et.LockSpans = lockSpans - et.DeprecatedCanCommitAtHigherTimestamp = canFwdRTS ba.Add(&et) _, pErr := s.SendLocked(ctx, ba) diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_committer_test.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_committer_test.go index ac77ff0d3407..5938c35db665 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_committer_test.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_committer_test.go @@ -354,11 +354,9 @@ func TestTxnCommitterAsyncExplicitCommitTask(t *testing.T) { etArgs.InFlightWrites = []roachpb.SequencedWrite{{Key: keyA, Sequence: 1}} ba.Add(&putArgs, &etArgs) - // Set the CanForwardReadTimestamp and DeprecatedCanCommitAtHigherTimestamp - // flags so we can make sure that these are propagated to the async explicit - // commit task. + // Set the CanForwardReadTimestamp flag so we can make sure that these are + // propagated to the async explicit commit task. ba.Header.CanForwardReadTimestamp = true - etArgs.DeprecatedCanCommitAtHigherTimestamp = true explicitCommitCh := make(chan struct{}) mockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) { @@ -369,7 +367,6 @@ func TestTxnCommitterAsyncExplicitCommitTask(t *testing.T) { et := ba.Requests[1].GetInner().(*roachpb.EndTxnRequest) require.True(t, et.Commit) - require.True(t, et.DeprecatedCanCommitAtHigherTimestamp) require.Len(t, et.InFlightWrites, 1) require.Equal(t, roachpb.SequencedWrite{Key: keyA, Sequence: 1}, et.InFlightWrites[0]) @@ -388,7 +385,6 @@ func TestTxnCommitterAsyncExplicitCommitTask(t *testing.T) { et := ba.Requests[0].GetInner().(*roachpb.EndTxnRequest) require.True(t, et.Commit) - require.True(t, et.DeprecatedCanCommitAtHigherTimestamp) require.Len(t, et.InFlightWrites, 0) br = ba.CreateReply() diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner_test.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner_test.go index 4a59effca871..f0fbec9255bf 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner_test.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner_test.go @@ -55,11 +55,6 @@ func (m *mockLockedSender) MockSend( m.mockFn = fn } -// Reset resets the mockLockedSender mocking function to a no-op. -func (m *mockLockedSender) Reset() { - m.mockFn = nil -} - // ChainMockSend sets a series of mocking functions on the mockLockedSender. // The provided mocking functions are set in the order that they are provided // and a given mocking function is set after the previous one has been called. diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go index 07a067fa16d6..7755422b1e01 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher.go @@ -164,33 +164,6 @@ func (sr *txnSpanRefresher) SendLocked( // Set the batch's CanForwardReadTimestamp flag. ba.CanForwardReadTimestamp = sr.canForwardReadTimestampWithoutRefresh(ba.Txn) - if rArgs, hasET := ba.GetArg(roachpb.EndTxn); hasET { - et := rArgs.(*roachpb.EndTxnRequest) - // Assign the EndTxn's DeprecatedCanCommitAtHigherTimestamp flag if it - // isn't already set correctly. We don't write blindly because we could - // be dealing with a re-issued batch from splitEndTxnAndRetrySend after - // a refresh and we don't want to mutate previously issued requests or - // we risk a data race (checked by raceTransport). In these cases, we - // need to clone the EndTxn request first before mutating. - // - // We know this is a re-issued batch if the flag is already set and we - // need to unset it. We aren't able to detect the case where the flag is - // not set and we now need to set it to true, but such cases don't - // happen in practice (i.e. we'll never begin setting the flag after a - // refresh). - // - // TODO(nvanbenschoten): this is ugly. If we weren't about to delete - // this field, we'd want to do something better. Just delete this ASAP. - if et.DeprecatedCanCommitAtHigherTimestamp != ba.CanForwardReadTimestamp { - isReissue := et.DeprecatedCanCommitAtHigherTimestamp - if isReissue { - etCpy := *et - ba.Requests[len(ba.Requests)-1].MustSetInner(&etCpy) - et = &etCpy - } - et.DeprecatedCanCommitAtHigherTimestamp = ba.CanForwardReadTimestamp - } - } // Attempt a refresh before sending the batch. ba, pErr := sr.maybeRefreshPreemptivelyLocked(ctx, ba, false) diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher_test.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher_test.go index 055980762148..905ac3c73523 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher_test.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_span_refresher_test.go @@ -1069,151 +1069,6 @@ func TestTxnSpanRefresherAssignsCanForwardReadTimestamp(t *testing.T) { require.False(t, tsr.refreshInvalid) } -// TestTxnSpanRefresherAssignsCanCommitAtHigherTimestamp tests that the -// txnSpanRefresher assigns the CanCommitAtHigherTimestamp flag on EndTxn -// requests, along with the CanForwardReadTimestamp on Batch headers. -func TestTxnSpanRefresherAssignsCanCommitAtHigherTimestamp(t *testing.T) { - defer leaktest.AfterTest(t)() - defer log.Scope(t).Close(t) - ctx := context.Background() - tsr, mockSender := makeMockTxnSpanRefresher() - - txn := makeTxnProto() - keyA, keyB := roachpb.Key("a"), roachpb.Key("b") - keyC, keyD := roachpb.Key("c"), roachpb.Key("d") - - // Send an EndTxn request. Should set DeprecatedCanCommitAtHigherTimestamp - // and CanForwardReadTimestamp flags. - var ba roachpb.BatchRequest - ba.Header = roachpb.Header{Txn: &txn} - ba.Add(&roachpb.EndTxnRequest{}) - - mockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) { - require.Len(t, ba.Requests, 1) - require.True(t, ba.CanForwardReadTimestamp) - require.IsType(t, &roachpb.EndTxnRequest{}, ba.Requests[0].GetInner()) - require.True(t, ba.Requests[0].GetEndTxn().DeprecatedCanCommitAtHigherTimestamp) - - br := ba.CreateReply() - br.Txn = ba.Txn - return br, nil - }) - - br, pErr := tsr.SendLocked(ctx, ba) - require.Nil(t, pErr) - require.NotNil(t, br) - - // Send an EndTxn request for a transaction with a fixed commit timestamp. - // Should NOT set DeprecatedCanCommitAtHigherTimestamp and - // CanForwardReadTimestamp flags. - txnFixed := txn.Clone() - txnFixed.CommitTimestampFixed = true - var baFixed roachpb.BatchRequest - baFixed.Header = roachpb.Header{Txn: txnFixed} - baFixed.Add(&roachpb.EndTxnRequest{}) - - mockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) { - require.Len(t, ba.Requests, 1) - require.False(t, ba.CanForwardReadTimestamp) - require.IsType(t, &roachpb.EndTxnRequest{}, ba.Requests[0].GetInner()) - require.False(t, ba.Requests[0].GetEndTxn().DeprecatedCanCommitAtHigherTimestamp) - - br = ba.CreateReply() - br.Txn = ba.Txn - return br, nil - }) - - br, pErr = tsr.SendLocked(ctx, baFixed) - require.Nil(t, pErr) - require.NotNil(t, br) - - // Send a batch below the limit to collect refresh spans. - ba.Requests = nil - scanArgs := roachpb.ScanRequest{RequestHeader: roachpb.RequestHeader{Key: keyA, EndKey: keyB}} - ba.Add(&scanArgs) - - mockSender.Reset() - br, pErr = tsr.SendLocked(ctx, ba) - require.Nil(t, pErr) - require.NotNil(t, br) - require.Equal(t, []roachpb.Span{scanArgs.Span()}, tsr.refreshFootprint.asSlice()) - require.False(t, tsr.refreshInvalid) - - // Send another EndTxn request. Should NOT set - // DeprecatedCanCommitAtHigherTimestamp and CanForwardReadTimestamp flags. - ba.Requests = nil - ba.Add(&roachpb.EndTxnRequest{}) - - mockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) { - require.Len(t, ba.Requests, 1) - require.False(t, ba.CanForwardReadTimestamp) - require.IsType(t, &roachpb.EndTxnRequest{}, ba.Requests[0].GetInner()) - require.False(t, ba.Requests[0].GetEndTxn().DeprecatedCanCommitAtHigherTimestamp) - - br = ba.CreateReply() - br.Txn = ba.Txn - return br, nil - }) - - br, pErr = tsr.SendLocked(ctx, ba) - require.Nil(t, pErr) - require.NotNil(t, br) - - // Send another batch. - ba.Requests = nil - scanArgs2 := roachpb.ScanRequest{RequestHeader: roachpb.RequestHeader{Key: keyC, EndKey: keyD}} - ba.Add(&scanArgs2) - - mockSender.Reset() - br, pErr = tsr.SendLocked(ctx, ba) - require.Nil(t, pErr) - require.NotNil(t, br) - - // Send another EndTxn request. Still should NOT set - // DeprecatedCanCommitAtHigherTimestamp and CanForwardReadTimestamp flags. - ba.Requests = nil - ba.Add(&roachpb.EndTxnRequest{}) - - mockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) { - require.Len(t, ba.Requests, 1) - require.False(t, ba.CanForwardReadTimestamp) - require.IsType(t, &roachpb.EndTxnRequest{}, ba.Requests[0].GetInner()) - require.False(t, ba.Requests[0].GetEndTxn().DeprecatedCanCommitAtHigherTimestamp) - - br = ba.CreateReply() - br.Txn = ba.Txn - return br, nil - }) - - br, pErr = tsr.SendLocked(ctx, ba) - require.Nil(t, pErr) - require.NotNil(t, br) - - // Increment the transaction's epoch and send another EndTxn request. Should - // set DeprecatedCanCommitAtHigherTimestamp and CanForwardReadTimestamp - // flags. - ba.Requests = nil - ba.Add(&roachpb.EndTxnRequest{}) - - mockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) { - require.Len(t, ba.Requests, 1) - require.True(t, ba.CanForwardReadTimestamp) - require.IsType(t, &roachpb.EndTxnRequest{}, ba.Requests[0].GetInner()) - require.True(t, ba.Requests[0].GetEndTxn().DeprecatedCanCommitAtHigherTimestamp) - - br = ba.CreateReply() - br.Txn = ba.Txn - return br, nil - }) - - tsr.epochBumpedLocked() - br, pErr = tsr.SendLocked(ctx, ba) - require.Nil(t, pErr) - require.NotNil(t, br) - require.Equal(t, []roachpb.Span(nil), tsr.refreshFootprint.asSlice()) - require.False(t, tsr.refreshInvalid) -} - // TestTxnSpanRefresherEpochIncrement tests that a txnSpanRefresher's refresh // spans and span validity status are reset on an epoch increment. func TestTxnSpanRefresherEpochIncrement(t *testing.T) { diff --git a/pkg/roachpb/api.pb.go b/pkg/roachpb/api.pb.go index dd53912e9812..b96051d8a216 100644 --- a/pkg/roachpb/api.pb.go +++ b/pkg/roachpb/api.pb.go @@ -1691,15 +1691,6 @@ type EndTxnRequest struct { // reliably for these transactions - a TransactionStatusError might be // returned instead if 1PC execution fails. Require1PC bool `protobuf:"varint,6,opt,name=require_1pc,json=require1pc,proto3" json:"require_1pc,omitempty"` - // DeprecatedCanCommitAtHigherTimestamp indicates that the batch this EndTxn - // is part of can be evaluated at a higher timestamp than the transaction's - // read timestamp. This is set by the client if the transaction has not - // performed any reads that must be refreshed prior to sending this current - // batch. When set, it allows the server to handle pushes and write too old - // conditions locally. - // TODO(nvanbenschoten): remove this in favor of can_forward_read_timestamp - // in v21.1. The flag is not read in v20.2. - DeprecatedCanCommitAtHigherTimestamp bool `protobuf:"varint,8,opt,name=deprecated_can_commit_at_higher_timestamp,json=deprecatedCanCommitAtHigherTimestamp,proto3" json:"deprecated_can_commit_at_higher_timestamp,omitempty"` // True to indicate that lock spans should be resolved with poison=true. // This is used when the transaction is being aborted independently of the // main thread of client operation, as in the case of an asynchronous abort @@ -6456,10 +6447,6 @@ type Header struct { // has not performed any reads that must be refreshed prior to sending this // current batch. When set, it allows the server to handle pushes and write // too old conditions locally. - // - // NOTE: this flag is a generalization of EndTxn.CanCommitAtHigherTimestamp. - // That flag should be deprecated in favor of this one. - // TODO(nvanbenschoten): perform this migration. CanForwardReadTimestamp bool `protobuf:"varint,16,opt,name=can_forward_read_timestamp,json=canForwardReadTimestamp,proto3" json:"can_forward_read_timestamp,omitempty"` } @@ -7329,530 +7316,528 @@ func init() { func init() { proto.RegisterFile("roachpb/api.proto", fileDescriptor_e08772acc330f58b) } var fileDescriptor_e08772acc330f58b = []byte{ - // 8363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7d, 0x5d, 0x6c, 0x23, 0xc9, - 0x76, 0x9e, 0x9a, 0xa4, 0x24, 0xf2, 0x50, 0xa2, 0x5a, 0xa5, 0xf9, 0xe1, 0x70, 0x77, 0x47, 0x33, - 0x3d, 0xff, 0x73, 0x77, 0xa9, 0x9d, 0x99, 0xbb, 0xd9, 0xf5, 0xce, 0x7a, 0xaf, 0x25, 0x8a, 0x33, - 0xa4, 0x34, 0xd2, 0x68, 0x9a, 0xd4, 0x0c, 0x76, 0x7d, 0x9d, 0x76, 0xab, 0xbb, 0x44, 0xf5, 0x15, - 0xd9, 0xcd, 0xe9, 0x6e, 0xea, 0x67, 0x81, 0x3c, 0x38, 0x36, 0x9c, 0xfb, 0x64, 0xdc, 0x00, 0x06, - 0x7c, 0x0d, 0x07, 0xf1, 0x75, 0xae, 0x11, 0x3f, 0x04, 0x48, 0x02, 0x24, 0xc8, 0x1f, 0x12, 0xfb, - 0x25, 0x40, 0x2e, 0x02, 0x27, 0xbe, 0x7e, 0x33, 0x02, 0x44, 0xb1, 0x75, 0xf3, 0x90, 0xc0, 0x41, - 0x10, 0xe4, 0xc5, 0xc0, 0x02, 0x09, 0x82, 0xfa, 0xe9, 0x3f, 0xb2, 0x49, 0x51, 0xb3, 0x7d, 0xe3, - 0x05, 0xfc, 0x22, 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0xef, 0x06, 0xd2, 0x9f, - 0x5d, 0xcb, 0x70, 0x2c, 0xb3, 0x98, 0x63, 0xfd, 0xc9, 0x52, 0xe8, 0x1e, 0x88, 0xee, 0x91, 0xa9, - 0xec, 0x61, 0xd5, 0x76, 0x77, 0xb0, 0xea, 0x92, 0x85, 0x1f, 0x68, 0x89, 0x39, 0xf7, 0xc8, 0xac, - 0x85, 0xc8, 0x6b, 0x99, 0xec, 0xb4, 0x98, 0x95, 0xfe, 0xb3, 0x00, 0x05, 0x6f, 0xb8, 0x25, 0x39, - 0x33, 0xee, 0x82, 0x68, 0x99, 0x58, 0xe9, 0xee, 0xa9, 0x0e, 0xe6, 0x8d, 0xe6, 0x0b, 0x4e, 0xc1, - 0x32, 0xf1, 0x16, 0x21, 0xb3, 0xb6, 0xa1, 0x2d, 0x98, 0x77, 0x5c, 0xb5, 0x65, 0x98, 0xad, 0x90, - 0x2e, 0x26, 0xc7, 0x07, 0x17, 0x22, 0xe7, 0xf6, 0xe9, 0x11, 0x2f, 0xe5, 0x8f, 0x05, 0x98, 0x5f, - 0xd6, 0x3b, 0x86, 0xd9, 0xe8, 0xb6, 0x8d, 0x44, 0xf7, 0x2c, 0x6e, 0x42, 0xce, 0x21, 0x32, 0x03, - 0x83, 0x1f, 0x20, 0xd0, 0x2c, 0xcd, 0x21, 0x96, 0xff, 0x19, 0xcc, 0xe1, 0xa3, 0xae, 0xc1, 0x5e, - 0x55, 0x30, 0xe0, 0x94, 0x19, 0xbf, 0x6d, 0x85, 0x80, 0x97, 0x64, 0xf1, 0x36, 0x7d, 0x06, 0x28, - 0xdc, 0xa4, 0x24, 0xb1, 0xcb, 0x67, 0xb0, 0x40, 0x45, 0x6f, 0x9b, 0x4e, 0xc2, 0xfa, 0x92, 0x7e, - 0x1e, 0x2e, 0x44, 0x45, 0x27, 0x59, 0xef, 0x57, 0xbc, 0x97, 0x37, 0xb0, 0x9d, 0x28, 0xe8, 0xf5, - 0x75, 0xcd, 0x05, 0x27, 0x59, 0xe7, 0x5f, 0x11, 0xe0, 0x0a, 0x95, 0x4d, 0xdf, 0xe6, 0xec, 0x62, - 0xfb, 0x19, 0x56, 0x9d, 0x44, 0x11, 0xfb, 0x0d, 0x98, 0x62, 0xc8, 0x9b, 0x8e, 0xcf, 0xc9, 0x95, - 0x3c, 0xf1, 0x5c, 0x1a, 0xae, 0x65, 0x13, 0xcf, 0x85, 0x67, 0x49, 0x2a, 0x94, 0xe2, 0x6a, 0x91, - 0x64, 0x4b, 0xff, 0xae, 0x00, 0xf3, 0xdc, 0x69, 0x24, 0x43, 0xb9, 0xb2, 0x47, 0x7c, 0x26, 0x54, - 0x85, 0xbc, 0x46, 0x7f, 0x29, 0xee, 0x71, 0x17, 0x53, 0xf9, 0x85, 0x51, 0xfe, 0x26, 0x63, 0x6b, - 0x1e, 0x77, 0x31, 0x71, 0x5a, 0xbd, 0xdf, 0x44, 0x51, 0xa1, 0x46, 0x8e, 0xf4, 0x58, 0xe9, 0x3c, - 0xa2, 0x65, 0x3d, 0xd7, 0x8f, 0xeb, 0xe0, 0x9f, 0xa4, 0xb9, 0x12, 0xd8, 0x33, 0x78, 0xf1, 0x44, - 0x7d, 0x94, 0xcf, 0xe1, 0x52, 0x78, 0x29, 0x08, 0x35, 0x3c, 0x75, 0x8e, 0x86, 0x87, 0x76, 0xf4, - 0x03, 0x2a, 0xfa, 0x0c, 0x42, 0x7b, 0xf6, 0x0a, 0x6b, 0x93, 0x87, 0x7e, 0xce, 0xa3, 0x8e, 0xf9, - 0x40, 0x0a, 0xa3, 0x3b, 0xa8, 0x02, 0x59, 0x7c, 0xd4, 0x55, 0x74, 0xec, 0x68, 0xdc, 0x70, 0x49, - 0x71, 0x02, 0x49, 0x55, 0x06, 0xf0, 0xc0, 0x34, 0x3e, 0xea, 0x12, 0x22, 0xda, 0x26, 0x4b, 0xb1, - 0xe7, 0x2a, 0xd0, 0x6a, 0x3b, 0x67, 0xc3, 0x8b, 0x60, 0xa4, 0x70, 0x71, 0x73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 0x30, 0xe6, 0x98, 0x24, 0xe9, - 0xc0, 0xbd, 0x10, 0x19, 0x95, 0x21, 0xd5, 0xd2, 0x8a, 0xb3, 0x43, 0xd7, 0x07, 0xff, 0x28, 0x60, - 0x6d, 0x42, 0x4e, 0xb5, 0x34, 0xf4, 0x29, 0x64, 0xd9, 0xb9, 0xae, 0x23, 0xb3, 0x58, 0x18, 0x6a, - 0x70, 0xa3, 0xa7, 0xe3, 0x6a, 0x13, 0x32, 0x3d, 0x4a, 0xc6, 0x07, 0x32, 0x3f, 0xb3, 0x43, 0x45, - 0x94, 0x47, 0x1c, 0xe7, 0xee, 0x3b, 0x39, 0x45, 0x06, 0x8c, 0xed, 0x13, 0xd1, 0x16, 0x14, 0x6c, - 0x16, 0xd5, 0xec, 0x9d, 0x41, 0x10, 0x87, 0xc6, 0xfa, 0xc4, 0x1d, 0x43, 0xa8, 0xd1, 0x8d, 0x8f, - 0x10, 0x9d, 0xf4, 0x5d, 0x54, 0x22, 0xef, 0xbb, 0xf9, 0xa1, 0x7d, 0x37, 0x34, 0x24, 0x9e, 0xf4, - 0x9d, 0x3d, 0x90, 0x89, 0x3e, 0x84, 0x49, 0x36, 0x4f, 0x10, 0x15, 0x19, 0x17, 0xbe, 0xd6, 0x37, - 0x45, 0x58, 0x79, 0x62, 0xbd, 0x5c, 0x1e, 0xda, 0xab, 0xb4, 0xad, 0x56, 0x71, 0x61, 0xa8, 0xf5, - 0x1a, 0x0c, 0x52, 0x26, 0xd6, 0xcb, 0x0d, 0xa8, 0x64, 0x00, 0xd9, 0x2c, 0x87, 0x4f, 0xb1, 0x0b, - 0x43, 0x07, 0x50, 0x4c, 0xc4, 0x6f, 0x8d, 0x1e, 0xba, 0x0a, 0xc8, 0xbe, 0x61, 0x75, 0xb0, 0x42, - 0x8d, 0xe2, 0xc5, 0xd1, 0x86, 0x35, 0x72, 0x85, 0x9a, 0x6f, 0x58, 0x19, 0x15, 0xbd, 0x04, 0x91, - 0xdf, 0xe3, 0x13,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dc, 0x88, - 0x1b, 0x0b, 0xb6, 0xbe, 0x35, 0x00, 0xb6, 0xa4, 0x51, 0x60, 0x2b, 0x98, 0x19, 0x1e, 0xda, 0xaa, - 0xc6, 0x60, 0xa3, 0x9b, 0xa3, 0xb1, 0x51, 0xb0, 0x90, 0x07, 0xe0, 0xa8, 0x16, 0x07, 0x8e, 0x6e, - 0x9d, 0x01, 0x8e, 0x82, 0x09, 0x16, 0x42, 0x47, 0x8f, 0xfb, 0xd0, 0xd1, 0xf5, 0x33, 0x23, 0x1c, - 0x43, 0xf0, 0xe8, 0x71, 0x1f, 0x3c, 0xba, 0x3e, 0x02, 0x1e, 0x05, 0xcc, 0x1c, 0x1f, 0xad, 0x0c, - 0xe2, 0xa3, 0x1b, 0x23, 0xf1, 0x91, 0x2f, 0x21, 0x00, 0x48, 0xeb, 0xb1, 0x00, 0xe9, 0xf6, 0x59, - 0x00, 0x29, 0x18, 0x91, 0x61, 0x84, 0xb4, 0x19, 0x8f, 0x90, 0xee, 0x9c, 0x89, 0x90, 0xfa, 0x56, - 0x4f, 0x0f, 0x22, 0xd5, 0xe2, 0x20, 0xd2, 0xad, 0x33, 0x20, 0x52, 0x78, 0xf5, 0xf4, 0x31, 0x52, - 0x73, 0x18, 0x46, 0xba, 0x37, 0x06, 0x46, 0x0a, 0x7c, 0xca, 0x3e, 0x90, 0xf4, 0x69, 0x3f, 0x48, - 0x92, 0x46, 0x81, 0xa4, 0x60, 0x2c, 0x7b, 0x28, 0x69, 0x33, 0x1e, 0x25, 0xdd, 0x39, 0x13, 0x25, - 0x85, 0xcd, 0x4b, 0x08, 0x26, 0x7d, 0xda, 0x0f, 0x93, 0xa4, 0x51, 0x30, 0x29, 0xa8, 0x8f, 0x87, - 0x93, 0x6a, 0x71, 0x38, 0xe9, 0xd6, 0x19, 0x38, 0x29, 0xb4, 0xea, 0x04, 0x40, 0xe9, 0x97, 0xc7, - 0x07, 0x4a, 0x1f, 0xbd, 0x69, 0x60, 0xce, 0xd9,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2a, 0x7c, 0xef, 0x27, 0x57, 0x27, 0x7e, 0xfc, 0x93, 0xab, 0x13, 0x7f, 0xf2, - 0x93, 0xab, 0x13, 0x9f, 0x4f, 0x73, 0xee, 0x9d, 0x29, 0x6a, 0x68, 0x1e, 0xfd, 0xbf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xfd, 0x08, 0xf8, 0xa0, 0x0c, 0x83, 0x00, 0x00, + // 8325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7d, 0x5d, 0x6c, 0x23, 0x59, + 0x76, 0x9e, 0x8a, 0xa4, 0x24, 0xf2, 0xf0, 0x57, 0x57, 0xfd, 0xc3, 0xe1, 0xcc, 0xb4, 0xba, 0x6b, + 0xa6, 0x7f, 0xa6, 0x77, 0x86, 0x9a, 0xee, 0xde, 0xc9, 0x8c, 0xa7, 0xc7, 0xb3, 0x96, 0x28, 0x76, + 0x93, 0x52, 0x4b, 0xad, 0x2e, 0x52, 0xdd, 0x98, 0xf1, 0x3a, 0xe5, 0x52, 0xd5, 0x15, 0x55, 0x2b, + 0xb2, 0x8a, 0x5d, 0x55, 0xd4, 0xcf, 0x00, 0x79, 0x70, 0x6c, 0x38, 0xfb, 0x64, 0x6c, 0x00, 0x03, + 0xde, 0x85, 0x83, 0x78, 0x9d, 0x35, 0xe2, 0x87, 0x00, 0x49, 0x80, 0x04, 0xf9, 0x43, 0x62, 0xbf, + 0x04, 0xc8, 0x22, 0x70, 0xe2, 0xf5, 0x9b, 0x11, 0x20, 0x8a, 0xad, 0xcd, 0x43, 0x02, 0x03, 0x41, + 0x90, 0x17, 0x03, 0x03, 0x24, 0x08, 0xee, 0x4f, 0xfd, 0x91, 0x45, 0x8a, 0xea, 0xa9, 0x4d, 0x06, + 0xf0, 0x8b, 0xc4, 0x7b, 0xee, 0x3d, 0xa7, 0xee, 0x3d, 0xf7, 0xde, 0x73, 0xcf, 0x77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, 0x23, 0xf1, 0x14, 0x7a, 0x13, 0x40, 0x51, 0x55, 0x6c, 0xdb, 0xb2, + 0x7b, 0xae, 0x30, 0x23, 0x65, 0x18, 0x65, 0x03, 0x9f, 0x10, 0x36, 0x1b, 0xab, 0x16, 0x76, 0xdc, + 0xc0, 0x2c, 0x96, 0x22, 0x6c, 0x0e, 0xee, 0xf5, 0x65, 0xc7, 0x3c, 0xc0, 0x06, 0x1d, 0x27, 0x19, + 0x62, 0x6a, 0x7a, 0xfd, 0x36, 0x21, 0x10, 0x2b, 0x89, 0x0d, 0xcd, 0x37, 0x69, 0x19, 0xc9, 0x4b, + 0x13, 0x91, 0x16, 0xee, 0xe8, 0xfc, 0x54, 0x5e, 0x46, 0xe2, 0x29, 0xa2, 0x25, 0x65, 0xe0, 0xec, + 0xd3, 0x9e, 0xc8, 0x48, 0xf4, 0x37, 0xba, 0x05, 0x45, 0x16, 0xcb, 0x29, 0x63, 0x43, 0x95, 0xa9, + 0x71, 0xcd, 0xd0, 0xec, 0x3c, 0x23, 0xd7, 0x0d, 0x95, 0x98, 0x52, 0xf4, 0x00, 0x38, 0x41, 0x3e, + 0xe8, 0xd9, 0x44, 0xa7, 0x40, 0x4a, 0xad, 0x16, 0xcf, 0x4e, 0x97, 0xb2, 0x2d, 0x9a, 0xb1, 0xb1, + 0xd9, 0x22, 0x0b, 0x14, 0x2b, 0xb5, 0xd1, 0xb3, 0x9b, 0x5a, 0xe5, 0x37, 0x05, 0x48, 0x3e, 0xae, + 0xb5, 0x2e, 0xac, 0x32, 0xb7, 0xa2, 0xc9, 0x40, 0x45, 0x6f, 0x43, 0x71, 0x57, 0xef, 0x76, 0x75, + 0xa3, 0x43, 0x9c, 0xb6, 0xef, 0x60, 0xd5, 0x55, 0x58, 0x81, 0x93, 0xb7, 0x19, 0x15, 0x5d, 0x87, + 0xac, 0x6a, 0x61, 0x0d, 0x1b, 0x8e, 0xae, 0x74, 0x6d, 0xae, 0xb9, 0x20, 0xa9, 0xf2, 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, + 0x20, 0x5a, 0x23, 0x75, 0xf8, 0xca, 0x11, 0x06, 0x59, 0xf6, 0xe0, 0x16, 0x79, 0x2e, 0xda, 0x82, + 0x92, 0xda, 0x65, 0x31, 0x0f, 0x5e, 0x34, 0xd3, 0x05, 0xb0, 0x4f, 0x91, 0x31, 0xfb, 0x01, 0x4d, + 0xcf, 0xc8, 0x64, 0x52, 0x34, 0x99, 0xdf, 0x28, 0xc9, 0xa1, 0x4b, 0x75, 0xcc, 0x8d, 0x11, 0x81, + 0x8b, 0x28, 0xab, 0x12, 0x56, 0x34, 0xee, 0x61, 0x93, 0x79, 0xe5, 0x25, 0xf8, 0xbc, 0x7a, 0x01, + 0x0b, 0x74, 0xdc, 0xc4, 0x7d, 0xf0, 0x5b, 0xfc, 0x51, 0x02, 0x50, 0x50, 0xf2, 0xcf, 0x6e, 0xbc, + 0x25, 0xe2, 0x1b, 0x6f, 0xef, 0x02, 0x62, 0x61, 0xb2, 0xb6, 0xdc, 0xc7, 0x96, 0x6c, 0x63, 0xd5, + 0xe4, 0x77, 0x7d, 0x09, 0x52, 0x89, 0xe7, 0x6c, 0x63, 0xab, 0x45, 0xe9, 0x68, 0x05, 0xc0, 0xf7, + 0xda, 0xf9, 0xa2, 0x38, 0x8d, 0xd3, 0x9e, 0xf1, 0x9c, 0x76, 0xf1, 0x7b, 0x02, 0x14, 0x36, 0xf5, + 0x8e, 0xa5, 0xc4, 0x7a, 0x95, 0x15, 0xfa, 0x38, 0xfc, 0x36, 0x23, 0x7b, 0xbf, 0x12, 0x15, 0xd8, + 0xc5, 0x4a, 0xb8, 0x70, 0x9b, 0x33, 0x90, 0xb5, 0xc6, 0xab, 0x51, 0x9c, 0x46, 0xf6, 0x3f, 0x54, + 0x20, 0xc7, 0xeb, 0xbd, 0x63, 0xe8, 0xa6, 0x81, 0xee, 0x41, 0xb2, 0xc3, 0xdf, 0x56, 0x65, 0x23, + 0x77, 0x96, 0xfd, 0x8b, 0x22, 0x1b, 0x33, 0x12,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0x62, 0x12, 0x7a, 0x02, 0xb3, 0x6c, 0xab, 0x71, 0x69, + 0x3c, 0x76, 0xa0, 0xd3, 0xbb, 0x72, 0xfd, 0x3c, 0x70, 0x21, 0xce, 0xa0, 0xbf, 0x0e, 0xd9, 0x80, + 0x4f, 0x85, 0xc6, 0x6e, 0xef, 0x84, 0xfc, 0xc8, 0xca, 0xad, 0xf3, 0x8a, 0x79, 0xf2, 0x5f, 0x40, + 0xc6, 0xb3, 0xf1, 0xe8, 0xad, 0x49, 0x2b, 0x80, 0x2b, 0x7b, 0xf2, 0x32, 0x41, 0x66, 0xa3, 0x38, + 0xf3, 0xbe, 0x80, 0x2c, 0x40, 0xa3, 0xe6, 0x18, 0x45, 0x05, 0x75, 0x8d, 0xb5, 0xf7, 0x95, 0xbb, + 0x53, 0x95, 0xf6, 0x9f, 0x49, 0x94, 0xe5, 0xaf, 0x29, 0xd1, 0xca, 0x1a, 0x59, 0xb1, 0xa2, 0x95, + 0x15, 0xb1, 0x34, 0xcd, 0xa0, 0x67, 0x90, 0x22, 0xb6, 0x14, 0x45, 0x79, 0x99, 0x43, 0xb6, 0xbb, + 0xf2, 0xd6, 0xc4, 0x32, 0xae, 0xc8, 0xd5, 0x77, 0x7e, 0xfc, 0xe7, 0xd7, 0x66, 0x7e, 0x7c, 0x76, + 0x4d, 0xf8, 0xc9, 0xd9, 0x35, 0xe1, 0x4f, 0xcf, 0xae, 0x09, 0x7f, 0x76, 0x76, 0x4d, 0xf8, 0xde, + 0x4f, 0xaf, 0xcd, 0xfc, 0xe4, 0xa7, 0xd7, 0x66, 0xfe, 0xf4, 0xa7, 0xd7, 0x66, 0x3e, 0x9f, 0xe7, + 0xdc, 0xbb, 0x73, 0xd4, 0xd0, 0x3c, 0xf8, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xc8, 0xad, + 0xa8, 0xb9, 0x82, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -9633,16 +9618,6 @@ func (m *EndTxnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x48 } - if m.DeprecatedCanCommitAtHigherTimestamp { - i-- - if m.DeprecatedCanCommitAtHigherTimestamp { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } if m.Require1PC { i-- if m.Require1PC { @@ -17252,9 +17227,6 @@ func (m *EndTxnRequest) Size() (n int) { if m.Require1PC { n += 2 } - if m.DeprecatedCanCommitAtHigherTimestamp { - n += 2 - } if m.Poison { n += 2 } @@ -24059,26 +24031,6 @@ func (m *EndTxnRequest) Unmarshal(dAtA []byte) error { } } m.Require1PC = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedCanCommitAtHigherTimestamp", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DeprecatedCanCommitAtHigherTimestamp = bool(v != 0) case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Poison", wireType) diff --git a/pkg/roachpb/api.proto b/pkg/roachpb/api.proto index 8c4fd116d82c..2a61c72cda41 100644 --- a/pkg/roachpb/api.proto +++ b/pkg/roachpb/api.proto @@ -650,15 +650,6 @@ message EndTxnRequest { // reliably for these transactions - a TransactionStatusError might be // returned instead if 1PC execution fails. bool require_1pc = 6 [(gogoproto.customname) = "Require1PC"]; - // DeprecatedCanCommitAtHigherTimestamp indicates that the batch this EndTxn - // is part of can be evaluated at a higher timestamp than the transaction's - // read timestamp. This is set by the client if the transaction has not - // performed any reads that must be refreshed prior to sending this current - // batch. When set, it allows the server to handle pushes and write too old - // conditions locally. - // TODO(nvanbenschoten): remove this in favor of can_forward_read_timestamp - // in v21.1. The flag is not read in v20.2. - bool deprecated_can_commit_at_higher_timestamp = 8; // True to indicate that lock spans should be resolved with poison=true. // This is used when the transaction is being aborted independently of the // main thread of client operation, as in the case of an asynchronous abort @@ -679,7 +670,7 @@ message EndTxnRequest { // WARNING: this flag was introduced in the v20.2 release. v20.1 nodes may not // set this properly so it should not be relied upon for correctness. bool txn_heartbeating = 10; - reserved 7; + reserved 7, 8; } // An EndTxnResponse is the return value from the EndTxn() method. The final @@ -2032,10 +2023,6 @@ message Header { // has not performed any reads that must be refreshed prior to sending this // current batch. When set, it allows the server to handle pushes and write // too old conditions locally. - // - // NOTE: this flag is a generalization of EndTxn.CanCommitAtHigherTimestamp. - // That flag should be deprecated in favor of this one. - // TODO(nvanbenschoten): perform this migration. bool can_forward_read_timestamp = 16; reserved 7, 10, 12, 14; }
ff832dde62ef23e71e64e538cc8adae34fa7d6e5
2020-12-01 22:46:25
Radu Berinde
sql: remove Filter from PostProcessSpec
false
remove Filter from PostProcessSpec
sql
diff --git a/pkg/sql/colexec/colbuilder/execplan.go b/pkg/sql/colexec/colbuilder/execplan.go index 2a6a5130488d..3a56110cb469 100644 --- a/pkg/sql/colexec/colbuilder/execplan.go +++ b/pkg/sql/colexec/colbuilder/execplan.go @@ -415,10 +415,10 @@ func (r opResult) createDiskBackedSort( colmem.NewAllocator(ctx, sortChunksMemAccount, factory), input, inputTypes, ordering.Columns, int(matchLen), ) - } else if post.Limit != 0 && post.Filter.Empty() && post.Limit < math.MaxUint64-post.Offset { - // There is a limit specified with no post-process filter, so we know - // exactly how many rows the sorter should output. The last part of the - // condition is making sure there is no overflow. + } else if post.Limit != 0 && post.Limit < math.MaxUint64-post.Offset { + // There is a limit specified, so we know exactly how many rows the sorter + // should output. The last part of the condition is making sure there is no + // overflow. // // Choose a top K sorter, which uses a heap to avoid storing more rows // than necessary. @@ -1244,8 +1244,7 @@ func NewColOperator( } // planAndMaybeWrapFilter plans a filter. If the filter is unsupported, it is -// planned as a wrapped noop processor with the filter as a post-processing -// stage. +// planned as a wrapped filterer processor. func (r opResult) planAndMaybeWrapFilter( ctx context.Context, flowCtx *execinfra.FlowCtx, @@ -1268,8 +1267,18 @@ func (r opResult) planAndMaybeWrapFilter( ) } - post := &execinfrapb.PostProcessSpec{Filter: filter} - return r.wrapPostProcessSpec(ctx, flowCtx, args, post, args.Spec.ResultTypes, factory, err) + filtererSpec := &execinfrapb.ProcessorSpec{ + Core: execinfrapb.ProcessorCoreUnion{ + Filterer: &execinfrapb.FiltererSpec{ + Filter: filter, + }, + }, + ResultTypes: args.Spec.ResultTypes, + } + return r.createAndWrapRowSource( + ctx, flowCtx, args, []colexecbase.Operator{r.Op}, [][]*types.T{r.ColumnTypes}, + filtererSpec, factory, err, + ) } r.Op = op return nil @@ -1312,16 +1321,6 @@ func (r *postProcessResult) planPostProcessSpec( post *execinfrapb.PostProcessSpec, factory coldata.ColumnFactory, ) error { - if !post.Filter.Empty() { - op, err := planFilterExpr( - ctx, flowCtx, evalCtx, r.Op, r.ColumnTypes, post.Filter, args.StreamingMemAccount, factory, args.ExprHelper, - ) - if err != nil { - return err - } - r.Op = op - } - if post.Projection { r.Op, r.ColumnTypes = addProjection(r.Op, r.ColumnTypes, post.OutputColumns) } else if post.RenderExprs != nil { diff --git a/pkg/sql/colexec/is_null_ops_test.go b/pkg/sql/colexec/is_null_ops_test.go index 2fd6e58296ba..a788a0864fb0 100644 --- a/pkg/sql/colexec/is_null_ops_test.go +++ b/pkg/sql/colexec/is_null_ops_test.go @@ -232,10 +232,9 @@ func TestIsNullSelOp(t *testing.T) { spec := &execinfrapb.ProcessorSpec{ Input: []execinfrapb.InputSyncSpec{{ColumnTypes: typs}}, Core: execinfrapb.ProcessorCoreUnion{ - Noop: &execinfrapb.NoopCoreSpec{}, - }, - Post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: fmt.Sprintf("@1 %s", c.selExpr)}, + Filterer: &execinfrapb.FiltererSpec{ + Filter: execinfrapb.Expression{Expr: fmt.Sprintf("@1 %s", c.selExpr)}, + }, }, ResultTypes: typs, } diff --git a/pkg/sql/distsql/columnar_operators_test.go b/pkg/sql/distsql/columnar_operators_test.go index 7226f5bd83b5..1b7ce3ad0153 100644 --- a/pkg/sql/distsql/columnar_operators_test.go +++ b/pkg/sql/distsql/columnar_operators_test.go @@ -618,127 +618,117 @@ func TestHashJoinerAgainstProcessor(t *testing.T) { for _, testSpec := range testSpecs { for nCols := 1; nCols <= maxCols; nCols++ { for nEqCols := 1; nEqCols <= nCols; nEqCols++ { - for _, addFilter := range getAddFilterOptions(testSpec.joinType, nEqCols < nCols) { - triedWithoutOnExpr, triedWithOnExpr := false, false - if !testSpec.onExprSupported { - triedWithOnExpr = true + triedWithoutOnExpr, triedWithOnExpr := false, false + if !testSpec.onExprSupported { + triedWithOnExpr = true + } + for !triedWithoutOnExpr || !triedWithOnExpr { + var ( + lRows, rRows rowenc.EncDatumRows + lEqCols, rEqCols []uint32 + lInputTypes, rInputTypes []*types.T + usingRandomTypes bool + ) + if rng.Float64() < randTypesProbability { + lInputTypes = generateRandomSupportedTypes(rng, nCols) + lEqCols = generateEqualityColumns(rng, nCols, nEqCols) + rInputTypes = append(rInputTypes[:0], lInputTypes...) + rEqCols = append(rEqCols[:0], lEqCols...) + rng.Shuffle(nEqCols, func(i, j int) { + iColIdx, jColIdx := rEqCols[i], rEqCols[j] + rInputTypes[iColIdx], rInputTypes[jColIdx] = rInputTypes[jColIdx], rInputTypes[iColIdx] + rEqCols[i], rEqCols[j] = rEqCols[j], rEqCols[i] + }) + rInputTypes = randomizeJoinRightTypes(rng, rInputTypes) + lRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, lInputTypes) + rRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, rInputTypes) + usingRandomTypes = true + } else { + lInputTypes = intTyps[:nCols] + rInputTypes = lInputTypes + lRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) + rRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) + lEqCols = generateEqualityColumns(rng, nCols, nEqCols) + rEqCols = generateEqualityColumns(rng, nCols, nEqCols) } - for !triedWithoutOnExpr || !triedWithOnExpr { - var ( - lRows, rRows rowenc.EncDatumRows - lEqCols, rEqCols []uint32 - lInputTypes, rInputTypes []*types.T - usingRandomTypes bool - ) - if rng.Float64() < randTypesProbability { - lInputTypes = generateRandomSupportedTypes(rng, nCols) - lEqCols = generateEqualityColumns(rng, nCols, nEqCols) - rInputTypes = append(rInputTypes[:0], lInputTypes...) - rEqCols = append(rEqCols[:0], lEqCols...) - rng.Shuffle(nEqCols, func(i, j int) { - iColIdx, jColIdx := rEqCols[i], rEqCols[j] - rInputTypes[iColIdx], rInputTypes[jColIdx] = rInputTypes[jColIdx], rInputTypes[iColIdx] - rEqCols[i], rEqCols[j] = rEqCols[j], rEqCols[i] - }) - rInputTypes = randomizeJoinRightTypes(rng, rInputTypes) - lRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, lInputTypes) - rRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, rInputTypes) - usingRandomTypes = true - } else { - lInputTypes = intTyps[:nCols] - rInputTypes = lInputTypes - lRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) - rRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) - lEqCols = generateEqualityColumns(rng, nCols, nEqCols) - rEqCols = generateEqualityColumns(rng, nCols, nEqCols) - } - var outputTypes []*types.T - if testSpec.joinType.ShouldIncludeLeftColsInOutput() { - outputTypes = append(outputTypes, lInputTypes...) - } - if testSpec.joinType.ShouldIncludeRightColsInOutput() { - outputTypes = append(outputTypes, rInputTypes...) - } - outputColumns := make([]uint32, len(outputTypes)) - for i := range outputColumns { - outputColumns[i] = uint32(i) - } + var outputTypes []*types.T + if testSpec.joinType.ShouldIncludeLeftColsInOutput() { + outputTypes = append(outputTypes, lInputTypes...) + } + if testSpec.joinType.ShouldIncludeRightColsInOutput() { + outputTypes = append(outputTypes, rInputTypes...) + } + outputColumns := make([]uint32, len(outputTypes)) + for i := range outputColumns { + outputColumns[i] = uint32(i) + } - var filter, onExpr execinfrapb.Expression - if addFilter { - forceSingleSide := !testSpec.joinType.ShouldIncludeLeftColsInOutput() || - !testSpec.joinType.ShouldIncludeRightColsInOutput() - filter = generateFilterExpr( - rng, nCols, nEqCols, outputTypes, usingRandomTypes, forceSingleSide, - ) - } - if triedWithoutOnExpr { - colTypes := append(lInputTypes, rInputTypes...) - onExpr = generateFilterExpr( - rng, nCols, nEqCols, colTypes, usingRandomTypes, false, /* forceSingleSide */ - ) - } - hjSpec := &execinfrapb.HashJoinerSpec{ - LeftEqColumns: lEqCols, - RightEqColumns: rEqCols, - OnExpr: onExpr, - Type: testSpec.joinType, - } - pspec := &execinfrapb.ProcessorSpec{ - Input: []execinfrapb.InputSyncSpec{ - {ColumnTypes: lInputTypes}, - {ColumnTypes: rInputTypes}, - }, - Core: execinfrapb.ProcessorCoreUnion{HashJoiner: hjSpec}, - Post: execinfrapb.PostProcessSpec{ - Projection: true, - OutputColumns: outputColumns, - Filter: filter, - }, - ResultTypes: outputTypes, - } - args := verifyColOperatorArgs{ - anyOrder: true, - inputTypes: [][]*types.T{lInputTypes, rInputTypes}, - inputs: []rowenc.EncDatumRows{lRows, rRows}, - pspec: pspec, - forceDiskSpill: spillForced, - // It is possible that we have a filter that is always false, and this - // will allow us to plan a zero operator which always returns a zero - // batch. In such case, the spilling might not occur and that's ok. - forcedDiskSpillMightNotOccur: !filter.Empty() || !onExpr.Empty(), - numForcedRepartitions: 2, - rng: rng, - } - if testSpec.joinType.IsSetOpJoin() && nEqCols < nCols { - // The output of set operation joins is not fully - // deterministic when there are non-equality - // columns, however, the rows must match on the - // equality columns between vectorized and row - // executions. - args.colIdxsToCheckForEquality = make([]int, nEqCols) - for i := range args.colIdxsToCheckForEquality { - args.colIdxsToCheckForEquality[i] = int(lEqCols[i]) - } + var onExpr execinfrapb.Expression + if triedWithoutOnExpr { + colTypes := append(lInputTypes, rInputTypes...) + onExpr = generateFilterExpr( + rng, nCols, nEqCols, colTypes, usingRandomTypes, false, /* forceSingleSide */ + ) + } + hjSpec := &execinfrapb.HashJoinerSpec{ + LeftEqColumns: lEqCols, + RightEqColumns: rEqCols, + OnExpr: onExpr, + Type: testSpec.joinType, + } + pspec := &execinfrapb.ProcessorSpec{ + Input: []execinfrapb.InputSyncSpec{ + {ColumnTypes: lInputTypes}, + {ColumnTypes: rInputTypes}, + }, + Core: execinfrapb.ProcessorCoreUnion{HashJoiner: hjSpec}, + Post: execinfrapb.PostProcessSpec{ + Projection: true, + OutputColumns: outputColumns, + }, + ResultTypes: outputTypes, + } + args := verifyColOperatorArgs{ + anyOrder: true, + inputTypes: [][]*types.T{lInputTypes, rInputTypes}, + inputs: []rowenc.EncDatumRows{lRows, rRows}, + pspec: pspec, + forceDiskSpill: spillForced, + // It is possible that we have a filter that is always false, and this + // will allow us to plan a zero operator which always returns a zero + // batch. In such case, the spilling might not occur and that's ok. + forcedDiskSpillMightNotOccur: !onExpr.Empty(), + numForcedRepartitions: 2, + rng: rng, + } + if testSpec.joinType.IsSetOpJoin() && nEqCols < nCols { + // The output of set operation joins is not fully + // deterministic when there are non-equality + // columns, however, the rows must match on the + // equality columns between vectorized and row + // executions. + args.colIdxsToCheckForEquality = make([]int, nEqCols) + for i := range args.colIdxsToCheckForEquality { + args.colIdxsToCheckForEquality[i] = int(lEqCols[i]) } + } - if err := verifyColOperator(t, args); err != nil { - fmt.Printf("--- spillForced = %t join type = %s onExpr = %q"+ - " filter = %q seed = %d run = %d ---\n", - spillForced, testSpec.joinType.String(), onExpr.Expr, filter.Expr, seed, run) - fmt.Printf("--- lEqCols = %v rEqCols = %v ---\n", lEqCols, rEqCols) - prettyPrintTypes(lInputTypes, "left_table" /* tableName */) - prettyPrintTypes(rInputTypes, "right_table" /* tableName */) - prettyPrintInput(lRows, lInputTypes, "left_table" /* tableName */) - prettyPrintInput(rRows, rInputTypes, "right_table" /* tableName */) - t.Fatal(err) - } - if onExpr.Expr == "" { - triedWithoutOnExpr = true - } else { - triedWithOnExpr = true - } + if err := verifyColOperator(t, args); err != nil { + fmt.Printf("--- spillForced = %t join type = %s onExpr = %q"+ + " q seed = %d run = %d ---\n", + spillForced, testSpec.joinType.String(), onExpr.Expr, seed, run) + fmt.Printf("--- lEqCols = %v rEqCols = %v ---\n", lEqCols, rEqCols) + prettyPrintTypes(lInputTypes, "left_table" /* tableName */) + prettyPrintTypes(rInputTypes, "right_table" /* tableName */) + prettyPrintInput(lRows, lInputTypes, "left_table" /* tableName */) + prettyPrintInput(rRows, rInputTypes, "right_table" /* tableName */) + t.Fatal(err) + } + if onExpr.Expr == "" { + triedWithoutOnExpr = true + } else { + triedWithOnExpr = true } } } @@ -824,134 +814,125 @@ func TestMergeJoinerAgainstProcessor(t *testing.T) { for _, testSpec := range testSpecs { for nCols := 1; nCols <= maxCols; nCols++ { for nOrderingCols := 1; nOrderingCols <= nCols; nOrderingCols++ { - for _, addFilter := range getAddFilterOptions(testSpec.joinType, nOrderingCols < nCols) { - triedWithoutOnExpr, triedWithOnExpr := false, false - if !testSpec.onExprSupported { - triedWithOnExpr = true - } - for !triedWithoutOnExpr || !triedWithOnExpr { - var ( - lRows, rRows rowenc.EncDatumRows - lInputTypes, rInputTypes []*types.T - lOrderingCols, rOrderingCols []execinfrapb.Ordering_Column - usingRandomTypes bool - ) - if rng.Float64() < randTypesProbability { - lInputTypes = generateRandomSupportedTypes(rng, nCols) - lOrderingCols = generateColumnOrdering(rng, nCols, nOrderingCols) - rInputTypes = append(rInputTypes[:0], lInputTypes...) - rOrderingCols = append(rOrderingCols[:0], lOrderingCols...) - rng.Shuffle(nOrderingCols, func(i, j int) { - iColIdx, jColIdx := rOrderingCols[i].ColIdx, rOrderingCols[j].ColIdx - rInputTypes[iColIdx], rInputTypes[jColIdx] = rInputTypes[jColIdx], rInputTypes[iColIdx] - rOrderingCols[i], rOrderingCols[j] = rOrderingCols[j], rOrderingCols[i] - }) - rInputTypes = randomizeJoinRightTypes(rng, rInputTypes) - lRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, lInputTypes) - rRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, rInputTypes) - usingRandomTypes = true - } else { - lInputTypes = intTyps[:nCols] - rInputTypes = lInputTypes - lRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) - rRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) - lOrderingCols = generateColumnOrdering(rng, nCols, nOrderingCols) - rOrderingCols = generateColumnOrdering(rng, nCols, nOrderingCols) - } - // Set the directions of both columns to be the same. - for i, lCol := range lOrderingCols { - rOrderingCols[i].Direction = lCol.Direction - } - - lMatchedCols := execinfrapb.ConvertToColumnOrdering(execinfrapb.Ordering{Columns: lOrderingCols}) - rMatchedCols := execinfrapb.ConvertToColumnOrdering(execinfrapb.Ordering{Columns: rOrderingCols}) - sort.Slice(lRows, func(i, j int) bool { - cmp, err := lRows[i].Compare(lInputTypes, &da, lMatchedCols, &evalCtx, lRows[j]) - if err != nil { - t.Fatal(err) - } - return cmp < 0 - }) - sort.Slice(rRows, func(i, j int) bool { - cmp, err := rRows[i].Compare(rInputTypes, &da, rMatchedCols, &evalCtx, rRows[j]) - if err != nil { - t.Fatal(err) - } - return cmp < 0 + triedWithoutOnExpr, triedWithOnExpr := false, false + if !testSpec.onExprSupported { + triedWithOnExpr = true + } + for !triedWithoutOnExpr || !triedWithOnExpr { + var ( + lRows, rRows rowenc.EncDatumRows + lInputTypes, rInputTypes []*types.T + lOrderingCols, rOrderingCols []execinfrapb.Ordering_Column + usingRandomTypes bool + ) + if rng.Float64() < randTypesProbability { + lInputTypes = generateRandomSupportedTypes(rng, nCols) + lOrderingCols = generateColumnOrdering(rng, nCols, nOrderingCols) + rInputTypes = append(rInputTypes[:0], lInputTypes...) + rOrderingCols = append(rOrderingCols[:0], lOrderingCols...) + rng.Shuffle(nOrderingCols, func(i, j int) { + iColIdx, jColIdx := rOrderingCols[i].ColIdx, rOrderingCols[j].ColIdx + rInputTypes[iColIdx], rInputTypes[jColIdx] = rInputTypes[jColIdx], rInputTypes[iColIdx] + rOrderingCols[i], rOrderingCols[j] = rOrderingCols[j], rOrderingCols[i] }) - var outputTypes []*types.T - if testSpec.joinType.ShouldIncludeLeftColsInOutput() { - outputTypes = append(outputTypes, lInputTypes...) - } - if testSpec.joinType.ShouldIncludeRightColsInOutput() { - outputTypes = append(outputTypes, rInputTypes...) - } - outputColumns := make([]uint32, len(outputTypes)) - for i := range outputColumns { - outputColumns[i] = uint32(i) - } + rInputTypes = randomizeJoinRightTypes(rng, rInputTypes) + lRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, lInputTypes) + rRows = rowenc.RandEncDatumRowsOfTypes(rng, nRows, rInputTypes) + usingRandomTypes = true + } else { + lInputTypes = intTyps[:nCols] + rInputTypes = lInputTypes + lRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) + rRows = rowenc.MakeRandIntRowsInRange(rng, nRows, nCols, maxNum, nullProbability) + lOrderingCols = generateColumnOrdering(rng, nCols, nOrderingCols) + rOrderingCols = generateColumnOrdering(rng, nCols, nOrderingCols) + } + // Set the directions of both columns to be the same. + for i, lCol := range lOrderingCols { + rOrderingCols[i].Direction = lCol.Direction + } - var filter, onExpr execinfrapb.Expression - if addFilter { - forceSingleSide := !testSpec.joinType.ShouldIncludeLeftColsInOutput() || - !testSpec.joinType.ShouldIncludeRightColsInOutput() - filter = generateFilterExpr( - rng, nCols, nOrderingCols, outputTypes, usingRandomTypes, forceSingleSide, - ) - } - if triedWithoutOnExpr { - colTypes := append(lInputTypes, rInputTypes...) - onExpr = generateFilterExpr( - rng, nCols, nOrderingCols, colTypes, usingRandomTypes, false, /* forceSingleSide */ - ) - } - mjSpec := &execinfrapb.MergeJoinerSpec{ - OnExpr: onExpr, - LeftOrdering: execinfrapb.Ordering{Columns: lOrderingCols}, - RightOrdering: execinfrapb.Ordering{Columns: rOrderingCols}, - Type: testSpec.joinType, - NullEquality: testSpec.joinType.IsSetOpJoin(), - } - pspec := &execinfrapb.ProcessorSpec{ - Input: []execinfrapb.InputSyncSpec{{ColumnTypes: lInputTypes}, {ColumnTypes: rInputTypes}}, - Core: execinfrapb.ProcessorCoreUnion{MergeJoiner: mjSpec}, - Post: execinfrapb.PostProcessSpec{Projection: true, OutputColumns: outputColumns, Filter: filter}, - ResultTypes: outputTypes, - } - args := verifyColOperatorArgs{ - anyOrder: testSpec.anyOrder, - inputTypes: [][]*types.T{lInputTypes, rInputTypes}, - inputs: []rowenc.EncDatumRows{lRows, rRows}, - pspec: pspec, - rng: rng, - } - if testSpec.joinType.IsSetOpJoin() && nOrderingCols < nCols { - // The output of set operation joins is not fully - // deterministic when there are non-equality - // columns, however, the rows must match on the - // equality columns between vectorized and row - // executions. - args.colIdxsToCheckForEquality = make([]int, nOrderingCols) - for i := range args.colIdxsToCheckForEquality { - args.colIdxsToCheckForEquality[i] = int(lOrderingCols[i].ColIdx) - } + lMatchedCols := execinfrapb.ConvertToColumnOrdering(execinfrapb.Ordering{Columns: lOrderingCols}) + rMatchedCols := execinfrapb.ConvertToColumnOrdering(execinfrapb.Ordering{Columns: rOrderingCols}) + sort.Slice(lRows, func(i, j int) bool { + cmp, err := lRows[i].Compare(lInputTypes, &da, lMatchedCols, &evalCtx, lRows[j]) + if err != nil { + t.Fatal(err) } - if err := verifyColOperator(t, args); err != nil { - fmt.Printf("--- join type = %s onExpr = %q filter = %q seed = %d run = %d ---\n", - testSpec.joinType.String(), onExpr.Expr, filter.Expr, seed, run) - fmt.Printf("--- left ordering = %v right ordering = %v ---\n", lOrderingCols, rOrderingCols) - prettyPrintTypes(lInputTypes, "left_table" /* tableName */) - prettyPrintTypes(rInputTypes, "right_table" /* tableName */) - prettyPrintInput(lRows, lInputTypes, "left_table" /* tableName */) - prettyPrintInput(rRows, rInputTypes, "right_table" /* tableName */) + return cmp < 0 + }) + sort.Slice(rRows, func(i, j int) bool { + cmp, err := rRows[i].Compare(rInputTypes, &da, rMatchedCols, &evalCtx, rRows[j]) + if err != nil { t.Fatal(err) } - if onExpr.Expr == "" { - triedWithoutOnExpr = true - } else { - triedWithOnExpr = true + return cmp < 0 + }) + var outputTypes []*types.T + if testSpec.joinType.ShouldIncludeLeftColsInOutput() { + outputTypes = append(outputTypes, lInputTypes...) + } + if testSpec.joinType.ShouldIncludeRightColsInOutput() { + outputTypes = append(outputTypes, rInputTypes...) + } + outputColumns := make([]uint32, len(outputTypes)) + for i := range outputColumns { + outputColumns[i] = uint32(i) + } + + var onExpr execinfrapb.Expression + if triedWithoutOnExpr { + colTypes := append(lInputTypes, rInputTypes...) + onExpr = generateFilterExpr( + rng, nCols, nOrderingCols, colTypes, usingRandomTypes, false, /* forceSingleSide */ + ) + } + mjSpec := &execinfrapb.MergeJoinerSpec{ + OnExpr: onExpr, + LeftOrdering: execinfrapb.Ordering{Columns: lOrderingCols}, + RightOrdering: execinfrapb.Ordering{Columns: rOrderingCols}, + Type: testSpec.joinType, + NullEquality: testSpec.joinType.IsSetOpJoin(), + } + pspec := &execinfrapb.ProcessorSpec{ + Input: []execinfrapb.InputSyncSpec{{ColumnTypes: lInputTypes}, {ColumnTypes: rInputTypes}}, + Core: execinfrapb.ProcessorCoreUnion{MergeJoiner: mjSpec}, + Post: execinfrapb.PostProcessSpec{Projection: true, OutputColumns: outputColumns}, + ResultTypes: outputTypes, + } + args := verifyColOperatorArgs{ + anyOrder: testSpec.anyOrder, + inputTypes: [][]*types.T{lInputTypes, rInputTypes}, + inputs: []rowenc.EncDatumRows{lRows, rRows}, + pspec: pspec, + rng: rng, + } + if testSpec.joinType.IsSetOpJoin() && nOrderingCols < nCols { + // The output of set operation joins is not fully + // deterministic when there are non-equality + // columns, however, the rows must match on the + // equality columns between vectorized and row + // executions. + args.colIdxsToCheckForEquality = make([]int, nOrderingCols) + for i := range args.colIdxsToCheckForEquality { + args.colIdxsToCheckForEquality[i] = int(lOrderingCols[i].ColIdx) } } + if err := verifyColOperator(t, args); err != nil { + fmt.Printf("--- join type = %s onExpr = %q seed = %d run = %d ---\n", + testSpec.joinType.String(), onExpr.Expr, seed, run) + fmt.Printf("--- left ordering = %v right ordering = %v ---\n", lOrderingCols, rOrderingCols) + prettyPrintTypes(lInputTypes, "left_table" /* tableName */) + prettyPrintTypes(rInputTypes, "right_table" /* tableName */) + prettyPrintInput(lRows, lInputTypes, "left_table" /* tableName */) + prettyPrintInput(rRows, rInputTypes, "right_table" /* tableName */) + t.Fatal(err) + } + if onExpr.Expr == "" { + triedWithoutOnExpr = true + } else { + triedWithOnExpr = true + } } } } @@ -979,16 +960,6 @@ func generateColumnOrdering( return orderingCols } -func getAddFilterOptions(joinType descpb.JoinType, nonEqualityColsPresent bool) []bool { - if joinType.IsSetOpJoin() && nonEqualityColsPresent { - // Output of set operation join when rows have non equality columns is - // not deterministic, so applying a filter on top of it can produce - // arbitrary results, and we skip such configuration. - return []bool{false} - } - return []bool{false, true} -} - // generateFilterExpr populates an execinfrapb.Expression that contains a // single comparison which can be either comparing a column from the left // against a column from the right or comparing a column from either side diff --git a/pkg/sql/execinfra/processorsbase.go b/pkg/sql/execinfra/processorsbase.go index 0ec8762e6574..8f3c016fab91 100644 --- a/pkg/sql/execinfra/processorsbase.go +++ b/pkg/sql/execinfra/processorsbase.go @@ -60,9 +60,6 @@ type ProcOutputHelper struct { // post-processed row directly. output RowReceiver RowAlloc rowenc.EncDatumRowAlloc - // filter is an optional filter that determines whether a single row is - // output or not. - filter *execinfrapb.ExprHelper // renderExprs has length > 0 if we have a rendering. Only one of renderExprs // and outputCols can be set. renderExprs []execinfrapb.ExprHelper @@ -120,12 +117,6 @@ func (h *ProcOutputHelper) Init( } h.output = output h.numInternalCols = len(coreOutputTypes) - if post.Filter != (execinfrapb.Expression{}) { - h.filter = &execinfrapb.ExprHelper{} - if err := h.filter.Init(post.Filter, coreOutputTypes, semaCtx, evalCtx); err != nil { - return err - } - } if post.Projection { for _, col := range post.OutputColumns { if int(col) >= h.numInternalCols { @@ -203,12 +194,6 @@ func (h *ProcOutputHelper) NeededColumns() (colIdxs util.FastIntSet) { } for i := 0; i < h.numInternalCols; i++ { - // See if filter requires this column. - if h.filter != nil && h.filter.Vars.IndexedVarUsed(i) { - colIdxs.Add(i) - continue - } - // See if render expressions require this column. for j := range h.renderExprs { if h.renderExprs[j].Vars.IndexedVarUsed(i) { @@ -285,19 +270,6 @@ func (h *ProcOutputHelper) ProcessRow( return nil, false, nil } - if h.filter != nil { - // Filtering. - passes, err := h.filter.EvalFilter(row) - if err != nil { - return nil, false, err - } - if !passes { - if log.V(4) { - log.Infof(ctx, "filtered out row %s", row.String(h.filter.Types)) - } - return nil, true, nil - } - } h.rowIdx++ if h.rowIdx <= h.offset { // Suppress row. diff --git a/pkg/sql/execinfra/readerbase.go b/pkg/sql/execinfra/readerbase.go index b3e7999b571d..06c99f776a6a 100644 --- a/pkg/sql/execinfra/readerbase.go +++ b/pkg/sql/execinfra/readerbase.go @@ -53,11 +53,6 @@ func LimitHint(specLimitHint int64, post *execinfrapb.PostProcessSpec) (limitHin limitHint = specLimitHint + RowChannelBufSize + 1 } - if !post.Filter.Empty() { - // We have a filter so we will likely need to read more rows. - limitHint *= 2 - } - return limitHint } diff --git a/pkg/sql/execinfra/version.go b/pkg/sql/execinfra/version.go index 7b67c3a17b93..db428cfbf876 100644 --- a/pkg/sql/execinfra/version.go +++ b/pkg/sql/execinfra/version.go @@ -39,11 +39,11 @@ import "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" // // ATTENTION: When updating these fields, add a brief description of what // changed to the version history below. -const Version execinfrapb.DistSQLVersion = 42 +const Version execinfrapb.DistSQLVersion = 43 // MinAcceptedVersion is the oldest version that the server is compatible with. // A server will not accept flows with older versions. -const MinAcceptedVersion execinfrapb.DistSQLVersion = 42 +const MinAcceptedVersion execinfrapb.DistSQLVersion = 43 /* @@ -51,6 +51,10 @@ const MinAcceptedVersion execinfrapb.DistSQLVersion = 42 Please add new entries at the top. +- Version: 43 (MinAcceptedVersion: 43) + - Filter was removed from PostProcessSpec and a new Filterer processor was + added. + - Version: 42 (MinAcceptedVersion: 42) - A new field NeededColumns is added to TableReaderSpec which is now required by the vectorized ColBatchScans to be set up. diff --git a/pkg/sql/execinfrapb/flow_diagram.go b/pkg/sql/execinfrapb/flow_diagram.go index 21ae42368f66..814d4c9ac473 100644 --- a/pkg/sql/execinfrapb/flow_diagram.go +++ b/pkg/sql/execinfrapb/flow_diagram.go @@ -430,9 +430,6 @@ func (post *PostProcessSpec) summary() []string { // (namely InterleavedReaderJoiner) that have multiple PostProcessors. func (post *PostProcessSpec) summaryWithPrefix(prefix string) []string { var res []string - if !post.Filter.Empty() { - res = append(res, fmt.Sprintf("%sFilter: %s", prefix, post.Filter)) - } if post.Projection { outputColumns := "None" if len(post.OutputColumns) > 0 { diff --git a/pkg/sql/execinfrapb/flow_diagram_test.go b/pkg/sql/execinfrapb/flow_diagram_test.go index 5a03be98cea1..394daf7827fd 100644 --- a/pkg/sql/execinfrapb/flow_diagram_test.go +++ b/pkg/sql/execinfrapb/flow_diagram_test.go @@ -122,7 +122,6 @@ func TestPlanDiagramIndexJoin(t *testing.T) { }}, Core: ProcessorCoreUnion{JoinReader: &JoinReaderSpec{Table: *desc}}, Post: PostProcessSpec{ - Filter: Expression{Expr: "@1+@2<@3"}, Projection: true, OutputColumns: []uint32{2}, }, @@ -149,7 +148,7 @@ func TestPlanDiagramIndexJoin(t *testing.T) { {"nodeIdx":0,"inputs":[],"core":{"title":"TableReader/0","details":["Table@SomeIndex","Out: @1,@2"]},"outputs":[],"stage":1}, {"nodeIdx":1,"inputs":[],"core":{"title":"TableReader/1","details":["Table@SomeIndex","Out: @1,@2"]},"outputs":[],"stage":1}, {"nodeIdx":2,"inputs":[],"core":{"title":"TableReader/2","details":["Table@SomeIndex","Out: @1,@2"]},"outputs":[],"stage":1}, - {"nodeIdx":2,"inputs":[{"title":"ordered","details":["@2+"]}],"core":{"title":"JoinReader/3","details":["Table@primary","Filter: @1+@2\u003c@3","Out: @3"]},"outputs":[],"stage":2}, + {"nodeIdx":2,"inputs":[{"title":"ordered","details":["@2+"]}],"core":{"title":"JoinReader/3","details":["Table@primary","Out: @3"]},"outputs":[],"stage":2}, {"nodeIdx":2,"inputs":[],"core":{"title":"Response","details":[]},"outputs":[]} ], "edges":[ @@ -163,7 +162,7 @@ func TestPlanDiagramIndexJoin(t *testing.T) { compareDiagrams(t, json, expected) - expectedURL := "https://cockroachdb.github.io/distsqlplan/decode.html#eJy0ksFLwzAUxu_-FeO77oFt4imnXiZO1OnmTXuozWMUuqQmKUxG_3dpKm6DTSbTY_L1e79fH9nAv9dQWMzuJ6PF093oZjKfgGCs5odixR7qBSkIAgSJnNA4W7L31vXRJn441WuohFCZpg39dU4orWOoDUIVaobCc_FW85wLze4yAUFzKKo6jo9RtrArnhrNaxBmbVCjLKVMIO8Itg3bwT4US4ZKO9qBp6fD0z-Hi9Ph4l_hW6Z1mh3rfVomxsi7A4a3tjJfgvKQYOOqVeE-QLiu6sCuNxxn4rVNEllm8ltbHnUWv1nYnH1jjec9lWOTk_6HWC95WIC3rSv50dkyvsjhOIu9eKHZhyGVw2FqYhSXultOzymLc8ryx_LVXjnp8u7iMwAA__-WuTh_" + expectedURL := "https://cockroachdb.github.io/distsqlplan/decode.html#eJy0ksFq8zAQhO__U4S5_oJack86-RJoStu0cW_FB9VagsGWXEmGFON3L5ZLE0NSUtIed8cz33hRD_9WQyJf3y8X-dPd4ma5WYLBWE0PqiEP-QIOBgGGFAVD62xJ3ls3Sn38cKV3kAlDZdoujOuCobSOIHuEKtQEiWf1WtOGlCZ3lYBBU1BVHeOjlOW2oZXRtAPDugtykXGWCRQDg-3CPtgHtSVIPrADOD8fzn8dLs6Hiz-F75nWaXKk57RM_EcxHGl4ayvzWTA9VrB1VaPc-1e99GQ38ZPDbMi31niaIU8lJ2Nx0luaftTbzpX06GwZX940rqMvLjT5MKnpNKxMlOLxDs38ErO4xJx-a76emZOhGP59BAAA___j2TIH" if url.String() != expectedURL { t.Errorf("expected `%s` got `%s`", expectedURL, url.String()) } diff --git a/pkg/sql/execinfrapb/processors_base.pb.go b/pkg/sql/execinfrapb/processors_base.pb.go index fa88bade0a13..f53b880aa7c2 100644 --- a/pkg/sql/execinfrapb/processors_base.pb.go +++ b/pkg/sql/execinfrapb/processors_base.pb.go @@ -27,13 +27,10 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package -// PostProcessSpec describes the processing required to obtain the output -// (filtering, projection). It operates on the internal schema of the processor -// (see ProcessorSpec). +// PostProcessSpec describes the processing required to obtain the output (e.g. +// projection). It operates on the internal schema of the processor (see +// ProcessorSpec). type PostProcessSpec struct { - // A filtering expression which references the internal columns of the - // processor via ordinal references (@1, @2, etc). - Filter Expression `protobuf:"bytes,1,opt,name=filter" json:"filter"` // If true, output_columns describes a projection. Used to differentiate // between an empty projection and no projection. // @@ -61,7 +58,7 @@ func (m *PostProcessSpec) Reset() { *m = PostProcessSpec{} } func (m *PostProcessSpec) String() string { return proto.CompactTextString(m) } func (*PostProcessSpec) ProtoMessage() {} func (*PostProcessSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_processors_base_77125fa0b0ed50f0, []int{0} + return fileDescriptor_processors_base_2f9dd97fffc5def6, []int{0} } func (m *PostProcessSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -94,7 +91,7 @@ func (m *Columns) Reset() { *m = Columns{} } func (m *Columns) String() string { return proto.CompactTextString(m) } func (*Columns) ProtoMessage() {} func (*Columns) Descriptor() ([]byte, []int) { - return fileDescriptor_processors_base_77125fa0b0ed50f0, []int{1} + return fileDescriptor_processors_base_2f9dd97fffc5def6, []int{1} } func (m *Columns) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -130,7 +127,7 @@ func (m *TableReaderSpan) Reset() { *m = TableReaderSpan{} } func (m *TableReaderSpan) String() string { return proto.CompactTextString(m) } func (*TableReaderSpan) ProtoMessage() {} func (*TableReaderSpan) Descriptor() ([]byte, []int) { - return fileDescriptor_processors_base_77125fa0b0ed50f0, []int{2} + return fileDescriptor_processors_base_2f9dd97fffc5def6, []int{2} } func (m *TableReaderSpan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,14 +172,6 @@ func (m *PostProcessSpec) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintProcessorsBase(dAtA, i, uint64(m.Filter.Size())) - n1, err := m.Filter.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 dAtA[i] = 0x10 i++ if m.Projection { @@ -192,21 +181,21 @@ func (m *PostProcessSpec) MarshalTo(dAtA []byte) (int, error) { } i++ if len(m.OutputColumns) > 0 { - dAtA3 := make([]byte, len(m.OutputColumns)*10) - var j2 int + dAtA2 := make([]byte, len(m.OutputColumns)*10) + var j1 int for _, num := range m.OutputColumns { for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j2++ + j1++ } - dAtA3[j2] = uint8(num) - j2++ + dAtA2[j1] = uint8(num) + j1++ } dAtA[i] = 0x1a i++ - i = encodeVarintProcessorsBase(dAtA, i, uint64(j2)) - i += copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintProcessorsBase(dAtA, i, uint64(j1)) + i += copy(dAtA[i:], dAtA2[:j1]) } if len(m.RenderExprs) > 0 { for _, msg := range m.RenderExprs { @@ -245,21 +234,21 @@ func (m *Columns) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if len(m.Columns) > 0 { - dAtA5 := make([]byte, len(m.Columns)*10) - var j4 int + dAtA4 := make([]byte, len(m.Columns)*10) + var j3 int for _, num := range m.Columns { for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j4++ + j3++ } - dAtA5[j4] = uint8(num) - j4++ + dAtA4[j3] = uint8(num) + j3++ } dAtA[i] = 0xa i++ - i = encodeVarintProcessorsBase(dAtA, i, uint64(j4)) - i += copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintProcessorsBase(dAtA, i, uint64(j3)) + i += copy(dAtA[i:], dAtA4[:j3]) } return i, nil } @@ -282,11 +271,11 @@ func (m *TableReaderSpan) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintProcessorsBase(dAtA, i, uint64(m.Span.Size())) - n6, err := m.Span.MarshalTo(dAtA[i:]) + n5, err := m.Span.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n5 return i, nil } @@ -305,8 +294,6 @@ func (m *PostProcessSpec) Size() (n int) { } var l int _ = l - l = m.Filter.Size() - n += 1 + l + sovProcessorsBase(uint64(l)) n += 2 if len(m.OutputColumns) > 0 { l = 0 @@ -395,36 +382,6 @@ func (m *PostProcessSpec) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: PostProcessSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProcessorsBase - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProcessorsBase - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Projection", wireType) @@ -917,33 +874,33 @@ var ( ) func init() { - proto.RegisterFile("sql/execinfrapb/processors_base.proto", fileDescriptor_processors_base_77125fa0b0ed50f0) + proto.RegisterFile("sql/execinfrapb/processors_base.proto", fileDescriptor_processors_base_2f9dd97fffc5def6) } -var fileDescriptor_processors_base_77125fa0b0ed50f0 = []byte{ - // 376 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0xae, 0xd3, 0x30, - 0x10, 0x86, 0xe3, 0x36, 0xaf, 0x0f, 0xb9, 0x3c, 0x8a, 0x2c, 0x24, 0xa2, 0xa8, 0x32, 0x51, 0x55, - 0x44, 0x58, 0x90, 0x0a, 0x8e, 0x10, 0x60, 0x89, 0x54, 0xb5, 0xac, 0xd8, 0x54, 0xae, 0xe3, 0x94, - 0x40, 0x6a, 0xbb, 0x1e, 0x47, 0xea, 0x31, 0xb8, 0x09, 0xd7, 0xe8, 0xb2, 0xcb, 0xae, 0x10, 0xa4, - 0x17, 0x41, 0xad, 0x13, 0x14, 0x90, 0x58, 0xbc, 0xdd, 0xe8, 0x9b, 0xf9, 0x3d, 0x9f, 0x6c, 0xe3, - 0xe7, 0xb0, 0x2b, 0x67, 0x62, 0x2f, 0x78, 0x21, 0x73, 0xc3, 0xf4, 0x7a, 0xa6, 0x8d, 0xe2, 0x02, - 0x40, 0x19, 0x58, 0xad, 0x19, 0x88, 0x44, 0x1b, 0x65, 0x15, 0x09, 0xb8, 0xe2, 0x5f, 0x8d, 0x62, - 0xfc, 0x73, 0x02, 0xbb, 0x32, 0xc9, 0x0a, 0xb0, 0xb0, 0x2b, 0x4d, 0x25, 0xc3, 0xf0, 0xdf, 0x03, - 0x32, 0x66, 0x99, 0x4b, 0x85, 0xe4, 0x9a, 0xf8, 0x9b, 0x3d, 0xd9, 0xa8, 0x8d, 0xba, 0x96, 0xb3, - 0x4b, 0xe5, 0xe8, 0xe4, 0x7b, 0x0f, 0x8f, 0xe6, 0x0a, 0xec, 0xdc, 0x6d, 0x5f, 0x6a, 0xc1, 0x49, - 0x8a, 0x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, 0x45, 0x3f, 0x6b, 0x8a, 0xbe, 0x9d, 0xa9, 0x77, - 0x3c, 0x53, 0xef, 0x74, 0xa6, 0xde, 0xa7, 0x61, 0xe7, 0x13, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, - 0x6d, 0xe2, 0x8a, 0x1e, 0x57, 0x02, 0x00, 0x00, +var fileDescriptor_processors_base_2f9dd97fffc5def6 = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0xce, 0xd2, 0x40, + 0x14, 0xc5, 0x3b, 0x50, 0xfe, 0x64, 0x2a, 0x42, 0x26, 0x26, 0x36, 0x0d, 0x19, 0x1b, 0x82, 0xb1, + 0x2e, 0x2c, 0x91, 0x47, 0x40, 0xdd, 0x98, 0x98, 0x10, 0x70, 0xe5, 0x86, 0x0c, 0xd3, 0x01, 0xab, + 0x65, 0x66, 0x98, 0x3b, 0x4d, 0x78, 0x0c, 0x1f, 0x8b, 0x25, 0x4b, 0x56, 0x46, 0xcb, 0x13, 0xf8, + 0x06, 0x06, 0x5a, 0x4c, 0xfd, 0x92, 0x6f, 0x77, 0xf3, 0xbb, 0xe7, 0xf4, 0x9c, 0xdb, 0xc1, 0x2f, + 0x61, 0x9f, 0x4d, 0xc4, 0x41, 0xf0, 0x54, 0x6e, 0x0c, 0xd3, 0xeb, 0x89, 0x36, 0x8a, 0x0b, 0x00, + 0x65, 0x60, 0xb5, 0x66, 0x20, 0x62, 0x6d, 0x94, 0x55, 0xc4, 0xe7, 0x8a, 0x7f, 0x37, 0x8a, 0xf1, + 0xaf, 0x31, 0xec, 0xb3, 0x38, 0x49, 0xc1, 0xc2, 0x3e, 0x33, 0xb9, 0x0c, 0x82, 0x87, 0x1f, 0x48, + 0x98, 0x65, 0xa5, 0x2b, 0x20, 0x37, 0xc7, 0xff, 0xec, 0xd9, 0x56, 0x6d, 0xd5, 0x6d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37, 0xe9, 0xec, 0xcd, 0xf1, 0x37, 0x75, 0x8e, 0x05, 0x45, 0xa7, 0x82, 0xa2, + 0x73, 0x41, 0xd1, 0xaf, 0x82, 0xa2, 0x1f, 0x17, 0xea, 0x9c, 0x2e, 0xd4, 0x39, 0x5f, 0xa8, 0xf3, + 0xc5, 0xab, 0x3d, 0xe3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0xd4, 0xc6, 0xca, 0x19, 0x02, + 0x00, 0x00, } diff --git a/pkg/sql/execinfrapb/processors_base.proto b/pkg/sql/execinfrapb/processors_base.proto index 092e06bf6066..a11766ad5606 100644 --- a/pkg/sql/execinfrapb/processors_base.proto +++ b/pkg/sql/execinfrapb/processors_base.proto @@ -23,14 +23,10 @@ import "sql/execinfrapb/data.proto"; import "roachpb/data.proto"; import "gogoproto/gogo.proto"; -// PostProcessSpec describes the processing required to obtain the output -// (filtering, projection). It operates on the internal schema of the processor -// (see ProcessorSpec). +// PostProcessSpec describes the processing required to obtain the output (e.g. +// projection). It operates on the internal schema of the processor (see +// ProcessorSpec). message PostProcessSpec { - // A filtering expression which references the internal columns of the - // processor via ordinal references (@1, @2, etc). - optional Expression filter = 1 [(gogoproto.nullable) = false]; - // If true, output_columns describes a projection. Used to differentiate // between an empty projection and no projection. // @@ -56,6 +52,8 @@ message PostProcessSpec { // If nonzero, the processor will stop after emitting this many rows. The rows // suppressed by <offset>, if any, do not count towards this limit. optional uint64 limit = 6 [(gogoproto.nullable) = false]; + + reserved 1; } message Columns { diff --git a/pkg/sql/flowinfra/server_test.go b/pkg/sql/flowinfra/server_test.go index 23aad9f6ad5a..9d9f909ac0ce 100644 --- a/pkg/sql/flowinfra/server_test.go +++ b/pkg/sql/flowinfra/server_test.go @@ -58,7 +58,6 @@ func TestServer(t *testing.T) { Spans: []execinfrapb.TableReaderSpan{{Span: td.PrimaryIndexSpan(keys.SystemSQLCodec)}}, } post := execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@1 != 2"}, // a != 2 Projection: true, OutputColumns: []uint32{0, 1}, // a } @@ -113,7 +112,7 @@ func TestServer(t *testing.T) { t.Errorf("unexpected metadata: %v", metas) } str := rows.String(rowenc.TwoIntCols) - expected := "[[1 10] [3 30]]" + expected := "[[1 10] [2 20] [3 30]]" if str != expected { t.Errorf("invalid results: %s, expected %s'", str, expected) } diff --git a/pkg/sql/physicalplan/physical_plan.go b/pkg/sql/physicalplan/physical_plan.go index 4dbc29b225ee..5c3f6eab4bdb 100644 --- a/pkg/sql/physicalplan/physical_plan.go +++ b/pkg/sql/physicalplan/physical_plan.go @@ -440,8 +440,7 @@ func (p *PhysicalPlan) CheckLastStagePost() error { // verify this assumption. for i := 1; i < len(p.ResultRouters); i++ { pi := &p.Processors[p.ResultRouters[i]].Spec.Post - if pi.Filter != post.Filter || - pi.Projection != post.Projection || + if pi.Projection != post.Projection || len(pi.OutputColumns) != len(post.OutputColumns) || len(pi.RenderExprs) != len(post.RenderExprs) { return errors.Errorf("inconsistent post-processing: %v vs %v", post, pi) diff --git a/pkg/sql/physicalplan/physical_plan_test.go b/pkg/sql/physicalplan/physical_plan_test.go index 4c5b98ef7723..873666418085 100644 --- a/pkg/sql/physicalplan/physical_plan_test.go +++ b/pkg/sql/physicalplan/physical_plan_test.go @@ -351,7 +351,6 @@ func TestProjectionAndRendering(t *testing.T) { // expressions, however, we don't do that for the expected results. In // order to be able to use the deep comparison below we manually unset // that unserialized field. - post.Filter.LocalExpr = nil for i := range post.RenderExprs { post.RenderExprs[i].LocalExpr = nil } diff --git a/pkg/sql/rowenc/testutils.go b/pkg/sql/rowenc/testutils.go index c42522f585ca..e3af5131db9a 100644 --- a/pkg/sql/rowenc/testutils.go +++ b/pkg/sql/rowenc/testutils.go @@ -1619,11 +1619,6 @@ func IntEncDatum(i int) EncDatum { return EncDatum{Datum: tree.NewDInt(tree.DInt(i))} } -// StrEncDatum returns an EncDatum representation of DString(s). -func StrEncDatum(s string) EncDatum { - return EncDatum{Datum: tree.NewDString(s)} -} - // NullEncDatum returns and EncDatum representation of tree.DNull. func NullEncDatum() EncDatum { return EncDatum{Datum: tree.DNull} diff --git a/pkg/sql/rowexec/joinreader_test.go b/pkg/sql/rowexec/joinreader_test.go index 483ababf6fad..ca2fd90082c0 100644 --- a/pkg/sql/rowexec/joinreader_test.go +++ b/pkg/sql/rowexec/joinreader_test.go @@ -1085,33 +1085,6 @@ func TestIndexJoiner(t *testing.T) { {v[1], v[5], v[6]}, }, }, - { - description: "Test a filter in the post process spec and using a secondary index", - desc: td.TableDesc(), - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@3 <= 5"}, // sum <= 5 - Projection: true, - OutputColumns: []uint32{3}, - }, - input: rowenc.EncDatumRows{ - {v[0], v[1]}, - {v[2], v[5]}, - {v[0], v[5]}, - {v[2], v[1]}, - {v[3], v[4]}, - {v[1], v[3]}, - {v[5], v[1]}, - {v[5], v[0]}, - }, - outputTypes: []*types.T{types.String}, - expected: rowenc.EncDatumRows{ - {rowenc.StrEncDatum("one")}, - {rowenc.StrEncDatum("five")}, - {rowenc.StrEncDatum("two-one")}, - {rowenc.StrEncDatum("one-three")}, - {rowenc.StrEncDatum("five-zero")}, - }, - }, { description: "Test selecting rows using the primary index with multiple family spans", desc: tdf.TableDesc(), diff --git a/pkg/sql/rowexec/processors_test.go b/pkg/sql/rowexec/processors_test.go index 9fef1d073f54..fad5ef45db8b 100644 --- a/pkg/sql/rowexec/processors_test.go +++ b/pkg/sql/rowexec/processors_test.go @@ -82,16 +82,6 @@ func TestPostProcess(t *testing.T) { expected: "[[0 1 2] [0 1 3] [0 1 4] [0 2 3] [0 2 4] [0 3 4] [1 2 3] [1 2 4] [1 3 4] [2 3 4]]", }, - // Filter. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@1 = 1"}, - }, - outputTypes: rowenc.ThreeIntCols, - expNeededCols: []int{0, 1, 2}, - expected: "[[1 2 3] [1 2 4] [1 3 4]]", - }, - // Projection. { post: execinfrapb.PostProcessSpec{ @@ -103,30 +93,6 @@ func TestPostProcess(t *testing.T) { expected: "[[0 2] [0 3] [0 4] [0 3] [0 4] [0 4] [1 3] [1 4] [1 4] [2 4]]", }, - // Filter and projection; filter only refers to projected column. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@1 = 1"}, - Projection: true, - OutputColumns: []uint32{0, 2}, - }, - outputTypes: rowenc.TwoIntCols, - expNeededCols: []int{0, 2}, - expected: "[[1 3] [1 4] [1 4]]", - }, - - // Filter and projection; filter refers to non-projected column. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@2 = 2"}, - Projection: true, - OutputColumns: []uint32{0, 2}, - }, - outputTypes: rowenc.TwoIntCols, - expNeededCols: []int{0, 1, 2}, - expected: "[[0 3] [0 4] [1 3] [1 4]]", - }, - // Rendering. { post: execinfrapb.PostProcessSpec{ @@ -137,28 +103,6 @@ func TestPostProcess(t *testing.T) { expected: "[[0 1 1] [0 1 1] [0 1 1] [0 2 2] [0 2 2] [0 3 3] [1 2 3] [1 2 3] [1 3 4] [2 3 5]]", }, - // Rendering and filtering; filter refers to column used in rendering. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@2 = 2"}, - RenderExprs: []execinfrapb.Expression{{Expr: "@1"}, {Expr: "@2"}, {Expr: "@1 + @2"}}, - }, - outputTypes: rowenc.ThreeIntCols, - expNeededCols: []int{0, 1}, - expected: "[[0 2 2] [0 2 2] [1 2 3] [1 2 3]]", - }, - - // Rendering and filtering; filter refers to column not used in rendering. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@3 = 4"}, - RenderExprs: []execinfrapb.Expression{{Expr: "@1"}, {Expr: "@2"}, {Expr: "@1 + @2"}}, - }, - outputTypes: rowenc.ThreeIntCols, - expNeededCols: []int{0, 1, 2}, - expected: "[[0 1 1] [0 2 2] [0 3 3] [1 2 3] [1 3 4] [2 3 5]]", - }, - // More complex rendering expressions. { post: execinfrapb.PostProcessSpec{ @@ -246,28 +190,6 @@ func TestPostProcess(t *testing.T) { expNeededCols: []int{0, 1, 2}, expected: "[[0 2 3] [0 2 4] [0 3 4] [1 2 3] [1 2 4] [1 3 4] [2 3 4]]", }, - - // Filter + offset. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@1 = 1"}, - Offset: 1, - }, - outputTypes: rowenc.ThreeIntCols, - expNeededCols: []int{0, 1, 2}, - expected: "[[1 2 4] [1 3 4]]", - }, - - // Filter + limit. - { - post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@1 = 1"}, - Limit: 2, - }, - outputTypes: rowenc.ThreeIntCols, - expNeededCols: []int{0, 1, 2}, - expected: "[[1 2 3] [1 2 4]]", - }, } for tcIdx, tc := range testCases { diff --git a/pkg/sql/rowexec/sorter.go b/pkg/sql/rowexec/sorter.go index 17d9e8a00b5b..4411b5c0972a 100644 --- a/pkg/sql/rowexec/sorter.go +++ b/pkg/sql/rowexec/sorter.go @@ -152,7 +152,7 @@ func newSorter( output execinfra.RowReceiver, ) (execinfra.Processor, error) { count := uint64(0) - if post.Limit != 0 && post.Filter.Empty() { + if post.Limit != 0 { // The sorter needs to produce Offset + Limit rows. The ProcOutputHelper // will discard the first Offset ones. if post.Limit <= math.MaxUint64-post.Offset { diff --git a/pkg/sql/rowexec/sorter_test.go b/pkg/sql/rowexec/sorter_test.go index ff3cb74e500a..3d23fa14fe34 100644 --- a/pkg/sql/rowexec/sorter_test.go +++ b/pkg/sql/rowexec/sorter_test.go @@ -137,34 +137,6 @@ func TestSorter(t *testing.T) { {v[3], v[2], v[0]}, {v[3], v[3], v[0]}, }, - }, { - name: "SortFilterExpr", - // No specified input ordering but specified postprocess filter expression. - spec: execinfrapb.SorterSpec{ - OutputOrdering: execinfrapb.ConvertToSpecOrdering( - colinfo.ColumnOrdering{ - {ColIdx: 0, Direction: asc}, - {ColIdx: 1, Direction: asc}, - {ColIdx: 2, Direction: asc}, - }), - }, - post: execinfrapb.PostProcessSpec{Filter: execinfrapb.Expression{Expr: "@1 + @2 < 7"}}, - types: rowenc.ThreeIntCols, - input: rowenc.EncDatumRows{ - {v[3], v[3], v[0]}, - {v[3], v[4], v[1]}, - {v[1], v[0], v[4]}, - {v[0], v[0], v[0]}, - {v[4], v[4], v[4]}, - {v[4], v[4], v[5]}, - {v[3], v[2], v[0]}, - }, - expected: rowenc.EncDatumRows{ - {v[0], v[0], v[0]}, - {v[1], v[0], v[4]}, - {v[3], v[2], v[0]}, - {v[3], v[3], v[0]}, - }, }, { name: "SortMatchOrderingNoLimit", // Specified match ordering length but no specified limit. diff --git a/pkg/sql/rowexec/tablereader_test.go b/pkg/sql/rowexec/tablereader_test.go index bc8efef32249..3e8abc08b0ae 100644 --- a/pkg/sql/rowexec/tablereader_test.go +++ b/pkg/sql/rowexec/tablereader_test.go @@ -64,7 +64,7 @@ func TestTableReader(t *testing.T) { sqlutils.CreateTable(t, sqlDB, "t", "a INT, b INT, sum INT, s STRING, PRIMARY KEY (a,b), INDEX bs (b,s)", - 99, + 19, sqlutils.ToRowFn(aFn, bFn, sumFn, sqlutils.RowEnglishFn)) td := catalogkv.TestingGetTableDescriptor(kvDB, keys.SystemSQLCodec, "test", "t") @@ -88,23 +88,21 @@ func TestTableReader(t *testing.T) { Spans: []execinfrapb.TableReaderSpan{{Span: td.PrimaryIndexSpan(keys.SystemSQLCodec)}}, }, post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@3 < 5 AND @2 != 3"}, // sum < 5 && b != 3 Projection: true, OutputColumns: []uint32{0, 1}, }, - expected: "[[0 1] [0 2] [0 4] [1 0] [1 1] [1 2] [2 0] [2 1] [2 2] [3 0] [3 1] [4 0]]", + expected: "[[0 1] [0 2] [0 3] [0 4] [0 5] [0 6] [0 7] [0 8] [0 9] [1 0] [1 1] [1 2] [1 3] [1 4] [1 5] [1 6] [1 7] [1 8] [1 9]]", }, { spec: execinfrapb.TableReaderSpec{ Spans: []execinfrapb.TableReaderSpan{{Span: td.PrimaryIndexSpan(keys.SystemSQLCodec)}}, }, post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@3 < 5 AND @2 != 3"}, Projection: true, OutputColumns: []uint32{3}, // s Limit: 4, }, - expected: "[['one'] ['two'] ['four'] ['one-zero']]", + expected: "[['one'] ['two'] ['three'] ['four']]", }, { spec: execinfrapb.TableReaderSpec{ @@ -114,11 +112,10 @@ func TestTableReader(t *testing.T) { LimitHint: 1, }, post: execinfrapb.PostProcessSpec{ - Filter: execinfrapb.Expression{Expr: "@1 < 3"}, // sum < 8 Projection: true, OutputColumns: []uint32{0, 1}, }, - expected: "[[2 5] [1 5] [0 5] [2 4] [1 4] [0 4]]", + expected: "[[1 5] [0 5] [1 4] [0 4]]", }, }
35625de29db2ba4ee285da70c94e897d9cb07322
2024-10-21 23:48:47
Jackson Owens
roachprod: update default CockroachDB logging configuration
false
update default CockroachDB logging configuration
roachprod
diff --git a/pkg/roachprod/install/files/cockroachdb-logging.yaml b/pkg/roachprod/install/files/cockroachdb-logging.yaml index 7fdf4e6889bc..ba57e161e919 100644 --- a/pkg/roachprod/install/files/cockroachdb-logging.yaml +++ b/pkg/roachprod/install/files/cockroachdb-logging.yaml @@ -35,13 +35,13 @@ sinks: channels: [STORAGE] security: channels: [PRIVILEGES, USER_ADMIN] - auditable: true + auditable: false sql-audit: channels: [SENSITIVE_ACCESS] - auditable: true + auditable: false sql-auth: channels: [SESSIONS] - auditable: true + auditable: false sql-exec: channels: [SQL_EXEC] sql-slow:
496948e5539011ba138c967e49e9b3046060b77c
2023-08-10 22:13:45
Yevgeniy Miretskiy
roachtest: Ensure tpcc workloads runs for a bit
false
Ensure tpcc workloads runs for a bit
roachtest
diff --git a/pkg/cmd/roachtest/tests/cdc.go b/pkg/cmd/roachtest/tests/cdc.go index 566a024fb5f3..5b26a7561311 100644 --- a/pkg/cmd/roachtest/tests/cdc.go +++ b/pkg/cmd/roachtest/tests/cdc.go @@ -1327,7 +1327,10 @@ func registerCDC(r registry.Registry) { ct := newCDCTester(ctx, t, c) defer ct.Close() - ct.runTPCCWorkload(tpccArgs{warehouses: 1}) + // Run tpcc workload for tiny bit. Roachtest monitor does not + // like when there are no tasks that were started with the monitor + // (This can be removed once #108530 resolved). + ct.runTPCCWorkload(tpccArgs{warehouses: 1, duration: "30s"}) kafkaNode := ct.kafkaSinkNode() kafka := kafkaManager{
7c04561236d0d2fcaffd37fd264d06b218cffd8c
2024-04-27 02:05:25
cockroach-teamcity
ci: update bazel builder image
false
update bazel builder image
ci
diff --git a/build/.bazelbuilderversion b/build/.bazelbuilderversion index d408806dd2b4..0782538cb0bb 100644 --- a/build/.bazelbuilderversion +++ b/build/.bazelbuilderversion @@ -1 +1 @@ -us-east1-docker.pkg.dev/crl-ci-images/cockroach/bazel:20240403-181753 \ No newline at end of file +us-east1-docker.pkg.dev/crl-ci-images/cockroach/bazel:20240426-060302 \ No newline at end of file diff --git a/build/toolchains/BUILD.bazel b/build/toolchains/BUILD.bazel index 27b7ab3ffddb..5cfccd6be84a 100644 --- a/build/toolchains/BUILD.bazel +++ b/build/toolchains/BUILD.bazel @@ -32,7 +32,7 @@ platform( "@platforms//cpu:x86_64", ], exec_properties = { - "container-image": "docker://us-east1-docker.pkg.dev/crl-ci-images/cockroach/bazel@sha256:d16cbd2486fbca3ee35408f424ed51953e7853d0c48e0f58fe8e0a7382050dc2", + "container-image": "docker://us-east1-docker.pkg.dev/crl-ci-images/cockroach/bazel@sha256:1d4890141445a1237d29956cc457adffc54f9523810684ec46db5b4c47aee114", "dockerReuse": "True", "Pool": "default", }, @@ -137,7 +137,7 @@ platform( "@platforms//cpu:arm64", ], exec_properties = { - "container-image": "docker://us-east1-docker.pkg.dev/crl-ci-images/cockroach/bazel@sha256:c631626d4988f6df1a314161d639a3503e29eab23f2d679a722b7861a47aa428", + "container-image": "docker://us-east1-docker.pkg.dev/crl-ci-images/cockroach/bazel@sha256:f1a0208b72c95f8c12a1e38ce4017cce68dd6cd881a83f649e580150eddac6d4", "dockerReuse": "True", "Pool": "default", },
52afa256b26d692944c2b2543875ed423ac1abb3
2018-07-07 22:01:55
Matt Jibson
cli: add sqlfmt subcommand
false
add sqlfmt subcommand
cli
diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 40926c001693..eef6ac1336a3 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -163,6 +163,7 @@ func init() { genCmd, versionCmd, debugCmd, + sqlfmtCmd, ) } diff --git a/pkg/cli/cli_test.go b/pkg/cli/cli_test.go index 3bdea05705fe..642fb4479de3 100644 --- a/pkg/cli/cli_test.go +++ b/pkg/cli/cli_test.go @@ -1796,6 +1796,7 @@ Available Commands: gen generate auxiliary files version output version information debug debugging commands + sqlfmt format SQL statements help Help about any command Flags: @@ -2386,3 +2387,44 @@ func Example_pretty_print_numerical_strings() { // +-------+---------------------------+ // (4 rows) } + +func Example_sqlfmt() { + c := newCLITest(cliTestParams{noServer: true}) + defer c.cleanup() + + c.RunWithArgs([]string{"sqlfmt", "-e", ";"}) + c.RunWithArgs([]string{"sqlfmt", "-e", "delete from t"}) + c.RunWithArgs([]string{"sqlfmt", "-e", "delete from t", "-e", "update t set a = 1"}) + c.RunWithArgs([]string{"sqlfmt", "--print-width=10", "-e", "select 1,2,3 from a,b,c;;;select 4"}) + c.RunWithArgs([]string{"sqlfmt", "--print-width=10", "--tab-width=2", "--use-spaces", "-e", "select 1,2,3 from a,b,c;;;select 4"}) + c.RunWithArgs([]string{"sqlfmt", "-e", "select (1+2)+3"}) + c.RunWithArgs([]string{"sqlfmt", "--no-simplify", "-e", "select (1+2)+3"}) + + // Output: + // sqlfmt -e ; + // sqlfmt -e delete from t + // DELETE FROM t + // sqlfmt -e delete from t -e update t set a = 1 + // DELETE FROM t; + // UPDATE t SET a = 1; + // sqlfmt --print-width=10 -e select 1,2,3 from a,b,c;;;select 4 + // SELECT + // 1, + // 2, + // 3 + // FROM + // a, + // b, + // c; + // SELECT 4; + // sqlfmt --print-width=10 --tab-width=2 --use-spaces -e select 1,2,3 from a,b,c;;;select 4 + // SELECT + // 1, 2, 3 + // FROM + // a, b, c; + // SELECT 4; + // sqlfmt -e select (1+2)+3 + // SELECT 1 + 2 + 3 + // sqlfmt --no-simplify -e select (1+2)+3 + // SELECT (1 + 2) + 3 +} diff --git a/pkg/cli/cliflags/flags.go b/pkg/cli/cliflags/flags.go index 8c9d82070a48..933a2bdf761a 100644 --- a/pkg/cli/cliflags/flags.go +++ b/pkg/cli/cliflags/flags.go @@ -720,4 +720,24 @@ in the history of the cluster.`, When no node ID is specified, also lists all nodes that have been decommissioned in the history of the cluster.`, } + + SQLFmtLen = FlagInfo{ + Name: "print-width", + Description: `The line length where sqlfmt will try to wrap.`, + } + + SQLFmtSpaces = FlagInfo{ + Name: "use-spaces", + Description: `Indent with spaces instead of tabs.`, + } + + SQLFmtTabWidth = FlagInfo{ + Name: "tab-width", + Description: `Number of spaces per indentation level.`, + } + + SQLFmtNoSimplify = FlagInfo{ + Name: "no-simplify", + Description: `Don't simplify output.`, + } ) diff --git a/pkg/cli/context.go b/pkg/cli/context.go index 04248ee6b0ba..1361087e2f1c 100644 --- a/pkg/cli/context.go +++ b/pkg/cli/context.go @@ -23,6 +23,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/server" "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/settings/cluster" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/storage/engine" "github.com/cockroachdb/cockroach/pkg/util/log" isatty "github.com/mattn/go-isatty" @@ -115,6 +116,12 @@ func initCLIDefaults() { nodeCtx.statusShowAll = false nodeCtx.statusShowDecommission = false + sqlfmtCtx.len = tree.DefaultPrettyWidth + sqlfmtCtx.useSpaces = false + sqlfmtCtx.tabWidth = 4 + sqlfmtCtx.noSimplify = false + sqlfmtCtx.execStmts = nil + initPreFlagsDefaults() } @@ -233,3 +240,13 @@ var nodeCtx struct { statusShowDecommission bool statusShowAll bool } + +// sqlfmtCtx captures the command-line parameters of the `sqlfmt` command. +// Defaults set by InitCLIDefaults() above. +var sqlfmtCtx struct { + len int + useSpaces bool + tabWidth int + noSimplify bool + execStmts statementsValue +} diff --git a/pkg/cli/flags.go b/pkg/cli/flags.go index 9987dd3531c8..465e9a07fc55 100644 --- a/pkg/cli/flags.go +++ b/pkg/cli/flags.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/cli/cliflags" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/util/envutil" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/log/logflags" @@ -366,6 +367,13 @@ func init() { VarFlag(f, &cliCtx.tableDisplayFormat, cliflags.TableDisplayFormat) } + // sqlfmt command. + VarFlag(sqlfmtCmd.Flags(), &sqlfmtCtx.execStmts, cliflags.Execute) + IntFlag(sqlfmtCmd.Flags(), &sqlfmtCtx.len, cliflags.SQLFmtLen, tree.DefaultPrettyWidth) + BoolFlag(sqlfmtCmd.Flags(), &sqlfmtCtx.useSpaces, cliflags.SQLFmtSpaces, false) + IntFlag(sqlfmtCmd.Flags(), &sqlfmtCtx.tabWidth, cliflags.SQLFmtTabWidth, 4) + BoolFlag(sqlfmtCmd.Flags(), &sqlfmtCtx.noSimplify, cliflags.SQLFmtNoSimplify, true) + // Debug commands. { f := debugKeysCmd.Flags() diff --git a/pkg/cli/sqlfmt.go b/pkg/cli/sqlfmt.go new file mode 100644 index 000000000000..3ed730cc5d27 --- /dev/null +++ b/pkg/cli/sqlfmt.go @@ -0,0 +1,79 @@ +// Copyright 2018 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. + +package cli + +import ( + "fmt" + "io/ioutil" + "os" + + "github.com/pkg/errors" + "github.com/spf13/cobra" + + "github.com/cockroachdb/cockroach/pkg/sql/parser" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" +) + +// TODO(mjibson): This subcommand has more flags than I would prefer. My +// goal is to have it have just -e and nothing else. gofmt initially started +// with tabs/spaces and width specifiers but later regretted that decision +// and removed them. I would like to get to the point where we achieve SQL +// formatting nirvana and we make this an opinionated formatter with few or +// zero options, hopefully before 2.1. + +var sqlfmtCmd = &cobra.Command{ + Use: "sqlfmt", + Short: "format SQL statements", + Long: "Formats SQL statements from stdin to line length n.", + RunE: runSQLFmt, +} + +func runSQLFmt(cmd *cobra.Command, args []string) error { + if sqlfmtCtx.len < 1 { + return errors.Errorf("line length must be > 0: %d", sqlfmtCtx.len) + } + if sqlfmtCtx.tabWidth < 1 { + return errors.Errorf("tab width must be > 0: %d", sqlfmtCtx.tabWidth) + } + + var sl tree.StatementList + if len(sqlfmtCtx.execStmts) != 0 { + for _, exec := range sqlfmtCtx.execStmts { + stmts, err := parser.Parse(exec) + if err != nil { + return err + } + sl = append(sl, stmts...) + } + } else { + in, err := ioutil.ReadAll(os.Stdin) + if err != nil { + return err + } + sl, err = parser.Parse(string(in)) + if err != nil { + return err + } + } + + for _, s := range sl { + fmt.Print(tree.PrettyWithOpts(s, sqlfmtCtx.len, !sqlfmtCtx.useSpaces, sqlfmtCtx.tabWidth, !sqlfmtCtx.noSimplify)) + if len(sl) > 1 { + fmt.Print(";") + } + fmt.Println() + } + return nil +}
65791542165bf2dc37efa523e318b3ebe27ac237
2017-09-26 01:59:29
David Taylor
sql: note unimplemented errors raised after parsing as well
false
note unimplemented errors raised after parsing as well
sql
diff --git a/pkg/server/updates_test.go b/pkg/server/updates_test.go index 7ba58a2e6b6a..c45376d5b840 100644 --- a/pkg/server/updates_test.go +++ b/pkg/server/updates_test.go @@ -125,11 +125,21 @@ func TestReportUsage(t *testing.T) { t.Fatal(err) } } + if _, err := db.Exec(`SELECT 1::INTERVAL(1)`); !testutils.IsError( + err, "unimplemented", + ) { + t.Fatal(err) + } if _, err := db.Exec(`ALTER TABLE foo RENAME CONSTRAINT x TO y`); !testutils.IsError( err, "unimplemented", ) { t.Fatal(err) } + if _, err := db.Exec(`CREATE TABLE somestring.foo (a INT PRIMARY KEY, b INT, INDEX (b) INTERLEAVE IN PARENT foo (b))`); !testutils.IsError( + err, "unimplemented: use CREATE INDEX to make interleaved indexes", + ) { + t.Fatal(err) + } // Even queries that don't use placeholders and contain literal strings // should still not cause those strings to appear in reports. for _, q := range []string{ @@ -245,17 +255,19 @@ func TestReportUsage(t *testing.T) { t.Fatalf("reported table %d does not match: expected\n%+v got\n%+v", tbl.ID, tbl, r) } } - if expected, actual := 1, len(r.last.UnimplementedErrors); expected != actual { + if expected, actual := 3, len(r.last.UnimplementedErrors); expected != actual { t.Fatalf("expected %d unimplemented feature errors, got %d", expected, actual) } - if expected, actual := int64(10), r.last.UnimplementedErrors["alter table rename constraint"]; expected != actual { - t.Fatalf( - "unexpected %d hits to unimplemented alter table rename constrain, got %d from %v", - expected, actual, r.last.UnimplementedErrors, - ) + for _, feat := range []string{"alter table rename constraint", "simple_type const_interval", "#9148"} { + if expected, actual := int64(10), r.last.UnimplementedErrors[feat]; expected != actual { + t.Fatalf( + "unexpected %d hits to unimplemented %q, got %d from %v", + expected, feat, actual, r.last.UnimplementedErrors, + ) + } } - if expected, actual := 8, len(r.last.SqlStats); expected != actual { + if expected, actual := 9, len(r.last.SqlStats); expected != actual { t.Fatalf("expected %d queries in stats report, got %d", expected, actual) } @@ -272,6 +284,7 @@ func TestReportUsage(t *testing.T) { "": { `CREATE DATABASE _`, `CREATE TABLE _ (_ INT, CONSTRAINT _ CHECK (_ > _))`, + `CREATE TABLE _ (_ INT PRIMARY KEY, _ INT, INDEX (_) INTERLEAVE IN PARENT _ (_))`, `INSERT INTO _ VALUES (length($1::STRING))`, `INSERT INTO _ VALUES (_)`, `SELECT * FROM _ WHERE (_ = length($1::STRING)) OR (_ = $2)`, @@ -286,7 +299,7 @@ func TestReportUsage(t *testing.T) { t.Fatalf("missing stats for default app") } else { if actual, expected := len(app), len(expectedStatements); expected != actual { - t.Fatalf("expected %d statements in app %s report, got %d", expected, appName, actual) + t.Fatalf("expected %d statements in app %q report, got %d: %+v", expected, appName, actual, app) } keys := make(map[string]struct{}) for _, q := range app { diff --git a/pkg/sql/executor.go b/pkg/sql/executor.go index 860e1cb9ed82..dfec6cd779f1 100644 --- a/pkg/sql/executor.go +++ b/pkg/sql/executor.go @@ -738,11 +738,6 @@ func (e *Executor) execRequest( session.phaseTimes[sessionEndParse] = timeutil.Now() if err != nil { - if pgErr, ok := pgerror.GetPGCause(err); ok { - if pgErr.Code == pgerror.CodeFeatureNotSupportedError { - e.recordUnimplementedFeature(pgErr.InternalCommand) - } - } if log.V(2) || logStatementsExecuteEnabled.Get(&e.cfg.Settings.SV) { log.Infof(session.Ctx(), "execRequest: error: %v", err) } @@ -757,6 +752,20 @@ func (e *Executor) execRequest( return e.execParsed(session, stmts, pinfo, copymsg) } +// RecordError is called by the common error handling routine in pgwire. Since +// all pgwire errors are returned via a single helper, this is easier than +// trying to log errors in the executor itself before they're returned. +func (e *Executor) RecordError(err error) { + if err == nil { + return + } + if pgErr, ok := pgerror.GetPGCause(err); ok { + if pgErr.Code == pgerror.CodeFeatureNotSupportedError { + e.recordUnimplementedFeature(pgErr.InternalCommand) + } + } +} + // execParsed executes a batch of statements received as a unit from the client // and returns query execution errors and communication errors. func (e *Executor) execParsed( diff --git a/pkg/sql/pgwire/v3.go b/pkg/sql/pgwire/v3.go index 6a84b9b51204..be724cc5cab1 100644 --- a/pkg/sql/pgwire/v3.go +++ b/pkg/sql/pgwire/v3.go @@ -978,6 +978,7 @@ func (c *v3Conn) sendInternalError(errToSend string) error { } func (c *v3Conn) sendError(err error) error { + c.executor.RecordError(err) if c.doingExtendedQueryMessage { c.ignoreTillSync = true }
bf76e36422cb1cde1908ba5d8cdc7c15f6fbbd29
2023-12-07 20:31:42
Erik Grinaker
kvserver: reduce range descriptor iteration logging to 10 seconds
false
reduce range descriptor iteration logging to 10 seconds
kvserver
diff --git a/pkg/kv/kvserver/kvstorage/init.go b/pkg/kv/kvserver/kvstorage/init.go index c34fa9b8e74c..6ca9a5d11af7 100644 --- a/pkg/kv/kvserver/kvstorage/init.go +++ b/pkg/kv/kvserver/kvstorage/init.go @@ -268,7 +268,7 @@ func IterateRangeDescriptorsFromDisk( } lastReportTime := timeutil.Now() kvToDesc := func(kv roachpb.KeyValue) error { - const reportPeriod = 15 * time.Second + const reportPeriod = 10 * time.Second if timeutil.Since(lastReportTime) >= reportPeriod { // Note: MVCCIterate scans and buffers 1000 keys at a time which could // make the scan stats confusing. However, because this callback can't
a8434379795a3bc0446a3f2ba3afca4d2b7e17ee
2020-06-30 04:51:05
Radu Berinde
sql: remove Impure flag
false
remove Impure flag
sql
diff --git a/pkg/sql/sem/builtins/aggregate_builtins.go b/pkg/sql/sem/builtins/aggregate_builtins.go index 9b8999b98f88..efb9ed52b0d3 100644 --- a/pkg/sql/sem/builtins/aggregate_builtins.go +++ b/pkg/sql/sem/builtins/aggregate_builtins.go @@ -38,9 +38,6 @@ func initAggregateBuiltins() { panic("duplicate builtin: " + k) } - if !v.props.Impure { - panic(fmt.Sprintf("%s: aggregate functions should all be impure, found %v", k, v)) - } if v.props.Class != tree.AggregateClass { panic(fmt.Sprintf("%s: aggregate functions should be marked with the tree.AggregateClass "+ "function class, found %v", k, v)) @@ -61,7 +58,7 @@ func initAggregateBuiltins() { } func aggProps() tree.FunctionProperties { - return tree.FunctionProperties{Class: tree.AggregateClass, Impure: true} + return tree.FunctionProperties{Class: tree.AggregateClass} } func aggPropsNullableArgs() tree.FunctionProperties { diff --git a/pkg/sql/sem/builtins/builtins.go b/pkg/sql/sem/builtins/builtins.go index 5d8bda8e8a6a..dbb876c1ddab 100644 --- a/pkg/sql/sem/builtins/builtins.go +++ b/pkg/sql/sem/builtins/builtins.go @@ -493,7 +493,6 @@ var builtins = map[string]builtinDefinition{ "gen_random_uuid": makeBuiltin( tree.FunctionProperties{ Category: categoryIDGeneration, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{}, @@ -1714,9 +1713,7 @@ CockroachDB supports the following flags: ), "random": makeBuiltin( - tree.FunctionProperties{ - Impure: true, - }, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.Float), @@ -1731,7 +1728,6 @@ CockroachDB supports the following flags: "unique_rowid": makeBuiltin( tree.FunctionProperties{ Category: categoryIDGeneration, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{}, @@ -1754,7 +1750,6 @@ CockroachDB supports the following flags: tree.FunctionProperties{ Category: categorySequences, DistsqlBlocklist: true, - Impure: true, HasSequenceArguments: true, }, tree.Overload{ @@ -1781,7 +1776,6 @@ CockroachDB supports the following flags: tree.FunctionProperties{ Category: categorySequences, DistsqlBlocklist: true, - Impure: true, HasSequenceArguments: true, }, tree.Overload{ @@ -1807,7 +1801,6 @@ CockroachDB supports the following flags: "lastval": makeBuiltin( tree.FunctionProperties{ Category: categorySequences, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{}, @@ -1830,7 +1823,6 @@ CockroachDB supports the following flags: tree.FunctionProperties{ Category: categorySequences, DistsqlBlocklist: true, - Impure: true, HasSequenceArguments: true, }, tree.Overload{ @@ -1999,7 +1991,7 @@ CockroachDB supports the following flags: // https://www.postgresql.org/docs/10/static/functions-datetime.html "age": makeBuiltin( - tree.FunctionProperties{Impure: true}, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{{"val", types.TimestampTZ}}, ReturnType: tree.FixedReturnType(types.Interval), @@ -2021,7 +2013,7 @@ CockroachDB supports the following flags: ), "current_date": makeBuiltin( - tree.FunctionProperties{Impure: true}, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.Date), @@ -2040,7 +2032,7 @@ CockroachDB supports the following flags: "localtime": txnTimeWithPrecisionBuiltin(false), "statement_timestamp": makeBuiltin( - tree.FunctionProperties{Impure: true}, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.TimestampTZ), @@ -2063,7 +2055,7 @@ CockroachDB supports the following flags: ), tree.FollowerReadTimestampFunctionName: makeBuiltin( - tree.FunctionProperties{Impure: true}, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.TimestampTZ), @@ -2091,7 +2083,6 @@ return without an error.`, "cluster_logical_timestamp": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{}, @@ -2111,7 +2102,7 @@ may increase either contention or retry errors, or both.`, ), "clock_timestamp": makeBuiltin( - tree.FunctionProperties{Impure: true}, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.TimestampTZ), @@ -2134,7 +2125,7 @@ may increase either contention or retry errors, or both.`, ), "timeofday": makeBuiltin( - tree.FunctionProperties{Category: categoryDateAndTime, Impure: true}, + tree.FunctionProperties{Category: categoryDateAndTime}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.String), @@ -3220,7 +3211,6 @@ may increase either contention or retry errors, or both.`, tree.FunctionProperties{ Category: categoryMultiTenancy, Undocumented: true, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{ @@ -3266,7 +3256,6 @@ may increase either contention or retry errors, or both.`, tree.FunctionProperties{ Category: categoryMultiTenancy, Undocumented: true, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{ @@ -3412,7 +3401,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.force_error": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"errorCode", types.String}, {"msg", types.String}}, @@ -3435,7 +3423,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.notice": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"msg", types.String}}, @@ -3466,7 +3453,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.force_assertion_error": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"msg", types.String}}, @@ -3483,7 +3469,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.force_panic": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"msg", types.String}}, @@ -3503,7 +3488,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.force_log_fatal": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"msg", types.String}}, @@ -3529,7 +3513,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.force_retry": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"val", types.Interval}}, @@ -3580,7 +3563,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.no_constant_folding": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"input", types.Any}}, @@ -3712,7 +3694,6 @@ may increase either contention or retry errors, or both.`, "crdb_internal.set_vmodule": makeBuiltin( tree.FunctionProperties{ Category: categorySystemInfo, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"vmodule_string", types.String}}, @@ -4194,7 +4175,6 @@ func getSubstringFromIndexOfLength(str, errMsg string, start, length int) (strin var uuidV4Impl = makeBuiltin( tree.FunctionProperties{ Category: categoryIDGeneration, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{}, @@ -4314,7 +4294,6 @@ func txnTSImplBuiltin(preferTZOverload bool) builtinDefinition { return makeBuiltin( tree.FunctionProperties{ Category: categoryDateAndTime, - Impure: true, }, txnTSOverloads(preferTZOverload)..., ) @@ -4324,7 +4303,6 @@ func txnTSWithPrecisionImplBuiltin(preferTZOverload bool) builtinDefinition { return makeBuiltin( tree.FunctionProperties{ Category: categoryDateAndTime, - Impure: true, }, txnTSWithPrecisionOverloads(preferTZOverload)..., ) @@ -4333,7 +4311,7 @@ func txnTSWithPrecisionImplBuiltin(preferTZOverload bool) builtinDefinition { func txnTimeWithPrecisionBuiltin(preferTZOverload bool) builtinDefinition { tzAdditionalDesc, noTZAdditionalDesc := getTimeAdditionalDesc(preferTZOverload) return makeBuiltin( - tree.FunctionProperties{Impure: true}, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{}, ReturnType: tree.FixedReturnType(types.TimeTZ), diff --git a/pkg/sql/sem/builtins/generator_builtins.go b/pkg/sql/sem/builtins/generator_builtins.go index cdf18a9bf517..30910d63ccc1 100644 --- a/pkg/sql/sem/builtins/generator_builtins.go +++ b/pkg/sql/sem/builtins/generator_builtins.go @@ -43,9 +43,6 @@ func initGeneratorBuiltins() { panic("duplicate builtin: " + k) } - if !v.props.Impure { - panic(fmt.Sprintf("generator functions should all be impure, found %v", v)) - } if v.props.Class != tree.GeneratorClass { panic(fmt.Sprintf("generator functions should be marked with the tree.GeneratorClass "+ "function class, found %v", v)) @@ -57,7 +54,6 @@ func initGeneratorBuiltins() { func genProps() tree.FunctionProperties { return tree.FunctionProperties{ - Impure: true, Class: tree.GeneratorClass, Category: categoryGenerator, } @@ -65,7 +61,6 @@ func genProps() tree.FunctionProperties { func genPropsWithLabels(returnLabels []string) tree.FunctionProperties { return tree.FunctionProperties{ - Impure: true, Class: tree.GeneratorClass, Category: categoryGenerator, ReturnLabels: returnLabels, @@ -265,7 +260,6 @@ var generators = map[string]builtinDefinition{ "crdb_internal.check_consistency": makeBuiltin( tree.FunctionProperties{ - Impure: true, Class: tree.GeneratorClass, Category: categorySystemInfo, }, diff --git a/pkg/sql/sem/builtins/geo_builtins.go b/pkg/sql/sem/builtins/geo_builtins.go index f6737fe94b1a..d59f94e7d7bd 100644 --- a/pkg/sql/sem/builtins/geo_builtins.go +++ b/pkg/sql/sem/builtins/geo_builtins.go @@ -2889,7 +2889,6 @@ The calculations are done on a sphere.`, tree.FunctionProperties{ Class: tree.SQLClass, Category: categoryGeospatial, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{ diff --git a/pkg/sql/sem/builtins/pg_builtins.go b/pkg/sql/sem/builtins/pg_builtins.go index 4da25552629b..8b3307eedb16 100644 --- a/pkg/sql/sem/builtins/pg_builtins.go +++ b/pkg/sql/sem/builtins/pg_builtins.go @@ -1083,11 +1083,7 @@ SELECT description ), "pg_sleep": makeBuiltin( - tree.FunctionProperties{ - // pg_sleep is marked as impure so it doesn't get executed during - // normalization. - Impure: true, - }, + tree.FunctionProperties{}, tree.Overload{ Types: tree.ArgTypes{{"seconds", types.Float}}, ReturnType: tree.FixedReturnType(types.Bool), @@ -1744,7 +1740,6 @@ SELECT description tree.FunctionProperties{ Category: categorySystemInfo, DistsqlBlocklist: true, - Impure: true, }, tree.Overload{ Types: tree.ArgTypes{{"setting_name", types.String}, {"new_value", types.String}, {"is_local", types.Bool}}, diff --git a/pkg/sql/sem/builtins/window_builtins.go b/pkg/sql/sem/builtins/window_builtins.go index 37c8087d5477..2dbcbac45c3c 100644 --- a/pkg/sql/sem/builtins/window_builtins.go +++ b/pkg/sql/sem/builtins/window_builtins.go @@ -27,9 +27,6 @@ func initWindowBuiltins() { panic("duplicate builtin: " + k) } - if !v.props.Impure { - panic(fmt.Sprintf("%s: window functions should all be impure, found %v", k, v)) - } if v.props.Class != tree.WindowClass { panic(fmt.Sprintf("%s: window functions should be marked with the tree.WindowClass "+ "function class, found %v", k, v)) @@ -46,8 +43,7 @@ func initWindowBuiltins() { func winProps() tree.FunctionProperties { return tree.FunctionProperties{ - Impure: true, - Class: tree.WindowClass, + Class: tree.WindowClass, } } diff --git a/pkg/sql/sem/tree/expr.go b/pkg/sql/sem/tree/expr.go index 1b12b32a9430..130bb3571ae9 100644 --- a/pkg/sql/sem/tree/expr.go +++ b/pkg/sql/sem/tree/expr.go @@ -1394,13 +1394,6 @@ func (node *FuncExpr) IsWindowFunctionApplication() bool { return node.WindowDef != nil } -// IsImpure returns whether the function application is impure, meaning that it -// potentially returns a different value when called in the same statement with -// the same parameters. -func (node *FuncExpr) IsImpure() bool { - return node.fnProps != nil && node.fnProps.Impure -} - // IsDistSQLBlocklist returns whether the function is not supported by DistSQL. func (node *FuncExpr) IsDistSQLBlocklist() bool { return node.fnProps != nil && node.fnProps.DistsqlBlocklist diff --git a/pkg/sql/sem/tree/function_definition.go b/pkg/sql/sem/tree/function_definition.go index 77d6f1df12cb..e715d9d75bb2 100644 --- a/pkg/sql/sem/tree/function_definition.go +++ b/pkg/sql/sem/tree/function_definition.go @@ -57,14 +57,6 @@ type FunctionProperties struct { // be NULL and should act accordingly. NullableArgs bool - // Impure is set to true when a function potentially returns a - // different value when called in the same statement with the same - // parameters. e.g.: random(), clock_timestamp(). Some functions - // like now() return the same value in the same statement, but - // different values in separate statements, and should not be marked - // as impure. - Impure bool - // DistsqlBlocklist is set to true when a function depends on // members of the EvalContext that are not marshaled by DistSQL // (e.g. planner). Currently used for DistSQL to determine if
85849afa492db435a389646d521fd9f09e535965
2017-01-25 02:10:43
Andrei Matei
sql: fix swallowing of errors in planVisitor
false
fix swallowing of errors in planVisitor
sql
diff --git a/pkg/sql/subquery_test.go b/pkg/sql/subquery_test.go new file mode 100644 index 000000000000..e20ba9454724 --- /dev/null +++ b/pkg/sql/subquery_test.go @@ -0,0 +1,48 @@ +// Copyright 2015 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. +// +// Author: Andrei Matei ([email protected]) + +package sql + +import ( + "testing" + + "github.com/cockroachdb/cockroach/pkg/sql/parser" + "github.com/cockroachdb/cockroach/pkg/testutils" + "github.com/cockroachdb/cockroach/pkg/util/leaktest" +) + +// Test that starting the subqueries returns an error if the evaluation of a +// subquery returns an error. +func TestStartSubqueriesReturnsError(t *testing.T) { + defer leaktest.AfterTest(t)() + sql := "SELECT 1 WHERE (SELECT CRDB_INTERNAL.FORCE_RETRY('1s':::INTERVAL) > 0)" + p := makeTestPlanner() + stmts, err := p.parser.Parse(sql, parser.Traditional) + if err != nil { + t.Fatal(err) + } + if len(stmts) != 1 { + t.Fatalf("expected to parse 1 statement, got: %d", len(stmts)) + } + stmt := stmts[0] + plan, err := p.makePlan(stmt, false /* autoCommit */) + if err != nil { + t.Fatal(err) + } + if err := p.startSubqueryPlans(plan); !testutils.IsError(err, `forced by crdb_internal\.force_retry\(\)`) { + t.Fatalf("expected error from force_retry(), got: %v", err) + } +} diff --git a/pkg/sql/txn_restart_test.go b/pkg/sql/txn_restart_test.go index 24f49c1c232d..66614357db33 100644 --- a/pkg/sql/txn_restart_test.go +++ b/pkg/sql/txn_restart_test.go @@ -1236,8 +1236,21 @@ INSERT INTO t.test (k, v) VALUES ('test_key', 'test_val'); t.Fatal(err) } - _, err := sqlDB.Exec(`UPDATE t.test SET v = 'updated' WHERE (`+ - `SELECT CRDB_INTERNAL.FORCE_RETRY('500ms':::INTERVAL, $1) > 0)`, bogusTxnID) + tx, err := sqlDB.Begin() + if err != nil { + t.Fatal(err) + } + // We're going to use FORCE_RETRY() to generate an error for a different + // transaction than the one we initiate. We need call that function in a + // transaction that already has an id (so, it can't be the first query in the + // transaction), because the "wrong txn id" detection mechanism doesn't work + // when the txn doesn't have an id yet (see TODO in + // IsRetryableErrMeantForTxn). + _, err = tx.Exec(`SELECT * FROM t.test`) + if err != nil { + t.Fatal(err) + } + _, err = tx.Exec(`SELECT CRDB_INTERNAL.FORCE_RETRY('500ms':::INTERVAL, $1)`, bogusTxnID) if isRetryableErr(err) { t.Fatalf("expected non-retryable error, got: %s", err) } diff --git a/pkg/sql/walk.go b/pkg/sql/walk.go index d9384b597f2a..5139486a250d 100644 --- a/pkg/sql/walk.go +++ b/pkg/sql/walk.go @@ -62,7 +62,6 @@ func walkPlan(plan planNode, observer planObserver) error { // planVisitor is the support structure for walkPlan(). type planVisitor struct { observer planObserver - nodeName string // subplans is a temporary accumulator array used when collecting // sub-query plans at each planNode. @@ -79,10 +78,9 @@ func (v *planVisitor) visit(plan planNode) { return } - lv := *v - lv.nodeName = nodeName(plan) - recurse := v.observer.enterNode(lv.nodeName, plan) - defer lv.observer.leaveNode(lv.nodeName) + name := nodeName(plan) + recurse := v.observer.enterNode(name, plan) + defer v.observer.leaveNode(name) if !recurse { return @@ -100,7 +98,7 @@ func (v *planVisitor) visit(plan planNode) { } description := fmt.Sprintf("%d column%s, %s", len(n.columns), util.Pluralize(int64(len(n.columns))), suffix) - lv.attr("size", description) + v.observer.attr(name, "size", description) var subplans []planNode for i, tuple := range n.tuples { @@ -108,55 +106,55 @@ func (v *planVisitor) visit(plan planNode) { if n.columns[j].omitted { continue } - subplans = lv.expr(fmt.Sprintf("row %d, expr", i), j, expr, subplans) + subplans = v.expr(name, fmt.Sprintf("row %d, expr", i), j, expr, subplans) } } - lv.subqueries(subplans) + v.subqueries(name, subplans) case *valueGenerator: - subplans := lv.expr("expr", -1, n.expr, nil) - lv.subqueries(subplans) + subplans := v.expr(name, "expr", -1, n.expr, nil) + v.subqueries(name, subplans) case *scanNode: - lv.attr("table", fmt.Sprintf("%s@%s", n.desc.Name, n.index.Name)) + v.observer.attr(name, "table", fmt.Sprintf("%s@%s", n.desc.Name, n.index.Name)) if n.noIndexJoin { - lv.attr("hint", "no index join") + v.observer.attr(name, "hint", "no index join") } if n.specifiedIndex != nil { - lv.attr("hint", fmt.Sprintf("force index @%s", n.specifiedIndex.Name)) + v.observer.attr(name, "hint", fmt.Sprintf("force index @%s", n.specifiedIndex.Name)) } spans := sqlbase.PrettySpans(n.spans, 2) if spans != "" { if spans == "-" { spans = "ALL" } - lv.attr("spans", spans) + v.observer.attr(name, "spans", spans) } if n.limitHint > 0 && !n.limitSoft { - lv.attr("limit", fmt.Sprintf("%d", n.limitHint)) + v.observer.attr(name, "limit", fmt.Sprintf("%d", n.limitHint)) } - subplans := lv.expr("filter", -1, n.filter, nil) - lv.subqueries(subplans) + subplans := v.expr(name, "filter", -1, n.filter, nil) + v.subqueries(name, subplans) case *filterNode: - subplans := lv.expr("filter", -1, n.filter, nil) + subplans := v.expr(name, "filter", -1, n.filter, nil) if n.explain != explainNone { - lv.attr("mode", explainStrings[n.explain]) + v.observer.attr(name, "mode", explainStrings[n.explain]) } - lv.subqueries(subplans) - lv.visit(n.source.plan) + v.subqueries(name, subplans) + v.visit(n.source.plan) case *renderNode: var subplans []planNode for i, r := range n.render { - subplans = lv.expr("render", i, r, subplans) + subplans = v.expr(name, "render", i, r, subplans) } - lv.subqueries(subplans) - lv.visit(n.source.plan) + v.subqueries(name, subplans) + v.visit(n.source.plan) case *indexJoinNode: - lv.visit(n.index) - lv.visit(n.table) + v.visit(n.index) + v.visit(n.table) case *joinNode: jType := "" @@ -173,7 +171,7 @@ func (v *planVisitor) visit(plan planNode) { case joinTypeFullOuter: jType = "full outer" } - lv.attr("type", jType) + v.observer.attr(name, "type", jType) if len(n.pred.leftColNames) > 0 { var buf bytes.Buffer @@ -182,40 +180,40 @@ func (v *planVisitor) visit(plan planNode) { buf.WriteString(") = (") n.pred.rightColNames.Format(&buf, parser.FmtSimple) buf.WriteByte(')') - lv.attr("equality", buf.String()) + v.observer.attr(name, "equality", buf.String()) } - subplans := lv.expr("pred", -1, n.pred.onCond, nil) - lv.subqueries(subplans) - lv.visit(n.left.plan) - lv.visit(n.right.plan) + subplans := v.expr(name, "pred", -1, n.pred.onCond, nil) + v.subqueries(name, subplans) + v.visit(n.left.plan) + v.visit(n.right.plan) case *selectTopNode: if n.plan != nil { - lv.visit(n.plan) + v.visit(n.plan) } else { if n.limit != nil { - lv.visit(n.limit) + v.visit(n.limit) } if n.distinct != nil { - lv.visit(n.distinct) + v.visit(n.distinct) } if n.sort != nil { - lv.visit(n.sort) + v.visit(n.sort) } if n.window != nil { - lv.visit(n.window) + v.visit(n.window) } if n.group != nil { - lv.visit(n.group) + v.visit(n.group) } - lv.visit(n.source) + v.visit(n.source) } case *limitNode: - subplans := lv.expr("count", -1, n.countExpr, nil) - subplans = lv.expr("offset", -1, n.offsetExpr, subplans) - lv.subqueries(subplans) - lv.visit(n.plan) + subplans := v.expr(name, "count", -1, n.countExpr, nil) + subplans = v.expr(name, "offset", -1, n.offsetExpr, subplans) + v.subqueries(name, subplans) + v.visit(n.plan) case *distinctNode: if n.columnsInOrder != nil { @@ -229,9 +227,9 @@ func (v *planVisitor) visit(plan planNode) { prefix = ", " } } - lv.attr("key", buf.String()) + v.observer.attr(name, "key", buf.String()) } - lv.visit(n.plan) + v.visit(n.plan) case *sortNode: var columns ResultColumns @@ -242,48 +240,48 @@ func (v *planVisitor) visit(plan planNode) { // plan.Ordering() does not include the added sort columns not // present in the output. order := orderingInfo{ordering: n.ordering} - lv.attr("order", order.AsString(columns)) + v.observer.attr(name, "order", order.AsString(columns)) switch ss := n.sortStrategy.(type) { case *iterativeSortStrategy: - lv.attr("strategy", "iterative") + v.observer.attr(name, "strategy", "iterative") case *sortTopKStrategy: - lv.attr("strategy", fmt.Sprintf("top %d", ss.topK)) + v.observer.attr(name, "strategy", fmt.Sprintf("top %d", ss.topK)) } - lv.visit(n.plan) + v.visit(n.plan) case *groupNode: var subplans []planNode for i, agg := range n.funcs { - subplans = lv.expr("aggregate", i, agg.expr, subplans) + subplans = v.expr(name, "aggregate", i, agg.expr, subplans) } for i, rexpr := range n.render { - subplans = lv.expr("render", i, rexpr, subplans) + subplans = v.expr(name, "render", i, rexpr, subplans) } - subplans = lv.expr("having", -1, n.having, subplans) - lv.subqueries(subplans) - lv.visit(n.plan) + subplans = v.expr(name, "having", -1, n.having, subplans) + v.subqueries(name, subplans) + v.visit(n.plan) case *windowNode: var subplans []planNode for i, agg := range n.funcs { - subplans = lv.expr("window", i, agg.expr, subplans) + subplans = v.expr(name, "window", i, agg.expr, subplans) } for i, rexpr := range n.windowRender { - subplans = lv.expr("render", i, rexpr, subplans) + subplans = v.expr(name, "render", i, rexpr, subplans) } - lv.subqueries(subplans) - lv.visit(n.plan) + v.subqueries(name, subplans) + v.visit(n.plan) case *unionNode: - lv.visit(n.left) - lv.visit(n.right) + v.visit(n.left) + v.visit(n.right) case *splitNode: var subplans []planNode for i, e := range n.exprs { - subplans = lv.expr("expr", i, e, subplans) + subplans = v.expr(name, "expr", i, e, subplans) } - lv.subqueries(subplans) + v.subqueries(name, subplans) case *insertNode: var buf bytes.Buffer @@ -296,26 +294,26 @@ func (v *planVisitor) visit(plan planNode) { buf.WriteString(col.Name) } buf.WriteByte(')') - lv.attr("into", buf.String()) + v.observer.attr(name, "into", buf.String()) var subplans []planNode for i, dexpr := range n.defaultExprs { - subplans = lv.expr("default", i, dexpr, subplans) + subplans = v.expr(name, "default", i, dexpr, subplans) } for i, cexpr := range n.checkHelper.exprs { - subplans = lv.expr("check", i, cexpr, subplans) + subplans = v.expr(name, "check", i, cexpr, subplans) } for i, rexpr := range n.rh.exprs { - subplans = lv.expr("returning", i, rexpr, subplans) + subplans = v.expr(name, "returning", i, rexpr, subplans) } n.tw.walkExprs(func(d string, i int, e parser.TypedExpr) { - subplans = lv.expr(d, i, e, subplans) + subplans = v.expr(name, d, i, e, subplans) }) - lv.subqueries(subplans) - lv.visit(n.run.rows) + v.subqueries(name, subplans) + v.visit(n.run.rows) case *updateNode: - lv.attr("table", n.tableDesc.Name) + v.observer.attr(name, "table", n.tableDesc.Name) if len(n.tw.ru.updateCols) > 0 { var buf bytes.Buffer for i, col := range n.tw.ru.updateCols { @@ -324,70 +322,65 @@ func (v *planVisitor) visit(plan planNode) { } buf.WriteString(col.Name) } - lv.attr("set", buf.String()) + v.observer.attr(name, "set", buf.String()) } var subplans []planNode for i, rexpr := range n.rh.exprs { - subplans = lv.expr("returning", i, rexpr, subplans) + subplans = v.expr(name, "returning", i, rexpr, subplans) } n.tw.walkExprs(func(d string, i int, e parser.TypedExpr) { - subplans = lv.expr(d, i, e, subplans) + subplans = v.expr(name, d, i, e, subplans) }) - lv.subqueries(subplans) - lv.visit(n.run.rows) + v.subqueries(name, subplans) + v.visit(n.run.rows) case *deleteNode: - lv.attr("from", n.tableDesc.Name) + v.observer.attr(name, "from", n.tableDesc.Name) var subplans []planNode for i, rexpr := range n.rh.exprs { - subplans = lv.expr("returning", i, rexpr, subplans) + subplans = v.expr(name, "returning", i, rexpr, subplans) } n.tw.walkExprs(func(d string, i int, e parser.TypedExpr) { - subplans = lv.expr(d, i, e, subplans) + subplans = v.expr(name, d, i, e, subplans) }) - lv.subqueries(subplans) - lv.visit(n.run.rows) + v.subqueries(name, subplans) + v.visit(n.run.rows) case *createTableNode: if n.n.As() { - lv.visit(n.sourcePlan) + v.visit(n.sourcePlan) } case *createViewNode: - lv.attr("query", n.sourceQuery) - lv.visit(n.sourcePlan) + v.observer.attr(name, "query", n.sourceQuery) + v.visit(n.sourcePlan) case *delayedNode: - lv.attr("source", n.name) - lv.visit(n.plan) + v.observer.attr(name, "source", n.name) + v.visit(n.plan) case *explainDebugNode: - lv.visit(n.plan) + v.visit(n.plan) case *ordinalityNode: - lv.visit(n.source) + v.visit(n.source) case *explainTraceNode: - lv.visit(n.plan) + v.visit(n.plan) case *explainPlanNode: - lv.attr("expanded", strconv.FormatBool(n.expanded)) - lv.visit(n.plan) + v.observer.attr(name, "expanded", strconv.FormatBool(n.expanded)) + v.visit(n.plan) } } -// attr wraps observer.attr() and provides it with the current node's name. -func (v *planVisitor) attr(name, value string) { - v.observer.attr(v.nodeName, name, value) -} - // subqueries informs the observer that the following sub-plans are // for sub-queries. -func (v *planVisitor) subqueries(subplans []planNode) { +func (v *planVisitor) subqueries(nodeName string, subplans []planNode) { if len(subplans) == 0 || v.err != nil { return } - v.attr("subqueries", strconv.Itoa(len(subplans))) + v.observer.attr(nodeName, "subqueries", strconv.Itoa(len(subplans))) for _, p := range subplans { v.visit(p) } @@ -396,13 +389,13 @@ func (v *planVisitor) subqueries(subplans []planNode) { // expr wraps observer.expr() and provides it with the current node's // name. It also collects the plans for the sub-queries. func (v *planVisitor) expr( - fieldName string, n int, expr parser.Expr, subplans []planNode, + nodeName string, fieldName string, n int, expr parser.Expr, subplans []planNode, ) []planNode { if v.err != nil { return subplans } - v.observer.expr(v.nodeName, fieldName, n, expr) + v.observer.expr(nodeName, fieldName, n, expr) if expr != nil { // Note: the recursion through WalkExprConst does nothing else
132d472c21c0a43ae499d0367dac61bcfad867e9
2022-05-16 20:05:56
Rail Aliiev
release: run preflight without TTY
false
run preflight without TTY
release
diff --git a/build/release/teamcity-publish-redhat-release.sh b/build/release/teamcity-publish-redhat-release.sh index a04a2b304e1b..9468f2c4b2b8 100755 --- a/build/release/teamcity-publish-redhat-release.sh +++ b/build/release/teamcity-publish-redhat-release.sh @@ -68,7 +68,6 @@ tc_end_block "Push RedHat docker image" tc_start_block "Run preflight" mkdir -p artifacts docker run \ - -it \ --rm \ --security-opt=label=disable \ --env PFLT_LOGLEVEL=trace \
c4255c5ad374ae4d645ef7a1e9a1ddb2c35ab044
2023-03-10 01:35:25
Evan Wall
multitenant: reduce capability unrelated test churn
false
reduce capability unrelated test churn
multitenant
diff --git a/pkg/ccl/multitenantccl/tenantcapabilitiesccl/testdata/can_admin_split b/pkg/ccl/multitenantccl/tenantcapabilitiesccl/testdata/can_admin_split index 83507a576c5d..b670f661bd69 100644 --- a/pkg/ccl/multitenantccl/tenantcapabilitiesccl/testdata/can_admin_split +++ b/pkg/ccl/multitenantccl/tenantcapabilitiesccl/testdata/can_admin_split @@ -1,9 +1,7 @@ query-sql-system -SHOW TENANT [10] WITH CAPABILITIES +SELECT * FROM [SHOW TENANT [10] WITH CAPABILITIES] WHERE capability_id = 'can_admin_split' ---- 10 tenant-10 ready none can_admin_split false -10 tenant-10 ready none can_view_node_info false -10 tenant-10 ready none can_view_tsdb_metrics false exec-sql-tenant CREATE TABLE t(a INT)
5ddaaddef5c52c4f4ba056797e8aa9dfbdc62b3a
2022-05-07 00:28:48
Michael Erickson
roachtest: fix costfuzz log on error while running perturbed statement
false
fix costfuzz log on error while running perturbed statement
roachtest
diff --git a/pkg/cmd/roachtest/tests/costfuzz.go b/pkg/cmd/roachtest/tests/costfuzz.go index 96b4824e9a36..0816bcfd9bbe 100644 --- a/pkg/cmd/roachtest/tests/costfuzz.go +++ b/pkg/cmd/roachtest/tests/costfuzz.go @@ -223,6 +223,7 @@ func runCostFuzzQuery( // Then, rerun the statement with cost perturbation. rows2, err := conn.Query(stmt) if err != nil { + logStmt(stmt) logStmt(seedStmt) logStmt(stmt) return errors.Wrap(err, "error while running perturbed statement")
7d7c1c13f4182f444f7dbc3bfc83a0d5cc9a958f
2018-03-06 03:01:11
Daniel Harrison
workload: copy ycsb from loadgen@3d2d3f4
false
copy ycsb from loadgen@3d2d3f4
workload
diff --git a/pkg/workload/ycsb/ycsb.go b/pkg/workload/ycsb/ycsb.go new file mode 100644 index 000000000000..669403fcb9b1 --- /dev/null +++ b/pkg/workload/ycsb/ycsb.go @@ -0,0 +1,889 @@ +// Copyright 2017 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. See the AUTHORS file +// for names of contributors. +// +// Author: Arjun Narayan +// +// The YCSB example program is intended to simulate the workload specified by +// the Yahoo! Cloud Serving Benchmark. +package main + +import ( + "context" + "database/sql" + "encoding/binary" + "flag" + "fmt" + "hash" + "hash/fnv" + "log" + "math" + "math/rand" + "net/url" + "os" + "os/signal" + "runtime" + "sort" + "strings" + "sync" + "sync/atomic" + "syscall" + "time" + "unsafe" + + "golang.org/x/time/rate" + mgo "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" + + "github.com/gocql/gocql" + "github.com/pkg/errors" + + // Cockroach round-robin driver. + _ "github.com/cockroachdb/loadgen/internal/driver" +) + +// SQL statements +const ( + numTableFields = 10 + fieldLength = 100 // In characters +) + +const ( + zipfS = 0.99 + zipfIMin = 1 +) + +var concurrency = flag.Int("concurrency", 2*runtime.NumCPU(), + "Number of concurrent workers sending read/write requests.") +var workload = flag.String("workload", "B", "workload type. Choose from A-F.") +var tolerateErrors = flag.Bool("tolerate-errors", false, + "Keep running on error. (default false)") +var duration = flag.Duration("duration", 0, + "The duration to run. If 0, run forever.") +var writeDuration = flag.Duration("write-duration", 0, + "The duration to perform writes. If 0, write forever.") +var verbose = flag.Bool("v", false, "Print *verbose debug output") +var drop = flag.Bool("drop", true, + "Drop the existing table and recreate it to start from scratch") +var maxRate = flag.Uint64("max-rate", 0, + "Maximum requency of operations (reads/writes). If 0, no limit.") +var initialLoad = flag.Uint64("initial-load", 10000, + "Initial number of rows to sequentially insert before beginning Zipfian workload generation") +var strictPostgres = flag.Bool("strict-postgres", false, + "Use Postgres compatible syntax, without any Cockroach specific extensions") +var json = flag.Bool("json", false, + "Use JSONB rather than relational data") + +// 7 days at 5% writes and 30k ops/s +var maxWrites = flag.Uint64("max-writes", 7*24*3600*1500, + "Maximum number of writes to perform before halting. This is required for accurately generating keys that are uniformly distributed across the keyspace.") + +var splits = flag.Int("splits", 0, "Number of splits to perform before starting normal operations") + +// Mongo flags. See https://godoc.org/gopkg.in/mgo.v2#Session.SetSafe for details. +var mongoWMode = flag.String("mongo-wmode", "", "WMode for mongo session (eg: majority)") +var mongoJ = flag.Bool("mongo-j", false, "Sync journal before op return") + +// Cassandra flags. +var cassandraConsistency = flag.String("cassandra-consistency", "QUORUM", "Op consistency: ANY ONE TWO THREE QUORUM ALL LOCAL_QUORUM EACH_QUORUM LOCAL_ONE") +var cassandraReplication = flag.Int("cassandra-replication", 1, "Replication factor for cassandra") + +var readOnly int32 + +type database interface { + readRow(key uint64) (bool, error) + insertRow(key uint64, fields []string) error + clone() database +} + +// ycsbWorker independently issues reads, writes, and scans against the database. +type ycsbWorker struct { + db database + // An RNG used to generate random keys + zipfR *ZipfGenerator + // An RNG used to generate random strings for the values + r *rand.Rand + readFreq float32 + writeFreq float32 + scanFreq float32 + hashFunc hash.Hash64 + hashBuf [8]byte +} + +type statistic int + +const ( + nonEmptyReads statistic = iota + emptyReads + writes + scans + writeErrors + readErrors + scanErrors + statsLength +) + +var globalStats [statsLength]uint64 + +type operation int + +const ( + writeOp operation = iota + readOp + scanOp +) + +func newYcsbWorker(db database, zipfR *ZipfGenerator, workloadFlag string) *ycsbWorker { + source := rand.NewSource(int64(time.Now().UnixNano())) + var readFreq, writeFreq, scanFreq float32 + + switch workloadFlag { + case "A", "a": + readFreq = 0.5 + writeFreq = 0.5 + case "B", "b": + readFreq = 0.95 + writeFreq = 0.05 + case "C", "c": + readFreq = 1.0 + case "D", "d": + readFreq = 0.95 + writeFreq = 0.95 + panic("Workload D not implemented yet") + // TODO(arjun) workload D (read latest) requires modifying the RNG to + // skew to the latest keys, so not done yet. + case "E", "e": + scanFreq = 0.95 + writeFreq = 0.05 + panic("Workload E (scans) not implemented yet") + case "F", "f": + writeFreq = 1.0 + } + r := rand.New(source) + return &ycsbWorker{ + db: db, + r: r, + zipfR: zipfR, + readFreq: readFreq, + writeFreq: writeFreq, + scanFreq: scanFreq, + hashFunc: fnv.New64(), + } +} + +func (yw *ycsbWorker) hashKey(key uint64) uint64 { + yw.hashBuf = [8]byte{} // clear hashBuf + binary.PutUvarint(yw.hashBuf[:], key) + yw.hashFunc.Reset() + if _, err := yw.hashFunc.Write(yw.hashBuf[:]); err != nil { + panic(err) + } + // The Go sql driver interface does not support having the high-bit set in + // uint64 values! + return yw.hashFunc.Sum64() & math.MaxInt64 +} + +// Keys are chosen by first drawing from a Zipf distribution and hashing the +// drawn value, so that not all hot keys are close together. +// See YCSB paper section 5.3 for a complete description of how keys are chosen. +func (yw *ycsbWorker) nextReadKey() uint64 { + var hashedKey uint64 + key := yw.zipfR.Uint64() + hashedKey = yw.hashKey(key) + if *verbose { + fmt.Printf("reader: %d -> %d\n", key, hashedKey) + } + return hashedKey +} + +func (yw *ycsbWorker) nextWriteKey() uint64 { + key := yw.zipfR.IMaxHead() + hashedKey := yw.hashKey(key) + if *verbose { + fmt.Printf("writer: %d -> %d\n", key, hashedKey) + } + return hashedKey +} + +// runLoader inserts n rows in parallel across numWorkers, with +// row_id = i*numWorkers + thisWorkerNum for i = 0...(n-1) +func (yw *ycsbWorker) runLoader(n uint64, numWorkers int, thisWorkerNum int, wg *sync.WaitGroup) { + defer wg.Done() + for i := uint64(thisWorkerNum + zipfIMin); i < n; i += uint64(numWorkers) { + hashedKey := yw.hashKey(i) + if err := yw.insertRow(hashedKey, false); err != nil { + if *verbose { + fmt.Printf("error loading row %d: %s\n", i, err) + } + atomic.AddUint64(&globalStats[writeErrors], 1) + } else if *verbose { + fmt.Printf("loaded %d -> %d\n", i, hashedKey) + } + } +} + +// runWorker is an infinite loop in which the ycsbWorker reads and writes +// random data into the table in proportion to the op frequencies. +func (yw *ycsbWorker) runWorker(errCh chan<- error, wg *sync.WaitGroup, limiter *rate.Limiter) { + defer wg.Done() + + for { + if limiter != nil { + if err := limiter.Wait(context.Background()); err != nil { + panic(err) + } + } + + switch yw.chooseOp() { + case readOp: + if err := yw.readRow(); err != nil { + atomic.AddUint64(&globalStats[readErrors], 1) + errCh <- err + } + case writeOp: + if atomic.LoadUint64(&globalStats[writes]) > *maxWrites { + break + } + key := yw.nextWriteKey() + if err := yw.insertRow(key, true); err != nil { + errCh <- err + atomic.AddUint64(&globalStats[writeErrors], 1) + } + case scanOp: + if err := yw.scanRows(); err != nil { + atomic.AddUint64(&globalStats[scanErrors], 1) + errCh <- err + } + } + } +} + +var letters = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") + +// Gnerate a random string of alphabetic characters. +func (yw *ycsbWorker) randString(length int) string { + str := make([]byte, length) + for i := range str { + str[i] = letters[yw.r.Intn(len(letters))] + } + return string(str) +} + +func (yw *ycsbWorker) insertRow(key uint64, increment bool) error { + fields := make([]string, numTableFields) + for i := 0; i < len(fields); i++ { + fields[i] = yw.randString(fieldLength) + } + if err := yw.db.insertRow(key, fields); err != nil { + return err + } + + if increment { + if err := yw.zipfR.IncrementIMax(); err != nil { + return err + } + } + atomic.AddUint64(&globalStats[writes], 1) + return nil +} + +func (yw *ycsbWorker) readRow() error { + empty, err := yw.db.readRow(yw.nextReadKey()) + if err != nil { + return err + } + if !empty { + atomic.AddUint64(&globalStats[nonEmptyReads], 1) + return nil + } + atomic.AddUint64(&globalStats[emptyReads], 1) + return nil +} + +func (yw *ycsbWorker) scanRows() error { + atomic.AddUint64(&globalStats[scans], 1) + return errors.Errorf("not implemented yet") +} + +// Choose an operation in proportion to the frequencies. +func (yw *ycsbWorker) chooseOp() operation { + p := yw.r.Float32() + if atomic.LoadInt32(&readOnly) == 0 && p <= yw.writeFreq { + return writeOp + } + p -= yw.writeFreq + // If both scanFreq and readFreq are 0 default to readOp if we've reached + // this point because readOnly is true. + if p <= yw.scanFreq { + return scanOp + } + return readOp +} + +type cockroach struct { + db *sql.DB + readStmt *sql.Stmt + writeStmt *sql.Stmt +} + +const ( + createStatement = 0 + readStatement = 1 + writeStatement = 2 +) + +var relationalStrategy = [3]string{ + `CREATE TABLE IF NOT EXISTS ycsb.usertable ( + ycsb_key BIGINT PRIMARY KEY NOT NULL, + FIELD1 TEXT, + FIELD2 TEXT, + FIELD3 TEXT, + FIELD4 TEXT, + FIELD5 TEXT, + FIELD6 TEXT, + FIELD7 TEXT, + FIELD8 TEXT, + FIELD9 TEXT, + FIELD10 TEXT + )`, + `SELECT * FROM ycsb.usertable WHERE ycsb_key = $1`, + `INSERT INTO ycsb.usertable VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)`, +} + +var jsonbStrategy = [3]string{ + `CREATE TABLE IF NOT EXISTS ycsb.usertable ( + ycsb_key BIGINT PRIMARY KEY NOT NULL, + FIELD JSONB + )`, + `SELECT * FROM ycsb.usertable WHERE ycsb_key = $1`, + `INSERT INTO ycsb.usertable VALUES ($1, + json_build_object( + 'field1', $2:::text, + 'field2', $3:::text, + 'field3', $4:::text, + 'field4', $5:::text, + 'field5', $6:::text, + 'field6', $7:::text, + 'field7', $8:::text, + 'field8', $9:::text, + 'field9', $10:::text, + 'field10', $11:::text + ))`, +} + +func (c *cockroach) readRow(key uint64) (bool, error) { + res, err := c.readStmt.Query(key) + if err != nil { + return false, err + } + var rowsFound int + for res.Next() { + rowsFound++ + } + if *verbose { + fmt.Printf("reader found %d rows for key %d\n", rowsFound, key) + } + if err := res.Close(); err != nil { + return false, err + } + return rowsFound == 0, nil +} + +func (c *cockroach) insertRow(key uint64, fields []string) error { + args := make([]interface{}, 1+len(fields)) + args[0] = key + for i, s := range fields { + args[i+1] = s + } + _, err := c.writeStmt.Exec(args...) + return err +} + +func (c *cockroach) clone() database { + return c +} + +func setupCockroach(dbURLs []string) (database, error) { + // Open connection to server and create a database. + db, err := sql.Open("cockroach", strings.Join(dbURLs, " ")) + if err != nil { + return nil, err + } + + // Allow a maximum of concurrency+1 connections to the database. + db.SetMaxOpenConns(*concurrency + 1) + db.SetMaxIdleConns(*concurrency + 1) + + if _, err := db.Exec("CREATE DATABASE IF NOT EXISTS ycsb"); err != nil { + if *verbose { + fmt.Printf("Failed to create the database, attempting to continue... %s\n", + err) + } + } + + if *strictPostgres { + // Since we use absolute paths (ycsb.usertable), create a Postgres schema + // to make the absolute paths work. + if _, err := db.Exec("CREATE SCHEMA IF NOT EXISTS ycsb"); err != nil { + if *verbose { + fmt.Printf("Failed to create schema: %s\n", err) + } + // Do not fail on this error, as we want strict postgres mode to + // also work on Cockroach, and Cockroach doesn't have CREATE SCHEMA. + } + } + + if *drop { + if *verbose { + fmt.Println("Dropping the table") + } + if _, err := db.Exec("DROP TABLE IF EXISTS ycsb.usertable"); err != nil { + if *verbose { + fmt.Printf("Failed to drop the table: %s\n", err) + } + return nil, err + } + } + + schema := relationalStrategy + if *json { + schema = jsonbStrategy + } + + if _, err := db.Exec(schema[createStatement]); err != nil { + return nil, err + } + + readStmt, err := db.Prepare(schema[readStatement]) + if err != nil { + return nil, err + } + + writeStmt, err := db.Prepare(schema[writeStatement]) + if err != nil { + return nil, err + } + + if *splits > 0 { + // NB: We only need ycsbWorker.hashKey, so passing nil for the database and + // ZipfGenerator is ok. + w := newYcsbWorker(nil, nil, *workload) + splitPoints := make([]uint64, *splits) + for i := 0; i < *splits; i++ { + splitPoints[i] = w.hashKey(uint64(i)) + } + sort.Slice(splitPoints, func(i, j int) bool { + return splitPoints[i] < splitPoints[j] + }) + + type pair struct { + lo, hi int + } + splitCh := make(chan pair, *concurrency) + splitCh <- pair{0, len(splitPoints)} + doneCh := make(chan struct{}) + + var wg sync.WaitGroup + for i := 0; i < *concurrency; i++ { + wg.Add(1) + go func() { + defer wg.Done() + for { + p, ok := <-splitCh + if !ok { + break + } + m := (p.lo + p.hi) / 2 + split := splitPoints[m] + if _, err := db.Exec(`ALTER TABLE ycsb.usertable SPLIT AT VALUES ($1)`, split); err != nil { + log.Fatal(err) + } + // NB: the split+1 expression below guarantees our scatter range + // touches both sides of the split. + if _, err := db.Exec(fmt.Sprintf(`ALTER TABLE ycsb.usertable SCATTER FROM (%d) TO (%d)`, + splitPoints[p.lo], split+1)); err != nil { + // SCATTER can collide with normal replicate queue operations and + // fail spuriously, so only print the error. + log.Print(err) + } + doneCh <- struct{}{} + go func() { + if p.lo < m { + splitCh <- pair{p.lo, m} + } + if m+1 < p.hi { + splitCh <- pair{m + 1, p.hi} + } + }() + } + }() + } + + for i := 0; i < len(splitPoints); i++ { + <-doneCh + if (i+1)%1000 == 0 { + fmt.Printf("%d splits\n", i+1) + } + } + close(splitCh) + wg.Wait() + } + + return &cockroach{db: db, readStmt: readStmt, writeStmt: writeStmt}, nil +} + +type mongoBlock struct { + Key int64 `bson:"_id"` + Fields []string +} + +type mongo struct { + kv *mgo.Collection +} + +func (m *mongo) readRow(key uint64) (bool, error) { + var b mongoBlock + if err := m.kv.Find(bson.M{"_id": key}).One(&b); err != nil { + if err == mgo.ErrNotFound { + return true, nil + } + return false, err + } + return false, nil +} + +func (m *mongo) insertRow(key uint64, fields []string) error { + return m.kv.Insert(&mongoBlock{ + Key: int64(key), + Fields: fields, + }) +} + +func (m *mongo) clone() database { + return &mongo{ + // NB: Whoa! + kv: m.kv.Database.Session.Copy().DB(m.kv.Database.Name).C(m.kv.Name), + } +} + +func setupMongo(dbURLs []string) (database, error) { + // NB: the Mongo driver automatically detects the other nodes in the + // cluster. We just have to specify the first one. + session, err := mgo.Dial(dbURLs[0]) + if err != nil { + panic(err) + } + + session.SetMode(mgo.Monotonic, true) + session.SetSafe(&mgo.Safe{WMode: *mongoWMode, J: *mongoJ}) + + kv := session.DB("ycsb").C("kv") + if *drop { + // Intentionally ignore the error as we can't tell if the collection + // doesn't exist. + _ = kv.DropCollection() + } + return &mongo{kv: kv}, nil +} + +type cassandra struct { + session *gocql.Session +} + +func (c *cassandra) readRow(key uint64) (bool, error) { + var k uint64 + var fields [10]string + if err := c.session.Query( + `SELECT * FROM ycsb.usertable WHERE ycsb_key = ? LIMIT 1`, + key).Scan(&k, &fields[0], &fields[1], &fields[2], &fields[3], + &fields[4], &fields[5], &fields[6], &fields[7], &fields[8], &fields[9]); err != nil { + if err == gocql.ErrNotFound { + return true, nil + } + return false, err + } + return false, nil +} + +func (c *cassandra) insertRow(key uint64, fields []string) error { + const stmt = "INSERT INTO ycsb.usertable " + + "(ycsb_key, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10) " + + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); " + args := make([]interface{}, len(fields)+1) + args[0] = key + for i := 0; i < len(fields); i++ { + args[i+1] = fields[i] + } + return c.session.Query(stmt, args...).Exec() +} + +func (c *cassandra) clone() database { + return c +} + +func setupCassandra(dbURLs []string) (database, error) { + hosts := make([]string, 0, len(dbURLs)) + for _, u := range dbURLs { + p, err := url.Parse(u) + if err != nil { + return nil, err + } + hosts = append(hosts, p.Host) + } + + cluster := gocql.NewCluster(hosts...) + cluster.Consistency = gocql.ParseConsistency(*cassandraConsistency) + s, err := cluster.CreateSession() + if err != nil { + log.Fatal(err) + } + + if *drop { + _ = s.Query(`DROP KEYSPACE ycsb`).RetryPolicy(nil).Exec() + } + + createKeyspace := fmt.Sprintf(` +CREATE KEYSPACE IF NOT EXISTS ycsb WITH REPLICATION = { + 'class' : 'SimpleStrategy', + 'replication_factor' : %d +};`, *cassandraReplication) + + const createTable = ` +CREATE TABLE IF NOT EXISTS ycsb.usertable ( + ycsb_key BIGINT, + FIELD1 BLOB, + FIELD2 BLOB, + FIELD3 BLOB, + FIELD4 BLOB, + FIELD5 BLOB, + FIELD6 BLOB, + FIELD7 BLOB, + FIELD8 BLOB, + FIELD9 BLOB, + FIELD10 BLOB, + PRIMARY KEY(ycsb_key) +);` + + if err := s.Query(createKeyspace).RetryPolicy(nil).Exec(); err != nil { + log.Fatal(err) + } + if err := s.Query(createTable).RetryPolicy(nil).Exec(); err != nil { + log.Fatal(err) + } + return &cassandra{session: s}, nil +} + +// setupDatabase performs initial setup for the example, creating a database +// with a single table. If the desired table already exists on the cluster, the +// existing table will be dropped if the -drop flag was specified. +func setupDatabase(dbURLs []string) (database, error) { + parsedURL, err := url.Parse(dbURLs[0]) + if err != nil { + return nil, err + } + parsedURL.Path = "ycsb" + + switch parsedURL.Scheme { + case "postgres", "postgresql": + return setupCockroach(dbURLs) + case "mongodb": + return setupMongo(dbURLs) + case "cassandra": + return setupCassandra(dbURLs) + default: + return nil, fmt.Errorf("unsupported database: %s", parsedURL.Scheme) + } +} + +var usage = func() { + fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) + fmt.Fprintf(os.Stderr, " %s <db URL>\n\n", os.Args[0]) + flag.PrintDefaults() +} + +func snapshotStats() (s [statsLength]uint64) { + for i := 0; i < int(statsLength); i++ { + s[i] = atomic.LoadUint64(&globalStats[i]) + } + return s +} + +type atomicTime struct { + ptr unsafe.Pointer +} + +func (t *atomicTime) set(v time.Time) { + atomic.StorePointer(&t.ptr, unsafe.Pointer(&v)) +} + +func (t *atomicTime) get() time.Time { + return *(*time.Time)(atomic.LoadPointer(&t.ptr)) +} + +func main() { + flag.Usage = usage + flag.Parse() + if *verbose { + fmt.Fprintf(os.Stdout, "Starting YCSB load generator\n") + } + + dbURLs := []string{"postgres://root@localhost:26257/ycsb?sslmode=disable"} + if args := flag.Args(); len(args) >= 1 { + dbURLs = args + } + + if *concurrency < 1 { + log.Fatalf("Value of 'concurrency' flag (%d) must be greater than or equal to 1", + concurrency) + } + + db, err := setupDatabase(dbURLs) + + if err != nil { + log.Fatalf("Setting up database failed: %s", err) + } + if *verbose { + fmt.Printf("Database setup complete. Loading...\n") + } + + lastNow := time.Now() + var lastOpsCount uint64 + var lastStats [statsLength]uint64 + + zipfR, err := NewZipfGenerator(zipfIMin, *initialLoad, zipfS, *verbose) + if err != nil { + panic(err) + } + + workers := make([]*ycsbWorker, *concurrency) + for i := range workers { + workers[i] = newYcsbWorker(db.clone(), zipfR, *workload) + } + + var limiter *rate.Limiter + if *maxRate > 0 { + // Create a limiter using maxRate specified on the command line and + // with allowed burst of 1 at the maximum allowed rate. + limiter = rate.NewLimiter(rate.Limit(*maxRate), 1) + } + + errCh := make(chan error) + tick := time.Tick(1 * time.Second) + done := make(chan os.Signal, 3) + signal.Notify(done, syscall.SIGINT, syscall.SIGTERM) + var start atomicTime + var startOpsCount uint64 + var numErr int + start.set(time.Now()) + + go func() { + loadStart := time.Now() + var wg sync.WaitGroup + for i, n := 0, len(workers); i < n; i++ { + wg.Add(1) + go workers[i].runLoader(*initialLoad, n, i, &wg) + } + wg.Wait() + fmt.Printf("Loading complete: %.1fs\n", time.Since(loadStart).Seconds()) + + // Reset the start time and stats. + lastNow = time.Now() + start.set(lastNow) + atomic.StoreUint64(&startOpsCount, 0) + for i := 0; i < int(statsLength); i++ { + atomic.StoreUint64(&globalStats[i], 0) + } + lastOpsCount = 0 + for i := range lastStats { + lastStats[i] = 0 + } + + wg = sync.WaitGroup{} + for i := range workers { + wg.Add(1) + go workers[i].runWorker(errCh, &wg, limiter) + } + + go func() { + wg.Wait() + done <- syscall.Signal(0) + }() + + if *duration > 0 { + go func() { + time.Sleep(*duration) + done <- syscall.Signal(0) + }() + } + + if *writeDuration > 0 { + go func() { + time.Sleep(*writeDuration) + atomic.StoreInt32(&readOnly, 1) + }() + } + }() + + for i := 0; ; { + select { + case err := <-errCh: + numErr++ + if !*tolerateErrors { + log.Fatal(err) + } else if *verbose { + log.Print(err) + } + continue + + case <-tick: + now := time.Now() + elapsed := now.Sub(lastNow) + + stats := snapshotStats() + opsCount := stats[writes] + stats[emptyReads] + + stats[nonEmptyReads] + stats[scans] + if i%20 == 0 { + fmt.Printf("elapsed______ops/sec__reads/empty/errors___writes/errors____scans/errors\n") + } + fmt.Printf("%7s %12.1f %19s %15s %15s\n", + time.Duration(time.Since(start.get()).Seconds()+0.5)*time.Second, + float64(opsCount-lastOpsCount)/elapsed.Seconds(), + fmt.Sprintf("%d / %d / %d", + stats[nonEmptyReads]-lastStats[nonEmptyReads], + stats[emptyReads]-lastStats[emptyReads], + stats[readErrors]-lastStats[readErrors]), + fmt.Sprintf("%d / %d", + stats[writes]-lastStats[writes], + stats[writeErrors]-lastStats[writeErrors]), + fmt.Sprintf("%d / %d", + stats[scans]-lastStats[scans], + stats[scanErrors]-lastStats[scanErrors])) + lastStats = stats + lastOpsCount = opsCount + lastNow = now + i++ + + case <-done: + stats := snapshotStats() + opsCount := stats[writes] + stats[emptyReads] + + stats[nonEmptyReads] + stats[scans] - atomic.LoadUint64(&startOpsCount) + elapsed := time.Since(start.get()).Seconds() + fmt.Printf("\nelapsed__ops/sec(total)__errors(total)\n") + fmt.Printf("%6.1fs %14.1f %14d\n", + time.Since(start.get()).Seconds(), + float64(opsCount)/elapsed, numErr) + return + } + } +} diff --git a/pkg/workload/ycsb/zipfgenerator.go b/pkg/workload/ycsb/zipfgenerator.go new file mode 100644 index 000000000000..a59367829a66 --- /dev/null +++ b/pkg/workload/ycsb/zipfgenerator.go @@ -0,0 +1,172 @@ +// Copyright 2017 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. See the AUTHORS file +// for names of contributors. +// +// Author: Arjun Narayan +// +// ZipfGenerator implements the Incrementing Zipfian Random Number Generator from +// [1]: "Quickly Generating Billion-Record Synthetic Databases" +// by Gray, Sundaresan, Englert, Baclawski, and Weinberger, SIGMOD 1994. + +package main + +import ( + "fmt" + "math" + "math/rand" + "sync" + "time" + + "github.com/pkg/errors" +) + +// ZipfGenerator is a random number generator that generates draws from a Zipf +// distribution. Unlike rand.Zipf, this generator supports incrementing the +// imax parameter without performing an expensive recomputation of the +// underlying hidden parameters, which is a pattern used in [1] for efficiently +// generating large volumes of Zipf-distributed records for synthetic data. +// Second, rand.Zipf only supports theta <= 1, we suppose all values of theta. +type ZipfGenerator struct { + // The underlying RNG + zipfGenMu ZipfGeneratorMu + // supplied values + theta float64 + iMin uint64 + // internally computed values + alpha, zeta2 float64 + verbose bool +} + +// ZipfGeneratorMu holds variables which must be globally synced. +type ZipfGeneratorMu struct { + mu sync.Mutex + r *rand.Rand + iMax uint64 + iMaxHead uint64 + eta float64 + zetaN float64 +} + +// NewZipfGenerator constructs a new ZipfGenerator with the given parameters. +// It returns an error if the parameters are outside the accepted range. +func NewZipfGenerator(iMin, iMax uint64, theta float64, verbose bool) (*ZipfGenerator, error) { + if iMin > iMax { + return nil, errors.Errorf("iMin %d > iMax %d", iMin, iMax) + } + if theta < 0.0 || theta == 1.0 { + return nil, errors.Errorf("0 < theta, and theta != 1") + } + + z := ZipfGenerator{ + iMin: iMin, + zipfGenMu: ZipfGeneratorMu{ + r: rand.New(rand.NewSource(int64(time.Now().UnixNano()))), + iMax: iMax, + }, + theta: theta, + verbose: verbose, + } + z.zipfGenMu.mu.Lock() + defer z.zipfGenMu.mu.Unlock() + + // Compute hidden parameters + zeta2, err := computeZetaFromScratch(2, theta) + if err != nil { + return nil, errors.Errorf("Could not compute zeta(2,theta): %s", err) + } + var zetaN float64 + zetaN, err = computeZetaFromScratch(iMax+1-iMin, theta) + if err != nil { + return nil, errors.Errorf("Could not compute zeta(2,%d): %s", iMax, err) + } + z.alpha = 1.0 / (1.0 - theta) + z.zipfGenMu.eta = (1 - math.Pow(2.0/float64(z.zipfGenMu.iMax+1-z.iMin), 1.0-theta)) / (1.0 - zeta2/zetaN) + z.zipfGenMu.zetaN = zetaN + z.zeta2 = zeta2 + return &z, nil +} + +// computeZetaIncrementally recomputes zeta(iMax, theta), assuming that +// sum = zeta(oldIMax, theta). It returns zeta(iMax, theta), computed incrementally. +func computeZetaIncrementally(oldIMax, iMax uint64, theta float64, sum float64) (float64, error) { + if iMax < oldIMax { + return 0, errors.Errorf("Can't increment iMax backwards!") + } + for i := oldIMax + 1; i <= iMax; i++ { + sum += 1.0 / math.Pow(float64(i), theta) + } + return sum, nil +} + +// The function zeta computes the value +// zeta(n, theta) = (1/1)^theta + (1/2)^theta + (1/3)^theta + ... + (1/n)^theta +func computeZetaFromScratch(n uint64, theta float64) (float64, error) { + zeta, err := computeZetaIncrementally(0, n, theta, 0.0) + if err != nil { + return zeta, errors.Errorf("could not compute zeta: %s", err) + } + return zeta, nil +} + +// Uint64 draws a new value between iMin and iMax, with probabilities +// according to the Zipf distribution. +func (z *ZipfGenerator) Uint64() uint64 { + z.zipfGenMu.mu.Lock() + u := z.zipfGenMu.r.Float64() + uz := u * z.zipfGenMu.zetaN + var result uint64 + if uz < 1.0 { + result = z.iMin + } else if uz < 1.0+math.Pow(0.5, z.theta) { + result = z.iMin + 1 + } else { + spread := float64(z.zipfGenMu.iMax + 1 - z.iMin) + result = z.iMin + uint64(spread*math.Pow(z.zipfGenMu.eta*u-z.zipfGenMu.eta+1.0, z.alpha)) + } + if z.verbose { + fmt.Printf("Uint64[%d, %d] -> %d\n", z.iMin, z.zipfGenMu.iMax, result) + } + z.zipfGenMu.mu.Unlock() + return result +} + +// IncrementIMax increments, iMax, and recompute the internal values that depend +// on it. It throws an error if the recomputation failed. +func (z *ZipfGenerator) IncrementIMax() error { + z.zipfGenMu.mu.Lock() + zetaN, err := computeZetaIncrementally( + z.zipfGenMu.iMax, z.zipfGenMu.iMax+1, z.theta, z.zipfGenMu.zetaN) + if err != nil { + z.zipfGenMu.mu.Unlock() + return errors.Errorf("Could not incrementally compute zeta: %s", err) + } + eta := (1 - math.Pow(2.0/float64(z.zipfGenMu.iMax+1-z.iMin), 1.0-z.theta)) / (1.0 - z.zeta2/zetaN) + z.zipfGenMu.eta = eta + z.zipfGenMu.zetaN = zetaN + z.zipfGenMu.iMax++ + z.zipfGenMu.mu.Unlock() + return nil +} + +// IMaxHead returns the current value of IMaxHead, and increments it after. +func (z *ZipfGenerator) IMaxHead() uint64 { + z.zipfGenMu.mu.Lock() + if z.zipfGenMu.iMaxHead < z.zipfGenMu.iMax { + z.zipfGenMu.iMaxHead = z.zipfGenMu.iMax + } + iMaxHead := z.zipfGenMu.iMaxHead + z.zipfGenMu.iMaxHead++ + z.zipfGenMu.mu.Unlock() + return iMaxHead +} diff --git a/pkg/workload/ycsb/zipfgenerator_test.go b/pkg/workload/ycsb/zipfgenerator_test.go new file mode 100644 index 000000000000..1c92fe5f0481 --- /dev/null +++ b/pkg/workload/ycsb/zipfgenerator_test.go @@ -0,0 +1,158 @@ +// Copyright 2017 The Cockroach Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. See the AUTHORS file +// for names of contributors. +// +// Author: Arjun Narayan + +package main + +import ( + "fmt" + "math" + "sort" + "testing" +) + +type params struct { + iMin, iMax uint64 + theta float64 +} + +var gens = []params{ + {0, 100, 0.99}, + {0, 100, 1.01}, +} + +func TestCreateZipfGenerator(t *testing.T) { + for _, gen := range gens { + _, err := NewZipfGenerator(gen.iMin, gen.iMax, gen.theta, false) + if err != nil { + t.Fatal(err) + } + } +} + +var zetas = [][]float64{ + // n, theta, zeta(n,theta) + {20.0, 0.99, 3.64309060779367}, + {200.0, 0.99, 6.02031118558}, + {1000, 0.99, 7.72895321728}, + {2000, 0.99, 8.47398788329}, + {10000, 0.99, 10.2243614596}, + {100000, 0.99, 12.7783380626}, + {1000000, 0.99, 15.391849746}, + {10000000, 0.99, 18.066242575}, + {100000000, 0.99, 20.80293049}, +} + +func TestZetaFromScratch(t *testing.T) { + for _, zeta := range zetas { + computedZeta, err := computeZetaFromScratch(uint64(zeta[0]), zeta[1]) + if err != nil { + t.Fatalf("Failed to compute zeta(%d,%f): %s", uint64(zeta[0]), zeta[1], err) + } + if math.Abs(computedZeta-zeta[2]) > 0.000000001 { + t.Fatalf("expected %6.4f, got %6.4f", zeta[2], computedZeta) + } + } +} + +func TestZetaIncrementally(t *testing.T) { + // Theta cannot be 1 by definition, so this is a safe initial value. + oldTheta := 1.0 + for i, zeta := range zetas { + var oldZetaN float64 + var oldN uint64 + // If theta has changed, recompute from scratch + if zetas[i][0] != oldTheta { + var err error + oldZetaN, err = computeZetaFromScratch(uint64(zeta[0]), zeta[1]) + if err != nil { + t.Fatalf("Failed to compute zeta(%d,%f): %s", uint64(zeta[0]), zeta[1], err) + } + oldN = uint64(zeta[0]) + continue + } + + computedZeta, err := computeZetaIncrementally(oldN, uint64(zeta[0]), zeta[1], oldZetaN) + if err != nil { + t.Fatalf("Failed to compute zeta(%d,%f) incrementally: %s", uint64(zeta[0]), zeta[1], err) + } + if math.Abs(computedZeta-zeta[2]) > 0.000000001 { + t.Fatalf("expected %6.4f, got %6.4f", zeta[2], computedZeta) + } + + oldZetaN = computedZeta + oldN = uint64(zeta[0]) + } +} + +func runZipfGenerators(t *testing.T, withIncrements bool) { + gen := gens[0] + z, err := NewZipfGenerator(gen.iMin, gen.iMax, gen.theta, false) + if err != nil { + t.Fatal(err) + } + + const ROLLS = 10000 + x := make([]int, ROLLS) + + for i := 0; i < ROLLS; i++ { + x[i] = int(z.Uint64()) + z.zipfGenMu.mu.Lock() + if x[i] < int(z.iMin) || x[i] > int(z.zipfGenMu.iMax) { + t.Fatalf("zipf(%d,%d,%f) rolled %d at index %d", z.iMin, z.zipfGenMu.iMax, z.theta, x[i], i) + z.zipfGenMu.mu.Unlock() + if withIncrements { + if err := z.IncrementIMax(); err != nil { + t.Fatalf("could not increment iMax: %s", err) + } + } + } + z.zipfGenMu.mu.Unlock() + } + + if withIncrements { + return + } + + sort.Ints(x) + + max := x[ROLLS-1] + step := max / 20 + index := 0 + count := 0 + for i := 0; i < max; i += step { + count = 0 + for { + if x[index] >= i { + break + } + index++ + count++ + } + fmt.Printf("[%10d-%10d) ", i, i+step) + for j := 0; j < count; j++ { + if j%50 == 0 { + fmt.Printf("%c", '∎') + } + } + fmt.Println() + } +} + +func TestZipfGenerator(t *testing.T) { + runZipfGenerators(t, false) + runZipfGenerators(t, true) +}
a31e8fbc38190faeb3e7ecc0a26e2914abb50331
2024-11-06 05:57:48
Arul Ajmani
raft: fix TODOs in TestLeaderTransfer{StaleFollower,StepsDownImmediately}
false
fix TODOs in TestLeaderTransfer{StaleFollower,StepsDownImmediately}
raft
diff --git a/pkg/raft/raft_test.go b/pkg/raft/raft_test.go index 683d8e3ce435..7039cf208068 100644 --- a/pkg/raft/raft_test.go +++ b/pkg/raft/raft_test.go @@ -3488,10 +3488,6 @@ func TestLeaderTransferLeaderStepsDownImmediately(t *testing.T) { require.Equal(t, uint64(1), lead.Term) checkLeaderTransferState(t, lead, pb.StateFollower, 1) - // TODO(arul): a leader that steps down will currently never campaign due to - // the fortification promise that it made to itself. We'll need to fix this. - lead.deFortify(lead.lead, lead.Term) - // Eventually, the previous leader gives up on waiting and calls an election // to reestablish leadership at the next term. for i := int64(0); i < lead.randomizedElectionTimeout; i++ { @@ -3957,10 +3953,6 @@ func TestLeaderTransferStaleFollower(t *testing.T) { require.Equal(t, uint64(1), n.Term) } - // TODO(arul): a leader that steps down will currently never campaign due to - // the fortification promise that it made to itself. We'll need to fix this. - n1.deFortify(n1.lead, n1.Term) - // Eventually, the previous leader gives up on waiting and calls an election // to reestablish leadership at the next term. Node 3 does not hear about this // either.
1a133d1a7cc0f7d5ea7f7553a5a49ab1d9b5fb55
2016-08-10 04:08:05
Peter Mattis
kv: deflake TestClientNotReady
false
deflake TestClientNotReady
kv
diff --git a/kv/send_test.go b/kv/send_test.go index 225865c5c921..3905717b6f7c 100644 --- a/kv/send_test.go +++ b/kv/send_test.go @@ -20,6 +20,7 @@ import ( "net" "reflect" "strconv" + "strings" "testing" "time" @@ -477,7 +478,12 @@ func TestClientNotReady(t *testing.T) { _, err := sendBatch(SendOptions{ Context: context.Background(), }, addrs, nodeContext) - if !testutils.IsError(err, "connection is closing|failed fast due to transport failure") { + expected := strings.Join([]string{ + "context canceled", + "connection is closing", + "failed fast due to transport failure", + }, "|") + if !testutils.IsError(err, expected) { errCh <- errors.Wrap(err, "unexpected error") } else { close(errCh)
ac86fa0d8783e068d7fd922de25178668ee29939
2019-08-27 08:12:51
Jordan Lewis
sql: add row lock modes; make FOR UPDATE a no-op
false
add row lock modes; make FOR UPDATE a no-op
sql
diff --git a/docs/generated/sql/bnf/select_stmt.bnf b/docs/generated/sql/bnf/select_stmt.bnf index 461e73a8f339..03cd7a259a1a 100644 --- a/docs/generated/sql/bnf/select_stmt.bnf +++ b/docs/generated/sql/bnf/select_stmt.bnf @@ -1,3 +1,3 @@ select_stmt ::= - ( select_clause ( sort_clause | ) ( limit_clause | ) ( offset_clause | ) | ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) select_clause ( sort_clause | ) ( limit_clause | ) ( offset_clause | ) ) + ( simple_select opt_for | select_clause sort_clause opt_for | select_clause ( sort_clause | ) ( limit_clause offset_clause | offset_clause limit_clause | limit_clause | offset_clause ) opt_for | ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) select_clause opt_for | ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) select_clause sort_clause opt_for | ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) select_clause ( sort_clause | ) ( limit_clause offset_clause | offset_clause limit_clause | limit_clause | offset_clause ) opt_for ) diff --git a/docs/generated/sql/bnf/stmt_block.bnf b/docs/generated/sql/bnf/stmt_block.bnf index 5863eabd655f..a82b8f158162 100644 --- a/docs/generated/sql/bnf/stmt_block.bnf +++ b/docs/generated/sql/bnf/stmt_block.bnf @@ -434,12 +434,12 @@ scrub_database_stmt ::= 'EXPERIMENTAL' 'SCRUB' 'DATABASE' database_name opt_as_of_clause select_no_parens ::= - simple_select - | select_clause sort_clause - | select_clause opt_sort_clause select_limit - | with_clause select_clause - | with_clause select_clause sort_clause - | with_clause select_clause opt_sort_clause select_limit + simple_select opt_for + | select_clause sort_clause opt_for + | select_clause opt_sort_clause select_limit opt_for + | with_clause select_clause opt_for + | with_clause select_clause sort_clause opt_for + | with_clause select_clause opt_sort_clause select_limit opt_for select_with_parens ::= '(' select_no_parens ')' @@ -788,6 +788,7 @@ unreserved_keyword ::= | 'SESSION' | 'SESSIONS' | 'SET' + | 'SHARE' | 'SHOW' | 'SIMPLE' | 'SMALLSERIAL' @@ -1142,6 +1143,12 @@ simple_select ::= | table_clause | set_operation +opt_for ::= + 'FOR' 'UPDATE' + | 'FOR' 'NO' 'KEY' 'UPDATE' + | 'FOR' 'SHARE' + | 'FOR' 'KEY' 'SHARE' + select_clause ::= simple_select | select_with_parens diff --git a/pkg/sql/logictest/testdata/logic_test/feature_counts b/pkg/sql/logictest/testdata/logic_test/feature_counts index ac3f527d9db5..a1ba17be7f7c 100644 --- a/pkg/sql/logictest/testdata/logic_test/feature_counts +++ b/pkg/sql/logictest/testdata/logic_test/feature_counts @@ -1,12 +1,12 @@ # LogicTest: local statement error unimplemented -SELECT * FROM system.users FOR UPDATE +SELECT 'a'::INTERVAL(123) query TI colnames SELECT * FROM crdb_internal.feature_usage - WHERE feature_name LIKE '%syntax.#6583%' + WHERE feature_name LIKE '%syntax.#32564%' ---- feature_name usage_count -unimplemented.syntax.#6583 1 +unimplemented.syntax.#32564 1 diff --git a/pkg/sql/logictest/testdata/logic_test/select_for_update b/pkg/sql/logictest/testdata/logic_test/select_for_update new file mode 100644 index 000000000000..c42ba817b989 --- /dev/null +++ b/pkg/sql/logictest/testdata/logic_test/select_for_update @@ -0,0 +1,21 @@ +# Cockroach currently supports all of the row locking modes as no-ops, so just +# test that they parse and run. +query I +SELECT 1 FOR UPDATE +---- +1 + +query I +SELECT 1 FOR NO KEY UPDATE +---- +1 + +query I +SELECT 1 FOR SHARE +---- +1 + +query I +SELECT 1 FOR KEY SHARE +---- +1 diff --git a/pkg/sql/opt/optbuilder/select.go b/pkg/sql/opt/optbuilder/select.go index fb353e3da0b0..1aa417f748e3 100644 --- a/pkg/sql/opt/optbuilder/select.go +++ b/pkg/sql/opt/optbuilder/select.go @@ -676,6 +676,20 @@ func (b *Builder) buildSelect( orderBy := stmt.OrderBy limit := stmt.Limit with := stmt.With + forLocked := stmt.ForLocked + + switch forLocked { + case tree.ForNone: + case tree.ForUpdate: + case tree.ForNoKeyUpdate: + case tree.ForShare: + case tree.ForKeyShare: + // CockroachDB treats all of the FOR LOCKED modes as no-ops. Since all + // transactions are serializable in CockroachDB, clients can't observe + // whether or not FOR UPDATE (or any of the other weaker modes) actually + // created a lock. This behavior may improve as the transaction model gains + // more capabilities. + } for s, ok := wrapped.(*tree.ParenSelect); ok; s, ok = wrapped.(*tree.ParenSelect) { stmt = s.Select diff --git a/pkg/sql/parser/parse_test.go b/pkg/sql/parser/parse_test.go index 979240020ecc..1bf6d5c0322f 100644 --- a/pkg/sql/parser/parse_test.go +++ b/pkg/sql/parser/parse_test.go @@ -1025,6 +1025,11 @@ func TestParse(t *testing.T) { {`SELECT (i.keys).*`}, {`SELECT (ARRAY['a', 'b', 'c']).name`}, + {`SELECT 1 FOR UPDATE`}, + {`SELECT 1 FOR NO KEY UPDATE`}, + {`SELECT 1 FOR SHARE`}, + {`SELECT 1 FOR KEY SHARE`}, + {`TABLE a`}, // Shorthand for: SELECT * FROM a; used e.g. in CREATE VIEW v AS TABLE t {`EXPLAIN TABLE a`}, {`TABLE [123 AS a]`}, @@ -3025,7 +3030,6 @@ func TestUnimplementedSyntax(t *testing.T) { {`INSERT INTO foo(a, a.b) VALUES (1,2)`, 27792, ``}, {`INSERT INTO foo VALUES (1,2) ON CONFLICT ON CONSTRAINT a DO NOTHING`, 28161, ``}, - {`SELECT * FROM a FOR UPDATE`, 6583, ``}, {`SELECT * FROM ROWS FROM (a(b) AS (d))`, 0, `ROWS FROM with col_def_list`}, {`SELECT 'a'::INTERVAL SECOND`, 0, `interval with unit qualifier`}, diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index cdd8021dc446..e49aba9ac3e3 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -290,6 +290,9 @@ func (u *sqlSymUnion) when() *tree.When { func (u *sqlSymUnion) whens() []*tree.When { return u.val.([]*tree.When) } +func (u *sqlSymUnion) forLocked() tree.ForLocked { + return u.val.(tree.ForLocked) +} func (u *sqlSymUnion) updateExpr() *tree.UpdateExpr { return u.val.(*tree.UpdateExpr) } @@ -554,7 +557,7 @@ func newNameFromStr(s string) *tree.Name { %token <str> SAVEPOINT SCATTER SCHEMA SCHEMAS SCRUB SEARCH SECOND SELECT SEQUENCE SEQUENCES %token <str> SERIAL SERIAL2 SERIAL4 SERIAL8 %token <str> SERIALIZABLE SERVER SESSION SESSIONS SESSION_USER SET SETTING SETTINGS -%token <str> SHOW SIMILAR SIMPLE SMALLINT SMALLSERIAL SNAPSHOT SOME SPLIT SQL +%token <str> SHARE SHOW SIMILAR SIMPLE SMALLINT SMALLSERIAL SNAPSHOT SOME SPLIT SQL %token <str> START STATISTICS STATUS STDIN STRICT STRING STORE STORED STORING SUBSTRING %token <str> SYMMETRIC SYNTAX SYSTEM SUBSCRIPTION @@ -773,6 +776,7 @@ func newNameFromStr(s string) *tree.Name { %type <*tree.Select> select_no_parens %type <tree.SelectStatement> select_clause select_with_parens simple_select values_clause table_clause simple_select_clause +%type <tree.ForLocked> opt_for %type <tree.SelectStatement> set_operation %type <tree.Expr> alter_column_default @@ -5750,32 +5754,35 @@ select_with_parens: select_no_parens: simple_select opt_for { - $$.val = &tree.Select{Select: $1.selectStmt()} + $$.val = &tree.Select{Select: $1.selectStmt(), ForLocked: $2.forLocked()} } | select_clause sort_clause opt_for { - $$.val = &tree.Select{Select: $1.selectStmt(), OrderBy: $2.orderBy()} + $$.val = &tree.Select{Select: $1.selectStmt(), OrderBy: $2.orderBy(), ForLocked: $3.forLocked()} } | select_clause opt_sort_clause select_limit opt_for { - $$.val = &tree.Select{Select: $1.selectStmt(), OrderBy: $2.orderBy(), Limit: $3.limit()} + $$.val = &tree.Select{Select: $1.selectStmt(), OrderBy: $2.orderBy(), Limit: $3.limit(), ForLocked: $4.forLocked()} } | with_clause select_clause opt_for { - $$.val = &tree.Select{With: $1.with(), Select: $2.selectStmt()} + $$.val = &tree.Select{With: $1.with(), Select: $2.selectStmt(), ForLocked: $3.forLocked()} } | with_clause select_clause sort_clause opt_for { - $$.val = &tree.Select{With: $1.with(), Select: $2.selectStmt(), OrderBy: $3.orderBy()} + $$.val = &tree.Select{With: $1.with(), Select: $2.selectStmt(), OrderBy: $3.orderBy(), ForLocked: $4.forLocked()} } | with_clause select_clause opt_sort_clause select_limit opt_for { - $$.val = &tree.Select{With: $1.with(), Select: $2.selectStmt(), OrderBy: $3.orderBy(), Limit: $4.limit()} + $$.val = &tree.Select{With: $1.with(), Select: $2.selectStmt(), OrderBy: $3.orderBy(), Limit: $4.limit(), ForLocked: $5.forLocked()} } opt_for: - /* EMPTY */ { /* no error */ } -| FOR error { return unimplementedWithIssue(sqllex, 6583) } + /* EMPTY */ { $$.val = tree.ForNone } +| FOR UPDATE { $$.val = tree.ForUpdate } +| FOR NO KEY UPDATE { $$.val = tree.ForNoKeyUpdate } +| FOR SHARE { $$.val = tree.ForShare } +| FOR KEY SHARE { $$.val = tree.ForKeyShare } select_clause: // We only provide help if an open parenthesis is provided, because @@ -9351,6 +9358,7 @@ unreserved_keyword: | SESSION | SESSIONS | SET +| SHARE | SHOW | SIMPLE | SMALLSERIAL diff --git a/pkg/sql/sem/tree/pretty.go b/pkg/sql/sem/tree/pretty.go index 0f4ee354eb4d..cc29b098368f 100644 --- a/pkg/sql/sem/tree/pretty.go +++ b/pkg/sql/sem/tree/pretty.go @@ -538,9 +538,31 @@ func (node *Select) docTable(p *PrettyCfg) []pretty.TableRow { } items = append(items, node.OrderBy.docRow(p)) items = append(items, node.Limit.docTable(p)...) + items = append(items, node.ForLocked.docTable(p)...) return items } +func (node ForLocked) doc(p *PrettyCfg) pretty.Doc { + return p.rlTable(node.docTable(p)...) +} + +func (node ForLocked) docTable(p *PrettyCfg) []pretty.TableRow { + var keyword string + switch node { + case ForNone: + return nil + case ForUpdate: + keyword = "FOR UPDATE" + case ForNoKeyUpdate: + keyword = "FOR NO KEY UPDATE" + case ForShare: + keyword = "FOR SHARE" + case ForKeyShare: + keyword = "FOR KEY SHARE" + } + return []pretty.TableRow{p.row("", pretty.Keyword(keyword))} +} + func (node *SelectClause) doc(p *PrettyCfg) pretty.Doc { return p.rlTable(node.docTable(p)...) } diff --git a/pkg/sql/sem/tree/select.go b/pkg/sql/sem/tree/select.go index f2f7768bc6c0..092cb0b04ba0 100644 --- a/pkg/sql/sem/tree/select.go +++ b/pkg/sql/sem/tree/select.go @@ -41,10 +41,43 @@ func (*ValuesClause) selectStatement() {} // Select represents a SelectStatement with an ORDER and/or LIMIT. type Select struct { - With *With - Select SelectStatement - OrderBy OrderBy - Limit *Limit + With *With + Select SelectStatement + OrderBy OrderBy + Limit *Limit + ForLocked ForLocked +} + +// ForLocked represents the possible row-level lock modes for a SELECT +// statement. +type ForLocked byte + +const ( + // ForNone represents the default - no for statement at all. + ForNone ForLocked = iota + // ForUpdate represents FOR UPDATE. + ForUpdate + // ForNoKeyUpdate represents FOR NO KEY UPDATE. + ForNoKeyUpdate + // ForShare represents FOR SHARE. + ForShare + // ForKeyShare represents FOR KEY SHARE. + ForKeyShare +) + +// Format implements the NodeFormatter interface. +func (f ForLocked) Format(ctx *FmtCtx) { + switch f { + case ForNone: + case ForUpdate: + ctx.WriteString(" FOR UPDATE") + case ForNoKeyUpdate: + ctx.WriteString(" FOR NO KEY UPDATE") + case ForShare: + ctx.WriteString(" FOR SHARE") + case ForKeyShare: + ctx.WriteString(" FOR KEY SHARE") + } } // Format implements the NodeFormatter interface. @@ -59,6 +92,7 @@ func (node *Select) Format(ctx *FmtCtx) { ctx.WriteByte(' ') ctx.FormatNode(node.Limit) } + ctx.FormatNode(node.ForLocked) } // ParenSelect represents a parenthesized SELECT/UNION/VALUES statement.
88a3f1c3083df3123c31a8739fa9af91aad608f8
2017-01-24 21:19:33
Radu Berinde
distsql: support filterNode
false
support filterNode
distsql
diff --git a/pkg/sql/distsql_physical_planner.go b/pkg/sql/distsql_physical_planner.go index 065c2162ba95..a8e1d49037e5 100644 --- a/pkg/sql/distsql_physical_planner.go +++ b/pkg/sql/distsql_physical_planner.go @@ -142,10 +142,10 @@ func (dsp *distSQLPlanner) checkExpr(expr parser.Expr) error { func (dsp *distSQLPlanner) CheckSupport(tree planNode) (shouldRunDist bool, notSuppErr error) { switch n := tree.(type) { case *filterNode: - // The Evaluator processors we use for select don't support filters yet. - // This is easily fixed, but it will only matter when we support joins - // (normally, all filters are pushed down to scanNodes). - return false, errors.Errorf("filter not supported as separate node") + if err := dsp.checkExpr(n.filter); err != nil { + return false, err + } + return dsp.CheckSupport(n.source.plan) case *renderNode: for i, e := range n.render { @@ -411,6 +411,75 @@ func distSQLExpression(expr parser.TypedExpr, columnMap []int) distsqlrun.Expres return distsqlrun.Expression{Expr: buf.String()} } +// getLastStagePost returns the PostProcessSpec for the current result +// processors in the plan. +func (p *physicalPlan) getLastStagePost() distsqlrun.PostProcessSpec { + post := p.processors[p.resultRouters[0]].spec.Post + + // All processors of a stage should be identical in terms of post-processing; + // verify this assumption. + for i := 1; i < len(p.resultRouters); i++ { + pi := &p.processors[p.resultRouters[i]].spec.Post + if pi.Filter != post.Filter || len(pi.OutputColumns) != len(post.OutputColumns) { + panic(fmt.Sprintf("inconsistent post-processing: %v vs %v", post, pi)) + } + for j, col := range pi.OutputColumns { + if col != post.OutputColumns[j] { + panic(fmt.Sprintf("inconsistent post-processing: %v vs %v", post, pi)) + } + } + } + + return post +} + +// addFilter adds a filter on the output of a plan. The filter is added as a +// post-processing step to the last stage. The expression's IndexedVars, after +// remapping through indexVarMap, refer to the output columns of the plan's +// resultRouters. +func addFilter(p *physicalPlan, expr parser.TypedExpr, indexVarMap []int) { + post := p.getLastStagePost() + + // The indexed variables in the filter expression - after remapping via + // indexVarMap - refer to the output columns of the processor(s) in the last + // stage (specifically p.resultRouters). These processors could have been + // already configured with projections. + // + // The filter in a processor's PostProcessSpec refers to variables *before* + // any output projection; so if there is an output projection, we have to take + // it into account and generate a composite indexed var map. For example: + // + // TableReader // table columns A,B,C,D + // OutputColumns: 0, 2 // A, C + // + // Filter: IndexedVar(0) < IndexedVar(1) // A < C + // indexVarMap: 0, 1 // identity + // compositeMap: 0, 2 + // Remapped expression: IndexedVar(0) < IndexedVar(2) + + var compositeMap []int + if len(post.OutputColumns) == 0 { + compositeMap = indexVarMap + } else { + compositeMap = make([]int, len(indexVarMap)) + for i, col := range indexVarMap { + if col == -1 { + compositeMap[i] = -1 + } else { + compositeMap[i] = int(post.OutputColumns[col]) + } + } + } + + filter := distSQLExpression(expr, compositeMap) + if post.Filter.Expr != "" { + filter.Expr = fmt.Sprintf("(%s) AND (%s)", post.Filter.Expr, filter.Expr) + } + for _, pIdx := range p.resultRouters { + p.processors[pIdx].spec.Post.Filter = filter + } +} + // spanPartition is the intersection between a set of spans for a certain // operation (e.g table scan) and the set of ranges owned by a given node. type spanPartition struct { @@ -776,6 +845,7 @@ func (dsp *distSQLPlanner) addSingleGroupStage( p *physicalPlan, nodeID roachpb.NodeID, core distsqlrun.ProcessorCoreUnion, + post distsqlrun.PostProcessSpec, colTypes []sqlbase.ColumnType, ) { proc := processor{ @@ -786,6 +856,7 @@ func (dsp *distSQLPlanner) addSingleGroupStage( ColumnTypes: colTypes, }}, Core: core, + Post: post, Output: []distsqlrun.OutputRouterSpec{{ Type: distsqlrun.OutputRouterSpec_PASS_THROUGH, }}, @@ -955,7 +1026,9 @@ func (dsp *distSQLPlanner) addAggregators( node = prevStageNode } dsp.addSingleGroupStage( - p, node, distsqlrun.ProcessorCoreUnion{Aggregator: &finalAggSpec}, inputTypes, + p, node, + distsqlrun.ProcessorCoreUnion{Aggregator: &finalAggSpec}, distsqlrun.PostProcessSpec{}, + inputTypes, ) evalExprs, needEval := dsp.extractPostAggrExprs(n.render) if needEval { @@ -1034,10 +1107,10 @@ ColLoop: types[i] = sqlbase.DatumTypeToColumnType(n.index.resultColumns[col].Typ) } dsp.addSingleGroupStage( - &plan, dsp.nodeDesc.NodeID, distsqlrun.ProcessorCoreUnion{JoinReader: &joinReaderSpec}, types, + &plan, dsp.nodeDesc.NodeID, + distsqlrun.ProcessorCoreUnion{JoinReader: &joinReaderSpec}, post, + types, ) - // TODO(radu): write generic code to add a filter. - plan.processors[plan.resultRouters[0]].spec.Post = post // Recalculate planToStreamColMap: it now maps to columns in the JoinReader's // output stream. for i := range plan.planToStreamColMap { @@ -1324,6 +1397,16 @@ func (dsp *distSQLPlanner) createPlanForNode( return plan, nil + case *filterNode: + plan, err := dsp.createPlanForNode(planCtx, n.source.plan) + if err != nil { + return physicalPlan{}, err + } + + addFilter(&plan, n.filter, plan.planToStreamColMap) + + return plan, nil + default: panic(fmt.Sprintf("unsupported node type %T", n)) } @@ -1422,6 +1505,7 @@ func (dsp *distSQLPlanner) PlanAndRun( plan.processors[plan.resultRouters[0]].node != thisNodeID { dsp.addSingleGroupStage( &plan, thisNodeID, distsqlrun.ProcessorCoreUnion{Noop: &distsqlrun.NoopCoreSpec{}}, + distsqlrun.PostProcessSpec{}, dsp.getTypesForPlanResult(plan.planToStreamColMap, tree), ) if len(plan.resultRouters) != 1 {
41d643c612981f121bc60312828f984f2d8b4257
2021-11-19 03:20:52
Steven Danna
sql: fix ineffectual assignment in tests
false
fix ineffectual assignment in tests
sql
diff --git a/pkg/sql/inverted/expression_test.go b/pkg/sql/inverted/expression_test.go index 7ff4938a97aa..20ef38901445 100644 --- a/pkg/sql/inverted/expression_test.go +++ b/pkg/sql/inverted/expression_test.go @@ -80,13 +80,13 @@ type UnknownExpression struct { tight bool } -func (u UnknownExpression) IsTight() bool { return u.tight } -func (u UnknownExpression) SetNotTight() { u.tight = false } -func (u UnknownExpression) String() string { +func (u *UnknownExpression) IsTight() bool { return u.tight } +func (u *UnknownExpression) SetNotTight() { u.tight = false } +func (u *UnknownExpression) String() string { return fmt.Sprintf("unknown expression: tight=%t", u.tight) } -func (u UnknownExpression) Copy() Expression { - return UnknownExpression{tight: u.tight} +func (u *UnknownExpression) Copy() Expression { + return &UnknownExpression{tight: u.tight} } // Makes a (shallow) copy of the root node of the expression identified @@ -112,8 +112,8 @@ func getExprCopy( } case NonInvertedColExpression: return NonInvertedColExpression{} - case UnknownExpression: - return UnknownExpression{tight: e.tight} + case *UnknownExpression: + return &UnknownExpression{tight: e.tight} default: d.Fatalf(t, "unknown expr type") return nil @@ -157,7 +157,7 @@ func TestExpression(t *testing.T) { d.ScanArgs(t, "name", &name) var tight bool d.ScanArgs(t, "tight", &tight) - expr := UnknownExpression{tight: tight} + expr := &UnknownExpression{tight: tight} exprsByName[name] = expr return fmt.Sprintf("%v", expr) case "new-non-inverted-leaf":
b67eb696f6a064d6a3a18517c1ed5525faa931e8
2017-12-12 21:12:05
Nathan VanBenschoten
storage: sync entries to disk in parallel with followers
false
sync entries to disk in parallel with followers
storage
diff --git a/pkg/storage/replica.go b/pkg/storage/replica.go index 711fb3d6787e..3de4f3fc9cbf 100644 --- a/pkg/storage/replica.go +++ b/pkg/storage/replica.go @@ -3430,6 +3430,43 @@ func (r *Replica) handleRaftReadyRaftMuLocked( } } + // Separate the MsgApp messages from all other Raft message types so that we + // can take advantage of the optimization discussed in the Raft thesis under + // the section: `10.2.1 Writing to the leader’s disk in parallel`. The + // optimization suggests that instead of a leader writing new log entries to + // disk before replicating them to its followers, the leader can instead + // write the entries to disk in parallel with replicating to its followers + // and them writing to their disks. + // + // Here, we invoke this optimization by: + // 1. sending all MsgApps. + // 2. syncing all entries and Raft state to disk. + // 3. sending all other messages. + // + // Since this is all handled in handleRaftReadyRaftMuLocked, we're assured + // that even though we may sync new entries to disk after sending them in + // MsgApps to followers, we'll always have them synced to disk before we + // process followers' MsgAppResps for the corresponding entries because this + // entire method requires RaftMu to be locked. This is a requirement because + // etcd/raft does not support commit quorums that do not include the leader, + // even though the Raft thesis states that this would technically be safe: + // > The leader may even commit an entry before it has been written to its + // > own disk, if a majority of followers have written it to their disks; + // > this is still safe. + // + // However, MsgApps are also used to inform followers of committed entries + // through the Commit index that they contains. Because the optimization + // sends all MsgApps before syncing to disc, we may send out a commit index + // in a MsgApp that we have not ourselves written in HardState.Commit. This + // is ok, because the Commit index can be treated as volatile state, as is + // supported by raft.MustSync. The Raft thesis corroborates this, stating in + // section: `3.8 Persisted state and server restarts` that: + // > Other state variables are safe to lose on a restart, as they can all be + // > recreated. The most interesting example is the commit index, which can + // > safely be reinitialized to zero on a restart. + mgsApps, otherMsgs := splitMsgApps(rd.Messages) + r.sendRaftMessages(ctx, mgsApps) + // Use a more efficient write-only batch because we don't need to do any // reads from the batch. Any reads are performed via the "distinct" batch // which passes the reads through to the underlying DB. @@ -3504,10 +3541,6 @@ func (r *Replica) handleRaftReadyRaftMuLocked( // Update protected state (last index, last term, raft log size and raft // leader ID) and set raft log entry cache. We clear any older, uncommitted // log entries and cache the latest ones. - // - // Note also that we're likely to send messages related to the Entries we - // just appended, and these entries need to be inlined when sending them to - // followers - populating the cache here saves a lot of that work. r.mu.Lock() r.store.raftEntryCache.addEntries(r.RangeID, rd.Entries) r.mu.lastIndex = lastIndex @@ -3519,7 +3552,7 @@ func (r *Replica) handleRaftReadyRaftMuLocked( } r.mu.Unlock() - r.sendRaftMessages(ctx, rd.Messages) + r.sendRaftMessages(ctx, otherMsgs) for _, e := range rd.CommittedEntries { switch e.Type { @@ -3651,6 +3684,20 @@ func (r *Replica) handleRaftReadyRaftMuLocked( return stats, "", nil } +// splitMsgApps splits the Raft message slice into two slices, one containing +// MsgApps and one containing all other message types. Each slice retains the +// relative ordering between messages in the original slice. +func splitMsgApps(msgs []raftpb.Message) (mgsApps, otherMsgs []raftpb.Message) { + splitIdx := 0 + for i, msg := range msgs { + if msg.Type == raftpb.MsgApp { + msgs[i], msgs[splitIdx] = msgs[splitIdx], msgs[i] + splitIdx++ + } + } + return msgs[:splitIdx], msgs[splitIdx:] +} + func fatalOnRaftReadyErr(ctx context.Context, expl string, err error) { // Mimic the behavior in processRaft. log.Fatalf(ctx, "%s: %s", log.Safe(expl), err) // TODO(bdarnell) diff --git a/pkg/storage/replica_test.go b/pkg/storage/replica_test.go index 16e4b423539c..cd864f727fc8 100644 --- a/pkg/storage/replica_test.go +++ b/pkg/storage/replica_test.go @@ -8704,6 +8704,98 @@ func TestErrorInRaftApplicationClearsIntents(t *testing.T) { } } +func TestSplitMsgApps(t *testing.T) { + defer leaktest.AfterTest(t)() + + msgApp := func(idx uint64) raftpb.Message { + return raftpb.Message{Index: idx, Type: raftpb.MsgApp} + } + otherMsg := func(idx uint64) raftpb.Message { + return raftpb.Message{Index: idx, Type: raftpb.MsgVote} + } + formatMsgs := func(msgs []raftpb.Message) string { + strs := make([]string, len(msgs)) + for i, msg := range msgs { + strs[i] = fmt.Sprintf("{%s:%d}", msg.Type, msg.Index) + } + return fmt.Sprint(strs) + } + + testCases := []struct { + msgsIn, msgAppsOut, otherMsgsOut []raftpb.Message + }{ + // No msgs. + { + msgsIn: []raftpb.Message{}, + msgAppsOut: []raftpb.Message{}, + otherMsgsOut: []raftpb.Message{}, + }, + // Only msgApps. + { + msgsIn: []raftpb.Message{msgApp(1)}, + msgAppsOut: []raftpb.Message{msgApp(1)}, + otherMsgsOut: []raftpb.Message{}, + }, + { + msgsIn: []raftpb.Message{msgApp(1), msgApp(2)}, + msgAppsOut: []raftpb.Message{msgApp(1), msgApp(2)}, + otherMsgsOut: []raftpb.Message{}, + }, + { + msgsIn: []raftpb.Message{msgApp(2), msgApp(1)}, + msgAppsOut: []raftpb.Message{msgApp(2), msgApp(1)}, + otherMsgsOut: []raftpb.Message{}, + }, + // Only otherMsgs. + { + msgsIn: []raftpb.Message{otherMsg(1)}, + msgAppsOut: []raftpb.Message{}, + otherMsgsOut: []raftpb.Message{otherMsg(1)}, + }, + { + msgsIn: []raftpb.Message{otherMsg(1), otherMsg(2)}, + msgAppsOut: []raftpb.Message{}, + otherMsgsOut: []raftpb.Message{otherMsg(1), otherMsg(2)}, + }, + { + msgsIn: []raftpb.Message{otherMsg(2), otherMsg(1)}, + msgAppsOut: []raftpb.Message{}, + otherMsgsOut: []raftpb.Message{otherMsg(2), otherMsg(1)}, + }, + // Mixed msgApps and otherMsgs. + { + msgsIn: []raftpb.Message{msgApp(1), otherMsg(2)}, + msgAppsOut: []raftpb.Message{msgApp(1)}, + otherMsgsOut: []raftpb.Message{otherMsg(2)}, + }, + { + msgsIn: []raftpb.Message{otherMsg(1), msgApp(2)}, + msgAppsOut: []raftpb.Message{msgApp(2)}, + otherMsgsOut: []raftpb.Message{otherMsg(1)}, + }, + { + msgsIn: []raftpb.Message{msgApp(1), otherMsg(2), msgApp(3)}, + msgAppsOut: []raftpb.Message{msgApp(1), msgApp(3)}, + otherMsgsOut: []raftpb.Message{otherMsg(2)}, + }, + { + msgsIn: []raftpb.Message{otherMsg(1), msgApp(2), otherMsg(3)}, + msgAppsOut: []raftpb.Message{msgApp(2)}, + otherMsgsOut: []raftpb.Message{otherMsg(1), otherMsg(3)}, + }, + } + for _, c := range testCases { + inStr := formatMsgs(c.msgsIn) + t.Run(inStr, func(t *testing.T) { + msgAppsRes, otherMsgsRes := splitMsgApps(c.msgsIn) + if !reflect.DeepEqual(msgAppsRes, c.msgAppsOut) || !reflect.DeepEqual(otherMsgsRes, c.otherMsgsOut) { + t.Errorf("expected splitMsgApps(%s)=%s/%s, found %s/%s", inStr, formatMsgs(c.msgAppsOut), + formatMsgs(c.otherMsgsOut), formatMsgs(msgAppsRes), formatMsgs(otherMsgsRes)) + } + }) + } +} + type testQuiescer struct { numProposals int status *raft.Status
05f0064263ab9d58cc9c675597a1865cc4b157bb
2023-09-05 22:55:01
irfan sharif
admission: add l0 control metrics
false
add l0 control metrics
admission
diff --git a/pkg/util/admission/grant_coordinator.go b/pkg/util/admission/grant_coordinator.go index afa7dd4a2f33..ba8b25e61961 100644 --- a/pkg/util/admission/grant_coordinator.go +++ b/pkg/util/admission/grant_coordinator.go @@ -49,13 +49,15 @@ func (gcs GrantCoordinators) Close() { type StoreGrantCoordinators struct { ambientCtx log.AmbientContext - settings *cluster.Settings - makeStoreRequesterFunc makeStoreRequesterFunc - kvIOTokensExhaustedDuration *metric.Counter - kvIOTokensAvailable *metric.Gauge - kvElasticIOTokensAvailable *metric.Gauge - kvIOTokensTookWithoutPermission *metric.Counter - kvIOTotalTokensTaken *metric.Counter + settings *cluster.Settings + makeStoreRequesterFunc makeStoreRequesterFunc + kvIOTokensExhaustedDuration *metric.Counter + kvIOTokensAvailable *metric.Gauge + kvElasticIOTokensAvailable *metric.Gauge + kvIOTotalTokensTaken *metric.Counter + kvIOTotalTokensReturned *metric.Counter + l0CompactedBytes *metric.Counter + l0TokensProduced *metric.Counter // These metrics are shared by WorkQueues across stores. workQueueMetrics *WorkQueueMetrics @@ -168,10 +170,10 @@ func (sgc *StoreGrantCoordinators) initGrantCoordinator(storeID roachpb.StoreID) // initialization, which will also set these to unlimited. startingIOTokens: unlimitedTokens / unloadedDuration.ticksInAdjustmentInterval(), ioTokensExhaustedDurationMetric: sgc.kvIOTokensExhaustedDuration, - availableTokensMetrics: sgc.kvIOTokensAvailable, + availableTokensMetric: sgc.kvIOTokensAvailable, availableElasticTokensMetric: sgc.kvElasticIOTokensAvailable, - tookWithoutPermissionMetric: sgc.kvIOTokensTookWithoutPermission, - totalTokensTaken: sgc.kvIOTotalTokensTaken, + tokensTakenMetric: sgc.kvIOTotalTokensTaken, + tokensReturnedMetric: sgc.kvIOTotalTokensReturned, } kvg.coordMu.availableIOTokens = unlimitedTokens / unloadedDuration.ticksInAdjustmentInterval() kvg.coordMu.availableElasticIOTokens = kvg.coordMu.availableIOTokens @@ -215,6 +217,8 @@ func (sgc *StoreGrantCoordinators) initGrantCoordinator(storeID roachpb.StoreID) perWorkTokenEstimator: makeStorePerWorkTokenEstimator(), diskBandwidthLimiter: makeDiskBandwidthLimiter(), kvGranter: kvg, + l0CompactedBytes: sgc.l0CompactedBytes, + l0TokensProduced: sgc.l0TokensProduced, } return coord } @@ -462,17 +466,19 @@ func makeStoresGrantCoordinators( makeStoreRequester = opts.makeStoreRequesterFunc } storeCoordinators := &StoreGrantCoordinators{ - ambientCtx: ambientCtx, - settings: st, - makeStoreRequesterFunc: makeStoreRequester, - kvIOTokensExhaustedDuration: metrics.KVIOTokensExhaustedDuration, - kvIOTokensTookWithoutPermission: metrics.KVIOTokensTookWithoutPermission, - kvIOTotalTokensTaken: metrics.KVIOTotalTokensTaken, - kvIOTokensAvailable: metrics.KVIOTokensAvailable, - kvElasticIOTokensAvailable: metrics.KVElasticIOTokensAvailable, - workQueueMetrics: storeWorkQueueMetrics, - onLogEntryAdmitted: onLogEntryAdmitted, - knobs: knobs, + ambientCtx: ambientCtx, + settings: st, + makeStoreRequesterFunc: makeStoreRequester, + kvIOTokensExhaustedDuration: metrics.KVIOTokensExhaustedDuration, + kvIOTotalTokensTaken: metrics.KVIOTotalTokensTaken, + kvIOTotalTokensReturned: metrics.KVIOTotalTokensReturned, + kvIOTokensAvailable: metrics.KVIOTokensAvailable, + kvElasticIOTokensAvailable: metrics.KVElasticIOTokensAvailable, + l0CompactedBytes: metrics.L0CompactedBytes, + l0TokensProduced: metrics.L0TokensProduced, + workQueueMetrics: storeWorkQueueMetrics, + onLogEntryAdmitted: onLogEntryAdmitted, + knobs: knobs, } return storeCoordinators } @@ -1012,13 +1018,15 @@ type GrantCoordinatorMetrics struct { KVSlotAdjusterIncrements *metric.Counter KVSlotAdjusterDecrements *metric.Counter // TODO(banabrick): Make these metrics per store. - KVIOTokensExhaustedDuration *metric.Counter - KVIOTokensTookWithoutPermission *metric.Counter - KVIOTotalTokensTaken *metric.Counter - KVIOTokensAvailable *metric.Gauge - KVElasticIOTokensAvailable *metric.Gauge - SQLLeafStartUsedSlots *metric.Gauge - SQLRootStartUsedSlots *metric.Gauge + KVIOTokensExhaustedDuration *metric.Counter + KVIOTotalTokensTaken *metric.Counter + KVIOTotalTokensReturned *metric.Counter + KVIOTokensAvailable *metric.Gauge + KVElasticIOTokensAvailable *metric.Gauge + L0CompactedBytes *metric.Counter + L0TokensProduced *metric.Counter + SQLLeafStartUsedSlots *metric.Gauge + SQLRootStartUsedSlots *metric.Gauge } // MetricStruct implements the metric.Struct interface. @@ -1026,20 +1034,22 @@ func (GrantCoordinatorMetrics) MetricStruct() {} func makeGrantCoordinatorMetrics() GrantCoordinatorMetrics { m := GrantCoordinatorMetrics{ - KVTotalSlots: metric.NewGauge(totalSlots), - KVUsedSlots: metric.NewGauge(addName(workKindString(KVWork), usedSlots)), - KVSlotsExhaustedDuration: metric.NewCounter(kvSlotsExhaustedDuration), - KVCPULoadShortPeriodDuration: metric.NewCounter(kvCPULoadShortPeriodDuration), - KVCPULoadLongPeriodDuration: metric.NewCounter(kvCPULoadLongPeriodDuration), - KVSlotAdjusterIncrements: metric.NewCounter(kvSlotAdjusterIncrements), - KVSlotAdjusterDecrements: metric.NewCounter(kvSlotAdjusterDecrements), - KVIOTokensExhaustedDuration: metric.NewCounter(kvIOTokensExhaustedDuration), - SQLLeafStartUsedSlots: metric.NewGauge(addName(workKindString(SQLStatementLeafStartWork), usedSlots)), - SQLRootStartUsedSlots: metric.NewGauge(addName(workKindString(SQLStatementRootStartWork), usedSlots)), - KVIOTokensTookWithoutPermission: metric.NewCounter(kvIONumIOTokensTookWithoutPermission), - KVIOTotalTokensTaken: metric.NewCounter(kvIOTotalTokensTaken), - KVIOTokensAvailable: metric.NewGauge(kvIOTokensAvailable), - KVElasticIOTokensAvailable: metric.NewGauge(kvElasticIOTokensAvailable), + KVTotalSlots: metric.NewGauge(totalSlots), + KVUsedSlots: metric.NewGauge(addName(workKindString(KVWork), usedSlots)), + KVSlotsExhaustedDuration: metric.NewCounter(kvSlotsExhaustedDuration), + KVCPULoadShortPeriodDuration: metric.NewCounter(kvCPULoadShortPeriodDuration), + KVCPULoadLongPeriodDuration: metric.NewCounter(kvCPULoadLongPeriodDuration), + KVSlotAdjusterIncrements: metric.NewCounter(kvSlotAdjusterIncrements), + KVSlotAdjusterDecrements: metric.NewCounter(kvSlotAdjusterDecrements), + KVIOTokensExhaustedDuration: metric.NewCounter(kvIOTokensExhaustedDuration), + SQLLeafStartUsedSlots: metric.NewGauge(addName(workKindString(SQLStatementLeafStartWork), usedSlots)), + SQLRootStartUsedSlots: metric.NewGauge(addName(workKindString(SQLStatementRootStartWork), usedSlots)), + KVIOTotalTokensTaken: metric.NewCounter(kvIOTotalTokensTaken), + KVIOTotalTokensReturned: metric.NewCounter(kvIOTotalTokensReturned), + KVIOTokensAvailable: metric.NewGauge(kvIOTokensAvailable), + KVElasticIOTokensAvailable: metric.NewGauge(kvElasticIOTokensAvailable), + L0CompactedBytes: metric.NewCounter(l0CompactedBytes), + L0TokensProduced: metric.NewCounter(l0TokensProduced), } return m } diff --git a/pkg/util/admission/granter.go b/pkg/util/admission/granter.go index efb7471ec064..63bb6401d3ea 100644 --- a/pkg/util/admission/granter.go +++ b/pkg/util/admission/granter.go @@ -315,11 +315,12 @@ type kvStoreTokenGranter struct { // computing startingIOTokens-availableIOTokens. startingIOTokens int64 ioTokensExhaustedDurationMetric *metric.Counter - availableTokensMetrics *metric.Gauge + availableTokensMetric *metric.Gauge availableElasticTokensMetric *metric.Gauge - tookWithoutPermissionMetric *metric.Counter - totalTokensTaken *metric.Counter - exhaustedStart time.Time + tokensReturnedMetric *metric.Counter + tokensTakenMetric *metric.Counter + + exhaustedStart time.Time // Estimation models. l0WriteLM, l0IngestLM, ingestLM tokensLinearModel @@ -404,7 +405,6 @@ func (sg *kvStoreTokenGranter) tryGetLocked(count int64, demuxHandle int8) grant if sg.coordMu.availableIOTokens > 0 { sg.subtractTokensLocked(count, count, false) sg.coordMu.diskBWTokensUsed[wc] += count - sg.totalTokensTaken.Inc(count) return grantSuccess } case admissionpb.ElasticWorkClass: @@ -414,7 +414,6 @@ func (sg *kvStoreTokenGranter) tryGetLocked(count int64, demuxHandle int8) grant sg.subtractTokensLocked(count, count, false) sg.coordMu.elasticIOTokensUsedByElastic += count sg.coordMu.diskBWTokensUsed[wc] += count - sg.totalTokensTaken.Inc(count) return grantSuccess } } @@ -446,8 +445,6 @@ func (sg *kvStoreTokenGranter) tookWithoutPermission(workClass admissionpb.WorkC func (sg *kvStoreTokenGranter) tookWithoutPermissionLocked(count int64, demuxHandle int8) { wc := admissionpb.WorkClass(demuxHandle) sg.subtractTokensLocked(count, count, false) - sg.tookWithoutPermissionMetric.Inc(count) - sg.totalTokensTaken.Inc(count) if wc == admissionpb.ElasticWorkClass { sg.coordMu.elasticDiskBWTokensAvailable -= count sg.coordMu.elasticIOTokensUsedByElastic += count @@ -458,18 +455,28 @@ func (sg *kvStoreTokenGranter) tookWithoutPermissionLocked(count int64, demuxHan // subtractTokensLocked is a helper function that subtracts count tokens (count // can be negative, in which case this is really an addition). func (sg *kvStoreTokenGranter) subtractTokensLocked( - count int64, elasticCount int64, forceTickMetric bool, + count int64, elasticCount int64, settingAvailableTokens bool, ) { avail := sg.coordMu.availableIOTokens sg.coordMu.availableIOTokens -= count + sg.coordMu.availableElasticIOTokens -= elasticCount + sg.availableTokensMetric.Update(sg.coordMu.availableIOTokens) + sg.availableElasticTokensMetric.Update(sg.coordMu.availableElasticIOTokens) + if !settingAvailableTokens { + if count > 0 { + sg.tokensTakenMetric.Inc(count) + } else { + sg.tokensReturnedMetric.Inc(-count) + } + } if count > 0 && avail > 0 && sg.coordMu.availableIOTokens <= 0 { // Transition from > 0 to <= 0. sg.exhaustedStart = timeutil.Now() - } else if count < 0 && avail <= 0 && (sg.coordMu.availableIOTokens > 0 || forceTickMetric) { - // Transition from <= 0 to > 0, or forced to tick the metric. The latter - // ensures that if the available tokens stay <= 0, we don't show a sudden - // change in the metric after minutes of exhaustion (we had observed such - // behavior prior to this change). + } else if count < 0 && avail <= 0 && (sg.coordMu.availableIOTokens > 0 || settingAvailableTokens) { + // Transition from <= 0 to > 0, or if we're newly setting available + // tokens. The latter ensures that if the available tokens stay <= 0, we + // don't show a sudden change in the metric after minutes of exhaustion + // (we had observed such behavior prior to this change). now := timeutil.Now() exhaustedMicros := now.Sub(sg.exhaustedStart).Microseconds() sg.ioTokensExhaustedDurationMetric.Inc(exhaustedMicros) @@ -477,9 +484,6 @@ func (sg *kvStoreTokenGranter) subtractTokensLocked( sg.exhaustedStart = now } } - sg.availableTokensMetrics.Update(sg.coordMu.availableIOTokens) - sg.coordMu.availableElasticIOTokens -= elasticCount - sg.availableElasticTokensMetric.Update(sg.coordMu.availableElasticIOTokens) } // requesterHasWaitingRequests implements granterWithLockedCalls. @@ -570,10 +574,9 @@ func (sg *kvStoreTokenGranter) setAvailableTokens( sg.coordMu.availableElasticIOTokens = min(sg.coordMu.availableElasticIOTokens, sg.coordMu.availableIOTokens) } - - sg.startingIOTokens = sg.coordMu.availableIOTokens - sg.availableTokensMetrics.Update(sg.coordMu.availableIOTokens) + sg.availableTokensMetric.Update(sg.coordMu.availableIOTokens) sg.availableElasticTokensMetric.Update(sg.coordMu.availableElasticIOTokens) + sg.startingIOTokens = sg.coordMu.availableIOTokens sg.coordMu.elasticDiskBWTokensAvailable += elasticDiskBandwidthTokens if sg.coordMu.elasticDiskBWTokensAvailable > elasticDiskBandwidthTokensCapacity { @@ -736,18 +739,18 @@ var ( Measurement: "Microseconds", Unit: metric.Unit_COUNT, } - kvIONumIOTokensTookWithoutPermission = metric.Metadata{ - Name: "admission.granter.io_tokens_took_without_permission.kv", - Help: "Total number of tokens taken without permission", - Measurement: "Tokens", - Unit: metric.Unit_COUNT, - } kvIOTotalTokensTaken = metric.Metadata{ Name: "admission.granter.io_tokens_taken.kv", Help: "Total number of tokens taken", Measurement: "Tokens", Unit: metric.Unit_COUNT, } + kvIOTotalTokensReturned = metric.Metadata{ + Name: "admission.granter.io_tokens_returned.kv", + Help: "Total number of tokens returned", + Measurement: "Tokens", + Unit: metric.Unit_COUNT, + } kvIOTokensAvailable = metric.Metadata{ Name: "admission.granter.io_tokens_available.kv", Help: "Number of tokens available", @@ -760,6 +763,18 @@ var ( Measurement: "Tokens", Unit: metric.Unit_COUNT, } + l0CompactedBytes = metric.Metadata{ + Name: "admission.l0_compacted_bytes.kv", + Help: "Total bytes compacted out of L0 (used to generate IO tokens)", + Measurement: "Tokens", + Unit: metric.Unit_COUNT, + } + l0TokensProduced = metric.Metadata{ + Name: "admission.l0_tokens_produced.kv", + Help: "Total bytes produced for L0 writes", + Measurement: "Tokens", + Unit: metric.Unit_COUNT, + } ) // TODO(irfansharif): we are lacking metrics for IO tokens and load, including diff --git a/pkg/util/admission/granter_test.go b/pkg/util/admission/granter_test.go index 83700a801aff..7c0bc610d877 100644 --- a/pkg/util/admission/granter_test.go +++ b/pkg/util/admission/granter_test.go @@ -137,14 +137,16 @@ func TestGranterBasic(t *testing.T) { requesters[numWorkKinds] = req.requesters[admissionpb.ElasticWorkClass] return req }, - kvIOTokensExhaustedDuration: metrics.KVIOTokensExhaustedDuration, - kvIOTokensAvailable: metrics.KVIOTokensAvailable, - kvElasticIOTokensAvailable: metrics.KVElasticIOTokensAvailable, - kvIOTokensTookWithoutPermission: metrics.KVIOTokensTookWithoutPermission, - kvIOTotalTokensTaken: metrics.KVIOTotalTokensTaken, - workQueueMetrics: workQueueMetrics, - disableTickerForTesting: true, - knobs: &TestingKnobs{}, + kvIOTokensExhaustedDuration: metrics.KVIOTokensExhaustedDuration, + kvIOTokensAvailable: metrics.KVIOTokensAvailable, + kvElasticIOTokensAvailable: metrics.KVElasticIOTokensAvailable, + kvIOTotalTokensTaken: metrics.KVIOTotalTokensTaken, + kvIOTotalTokensReturned: metrics.KVIOTotalTokensReturned, + l0CompactedBytes: metrics.L0CompactedBytes, + l0TokensProduced: metrics.L0TokensProduced, + workQueueMetrics: workQueueMetrics, + disableTickerForTesting: true, + knobs: &TestingKnobs{}, } var metricsProvider testMetricsProvider metricsProvider.setMetricsForStores([]int32{1}, pebble.Metrics{}) diff --git a/pkg/util/admission/io_load_listener.go b/pkg/util/admission/io_load_listener.go index 5b29ba618bbf..74c399141baa 100644 --- a/pkg/util/admission/io_load_listener.go +++ b/pkg/util/admission/io_load_listener.go @@ -21,6 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/admission/admissionpb" "github.com/cockroachdb/cockroach/pkg/util/humanizeutil" "github.com/cockroachdb/cockroach/pkg/util/log" + "github.com/cockroachdb/cockroach/pkg/util/metric" "github.com/cockroachdb/cockroach/pkg/util/timeutil" "github.com/cockroachdb/errors" "github.com/cockroachdb/logtags" @@ -188,6 +189,9 @@ type ioLoadListener struct { adjustTokensResult perWorkTokenEstimator storePerWorkTokenEstimator diskBandwidthLimiter diskBandwidthLimiter + + l0CompactedBytes *metric.Counter + l0TokensProduced *metric.Counter } type ioLoadListenerState struct { @@ -641,7 +645,7 @@ type adjustTokensAuxComputations struct { // adjustTokensInner is used for computing tokens based on compaction and // flush bottlenecks. -func (*ioLoadListener) adjustTokensInner( +func (io *ioLoadListener) adjustTokensInner( ctx context.Context, prev ioLoadListenerState, l0Metrics pebble.LevelMetrics, @@ -677,7 +681,10 @@ func (*ioLoadListener) adjustTokensInner( // bytes (gauge). intL0CompactedBytes = 0 } + io.l0CompactedBytes.Inc(intL0CompactedBytes) + const alpha = 0.5 + // Compaction scheduling can be uneven in prioritizing L0 for compactions, // so smooth out what is being removed by compactions. smoothedIntL0CompactedBytes := int64(alpha*float64(intL0CompactedBytes) + (1-alpha)*float64(prev.smoothedIntL0CompactedBytes)) @@ -958,6 +965,9 @@ func (*ioLoadListener) adjustTokensInner( if totalNumElasticByteTokens > totalNumByteTokens { totalNumElasticByteTokens = totalNumByteTokens } + + io.l0TokensProduced.Inc(totalNumByteTokens) + // Install the latest cumulative stats. return adjustTokensResult{ ioLoadListenerState: ioLoadListenerState{ @@ -1047,6 +1057,9 @@ func (res adjustTokensResult) SafeFormat(p redact.SafePrinter, _ rune) { ib(m/adjustmentInterval)) switch res.aux.tokenKind { case compactionTokenKind: + // NB: res.smoothedCompactionByteTokens is the same as + // res.ioLoadListenerState.totalNumByteTokens (printed above) when + // res.aux.tokenKind == compactionTokenKind. p.Printf(" due to L0 growth") case flushTokenKind: p.Printf(" due to memtable flush (multiplier %.3f)", res.flushUtilTargetFraction) diff --git a/pkg/util/admission/io_load_listener_test.go b/pkg/util/admission/io_load_listener_test.go index 334a14709ebc..a6bcf38a84eb 100644 --- a/pkg/util/admission/io_load_listener_test.go +++ b/pkg/util/admission/io_load_listener_test.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/testutils/echotest" "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/util/admission/admissionpb" + "github.com/cockroachdb/cockroach/pkg/util/metric" "github.com/cockroachdb/cockroach/pkg/util/timeutil" "github.com/cockroachdb/datadriven" "github.com/cockroachdb/pebble" @@ -55,6 +56,8 @@ func TestIOLoadListener(t *testing.T) { kvRequester: req, perWorkTokenEstimator: makeStorePerWorkTokenEstimator(), diskBandwidthLimiter: makeDiskBandwidthLimiter(), + l0CompactedBytes: metric.NewCounter(l0CompactedBytes), + l0TokensProduced: metric.NewCounter(l0TokensProduced), } // The mutex is needed by ioLoadListener but is not useful in this // test -- the channels provide synchronization and prevent this @@ -214,8 +217,10 @@ func TestIOLoadListenerOverflow(t *testing.T) { ctx := context.Background() st := cluster.MakeTestingClusterSettings() ioll := ioLoadListener{ - settings: st, - kvRequester: req, + settings: st, + kvRequester: req, + l0CompactedBytes: metric.NewCounter(l0CompactedBytes), + l0TokensProduced: metric.NewCounter(l0TokensProduced), } ioll.kvGranter = kvGranter // Bug 1: overflow when totalNumByteTokens is too large. @@ -275,7 +280,12 @@ func TestAdjustTokensInnerAndLogging(t *testing.T) { var buf redact.StringBuilder for _, tt := range tests { buf.Printf("%s:\n", tt.name) - res := (*ioLoadListener)(nil).adjustTokensInner( + ioll := &ioLoadListener{ + settings: cluster.MakeTestingClusterSettings(), + l0CompactedBytes: metric.NewCounter(l0CompactedBytes), + l0TokensProduced: metric.NewCounter(l0TokensProduced), + } + res := ioll.adjustTokensInner( ctx, tt.prev, tt.l0Metrics, 12, pebble.ThroughputMetric{}, 100, 10, 0, 0.50) buf.Printf("%s\n", res) @@ -316,6 +326,8 @@ func TestBadIOLoadListenerStats(t *testing.T) { kvRequester: req, perWorkTokenEstimator: makeStorePerWorkTokenEstimator(), diskBandwidthLimiter: makeDiskBandwidthLimiter(), + l0CompactedBytes: metric.NewCounter(l0CompactedBytes), + l0TokensProduced: metric.NewCounter(l0TokensProduced), } ioll.kvGranter = kvGranter for i := 0; i < 100; i++ {
33a791dc1fb7a67b51beebb7bab5f0da8fedc96e
2024-07-25 20:35:21
Xin Hao Zhang
ui: alphabetize imports
false
alphabetize imports
ui
diff --git a/pkg/ui/workspaces/cluster-ui/.eslintrc.json b/pkg/ui/workspaces/cluster-ui/.eslintrc.json index 3c0499ea40c8..4e6fe2794cff 100644 --- a/pkg/ui/workspaces/cluster-ui/.eslintrc.json +++ b/pkg/ui/workspaces/cluster-ui/.eslintrc.json @@ -43,6 +43,10 @@ "import/order": [ "error", { + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, "newlines-between": "always", "groups": [ "builtin", diff --git a/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx b/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx index 883296aadaf9..872df3ec9fd8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/NotificationMessage/NotificationMessage.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { FunctionComponent } from "react"; -import classnames from "classnames/bind"; import { Badge, BadgeIntent, FuzzyTime } from "@cockroachlabs/ui-components"; +import classnames from "classnames/bind"; +import React, { FunctionComponent } from "react"; import { NotificationTypeProp, diff --git a/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts b/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts index 99226f4c1698..23a0006af4cf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts +++ b/pkg/ui/workspaces/cluster-ui/src/Notifications/notifications.ts @@ -10,8 +10,8 @@ // This is a placeholder for real implementation (likely in Redux?) of notifications -import { notificationTypes, NotificationProps } from "../Notifications"; import { NotificationMessageProps } from "../NotificationMessage"; +import { notificationTypes, NotificationProps } from "../Notifications"; export const generateNotificationProps = ( notifications: Array<NotificationProps>, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts index 60e060e7ad30..53ed541dd713 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.spec.ts @@ -9,11 +9,18 @@ // licenses/APL.txt. import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import moment from "moment-timezone"; import Long from "long"; +import moment from "moment-timezone"; import { TimestampToMoment } from "../util"; +import { + getActiveExecutionsFromSessions, + getAppsFromActiveExecutions, + filterActiveStatements, + filterActiveTransactions, + INTERNAL_APP_NAME_PREFIX, +} from "./activeStatementUtils"; import { ActiveStatementPhase, SessionsResponse, @@ -24,13 +31,6 @@ import { ActiveTransactionFilters, ExecutionStatus, } from "./types"; -import { - getActiveExecutionsFromSessions, - getAppsFromActiveExecutions, - filterActiveStatements, - filterActiveTransactions, - INTERNAL_APP_NAME_PREFIX, -} from "./activeStatementUtils"; type ActiveQuery = protos.cockroach.server.serverpb.ActiveQuery; const Timestamp = protos.google.protobuf.Timestamp; diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts index 46af442d5489..2edf590c60e5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementUtils.ts @@ -10,9 +10,9 @@ import moment from "moment-timezone"; +import { ClusterLocksResponse, ClusterLockState } from "src/api"; import { byteArrayToUuid } from "src/sessions"; import { TimestampToMoment, unset } from "src/util"; -import { ClusterLocksResponse, ClusterLockState } from "src/api"; import { DurationToMomentDuration } from "src/util/convert"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx index 40281dda1df0..b112543cc323 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsSection.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useMemo } from "react"; import classNames from "classnames/bind"; +import React, { useMemo } from "react"; import { ActiveStatement, @@ -18,12 +18,12 @@ import { import ColumnsSelector, { SelectOption, } from "src/columnsSelector/columnsSelector"; +import { isSelectedColumn } from "src/columnsSelector/utils"; +import { calculateActiveFilters } from "src/queryFilter/filter"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; import { EmptyStatementsPlaceholder } from "src/statementsPage/emptyStatementsPlaceholder"; -import { TableStatistics } from "src/tableStatistics"; import { StatementViewType } from "src/statementsPage/statementPageTypes"; -import { calculateActiveFilters } from "src/queryFilter/filter"; -import { isSelectedColumn } from "src/columnsSelector/utils"; +import { TableStatistics } from "src/tableStatistics"; import { ISortedTablePagination, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx index 761c8143d7d3..61ada2daa684 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeStatementsTable/activeStatementsTable.tsx @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Tooltip } from "@cockroachlabs/ui-components"; import React from "react"; import { Link } from "react-router-dom"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { isSelectedColumn } from "../../columnsSelector/utils"; import { ColumnDescriptor } from "../../sortedtable"; +import { limitText } from "../../util"; import { activeStatementColumnsFromCommon, ExecutionsColumn, @@ -21,7 +22,6 @@ import { getLabel, } from "../execTableCommon"; import { ActiveStatement } from "../types"; -import { limitText } from "../../util"; export function makeActiveStatementsColumns( isTenant: boolean, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx index c7882323afa9..da0fd24346bc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsSection.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useMemo } from "react"; import classNames from "classnames/bind"; +import React, { useMemo } from "react"; import { ActiveTransaction, @@ -18,13 +18,13 @@ import { import ColumnsSelector, { SelectOption, } from "src/columnsSelector/columnsSelector"; +import { isSelectedColumn } from "src/columnsSelector/utils"; +import { calculateActiveFilters } from "src/queryFilter/filter"; +import { SortedTable } from "src/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { EmptyTransactionsPlaceholder } from "src/transactionsPage/emptyTransactionsPlaceholder"; import { TableStatistics } from "src/tableStatistics"; +import { EmptyTransactionsPlaceholder } from "src/transactionsPage/emptyTransactionsPlaceholder"; import { TransactionViewType } from "src/transactionsPage/transactionsPageTypes"; -import { calculateActiveFilters } from "src/queryFilter/filter"; -import { isSelectedColumn } from "src/columnsSelector/utils"; -import { SortedTable } from "src/sortedtable"; import { ISortedTablePagination, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx index 8488b3f4fb83..b4640e0cc814 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/activeTransactionsTable.tsx @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Tooltip } from "@cockroachlabs/ui-components"; import React from "react"; import { Link } from "react-router-dom"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { isSelectedColumn } from "../../columnsSelector/utils"; import { ColumnDescriptor } from "../../sortedtable"; +import { limitText } from "../../util"; import { activeTransactionColumnsFromCommon, ExecutionsColumn, @@ -21,7 +22,6 @@ import { getLabel, } from "../execTableCommon"; import { ActiveTransaction, ExecutionType } from "../types"; -import { limitText } from "../../util"; export function makeActiveTransactionsColumns( isTenant: boolean, diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx index 85eefa0006c0..3f7868fe7a52 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/activeTransactionsTable/execContentionTable.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Tooltip } from "@cockroachlabs/ui-components"; import React from "react"; import { Link } from "react-router-dom"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { ColumnDescriptor, SortedTable } from "../../sortedtable"; -import { ContendedExecution, ExecutionType } from "../types"; -import { StatusIcon } from "../statusIcon"; -import { executionsTableTitles } from "../execTableCommon"; -import { DATE_FORMAT_24_TZ, Duration, limitText } from "../../util"; import { Timestamp } from "../../timestamp"; +import { DATE_FORMAT_24_TZ, Duration, limitText } from "../../util"; +import { executionsTableTitles } from "../execTableCommon"; +import { StatusIcon } from "../statusIcon"; +import { ContendedExecution, ExecutionType } from "../types"; const getID = (item: ContendedExecution, execType: ExecutionType) => execType === "transaction" diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx index daba9398f5c5..c80175cb74f8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/execTableCommon.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; +import React from "react"; import { Link } from "react-router-dom"; import { ColumnDescriptor } from "src/sortedtable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx index 8122a75afac8..e82230cdbe66 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/refreshControl/refreshControl.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. import { Switch } from "antd"; -import React from "react"; import classNames from "classnames/bind"; import { Moment } from "moment-timezone"; +import React from "react"; import RefreshIcon from "src/icon/refreshIcon"; import { Timestamp } from "src/timestamp"; diff --git a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx index e70207e7465b..b2fbb9955505 100644 --- a/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/activeExecutions/statusIcon.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { CircleFilled } from "src/icon"; -import { ExecutionStatus } from "./types"; import styles from "./executionStatusIcon.module.scss"; +import { ExecutionStatus } from "./types"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx b/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx index 9804ad85be0e..4037f08fc3db 100644 --- a/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/anchor/anchor.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import styles from "./anchor.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts index 37585b9ee1c4..c75c5ed48362 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/contentionApi.ts @@ -33,12 +33,12 @@ import { sqlResultsAreEmpty, } from "./sqlApi"; import { TxnInsightDetailsRequest } from "./txnInsightDetailsApi"; -import { makeInsightsSqlRequest } from "./txnInsightsUtils"; import { FingerprintStmtsResponseColumns, TxnStmtFingerprintsResponseColumns, TxnWithStmtFingerprints, } from "./txnInsightsApi"; +import { makeInsightsSqlRequest } from "./txnInsightsUtils"; export type ContentionFilters = { waitingTxnID?: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts index 52250426470d..9205f13115cf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { IndexUsageStatistic, recommendDropUnusedIndex } from "../insights"; import { getLogger, indexUnusedDuration, maybeError } from "../util"; +import { Format, Identifier, QualifiedIdentifier } from "./safesql"; import { combineQueryErrors, createSqlExecutionRequest, @@ -30,7 +31,6 @@ import { SqlTxnResult, txnResultIsEmpty, } from "./sqlApi"; -import { Format, Identifier, QualifiedIdentifier } from "./safesql"; import { fromHexString, withTimeout } from "./util"; const { ZoneConfig } = cockroach.config.zonepb; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts index cd06096be4ae..4cfce867e021 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/indexDetailsApi.ts @@ -23,9 +23,9 @@ import { StatementRawFormat, } from "src/api"; -import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; -import { AggregateStatistics } from "../statementsTable"; import { INTERNAL_APP_NAME_PREFIX } from "../activeExecutions/activeStatementUtils"; +import { AggregateStatistics } from "../statementsTable"; +import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; export type TableIndexStatsRequest = cockroach.server.serverpb.TableIndexStatsRequest; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts index 24a4cfeafcc7..21746e1d65c2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts @@ -15,6 +15,7 @@ import { } from "../insights"; import { HexStringToInt64String, indexUnusedDuration } from "../util"; +import { QuoteIdentifier } from "./safesql"; import { SqlExecutionRequest, SqlTxnResult, @@ -25,7 +26,6 @@ import { SqlApiResponse, formatApiResult, } from "./sqlApi"; -import { QuoteIdentifier } from "./safesql"; // Export for db-console import from clusterUiApi. export type { InsightRecommendation } from "../insights"; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts index c13cddd2df59..5fa5c307228d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/statementDiagnosticsApi.ts @@ -10,7 +10,6 @@ import moment from "moment-timezone"; -import { Duration } from "src/util/format"; import { createSqlExecutionRequest, executeInternalSql, @@ -19,6 +18,7 @@ import { SqlTxnResult, txnResultSetIsEmpty, } from "src/api"; +import { Duration } from "src/util/format"; export type StatementDiagnosticsReport = { id: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts index 44c89809728f..94813fab0776 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/stmtInsightsApi.ts @@ -18,8 +18,8 @@ import { } from "src/insights/types"; import { INTERNAL_APP_NAME_PREFIX } from "src/util/constants"; -import { FixFingerprintHexValue } from "../util"; import { getInsightsFromProblemsAndCauses } from "../insights/utils"; +import { FixFingerprintHexValue } from "../util"; import { getContentionDetailsApi } from "./contentionApi"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts index 5801c2df480d..e00883906031 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/tableDetailsApi.ts @@ -8,14 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { IndexUsageStatistic, recommendDropUnusedIndex } from "../insights"; import { getLogger, indexUnusedDuration, maybeError } from "../util"; import { Format, Identifier, Join, SQL } from "./safesql"; -import { fromHexString, withTimeout } from "./util"; import { combineQueryErrors, executeInternalSql, @@ -30,6 +29,7 @@ import { SqlTxnResult, txnResultIsEmpty, } from "./sqlApi"; +import { fromHexString, withTimeout } from "./util"; const { ZoneConfig } = cockroach.config.zonepb; const { ZoneConfigurationLevel } = cockroach.server.serverpb; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts index 973644673721..6fc18b2e1c03 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightDetailsApi.ts @@ -17,6 +17,7 @@ import { } from "../insights"; import { maybeError } from "../util"; +import { getTxnInsightsContentionDetailsApi } from "./contentionApi"; import { executeInternalSql, isMaxSizeError, @@ -34,7 +35,6 @@ import { TxnInsightsResponseRow, } from "./txnInsightsApi"; import { makeInsightsSqlRequest } from "./txnInsightsUtils"; -import { getTxnInsightsContentionDetailsApi } from "./contentionApi"; export type TxnInsightDetailsRequest = { txnExecutionID: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts index 841a337511d6..4e1be475ea13 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/txnInsightsApi.spec.ts @@ -17,16 +17,16 @@ import { } from "../insights"; import { MockSqlResponse } from "../util/testing"; -import { - TxnStmtFingerprintsResponseColumns, - FingerprintStmtsResponseColumns, -} from "./txnInsightsApi"; -import * as sqlApi from "./sqlApi"; -import { SqlExecutionResponse } from "./sqlApi"; import { ContentionResponseColumns, getTxnInsightsContentionDetailsApi, } from "./contentionApi"; +import * as sqlApi from "./sqlApi"; +import { SqlExecutionResponse } from "./sqlApi"; +import { + TxnStmtFingerprintsResponseColumns, + FingerprintStmtsResponseColumns, +} from "./txnInsightsApi"; type TxnContentionDetailsTests = { name: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx index 7e73160d557d..d56071b97fc0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/badge/badge.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Badge } from "./index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx b/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx index 20ec6b002c22..ec70fb5db118 100644 --- a/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import classNames from "classnames/bind"; +import * as React from "react"; import styles from "./badge.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx index 047c1ab95310..c28dfc8aea0d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/barChartFactory.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { scaleLinear } from "d3-scale"; -import { extent as d3Extent } from "d3-array"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import sum from "lodash/sum"; +import { extent as d3Extent } from "d3-array"; +import { scaleLinear } from "d3-scale"; import map from "lodash/map"; +import sum from "lodash/sum"; +import React from "react"; import styles from "./barCharts.module.scss"; import { NumericStatLegend } from "./numericStatLegend"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx index 77862cc1093b..a294564f05bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf, DecoratorFn } from "@storybook/react"; import Long from "long"; +import React from "react"; import statementsPagePropsFixture from "src/statementsPage/statementsPage.fixture"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx index 1c4624d9de14..36cfdd66de9b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/barCharts.tsx @@ -11,13 +11,13 @@ import * as protos from "@cockroachlabs/crdb-protobuf-client"; import classNames from "classnames/bind"; +import { AggregateStatistics } from "src/statementsTable/statementsTable"; import { stdDevLong, longToInt } from "src/util"; import { Duration, Bytes, PercentageCustom } from "src/util/format"; -import { AggregateStatistics } from "src/statementsTable/statementsTable"; +import { barChartFactory, BarChartOptions } from "./barChartFactory"; import styles from "./barCharts.module.scss"; import { bar, approximify } from "./utils"; -import { barChartFactory, BarChartOptions } from "./barChartFactory"; type StatementStatistics = protos.cockroach.server.serverpb.StatementsResponse.ICollectedStatementStatistics; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx index 593c7e4c286a..98014de8507d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/genericBarChart.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { scaleLinear } from "d3-scale"; import { format as d3Format } from "d3-format"; -import { Tooltip } from "@cockroachlabs/ui-components"; +import { scaleLinear } from "d3-scale"; +import React from "react"; import { stdDevLong, longToInt, NumericStat } from "src/util"; -import { clamp, normalizeClosedDomain } from "./utils"; import styles from "./barCharts.module.scss"; +import { clamp, normalizeClosedDomain } from "./utils"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx index 380b4c3880c4..8ee34f72887f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/latencyBreakdown.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { scaleLinear } from "d3-scale"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import { scaleLinear } from "d3-scale"; +import React from "react"; -import { Duration } from "src/util/format"; import { stdDevLong } from "src/util"; +import { Duration } from "src/util/format"; -import { NumericStatLegend } from "./numericStatLegend"; import styles from "./barCharts.module.scss"; +import { NumericStatLegend } from "./numericStatLegend"; import { clamp, normalizeClosedDomain } from "./utils"; type StatementStatistics = diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx b/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx index dbf4eca4ed3d..f1a5b7bcfcac 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/numericStatLegend.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { longToInt } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts b/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts index c8c9d57b0a5b..0d3cd39c629c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/rowsBreakdown.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { scaleLinear } from "d3-scale"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { scaleLinear } from "d3-scale"; import { stdDevLong } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts b/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts index 3b930bedfc13..73b02eff04aa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/barCharts/utils.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { format as d3Format } from "d3-format"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { format as d3Format } from "d3-format"; import { TransactionInfo } from "../transactionsTable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx b/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx index 87c01cdfe537..ea3c575f9751 100644 --- a/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/breadcrumbs/breadcrumbs.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classnames from "classnames/bind"; import React, { FunctionComponent, ReactElement } from "react"; import { Link } from "react-router-dom"; -import classnames from "classnames/bind"; import styles from "./breadcrumbs.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx index 12843ec2ccbb..17f221bf321f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/button/button.stories.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. /* eslint-disable react/jsx-key */ -import React from "react"; -import { storiesOf } from "@storybook/react"; import { CaretDown } from "@cockroachlabs/icons"; +import { storiesOf } from "@storybook/react"; +import React from "react"; import { Button, ButtonProps } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/button/button.tsx b/pkg/ui/workspaces/cluster-ui/src/button/button.tsx index 0c07d9ffae21..67f7200db55c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/button/button.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/button/button.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ButtonHTMLAttributes } from "react"; import classNames from "classnames/bind"; +import React, { ButtonHTMLAttributes } from "react"; import styles from "./button.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx b/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx index 88a368af6262..f880fcfb5ae8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/columnsSelector/columnsSelector.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Select, { components, OptionsType, ActionMeta } from "react-select"; -import React from "react"; -import classNames from "classnames/bind"; import { Gear } from "@cockroachlabs/icons"; +import classNames from "classnames/bind"; +import React from "react"; +import Select, { components, OptionsType, ActionMeta } from "react-select"; import { Button } from "../button"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts index 1bda541b3daf..61d48913ecc5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsConnected.ts @@ -15,18 +15,16 @@ import { Dispatch } from "redux"; import { databaseNameCCAttr } from "src/util/constants"; import { getMatchParamByName } from "src/util/query"; +import { deriveTableDetailsMemoized } from "../databases"; +import { Filters } from "../queryFilter"; import { AppState } from "../store"; +import { actions as analyticsActions } from "../store/analytics"; +import { + selectDropUnusedIndexDuration, + selectIndexRecommendationsEnabled, +} from "../store/clusterSettings/clusterSettings.selectors"; import { databaseDetailsReducer } from "../store/databaseDetails"; const databaseDetailsActions = databaseDetailsReducer.actions; -import { - actions as localStorageActions, - LocalStorageKeys, -} from "../store/localStorage"; -import { actions as tableDetailsActions } from "../store/databaseTableDetails"; -import { actions as analyticsActions } from "../store/analytics"; -import { Filters } from "../queryFilter"; -import { nodeRegionsByIDSelector } from "../store/nodes"; -import { selectIsTenant } from "../store/uiConfig"; import { selectDatabaseDetailsGrantsSortSetting, selectDatabaseDetailsTablesFiltersSetting, @@ -34,19 +32,21 @@ import { selectDatabaseDetailsTablesSortSetting, selectDatabaseDetailsViewModeSetting, } from "../store/databaseDetails/databaseDetails.selectors"; -import { deriveTableDetailsMemoized } from "../databases"; +import { actions as tableDetailsActions } from "../store/databaseTableDetails"; import { - selectDropUnusedIndexDuration, - selectIndexRecommendationsEnabled, -} from "../store/clusterSettings/clusterSettings.selectors"; + actions as localStorageActions, + LocalStorageKeys, +} from "../store/localStorage"; +import { nodeRegionsByIDSelector } from "../store/nodes"; import { actions as nodesActions } from "../store/nodes/nodes.reducer"; +import { selectIsTenant } from "../store/uiConfig"; -import { ViewMode } from "./types"; import { DatabaseDetailsPage, DatabaseDetailsPageActions, DatabaseDetailsPageData, } from "./databaseDetailsPage"; +import { ViewMode } from "./types"; const mapStateToProps = ( state: AppState, diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx index 84e98f15a605..947750339c06 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; -import * as H from "history"; import { shallow } from "enzyme"; +import * as H from "history"; +import React from "react"; import { defaultFilters } from "../queryFilter"; import { indexUnusedDuration } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx index 8687c34d6f55..00c2bacfdac8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx @@ -8,20 +8,20 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import * as H from "history"; import random from "lodash/random"; import uniq from "lodash/uniq"; -import * as H from "history"; import moment from "moment-timezone"; +import React from "react"; +import { defaultFilters } from "src/queryFilter"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { randomName, randomRole, randomTablePrivilege, } from "src/storybook/fixtures"; -import { defaultFilters } from "src/queryFilter"; import { indexUnusedDuration } from "src/util/constants"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx index 4599b41b0dfa..e6e4901cb555 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.tsx @@ -8,35 +8,36 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link, RouteComponentProps } from "react-router-dom"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React from "react"; +import { Link, RouteComponentProps } from "react-router-dom"; import { Dropdown, DropdownOption } from "src/dropdown"; import { DatabaseIcon } from "src/icon/databaseIcon"; import { StackIcon } from "src/icon/stackIcon"; import { PageConfig, PageConfigItem } from "src/pageConfig"; import { Pagination } from "src/pagination"; +import { + calculateActiveFilters, + defaultFilters, + Filter, + Filters, +} from "src/queryFilter"; import { ColumnDescriptor, ISortedTablePagination, SortedTable, SortSetting, } from "src/sortedtable"; -import { DATE_FORMAT, EncodeDatabaseTableUri } from "src/util/format"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; -import { - calculateActiveFilters, - defaultFilters, - Filter, - Filters, -} from "src/queryFilter"; import { UIConfigState } from "src/store"; import { TableStatistics } from "src/tableStatistics"; +import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; +import { DATE_FORMAT, EncodeDatabaseTableUri } from "src/util/format"; +import { Anchor } from "../anchor"; import { isMaxSizeError, SqlApiQueryResponse, @@ -48,13 +49,13 @@ import { TableSpanStatsRow, } from "../api"; import { LoadingCell } from "../databases"; -import { Timestamp, Timezone } from "../timestamp"; -import { Search } from "../search"; import { Loading } from "../loading"; +import { Search } from "../search"; import LoadingError from "../sqlActivity/errorComponent"; -import { Anchor } from "../anchor"; +import { Timestamp, Timezone } from "../timestamp"; import { mvccGarbage, syncHistory, unique } from "../util"; +import styles from "./databaseDetailsPage.module.scss"; import { DbDetailsBreadcrumbs, DiskSizeCell, @@ -63,7 +64,6 @@ import { TableNameCell, } from "./tableCells"; import { ViewMode } from "./types"; -import styles from "./databaseDetailsPage.module.scss"; const cx = classNames.bind(styles); const sortableTableCx = classNames.bind(sortableTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx index 14f9e56a99ab..3175d45c14c1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/tableCells.tsx @@ -8,12 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Caution } from "@cockroachlabs/icons"; +import { Tooltip } from "antd"; +import classNames from "classnames/bind"; import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import classNames from "classnames/bind"; -import { Tooltip } from "antd"; -import { Caution } from "@cockroachlabs/icons"; +import { Breadcrumbs } from "../breadcrumbs"; +import { CockroachCloudContext } from "../contexts"; +import { LoadingCell, getNetworkErrorMessage } from "../databases"; +import { CaretRight } from "../icon/caretRight"; +import { DatabaseIcon } from "../icon/databaseIcon"; import { EncodeDatabaseTableUri, EncodeDatabaseUri, @@ -22,18 +27,13 @@ import { schemaNameAttr, } from "../util"; import * as format from "../util/format"; -import { Breadcrumbs } from "../breadcrumbs"; -import { CaretRight } from "../icon/caretRight"; -import { CockroachCloudContext } from "../contexts"; -import { LoadingCell, getNetworkErrorMessage } from "../databases"; -import { DatabaseIcon } from "../icon/databaseIcon"; -import styles from "./databaseDetailsPage.module.scss"; import { DatabaseDetailsPageDataTable, DatabaseDetailsPageDataTableDetails, DatabaseDetailsPageProps, } from "./databaseDetailsPage"; +import styles from "./databaseDetailsPage.module.scss"; import { ViewMode } from "./types"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx index e4ae88e61306..95a8cf783c3e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.spec.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; -import * as H from "history"; import { shallow } from "enzyme"; +import * as H from "history"; +import React from "react"; -import { indexUnusedDuration } from "../util"; import { util } from "../index"; +import { indexUnusedDuration } from "../util"; import { DatabaseTablePage, DatabaseTablePageProps } from "./databaseTablePage"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx index ca6fa5169438..df36ccf72e33 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import * as H from "history"; import random from "lodash/random"; import uniq from "lodash/uniq"; import moment from "moment-timezone"; -import * as H from "history"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx index f88834c1409e..723785677408 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row, Tabs, Tooltip } from "antd"; -import { RouteComponentProps } from "react-router-dom"; import classNames from "classnames/bind"; -import { Heading } from "@cockroachlabs/ui-components"; import { Moment } from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; import { Anchor } from "src/anchor"; +import { commonStyles } from "src/common"; import { StackIcon } from "src/icon/stackIcon"; -import { SqlBox } from "src/sql"; import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; +import { SqlBox } from "src/sql"; import { SummaryCard, SummaryCardItem, SummaryCardItemBoolSetting, } from "src/summaryCard"; -import * as format from "src/util/format"; -import { DATE_FORMAT_24_TZ } from "src/util/format"; +import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { ascendingAttr, columnTitleAttr, @@ -33,16 +33,9 @@ import { tabAttr, tableStatsClusterSetting, } from "src/util"; -import { commonStyles } from "src/common"; -import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; +import * as format from "src/util/format"; +import { DATE_FORMAT_24_TZ } from "src/util/format"; -import booleanSettingStyles from "../settings/booleanSetting.module.scss"; -import { CockroachCloudContext } from "../contexts"; -import { RecommendationType } from "../indexDetailsPage"; -import LoadingError from "../sqlActivity/errorComponent"; -import { Loading } from "../loading"; -import { UIConfigState } from "../store"; -import { Timestamp, Timezone } from "../timestamp"; import { SqlApiQueryResponse, SqlExecutionErrorMessage, @@ -52,8 +45,16 @@ import { TableSchemaDetailsRow, TableSpanStatsRow, } from "../api"; +import { CockroachCloudContext } from "../contexts"; import { LoadingCell } from "../databases"; +import { RecommendationType } from "../indexDetailsPage"; +import { Loading } from "../loading"; +import booleanSettingStyles from "../settings/booleanSetting.module.scss"; +import LoadingError from "../sqlActivity/errorComponent"; +import { UIConfigState } from "../store"; +import { Timestamp, Timezone } from "../timestamp"; +import styles from "./databaseTablePage.module.scss"; import { ActionCell, DbTablesBreadcrumbs, @@ -64,7 +65,6 @@ import { LastUsed, NameCell, } from "./helperComponents"; -import styles from "./databaseTablePage.module.scss"; const cx = classNames.bind(styles); const booleanSettingCx = classNames.bind(booleanSettingStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts index d13a23715542..a3b21e21728a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePageConnected.ts @@ -8,13 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps } from "react-router"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { Dispatch } from "redux"; -import { withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router-dom"; +import { Dispatch } from "redux"; import { AppState, uiConfigActions } from "src/store"; +import { actions as analyticsActions } from "src/store/analytics"; +import { actions as clusterSettingsActions } from "src/store/clusterSettings"; +import { + selectAutomaticStatsCollectionEnabled, + selectDropUnusedIndexDuration, + selectIndexRecommendationsEnabled, + selectIndexUsageStatsEnabled, +} from "src/store/clusterSettings/clusterSettings.selectors"; +import { actions as tableDetailsActions } from "src/store/databaseTableDetails"; +import { actions as indexStatsActions } from "src/store/indexStats"; +import { + actions as nodesActions, + nodeRegionsByIDSelector, +} from "src/store/nodes"; +import { selectHasAdminRole, selectIsTenant } from "src/store/uiConfig"; import { databaseNameCCAttr, generateTableID, @@ -24,21 +39,6 @@ import { tableNameCCAttr, TimestampToMoment, } from "src/util"; -import { - actions as nodesActions, - nodeRegionsByIDSelector, -} from "src/store/nodes"; -import { - selectAutomaticStatsCollectionEnabled, - selectDropUnusedIndexDuration, - selectIndexRecommendationsEnabled, - selectIndexUsageStatsEnabled, -} from "src/store/clusterSettings/clusterSettings.selectors"; -import { selectHasAdminRole, selectIsTenant } from "src/store/uiConfig"; -import { actions as tableDetailsActions } from "src/store/databaseTableDetails"; -import { actions as indexStatsActions } from "src/store/indexStats"; -import { actions as analyticsActions } from "src/store/analytics"; -import { actions as clusterSettingsActions } from "src/store/clusterSettings"; import { deriveIndexDetailsMemoized, diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx index 5b9643250f5b..379b82ef3c23 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/helperComponents.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; -import { Moment } from "moment-timezone"; +import { Search as IndexIcon } from "@cockroachlabs/icons"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; +import { Moment } from "moment-timezone"; +import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import { Search as IndexIcon } from "@cockroachlabs/icons"; import { Anchor } from "../anchor"; -import * as format from "../util/format"; -import IdxRecAction from "../insights/indexActionBtn"; +import { sqlApiErrorMessage } from "../api"; import { QuoteIdentifier } from "../api/safesql"; -import { CircleFilled } from "../icon"; import { Breadcrumbs } from "../breadcrumbs"; -import { CaretRight } from "../icon/caretRight"; import { CockroachCloudContext } from "../contexts"; -import { sqlApiErrorMessage } from "../api"; +import { CircleFilled } from "../icon"; +import { CaretRight } from "../icon/caretRight"; +import IdxRecAction from "../insights/indexActionBtn"; +import { Timestamp } from "../timestamp"; import { DATE_FORMAT, DATE_FORMAT_24_TZ, @@ -33,10 +33,10 @@ import { minDate, performanceTuningRecipes, } from "../util"; -import { Timestamp } from "../timestamp"; +import * as format from "../util/format"; -import styles from "./databaseTablePage.module.scss"; import { DatabaseTablePageDataDetails, IndexStat } from "./databaseTablePage"; +import styles from "./databaseTablePage.module.scss"; const cx = classNames.bind(styles); export const NameCell = ({ diff --git a/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts b/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts index 49472c497439..df43662c52af 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSelector } from "@reduxjs/toolkit"; import { DatabaseDetailsPageDataTable } from "src/databaseDetailsPage"; +import { DatabasesListResponse, TableNameParts } from "../api"; +import { DatabasesPageDataDatabase } from "../databasesPage"; +import { DatabaseTablePageDataDetails, IndexStat } from "../databaseTablePage"; +import { RecommendationType as RecType } from "../indexDetailsPage"; import { DatabaseDetailsSpanStatsState, DatabaseDetailsState, } from "../store/databaseDetails"; import { TableDetailsState } from "../store/databaseTableDetails"; -import { generateTableID, longToInt, TimestampToMoment } from "../util"; -import { DatabaseTablePageDataDetails, IndexStat } from "../databaseTablePage"; import { IndexStatsState } from "../store/indexStats"; -import { DatabasesPageDataDatabase } from "../databasesPage"; -import { DatabasesListResponse, TableNameParts } from "../api"; -import { RecommendationType as RecType } from "../indexDetailsPage"; +import { generateTableID, longToInt, TimestampToMoment } from "../util"; import { Nodes, diff --git a/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx index 234a8a37be51..a14b656f8530 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databases/util.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render } from "@testing-library/react"; +import React from "react"; import { INodeStatus } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx b/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx index e7be98df2d33..514156f8f8dc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databases/util.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import React from "react"; -import { Skeleton, Tooltip } from "antd"; import { Caution } from "@cockroachlabs/icons"; +import { Skeleton, Tooltip } from "antd"; +import React from "react"; import { isMaxSizeError, diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx index 7fb06cad6c38..a3c0b237b3a2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databaseTableCells.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; +import { Caution } from "@cockroachlabs/icons"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; +import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import { Caution } from "@cockroachlabs/icons"; -import { CircleFilled } from "../icon"; -import { EncodeDatabaseUri } from "../util"; -import { StackIcon } from "../icon/stackIcon"; import { CockroachCloudContext } from "../contexts"; import { LoadingCell, getNetworkErrorMessage, getQueryErrorMessage, } from "../databases"; +import { CircleFilled } from "../icon"; +import { StackIcon } from "../icon/stackIcon"; +import { EncodeDatabaseUri } from "../util"; import * as format from "../util/format"; -import styles from "./databasesPage.module.scss"; import { DatabasesPageDataDatabase } from "./databasesPage"; +import styles from "./databasesPage.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx index 0db1a7d2b923..6423616efdd0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; -import * as H from "history"; import { shallow } from "enzyme"; +import * as H from "history"; +import React from "react"; import { defaultFilters } from "../queryFilter"; import { indexUnusedDuration } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx index 8fa96e9fff92..d543e5a69335 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import random from "lodash/random"; import * as H from "history"; +import random from "lodash/random"; +import React from "react"; +import { defaultFilters } from "src/queryFilter"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { randomName } from "src/storybook/fixtures"; -import { defaultFilters } from "src/queryFilter"; import { indexUnusedDuration } from "src/util/constants"; import { DatabasesPage, DatabasesPageProps } from "./databasesPage"; diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx index fb004c1fcde5..fc469d1bd78d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { RouteComponentProps } from "react-router-dom"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; import merge from "lodash/merge"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; import { Anchor } from "src/anchor"; import { StackIcon } from "src/icon/stackIcon"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; import { Pagination } from "src/pagination"; import { BooleanSetting } from "src/settings/booleanSetting"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; import { ColumnDescriptor, handleSortSettingFromQueryString, @@ -28,14 +28,19 @@ import { SortSetting, } from "src/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; +import { UIConfigState } from "src/store"; import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { syncHistory, tableStatsClusterSetting, unique } from "src/util"; -import { UIConfigState } from "src/store"; -import booleanSettingStyles from "../settings/booleanSetting.module.scss"; -import LoadingError from "../sqlActivity/errorComponent"; +import { + DatabaseSpanStatsRow, + DatabaseTablesResponse, + isMaxSizeError, + SqlApiQueryResponse, + SqlExecutionErrorMessage, +} from "../api"; +import { LoadingCell } from "../databases"; import { Loading } from "../loading"; -import { Search } from "../search"; import { calculateActiveFilters, defaultFilters, @@ -43,22 +48,17 @@ import { Filters, handleFiltersFromQueryString, } from "../queryFilter"; +import { Search } from "../search"; +import booleanSettingStyles from "../settings/booleanSetting.module.scss"; +import LoadingError from "../sqlActivity/errorComponent"; import { TableStatistics } from "../tableStatistics"; -import { - DatabaseSpanStatsRow, - DatabaseTablesResponse, - isMaxSizeError, - SqlApiQueryResponse, - SqlExecutionErrorMessage, -} from "../api"; -import { LoadingCell } from "../databases"; +import styles from "./databasesPage.module.scss"; import { DatabaseNameCell, IndexRecCell, DiskSizeCell, } from "./databaseTableCells"; -import styles from "./databasesPage.module.scss"; const cx = classNames.bind(styles); const sortableTableCx = classNames.bind(sortableTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts index a179596b155d..21746832fb5b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPageConnected.ts @@ -8,40 +8,40 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { selectIsTenant } from "../store/uiConfig"; +import { deriveDatabaseDetailsMemoized } from "../databases"; +import { Filters } from "../queryFilter"; +import { AppState } from "../store"; +import { actions as analyticsActions } from "../store/analytics"; +import { actions as clusterSettingsActions } from "../store/clusterSettings"; import { - actions as nodesActions, - nodeRegionsByIDSelector, -} from "../store/nodes"; + selectAutomaticStatsCollectionEnabled, + selectDropUnusedIndexDuration, + selectIndexRecommendationsEnabled, +} from "../store/clusterSettings/clusterSettings.selectors"; +import { + databaseDetailsReducer, + databaseDetailsSpanStatsReducer, +} from "../store/databaseDetails"; +import { actions as databasesListActions } from "../store/databasesList"; import { databasesListSelector, selectDatabasesFilters, selectDatabasesSearch, selectDatabasesSortSetting, } from "../store/databasesList/databasesList.selectors"; -import { AppState } from "../store"; -import { actions as clusterSettingsActions } from "../store/clusterSettings"; -import { actions as databasesListActions } from "../store/databasesList"; -import { - databaseDetailsReducer, - databaseDetailsSpanStatsReducer, -} from "../store/databaseDetails"; import { actions as localStorageActions, LocalStorageKeys, } from "../store/localStorage"; -import { Filters } from "../queryFilter"; -import { actions as analyticsActions } from "../store/analytics"; import { - selectAutomaticStatsCollectionEnabled, - selectDropUnusedIndexDuration, - selectIndexRecommendationsEnabled, -} from "../store/clusterSettings/clusterSettings.selectors"; -import { deriveDatabaseDetailsMemoized } from "../databases"; + actions as nodesActions, + nodeRegionsByIDSelector, +} from "../store/nodes"; +import { selectIsTenant } from "../store/uiConfig"; import { DatabasesPage, diff --git a/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx b/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx index 931078194482..1af951e27e28 100644 --- a/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/dateRangeMenu/dateRangeMenu.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useState } from "react"; -import { Alert, DatePicker as AntDatePicker } from "antd"; import ArrowLeftOutlined from "@ant-design/icons/ArrowLeftOutlined"; +import { Time as TimeIcon, ErrorCircleFilled } from "@cockroachlabs/icons"; +import { Alert, DatePicker as AntDatePicker } from "antd"; +import classNames from "classnames/bind"; import moment, { Moment } from "moment-timezone"; import momentGenerateConfig from "rc-picker/lib/generate/moment"; -import classNames from "classnames/bind"; -import { Time as TimeIcon, ErrorCircleFilled } from "@cockroachlabs/icons"; +import React, { useContext, useState } from "react"; import { Button } from "src/button"; import { Text, TextTypes } from "src/text"; diff --git a/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx b/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx index aea34b68e21f..3354718883ef 100644 --- a/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/demo/demoFetch.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import React from "react"; import { fetchData } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx index ed02a9c83cf8..9e09ce600ef8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/detailsPanels/waitTimeInsightsPanel.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; -import { Heading } from "@cockroachlabs/ui-components"; +import React from "react"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import { ContendedExecution, ExecutionType } from "src/activeExecutions"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import { capitalize, Duration, NO_SAMPLES_FOUND } from "../util"; import { ExecutionContentionTable } from "../activeExecutions/activeTransactionsTable/execContentionTable"; import styles from "../statementDetails/statementDetails.module.scss"; +import { capitalize, Duration, NO_SAMPLES_FOUND } from "../util"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx index 4725b9128d35..2398691404ed 100644 --- a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.stories.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Download } from "@cockroachlabs/icons"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; -import { Download } from "@cockroachlabs/icons"; +import React from "react"; import { Button } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx index 1079d38d086e..0c08435ef0aa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/dropdown/dropdown.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classnames from "classnames/bind"; import { CaretDown } from "@cockroachlabs/icons"; +import classnames from "classnames/bind"; +import React from "react"; import { Button, ButtonProps } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx index 0e8064fa6973..4d151d5e622e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/empty/emptyPanel/emptyPanel.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classnames from "classnames/bind"; import { Heading, Text, Button } from "@cockroachlabs/ui-components"; +import classnames from "classnames/bind"; +import React from "react"; import { Anchor } from "../../anchor"; import heroBannerLp from "../../assets/heroBannerLp.png"; diff --git a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx index 0906ea5dbdff..fac1159fc2b1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Button } from "src/button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx index d55f7cdbd6fa..ad1635425742 100644 --- a/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/empty/emptyTable/emptyTable.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Heading, Text } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; import isString from "lodash/isString"; -import { Heading, Text } from "@cockroachlabs/ui-components"; +import React from "react"; import styles from "./emptyTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx index 4756365fdc9c..4821a8f520a1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterCheckboxOption.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import noop from "lodash/noop"; import React from "react"; import Select, { Props, OptionsType } from "react-select"; -import noop from "lodash/noop"; import { StylesConfig } from "react-select/src/styles"; import { CheckboxOption } from "../multiSelectCheckbox/multiSelectCheckbox"; diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx index f0f725def900..024e404f47e0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; +import React from "react"; -import { FilterDropdown } from "./filterDropdown"; import { FilterCheckboxOption } from "./filterCheckboxOption"; +import { FilterDropdown } from "./filterDropdown"; import { FilterSearchOption } from "./filterSearchOption"; storiesOf("FilterDropdown", module) diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx index a0dfa689a6f7..2bd09043923b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterDropdown.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; +import { Button } from "../button"; import { DropdownButton } from "../dropdown"; -import { OutsideEventHandler } from "../outsideEventHandler"; import styles from "../dropdown/dropdown.module.scss"; +import { OutsideEventHandler } from "../outsideEventHandler"; import { applyBtn } from "../queryFilter/filterClasses"; -import { Button } from "../button"; const cx = classnames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx b/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx index faeed0bfd4d3..a752700e08ae 100644 --- a/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/filter/filterSearchOption.tsx @@ -10,8 +10,8 @@ import React from "react"; -import { Search } from "../search"; import { filterLabel } from "../queryFilter/filterClasses"; +import { Search } from "../search"; export type FilterSearchOptionProps = { label: string; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx index 04216968ec23..fee54596adc7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/barGraph.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { AlignedData, Options } from "uplot"; import { AxisUnits } from "../utils/domain"; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx index de874463a227..7eeb4fbe80a3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/index.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useEffect, useRef } from "react"; import classNames from "classnames/bind"; +import React, { useContext, useEffect, useRef } from "react"; import uPlot, { AlignedData, Options } from "uplot"; -import { Visualization } from "../visualization"; +import { TimezoneContext } from "../../contexts"; import { AxisUnits, calculateXAxisDomainBarChart, calculateYAxisDomain, } from "../utils/domain"; -import { TimezoneContext } from "../../contexts"; +import { Visualization } from "../visualization"; import styles from "./bargraph.module.scss"; import { getStackedBarOpts, stack } from "./bars"; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts index 8d91914c5779..9fd73edd7309 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/bargraph/plugins.ts @@ -8,10 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import uPlot, { Plugin } from "uplot"; import moment from "moment-timezone"; +import uPlot, { Plugin } from "uplot"; -import { AxisUnits } from "../utils/domain"; import { Bytes, Duration, @@ -20,6 +19,7 @@ import { FormatWithTimezone, DATE_WITH_SECONDS_FORMAT_24_TZ, } from "../../util"; +import { AxisUnits } from "../utils/domain"; // Fallback color for series stroke if one is not defined. const DEFAULT_STROKE = "#7e89a9"; diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts b/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts index 342fec20bff6..7a31e38cc894 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/utils/domain.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import sortedIndex from "lodash/sortedIndex"; -import min from "lodash/min"; import max from "lodash/max"; +import min from "lodash/min"; +import sortedIndex from "lodash/sortedIndex"; import moment from "moment-timezone"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx b/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx index 6de5b458b075..326b364df73b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/graphs/visualization/index.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Tooltip } from "antd"; +import classNames from "classnames/bind"; +import React from "react"; import spinner from "src/assets/spinner.gif"; diff --git a/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx b/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx index 611153c546b9..4b1ac0fa91b3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/highlightedText/highlightedText.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. /* eslint-disable no-useless-escape */ -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./highlightedText.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx b/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx index bba1d293ba16..dc149939ee6b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/icon/backIcon.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import Back from "./back-arrow.svg"; import styles from "./backIcon.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/index.ts b/pkg/ui/workspaces/cluster-ui/src/index.ts index 1f8dcd806d8e..31f8e7ff7a98 100644 --- a/pkg/ui/workspaces/cluster-ui/src/index.ts +++ b/pkg/ui/workspaces/cluster-ui/src/index.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import "./protobufInit"; -import * as util from "./util"; import * as api from "./api"; +import * as util from "./util"; export * from "./anchor"; export * from "./badge"; export * from "./barCharts"; diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx index c57af3e0a697..78131d14c17a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDeailsPage.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { expect } from "chai"; import { shallow } from "enzyme"; import moment from "moment"; +import React from "react"; import { IndexDetailsPage, IndexDetailsPageProps, util } from "../index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts index 2af1cef98fdb..09cb1590fa2a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsConnected.ts @@ -8,21 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { connect } from "react-redux"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { actions as indexStatsActions } from "src/store/indexStats/indexStats.reducer"; +import { BreadcrumbItem } from "../breadcrumbs"; import { AppState, uiConfigActions } from "../store"; +import { actions as analyticsActions } from "../store/analytics"; import { actions as nodesActions, nodeRegionsByIDSelector, } from "../store/nodes"; -import { TimeScale } from "../timeScaleDropdown"; import { actions as sqlStatsActions } from "../store/sqlStats"; -import { actions as analyticsActions } from "../store/analytics"; +import { + selectHasAdminRole, + selectHasViewActivityRedactedRole, + selectIsTenant, +} from "../store/uiConfig"; +import { selectTimeScale } from "../store/utils/selectors"; +import { TimeScale } from "../timeScaleDropdown"; import { databaseNameAttr, generateTableID, @@ -33,13 +40,6 @@ import { tableNameAttr, TimestampToMoment, } from "../util"; -import { BreadcrumbItem } from "../breadcrumbs"; -import { - selectHasAdminRole, - selectHasViewActivityRedactedRole, - selectIsTenant, -} from "../store/uiConfig"; -import { selectTimeScale } from "../store/utils/selectors"; import { IndexDetailPageActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx index 6f45589a9afa..39c06aa54326 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import moment from "moment-timezone"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; import { randomName } from "src/storybook/fixtures"; diff --git a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx index 7d803c46657d..9c6401296407 100644 --- a/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/indexDetailsPage/indexDetailsPage.tsx @@ -8,72 +8,72 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; -import flatMap from "lodash/flatMap"; import { Caution, Search as IndexIcon } from "@cockroachlabs/icons"; -import moment, { Moment } from "moment-timezone"; import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row, Tooltip } from "antd"; +import classNames from "classnames/bind"; +import flatMap from "lodash/flatMap"; +import moment, { Moment } from "moment-timezone"; +import React from "react"; import { Loading } from "src/loading"; -import { Timestamp } from "src/timestamp"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; import { ISortedTablePagination, SortedTable, SortSetting, } from "src/sortedtable"; -import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { SqlBox, SqlBoxSize } from "src/sql"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { Timestamp } from "src/timestamp"; +import { baseHeadingClasses } from "src/transactionsPage/transactionsPageClasses"; import { INTERNAL_APP_NAME_PREFIX } from "src/util/constants"; -import { CaretRight } from "../icon/caretRight"; -import { BreadcrumbItem, Breadcrumbs } from "../breadcrumbs"; -import { SummaryCard } from "../summaryCard"; import { Anchor } from "../anchor"; -import { - calculateTotalWorkload, - Count, - DATE_FORMAT_24_TZ, - EncodeDatabaseTableIndexUri, - EncodeDatabaseTableUri, - EncodeDatabaseUri, - performanceTuningRecipes, - unique, - unset, -} from "../util"; import { getStatementsUsingIndex, StatementsListRequestFromDetails, StatementsUsingIndexRequest, } from "../api/indexDetailsApi"; +import { BreadcrumbItem, Breadcrumbs } from "../breadcrumbs"; +import { commonStyles } from "../common"; +import { CaretRight } from "../icon/caretRight"; +import { Pagination } from "../pagination"; +import { + calculateActiveFilters, + defaultFilters, + Filter, + Filters, +} from "../queryFilter"; +import { Search } from "../search"; +import LoadingError from "../sqlActivity/errorComponent"; +import { filterStatementsData } from "../sqlActivity/util"; +import { EmptyStatementsPlaceholder } from "../statementsPage/emptyStatementsPlaceholder"; +import { StatementViewType } from "../statementsPage/statementPageTypes"; +import statementsStyles from "../statementsPage/statementsPage.module.scss"; import { AggregateStatistics, makeStatementsColumns, populateRegionNodeForStatements, } from "../statementsTable"; import { UIConfigState } from "../store"; -import statementsStyles from "../statementsPage/statementsPage.module.scss"; -import { Pagination } from "../pagination"; +import { SummaryCard } from "../summaryCard"; import { TableStatistics } from "../tableStatistics"; -import LoadingError from "../sqlActivity/errorComponent"; -import { filterStatementsData } from "../sqlActivity/util"; import { TimeScale, timeScale1hMinOptions, TimeScaleDropdown, } from "../timeScaleDropdown"; -import { Search } from "../search"; import { - calculateActiveFilters, - defaultFilters, - Filter, - Filters, -} from "../queryFilter"; -import { commonStyles } from "../common"; -import { EmptyStatementsPlaceholder } from "../statementsPage/emptyStatementsPlaceholder"; -import { StatementViewType } from "../statementsPage/statementPageTypes"; + calculateTotalWorkload, + Count, + DATE_FORMAT_24_TZ, + EncodeDatabaseTableIndexUri, + EncodeDatabaseTableUri, + EncodeDatabaseUri, + performanceTuningRecipes, + unique, + unset, +} from "../util"; import styles from "./indexDetailsPage.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx index 6bdb4cba3e3c..4a0ffb5b53b1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/indexActionBtn.tsx @@ -8,27 +8,27 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useState } from "react"; -import copy from "copy-to-clipboard"; -import { message } from "antd"; import CopyOutlined from "@ant-design/icons/CopyOutlined"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import { message } from "antd"; import classNames from "classnames/bind"; +import copy from "copy-to-clipboard"; +import React, { useCallback, useState } from "react"; -import { Modal } from "../modal"; -import { Text, TextTypes } from "../text"; -import { Button } from "../button"; +import { Anchor } from "../anchor"; import { executeIndexRecAction, IndexActionResponse, } from "../api/indexActionsApi"; +import { Button } from "../button"; +import { Modal } from "../modal"; +import { Text, TextTypes } from "../text"; import { alterIndex, createIndex, dropIndex, onlineSchemaChanges, } from "../util"; -import { Anchor } from "../anchor"; import styles from "./indexActionBtn.module.scss"; import { InsightType } from "./types"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx index 35f903f5e92d..bf53e9697b31 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/insightsErrorComponent.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./workloadInsights/util/workloadInsights.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx index cf29d8049398..165c4b64a83e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/emptySchemaInsightsTablePlaceholder.tsx @@ -10,9 +10,9 @@ import React from "react"; -import { EmptyTable, EmptyTableProps } from "src/empty"; -import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "src/empty"; import { Anchor } from "../../anchor"; import { insights } from "../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx index 43c5b8645531..233170d25e76 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsPageConnected.tsx @@ -12,6 +12,9 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { SortSetting } from "src/sortedtable"; +import { AppState, uiConfigActions } from "src/store"; +import { selectDropUnusedIndexDuration } from "src/store/clusterSettings/clusterSettings.selectors"; import { actions, selectSchemaInsights, @@ -22,14 +25,11 @@ import { selectFilters, selectSortSetting, } from "src/store/schemaInsights"; -import { AppState, uiConfigActions } from "src/store"; -import { SortSetting } from "src/sortedtable"; -import { selectDropUnusedIndexDuration } from "src/store/clusterSettings/clusterSettings.selectors"; -import { SchemaInsightEventFilters } from "../types"; +import { actions as analyticsActions } from "../../store/analytics"; import { actions as localStorageActions } from "../../store/localStorage"; import { selectHasAdminRole } from "../../store/uiConfig"; -import { actions as analyticsActions } from "../../store/analytics"; +import { SchemaInsightEventFilters } from "../types"; import { SchemaInsightsView, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx index 11aeb607b481..d1b158cbb53e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/schemaInsights/schemaInsightsView.tsx @@ -8,23 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useEffect, useState } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React, { useContext, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import { Anchor } from "src/anchor"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; import styles from "src/statementsPage/statementsPage.module.scss"; import { insights } from "src/util"; -import { Anchor } from "src/anchor"; -import { ISortedTablePagination, SortSetting } from "../../sortedtable"; -import { PageConfig, PageConfigItem } from "../../pageConfig"; -import { Loading } from "../../loading"; +import { CockroachCloudContext } from "../../contexts"; import { InsightsSortedTable, makeInsightsColumns, } from "../../insightsTable/insightsTable"; +import insightTableStyles from "../../insightsTable/insightsTable.module.scss"; +import { Loading } from "../../loading"; +import { PageConfig, PageConfigItem } from "../../pageConfig"; +import { Pagination } from "../../pagination"; import { calculateActiveFilters, defaultFilters, @@ -32,17 +34,15 @@ import { getFullFiltersAsStringRecord, SelectedFilters, } from "../../queryFilter"; -import { queryByName, syncHistory } from "../../util"; +import { getSchemaInsightEventFiltersFromURL } from "../../queryFilter/utils"; +import { Search } from "../../search"; +import { ISortedTablePagination, SortSetting } from "../../sortedtable"; import { getTableSortFromURL } from "../../sortedtable/getTableSortFromURL"; import { TableStatistics } from "../../tableStatistics"; +import { queryByName, syncHistory } from "../../util"; +import { InsightsError } from "../insightsErrorComponent"; import { InsightRecommendation, SchemaInsightEventFilters } from "../types"; -import { getSchemaInsightEventFiltersFromURL } from "../../queryFilter/utils"; import { filterSchemaInsights } from "../utils"; -import { Search } from "../../search"; -import { InsightsError } from "../insightsErrorComponent"; -import { Pagination } from "../../pagination"; -import { CockroachCloudContext } from "../../contexts"; -import insightTableStyles from "../../insightsTable/insightsTable.module.scss"; import { EmptySchemaInsightsTablePlaceholder } from "./emptySchemaInsightsTablePlaceholder"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts index 79eea5e16f4f..145c7c24ae7e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/types.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/types.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment, { Moment } from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment, { Moment } from "moment-timezone"; import { Filters } from "../queryFilter"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts index 096f28448dea..ecb241e008cb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/utils.spec.ts @@ -10,14 +10,6 @@ import moment from "moment-timezone"; -import { - filterStatementInsights, - filterTransactionInsights, - getAppsFromStatementInsights, - getAppsFromTransactionInsights, - getInsightsFromProblemsAndCauses, - mergeTxnInsightDetails, -} from "./utils"; import { ContentionDetails, failedExecutionInsight, @@ -34,6 +26,14 @@ import { TxnInsightDetails, TxnInsightEvent, } from "./types"; +import { + filterStatementInsights, + filterTransactionInsights, + getAppsFromStatementInsights, + getAppsFromTransactionInsights, + getInsightsFromProblemsAndCauses, + mergeTxnInsightDetails, +} from "./utils"; const INTERNAL_APP_PREFIX = "$ internal"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx index 76dec7be637f..ba70bdb3f9d1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Col, Row } from "antd"; -import "antd/lib/row/style"; -import "antd/lib/col/style"; import { Heading } from "@cockroachlabs/ui-components"; +import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import "antd/lib/col/style"; +import React from "react"; -import { SummaryCard, SummaryCardItem } from "../../summaryCard"; // TODO (xinhaoz) we should organize these common page details styles into its own file. import styles from "../../statementDetails/statementDetails.module.scss"; -import { TransactionDetailsLink } from "../workloadInsights/util"; +import { SummaryCard, SummaryCardItem } from "../../summaryCard"; import { ContentionDetails } from "../types"; +import { TransactionDetailsLink } from "../workloadInsights/util"; +import "antd/lib/row/style"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts index bb7f4f5d1855..1636756d2823 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.fixture.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { createMemoryHistory } from "history"; import noop from "lodash/noop"; +import moment from "moment-timezone"; import { InsightEventBase, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx index 3f95d21b3a66..900bf22586ce 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetails.spec.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; -import { createSandbox } from "sinon"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; +import { createSandbox } from "sinon"; import * as sqlApi from "../../api/sqlApi"; -import * as stmtInsightsApi from "../../api/stmtInsightsApi"; import { SqlApiResponse } from "../../api/sqlApi"; -import { StmtInsightEvent } from "../types"; +import * as stmtInsightsApi from "../../api/stmtInsightsApi"; import { CollapseWhitespace, MockSqlResponse } from "../../util/testing"; +import { StmtInsightEvent } from "../types"; import { getStatementInsightPropsFixture } from "./insightDetails.fixture"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx index 3bccb16cf066..97b06b208929 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/insightDetailsTables.tsx @@ -13,6 +13,8 @@ import React, { useState } from "react"; import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; import { DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT, Duration } from "src/util"; +import { TimeScale } from "../../timeScaleDropdown"; +import { Timestamp } from "../../timestamp"; import { ContentionDetails, ContentionEvent, InsightExecEnum } from "../types"; import { insightsTableTitles, @@ -20,8 +22,6 @@ import { StatementDetailsLink, TransactionDetailsLink, } from "../workloadInsights/util"; -import { TimeScale } from "../../timeScaleDropdown"; -import { Timestamp } from "../../timestamp"; interface InsightDetailsTableProps { data: ContentionEvent[]; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx index d5bb1dbb313c..93cf91610d5b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetails.tsx @@ -7,25 +7,25 @@ // 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. -import React, { useEffect, useState } from "react"; -import Helmet from "react-helmet"; -import { RouteComponentProps } from "react-router-dom"; import { ArrowLeft } from "@cockroachlabs/icons"; import { Row, Col, Tabs } from "antd"; import classNames from "classnames/bind"; +import React, { useEffect, useState } from "react"; +import Helmet from "react-helmet"; +import { RouteComponentProps } from "react-router-dom"; +import { getExplainPlanFromGist } from "src/api/decodePlanGistApi"; +import { getStmtInsightsApi } from "src/api/stmtInsightsApi"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; import { Loading } from "src/loading"; import { SqlBox, SqlBoxSize } from "src/sql"; import { getMatchParamByName, idAttr } from "src/util"; -import { getExplainPlanFromGist } from "src/api/decodePlanGistApi"; -import { getStmtInsightsApi } from "src/api/stmtInsightsApi"; // Styles -import { commonStyles } from "src/common"; -import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; -import { InsightsError } from "../insightsErrorComponent"; import { TimeScale, toDateRange } from "../../timeScaleDropdown"; +import { InsightsError } from "../insightsErrorComponent"; import { StmtInsightEvent } from "../types"; import { StatementInsightDetailsOverviewTab } from "./statementInsightDetailsOverviewTab"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx index 7f75f6195add..640017a03408 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. import { connect } from "react-redux"; -import { Dispatch } from "redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; +import { Dispatch } from "redux"; import { AppState, uiConfigActions } from "src/store"; import { @@ -18,10 +18,10 @@ import { } from "src/store/insights/statementInsights"; import { selectHasAdminRole } from "src/store/uiConfig"; -import { TimeScale } from "../../timeScaleDropdown"; +import { actions as analyticsActions } from "../../store/analytics"; import { actions as sqlStatsActions } from "../../store/sqlStats"; import { selectTimeScale } from "../../store/utils/selectors"; -import { actions as analyticsActions } from "../../store/analytics"; +import { TimeScale } from "../../timeScaleDropdown"; import { StatementInsightDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx index fc34e306a89a..bbb2c6051480 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsOverviewTab.tsx @@ -7,36 +7,36 @@ // 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. -import React, { useContext, useMemo, useState } from "react"; +import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; -import { Heading } from "@cockroachlabs/ui-components"; +import React, { useContext, useMemo, useState } from "react"; +import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; import { InsightsSortedTable, makeInsightsColumns, } from "src/insightsTable/insightsTable"; +import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; import { capitalize, Duration } from "src/util"; import { Count, DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, } from "src/util/format"; // Styles -import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; +import { CockroachCloudContext } from "../../contexts"; import { WaitTimeInsightsLabels } from "../../detailsPanels/waitTimeInsightsPanel"; +import { SortSetting } from "../../sortedtable"; +import { Timestamp } from "../../timestamp"; +import { StmtInsightEvent } from "../types"; import { getStmtInsightRecommendations } from "../utils"; import { StatementDetailsLink, TransactionDetailsLink, } from "../workloadInsights/util"; -import { CockroachCloudContext } from "../../contexts"; -import { StmtInsightEvent } from "../types"; -import { SortSetting } from "../../sortedtable"; -import { Timestamp } from "../../timestamp"; import { ContentionStatementDetailsTable } from "./insightDetailsTables"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx index 70b4a78c76cd..73dfe2c6f941 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetails.tsx @@ -7,20 +7,20 @@ // 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. +import { ArrowLeft } from "@cockroachlabs/icons"; +import { InlineAlert } from "@cockroachlabs/ui-components"; +import { Tabs } from "antd"; import React, { useEffect, useRef } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import { ArrowLeft } from "@cockroachlabs/icons"; -import { Tabs } from "antd"; -import { InlineAlert } from "@cockroachlabs/ui-components"; -import { Button } from "src/button"; -import { getMatchParamByName } from "src/util/query"; +import { Anchor } from "src/anchor"; import { TxnInsightDetailsRequest, TxnInsightDetailsReqErrs } from "src/api"; +import { Button } from "src/button"; import { commonStyles } from "src/common"; -import { idAttr, insights } from "src/util"; import { timeScaleRangeToObj } from "src/timeScaleDropdown/utils"; -import { Anchor } from "src/anchor"; +import { idAttr, insights } from "src/util"; +import { getMatchParamByName } from "src/util/query"; import { TimeScale } from "../../timeScaleDropdown"; import { @@ -29,8 +29,8 @@ import { TxnInsightDetails, } from "../types"; -import { TransactionInsightsDetailsStmtsTab } from "./transactionInsightDetailsStmtsTab"; import { TransactionInsightDetailsOverviewTab } from "./transactionInsightDetailsOverviewTab"; +import { TransactionInsightsDetailsStmtsTab } from "./transactionInsightDetailsStmtsTab"; export interface TransactionInsightDetailsStateProps { insightDetails: TxnInsightDetails; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx index 1bccde930f58..56fd789f5bf1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx @@ -11,6 +11,7 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { TxnInsightDetailsRequest } from "src/api"; import { AppState, uiConfigActions } from "src/store"; import { selectTransactionInsightDetails, @@ -18,13 +19,12 @@ import { actions, selectTransactionInsightDetailsMaxSizeReached, } from "src/store/insightDetails/transactionInsightDetails"; -import { TxnInsightDetailsRequest } from "src/api"; -import { TimeScale } from "../../timeScaleDropdown"; +import { actions as analyticsActions } from "../../store/analytics"; import { actions as sqlStatsActions } from "../../store/sqlStats"; -import { selectTimeScale } from "../../store/utils/selectors"; import { selectHasAdminRole } from "../../store/uiConfig"; -import { actions as analyticsActions } from "../../store/analytics"; +import { selectTimeScale } from "../../store/utils/selectors"; +import { TimeScale } from "../../timeScaleDropdown"; import { TransactionInsightDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx index 64bf3c081e76..8d46572348cd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsOverviewTab.tsx @@ -8,29 +8,34 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useState } from "react"; import { Heading } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import React, { useContext, useState } from "react"; +import { TxnInsightDetailsReqErrs } from "src/api"; +import { WaitTimeInsightsLabels } from "src/detailsPanels/waitTimeInsightsPanel"; +import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; +import { + InsightsSortedTable, + makeInsightsColumns, +} from "src/insightsTable/insightsTable"; +import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; +import { Loading } from "src/loading"; import { SqlBox, SqlBoxSize } from "src/sql"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import { NO_SAMPLES_FOUND } from "src/util"; import { Count, DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, Duration, } from "src/util/format"; -import { WaitTimeInsightsLabels } from "src/detailsPanels/waitTimeInsightsPanel"; -import { NO_SAMPLES_FOUND } from "src/util"; -import { - InsightsSortedTable, - makeInsightsColumns, -} from "src/insightsTable/insightsTable"; -import { TxnInsightDetailsReqErrs } from "src/api"; -import { Loading } from "src/loading"; -import insightTableStyles from "src/insightsTable/insightsTable.module.scss"; -import insightsDetailsStyles from "src/insights/workloadInsightDetails/insightsDetails.module.scss"; +import { CockroachCloudContext } from "../../contexts"; +import { SortSetting } from "../../sortedtable"; +import { TimeScale } from "../../timeScaleDropdown"; +import { Timestamp } from "../../timestamp"; +import { InsightsError } from "../insightsErrorComponent"; import { ContentionDetails, ContentionEvent, @@ -39,16 +44,11 @@ import { StmtInsightEvent, TxnInsightEvent, } from "../types"; -import { CockroachCloudContext } from "../../contexts"; -import { TransactionDetailsLink } from "../workloadInsights/util"; -import { TimeScale } from "../../timeScaleDropdown"; import { getTxnInsightRecommendations } from "../utils"; -import { SortSetting } from "../../sortedtable"; -import { InsightsError } from "../insightsErrorComponent"; -import { Timestamp } from "../../timestamp"; +import { TransactionDetailsLink } from "../workloadInsights/util"; -import { WaitTimeDetailsTable } from "./insightDetailsTables"; import { FailedInsightDetailsPanel } from "./failedInsightDetailsPanel"; +import { WaitTimeDetailsTable } from "./insightDetailsTables"; const cx = classNames.bind(insightsDetailsStyles); const tableCx = classNames.bind(insightTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx index 5bf0976d358b..d7962636fce9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsStmtsTab.tsx @@ -11,18 +11,18 @@ import React from "react"; import { Link } from "react-router-dom"; +import { Loading } from "src/loading"; import { ColumnDescriptor, SortedTable } from "src/sortedtable"; import { DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT, Duration, limitText, } from "src/util"; -import { Loading } from "src/loading"; +import { Timestamp, Timezone } from "../../timestamp"; +import { InsightsError } from "../insightsErrorComponent"; import { StmtInsightEvent } from "../types"; import { InsightCell } from "../workloadInsights/util/insightCell"; -import { InsightsError } from "../insightsErrorComponent"; -import { Timestamp, Timezone } from "../../timestamp"; const stmtColumns: ColumnDescriptor<StmtInsightEvent>[] = [ { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx index 84044d752e3f..dbc3c63e69df 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsTable.tsx @@ -8,11 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; -import { Link } from "react-router-dom"; import classNames from "classnames/bind"; +import React from "react"; +import { Link } from "react-router-dom"; +import { Badge } from "src/badge"; +import { + InsightExecEnum, + StatementStatus, + StmtInsightEvent, +} from "src/insights"; import { ColumnDescriptor, ISortedTablePagination, @@ -26,20 +32,14 @@ import { limitText, NO_SAMPLES_FOUND, } from "src/util"; -import { - InsightExecEnum, - StatementStatus, - StmtInsightEvent, -} from "src/insights"; -import { Badge } from "src/badge"; -import styles from "../util/workloadInsights.module.scss"; +import { Timestamp } from "../../../timestamp"; import { InsightCell, insightsTableTitles, StatementDetailsLink, } from "../util"; -import { Timestamp } from "../../../timestamp"; +import styles from "../util/workloadInsights.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx index 3109bdc311dc..5688ccf5622f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/statementInsights/statementInsightsView.tsx @@ -8,19 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState, useCallback } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { useHistory } from "react-router-dom"; import moment from "moment-timezone"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React, { useEffect, useState, useCallback } from "react"; +import { useHistory } from "react-router-dom"; +import { Anchor } from "src/anchor"; +import { StmtInsightsReq } from "src/api/stmtInsightsApi"; +import { isSelectedColumn } from "src/columnsSelector/utils"; import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; + filterStatementInsights, + StmtInsightEvent, + getAppsFromStatementInsights, + makeStatementInsightsColumns, + WorkloadInsightEventFilters, +} from "src/insights"; import { Loading } from "src/loading/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; +import { Pagination } from "src/pagination"; import { calculateActiveFilters, defaultFilters, @@ -29,34 +35,28 @@ import { SelectedFilters, } from "src/queryFilter/filter"; import { getWorkloadInsightEventFiltersFromURL } from "src/queryFilter/utils"; -import { Pagination } from "src/pagination"; -import { queryByName, syncHistory } from "src/util/query"; +import { Search } from "src/search/search"; import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; -import { TableStatistics } from "src/tableStatistics"; -import { isSelectedColumn } from "src/columnsSelector/utils"; import { - filterStatementInsights, - StmtInsightEvent, - getAppsFromStatementInsights, - makeStatementInsightsColumns, - WorkloadInsightEventFilters, -} from "src/insights"; -import { StmtInsightsReq } from "src/api/stmtInsightsApi"; -import styles from "src/statementsPage/statementsPage.module.scss"; + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { useScheduleFunction } from "src/util/hooks"; +import styles from "src/statementsPage/statementsPage.module.scss"; +import { TableStatistics } from "src/tableStatistics"; import { insights } from "src/util"; -import { Anchor } from "src/anchor"; +import { useScheduleFunction } from "src/util/hooks"; +import { queryByName, syncHistory } from "src/util/query"; +import ColumnsSelector from "../../../columnsSelector/columnsSelector"; import { commonStyles } from "../../../common"; +import { SelectOption } from "../../../multiSelectCheckbox/multiSelectCheckbox"; import { defaultTimeScaleOptions, TimeScale, TimeScaleDropdown, timeScaleRangeToObj, } from "../../../timeScaleDropdown"; -import { SelectOption } from "../../../multiSelectCheckbox/multiSelectCheckbox"; -import ColumnsSelector from "../../../columnsSelector/columnsSelector"; import { InsightsError } from "../../insightsErrorComponent"; import { EmptyInsightsTablePlaceholder } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx index 01850ed091e5..97eb0128b783 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsTable.tsx @@ -11,6 +11,12 @@ import React from "react"; import { Link } from "react-router-dom"; +import { Badge } from "src/badge"; +import { + InsightExecEnum, + TransactionStatus, + TxnInsightEvent, +} from "src/insights"; import { ColumnDescriptor, ISortedTablePagination, @@ -21,21 +27,15 @@ import { DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, Duration, } from "src/util"; -import { - InsightExecEnum, - TransactionStatus, - TxnInsightEvent, -} from "src/insights"; -import { Badge } from "src/badge"; +import { TimeScale } from "../../../timeScaleDropdown"; +import { Timestamp } from "../../../timestamp"; import { InsightCell, insightsTableTitles, QueriesCell, TransactionDetailsLink, } from "../util"; -import { TimeScale } from "../../../timeScaleDropdown"; -import { Timestamp } from "../../../timestamp"; function txnStatusToString(status: TransactionStatus) { switch (status) { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx index b9b6fbe2b5a8..2e97f5661c6e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/transactionInsights/transactionInsightsView.tsx @@ -8,18 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useEffect, useState } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React, { useCallback, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import { Anchor } from "src/anchor"; +import { TxnInsightsRequest } from "src/api"; import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; + filterTransactionInsights, + getAppsFromTransactionInsights, + WorkloadInsightEventFilters, + TxnInsightEvent, +} from "src/insights"; import { Loading } from "src/loading/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; +import { Pagination } from "src/pagination"; import { calculateActiveFilters, defaultFilters, @@ -28,22 +32,18 @@ import { SelectedFilters, } from "src/queryFilter/filter"; import { getWorkloadInsightEventFiltersFromURL } from "src/queryFilter/utils"; -import { Pagination } from "src/pagination"; -import { queryByName, syncHistory } from "src/util/query"; +import { Search } from "src/search/search"; import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; -import { TableStatistics } from "src/tableStatistics"; import { - filterTransactionInsights, - getAppsFromTransactionInsights, - WorkloadInsightEventFilters, - TxnInsightEvent, -} from "src/insights"; -import { TxnInsightsRequest } from "src/api"; -import styles from "src/statementsPage/statementsPage.module.scss"; + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { useScheduleFunction } from "src/util/hooks"; +import styles from "src/statementsPage/statementsPage.module.scss"; +import { TableStatistics } from "src/tableStatistics"; import { insights } from "src/util"; -import { Anchor } from "src/anchor"; +import { useScheduleFunction } from "src/util/hooks"; +import { queryByName, syncHistory } from "src/util/query"; import { commonStyles } from "../../../common"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx index dfeebee3d877..5b3a30a986a6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/detailsLinks.tsx @@ -11,10 +11,10 @@ import React from "react"; import { Link } from "react-router-dom"; -import { StmtInsightEvent } from "../../types"; -import { HexStringToInt64String } from "../../../util"; import { StatementLinkTarget } from "../../../statementsTable"; import { TransactionLinkTarget } from "../../../transactionsTable"; +import { HexStringToInt64String } from "../../../util"; +import { StmtInsightEvent } from "../../types"; export function TransactionDetailsLink( transactionFingerprintID: string, diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx index 29af21842f95..a848f261780b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/emptyInsightsTablePlaceholder.tsx @@ -10,11 +10,11 @@ import React from "react"; -import { EmptyTable, EmptyTableProps } from "src/empty"; import { Anchor } from "src/anchor"; -import { insights } from "src/util"; -import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "src/empty"; +import { insights } from "src/util"; const footer = ( <Anchor href={insights} target="_blank"> diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx index fabb5ea3b8e1..3726e28ea8c2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightCell.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; +import React from "react"; import { Insight } from "src/insights"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx index 9be71118d858..fa9a4fa36a91 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/insightsColumns.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ReactElement } from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; +import React, { ReactElement } from "react"; import { InsightExecEnum } from "src/insights/types"; import { Timezone } from "src/timestamp"; -import { contentModifiers } from "../../../statsTableUtil/statsTableUtil"; import { Anchor } from "../../../anchor"; +import { contentModifiers } from "../../../statsTableUtil/statsTableUtil"; import { contentionTime, readFromDisk, writtenToDisk } from "../../../util"; export const insightsColumnLabels = { diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx index acf81f7bc56d..4829cd8b6357 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/util/queriesCell.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React from "react"; import { limitStringArray } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx index 2afbac18a38f..304a60323feb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightRootControl.tsx @@ -16,15 +16,15 @@ import { queryByName } from "src/util/query"; import { InsightExecEnum, InsightExecOptions } from "../types"; -import { DropDownSelect } from "./util"; -import { - TransactionInsightsView, - TransactionInsightsViewProps, -} from "./transactionInsights"; import { StatementInsightsView, StatementInsightsViewProps, } from "./statementInsights"; +import { + TransactionInsightsView, + TransactionInsightsViewProps, +} from "./transactionInsights"; +import { DropDownSelect } from "./util"; export type WorkloadInsightsViewProps = { transactionInsightsViewProps: TransactionInsightsViewProps; diff --git a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx index 2cf73b50e6d2..83aa05b86712 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insights/workloadInsights/workloadInsightsPageConnected.tsx @@ -12,15 +12,14 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { AppState } from "src/store"; -import { actions as localStorageActions } from "src/store/localStorage"; -import { actions as sqlActions } from "src/store/sqlStats"; +import { StmtInsightsReq, TxnInsightsRequest } from "src/api"; +import { selectStmtInsights } from "src/selectors/common"; import { SortSetting } from "src/sortedtable"; +import { AppState } from "src/store"; import { actions as statementInsights, selectColumns, selectInsightTypes, - selectStmtInsights, selectStmtInsightsError, selectStmtInsightsLoading, selectStmtInsightsMaxApiReached, @@ -34,17 +33,14 @@ import { selectTransactionInsightsLoading, selectTransactionInsightsMaxApiReached, } from "src/store/insights/transactionInsights"; -import { StmtInsightsReq, TxnInsightsRequest } from "src/api"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { actions as sqlActions } from "src/store/sqlStats"; +import { actions as analyticsActions } from "../../store/analytics"; +import { selectTimeScale } from "../../store/utils/selectors"; import { TimeScale } from "../../timeScaleDropdown"; import { WorkloadInsightEventFilters } from "../types"; -import { selectTimeScale } from "../../store/utils/selectors"; -import { actions as analyticsActions } from "../../store/analytics"; -import { - WorkloadInsightsViewProps, - WorkloadInsightsRootControl, -} from "./workloadInsightRootControl"; import { StatementInsightsViewDispatchProps, StatementInsightsViewStateProps, @@ -53,6 +49,10 @@ import { TransactionInsightsViewDispatchProps, TransactionInsightsViewStateProps, } from "./transactionInsights"; +import { + WorkloadInsightsViewProps, + WorkloadInsightsRootControl, +} from "./workloadInsightRootControl"; const transactionMapStateToProps = ( state: AppState, diff --git a/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx index 45b63c44a909..73f5a1eb4537 100644 --- a/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/insightsTable/insightsTable.tsx @@ -9,12 +9,20 @@ // licenses/APL.txt. import { Tooltip } from "@cockroachlabs/ui-components"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { Link } from "react-router-dom"; -import { StatementLink } from "../statementsTable"; +import { Anchor } from "../anchor"; import IdxRecAction from "../insights/indexActionBtn"; +import { + InsightExecEnum, + InsightRecommendation, + InsightType, +} from "../insights/types"; +import { insightType } from "../insights/utils"; +import { ColumnDescriptor, SortedTable } from "../sortedtable"; +import { StatementLink } from "../statementsTable"; import { clusterSettings, computeOrUseStmtSummary, @@ -26,14 +34,6 @@ import { statementsRetries, stmtPerformanceRules, } from "../util"; -import { Anchor } from "../anchor"; -import { ColumnDescriptor, SortedTable } from "../sortedtable"; -import { - InsightExecEnum, - InsightRecommendation, - InsightType, -} from "../insights/types"; -import { insightType } from "../insights/utils"; import styles from "./insightsTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx index e3198dac52a9..06b0d59710f6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetails.tsx @@ -7,34 +7,34 @@ // 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. -import React, { useContext } from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { ArrowLeft } from "@cockroachlabs/icons"; import { Col, Row, Tabs } from "antd"; +import classNames from "classnames/bind"; import Long from "long"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; -import moment from "moment-timezone"; import { JobRequest, JobResponse } from "src/api/jobsApi"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { CockroachCloudContext } from "src/contexts"; +import jobStyles from "src/jobs/jobs.module.scss"; +import { HighwaterTimestamp } from "src/jobs/util/highwaterTimestamp"; +import { JobStatusCell } from "src/jobs/util/jobStatusCell"; import { Loading } from "src/loading"; import { SqlBox, SqlBoxSize } from "src/sql"; +import { UIConfigState } from "src/store"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; import { TimestampToMoment, idAttr, getMatchParamByName, DATE_WITH_SECONDS_AND_MILLISECONDS_FORMAT_24_TZ, } from "src/util"; -import { HighwaterTimestamp } from "src/jobs/util/highwaterTimestamp"; -import { JobStatusCell } from "src/jobs/util/jobStatusCell"; -import { commonStyles } from "src/common"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import jobStyles from "src/jobs/jobs.module.scss"; -import { CockroachCloudContext } from "src/contexts"; -import { UIConfigState } from "src/store"; import { GetJobProfilerExecutionDetailRequest, diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx index ab5fba383266..656c41e74f37 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobDetailsConnected.tsx @@ -8,19 +8,19 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import long from "long"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import long from "long"; -import { AppState, uiConfigActions } from "src/store"; -import { JobRequest, JobResponse } from "src/api/jobsApi"; -import { actions as jobActions } from "src/store/jobDetails"; import { ListJobProfilerExecutionDetailsRequest, createInitialState, getExecutionDetailFile, } from "src/api"; +import { JobRequest, JobResponse } from "src/api/jobsApi"; +import { AppState, uiConfigActions } from "src/store"; +import { actions as jobActions } from "src/store/jobDetails"; import { initialState, actions as jobProfilerActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx index fd147fb4094a..bfe26ffda57f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useEffect, useMemo, useState } from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Button, InlineAlert, Icon } from "@cockroachlabs/ui-components"; -import moment from "moment-timezone"; import { Space } from "antd"; import classNames from "classnames"; -import long from "long"; import classnames from "classnames/bind"; +import long from "long"; +import moment from "moment-timezone"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import { RequestState } from "src/api"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; -import { EmptyTable } from "src/empty"; -import { useScheduleFunction } from "src/util/hooks"; -import { DownloadFile, DownloadFileRef } from "src/downloadFile"; import { GetJobProfilerExecutionDetailRequest, GetJobProfilerExecutionDetailResponse, ListJobProfilerExecutionDetailsRequest, ListJobProfilerExecutionDetailsResponse, } from "src/api/jobProfilerApi"; +import { DownloadFile, DownloadFileRef } from "src/downloadFile"; +import { EmptyTable } from "src/empty"; +import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; +import { useScheduleFunction } from "src/util/hooks"; import styles from "./jobProfilerView.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx index 6c25d5f93089..0bffc9693580 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobDescriptionCell.tsx @@ -9,9 +9,9 @@ // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import React from "react"; import { Link } from "react-router-dom"; -import classNames from "classnames/bind"; import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx index 7809b28a3bb4..d22decad418e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.spec.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { render } from "@testing-library/react"; +import * as H from "history"; +import moment from "moment-timezone"; import React from "react"; import { MemoryRouter } from "react-router-dom"; -import * as H from "history"; import { formatDuration } from "../util/duration"; -import { allJobsFixture, earliestRetainedTime } from "./jobsPage.fixture"; import { JobsPage, JobsPageProps } from "./jobsPage"; +import { allJobsFixture, earliestRetainedTime } from "./jobsPage.fixture"; import Job = cockroach.server.serverpb.IJobResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx index c7fc7c9d3c94..c4c4818eecc5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.stories.tsx @@ -7,8 +7,8 @@ // 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. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx index 37c444afec3f..dddd927819e4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPage.tsx @@ -9,28 +9,29 @@ // licenses/APL.txt. import { cockroach, google } from "@cockroachlabs/crdb-protobuf-client"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import moment from "moment-timezone"; import React from "react"; import { Helmet } from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { JobsRequest, JobsResponse } from "src/api/jobsApi"; import { RequestState } from "src/api/types"; -import { Delayed } from "src/delayed"; -import { Dropdown } from "src/dropdown"; -import { Loading } from "src/loading"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; -import { ISortedTablePagination, SortSetting } from "src/sortedtable"; import ColumnsSelector, { SelectOption, } from "src/columnsSelector/columnsSelector"; -import { Pagination, ResultsPerPageLabel } from "src/pagination"; import { isSelectedColumn } from "src/columnsSelector/utils"; -import { DATE_FORMAT_24_TZ, syncHistory, TimestampToMoment } from "src/util"; import { commonStyles } from "src/common"; +import { Delayed } from "src/delayed"; +import { Dropdown } from "src/dropdown"; +import { Loading } from "src/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { Pagination, ResultsPerPageLabel } from "src/pagination"; +import { ISortedTablePagination, SortSetting } from "src/sortedtable"; import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; +import { DATE_FORMAT_24_TZ, syncHistory, TimestampToMoment } from "src/util"; +import { Timestamp } from "../../timestamp"; import styles from "../jobs.module.scss"; import { showOptions, @@ -40,7 +41,6 @@ import { defaultRequestOptions, isValidJobType, } from "../util"; -import { Timestamp } from "../../timestamp"; import { jobsColumnLabels, JobsTable, makeJobsColumns } from "./jobsTable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx index 8bc82b17e12c..0ee8d35264bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsPageConnected.tsx @@ -12,6 +12,7 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { JobsRequest } from "src/api/jobsApi"; import { AppState } from "src/store"; import { selectShowSetting, @@ -22,11 +23,10 @@ import { initialState, actions as jobsActions, } from "src/store/jobs"; -import { JobsRequest } from "src/api/jobsApi"; -import { actions as localStorageActions } from "../../store/localStorage"; import { SortSetting } from "../../sortedtable"; import { actions as analyticsActions } from "../../store/analytics"; +import { actions as localStorageActions } from "../../store/localStorage"; import { JobsPageStateProps, diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx index 60ff20f7dd54..8a20b4490bfb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/jobsPage/jobsTable.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Tooltip } from "@cockroachlabs/ui-components"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { Anchor } from "src/anchor"; import { EmptyTable } from "src/empty"; @@ -30,9 +30,9 @@ import { } from "src/util/docs"; import { DATE_WITH_SECONDS_FORMAT } from "src/util/format"; -import { HighwaterTimestamp, JobStatusCell } from "../util"; -import styles from "../jobs.module.scss"; import { Timestamp, Timezone } from "../../timestamp"; +import styles from "../jobs.module.scss"; +import { HighwaterTimestamp, JobStatusCell } from "../util"; import { JobDescriptionCell } from "./jobDescriptionCell"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx index 9a4b00aa1ed0..a09deaa8c741 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/util/duration.spec.tsx @@ -8,12 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { render, screen } from "@testing-library/react"; +import React from "react"; import { makeTimestamp } from "src/util"; +import { Duration } from "./duration"; import { JOB_STATUS_RUNNING, JOB_STATUS_SUCCEEDED, @@ -26,7 +27,6 @@ import { JOB_STATUS_REVERTING, JOB_STATUS_REVERT_FAILED, } from "./jobOptions"; -import { Duration } from "./duration"; // Job running for 10 minutes const START_SECONDS = 0; diff --git a/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx b/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx index c824e2585363..96de0a4f6c39 100644 --- a/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/jobs/util/progressBar.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import classNames from "classnames/bind"; import { Line } from "rc-progress"; import React from "react"; -import classNames from "classnames/bind"; import { Badge } from "src/badge"; diff --git a/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx index fc2d1432d5b9..64a8faeb7121 100644 --- a/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/loading/loading.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Spinner, InlineAlert } from "@cockroachlabs/ui-components"; import { assert } from "chai"; import { mount } from "enzyme"; -import { Spinner, InlineAlert } from "@cockroachlabs/ui-components"; +import React from "react"; import { Loading } from "./loading"; diff --git a/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx b/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx index 871e6e4d7f0b..387a91da381d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/loading/loading.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { InlineAlert, InlineAlertProps, Spinner, InlineAlertIntent, } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import groupBy from "lodash/groupBy"; import map from "lodash/map"; +import React from "react"; import { adminUIAccess, getLogger, isForbiddenRequestError } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx b/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx index 1a5eabbd5e27..153e376a5841 100644 --- a/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/modal/modal.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Modal as AntModal, Space } from "antd"; +import classNames from "classnames/bind"; +import React from "react"; import { Button } from "../button"; -import { Text, TextTypes } from "../text"; import SpinIcon from "../icon/spin"; +import { Text, TextTypes } from "../text"; import styles from "./modal.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx b/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx index 7ccb056a8f72..f9d363745ca5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/multiSelectCheckbox/multiSelectCheckbox.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import React from "react"; import Select, { components, OptionsType } from "react-select"; -import classNames from "classnames/bind"; import { Filter } from "../queryFilter"; diff --git a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx index f038ae3582a6..7ea5dccd4489 100644 --- a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./outsideEventHandler.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx index 13db0a603e77..bbc9b04694a2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/outsideEventHandler/outsideEventHandler.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { createRef } from "react"; import { render, waitFor } from "@testing-library/react"; +import React, { createRef } from "react"; import { OutsideEventHandler } from "./index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx b/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx index f06a84b88468..3ca4f736d727 100644 --- a/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/pageConfig/pageConfig.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; import classnames from "classnames/bind"; +import React, { useContext } from "react"; import { CockroachCloudContext } from "../contexts"; diff --git a/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx b/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx index 5cda0b33c29e..2c0461a77804 100644 --- a/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/pagination/pagination.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Pagination as AntPagination, PaginationProps as AntPaginationProps, } from "antd"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./pagination.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx index 9d208c76b286..04f699bad70a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/pagination/resultsPerPageLabel.spec.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { assert } from "chai"; import { shallow } from "enzyme"; +import React from "react"; import { ResultsPerPageLabel, diff --git a/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts b/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts index a425e7f1fbed..db6eb404acf1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts +++ b/pkg/ui/workspaces/cluster-ui/src/protobufInit.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as protobuf from "protobufjs/minimal"; import Long from "long"; +import * as protobuf from "protobufjs/minimal"; protobuf.util.Long = Long; protobuf.configure(); diff --git a/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx b/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx index c78a1cad3f6f..59f0cf503515 100644 --- a/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/queryFilter/filter.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import Select from "react-select"; -import { History } from "history"; import { CaretDown, Cancel } from "@cockroachlabs/icons"; import { Input } from "antd"; +import { History } from "history"; import isEqual from "lodash/isEqual"; +import React from "react"; +import Select from "react-select"; +import { Button } from "../button"; +import { selectCustomStyles } from "../common"; import { MultiSelectCheckbox } from "../multiSelectCheckbox/multiSelectCheckbox"; import { syncHistory } from "../util"; -import { selectCustomStyles } from "../common"; -import { Button } from "../button"; import { dropdownButton, diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx index 87ba1686560a..520e8ee1f1dd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/scheduleDetailsPage/scheduleDetails.tsx @@ -9,21 +9,21 @@ // licenses/APL.txt. import { ArrowLeft } from "@cockroachlabs/icons"; import { Col, Row } from "antd"; +import classNames from "classnames/bind"; import Long from "long"; import React, { useEffect } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { Schedule } from "src/api/schedulesApi"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; import { Loading } from "src/loading"; +import scheduleStyles from "src/schedules/schedules.module.scss"; import { SqlBox, SqlBoxSize } from "src/sql"; import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import { DATE_FORMAT_24_TZ, idAttr, getMatchParamByName } from "src/util"; -import { commonStyles } from "src/common"; import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import scheduleStyles from "src/schedules/schedules.module.scss"; +import { DATE_FORMAT_24_TZ, idAttr, getMatchParamByName } from "src/util"; import { Timestamp } from "../../timestamp"; diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx index dbf499cf584d..bdcb35be862e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.spec.tsx @@ -7,11 +7,11 @@ // 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. -import React from "react"; import { shallow } from "enzyme"; +import React from "react"; -import { ScheduleTable, ScheduleTableProps } from "./scheduleTable"; import { allSchedulesFixture } from "./schedulesPage.fixture"; +import { ScheduleTable, ScheduleTableProps } from "./scheduleTable"; describe("<ScheduleTable>", () => { it("should reset page to 1 after schedule list prop changes", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx index f69a52e29378..dfb0a0d97dc7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/scheduleTable.tsx @@ -7,13 +7,13 @@ // 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. -import React from "react"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { Nodes, MagnifyingGlass } from "@cockroachlabs/icons"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { Link } from "react-router-dom"; -import map from "lodash/map"; import isEqual from "lodash/isEqual"; +import map from "lodash/map"; +import React from "react"; +import { Link } from "react-router-dom"; import { Anchor } from "src/anchor"; import { Schedule, Schedules } from "src/api/schedulesApi"; @@ -23,8 +23,8 @@ import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import { dropSchedules, pauseSchedules, resumeSchedules } from "src/util/docs"; import { DATE_FORMAT } from "src/util/format"; -import styles from "../schedules.module.scss"; import { Timestamp, Timezone } from "../../timestamp"; +import styles from "../schedules.module.scss"; const cx = classNames.bind(styles); class SchedulesSortedTable extends SortedTable<Schedule> {} diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx index 8bf05febac46..dda53981e91a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.spec.tsx @@ -9,14 +9,14 @@ // licenses/APL.txt. import { render } from "@testing-library/react"; +import * as H from "history"; import React from "react"; import { MemoryRouter } from "react-router-dom"; -import * as H from "history"; import { Schedule } from "src/api/schedulesApi"; -import { allSchedulesFixture } from "./schedulesPage.fixture"; import { SchedulesPage, SchedulesPageProps } from "./schedulesPage"; +import { allSchedulesFixture } from "./schedulesPage.fixture"; const getMockSchedulesPageProps = ( schedules: Array<Schedule>, diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx index bd606a8bda90..cd3f15b994c8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.stories.tsx @@ -7,8 +7,8 @@ // 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. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx index 42a219f4a368..fbc9c03bbf7e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/schedules/schedulesPage/schedulesPage.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import moment from "moment-timezone"; import React, { useEffect } from "react"; import { Helmet } from "react-helmet"; import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { Schedules } from "src/api/schedulesApi"; +import { commonStyles } from "src/common"; import { Delayed } from "src/delayed"; import { Dropdown } from "src/dropdown"; import { Loading } from "src/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig"; import { SortSetting } from "src/sortedtable"; import { syncHistory } from "src/util"; -import { commonStyles } from "src/common"; import styles from "../schedules.module.scss"; -import { ScheduleTable } from "./scheduleTable"; import { statusOptions, showOptions } from "./scheduleOptions"; +import { ScheduleTable } from "./scheduleTable"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx index bc84dc934a2f..92f8b6702793 100644 --- a/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/search/search.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Search } from "./index"; diff --git a/pkg/ui/workspaces/cluster-ui/src/search/search.tsx b/pkg/ui/workspaces/cluster-ui/src/search/search.tsx index ad3eedbd2aff..9ce9c7a689bc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/search/search.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/search/search.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Button, Input, ConfigProvider } from "antd"; -import classNames from "classnames/bind"; -import noop from "lodash/noop"; import { Cancel as CancelIcon, Search as SearchIcon, } from "@cockroachlabs/icons"; +import { Button, Input, ConfigProvider } from "antd"; +import classNames from "classnames/bind"; +import noop from "lodash/noop"; +import React from "react"; import { crlTheme } from "../antdTheme"; diff --git a/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx b/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx index 7844f0661aa6..a941426f2552 100644 --- a/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/searchCriteria/searchCriteria.tsx @@ -8,22 +8,23 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; -import { Menu, Dropdown } from "antd"; import { CaretDown } from "@cockroachlabs/icons"; +import { Menu, Dropdown } from "antd"; +import classNames from "classnames/bind"; import { MenuClickEventHandler } from "rc-menu/es/interface"; +import React from "react"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; import { Button } from "src/button"; import { commonStyles } from "src/common"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; import { TimeScale, timeScale1hMinOptions, TimeScaleDropdown, } from "src/timeScaleDropdown"; -import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; +import { applyBtn } from "../queryFilter/filterClasses"; import { limitOptions, limitMoreOptions, @@ -33,7 +34,6 @@ import { stmtRequestSortMoreOptions, txnRequestSortMoreOptions, } from "../util/sqlActivityConstants"; -import { applyBtn } from "../queryFilter/filterClasses"; import styles from "./searchCriteria.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx b/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx index dcb5929ed916..05471da229d8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/selectWithDescription/selectWithDescription.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; -import classNames from "classnames/bind"; import { CaretUp, CaretDown } from "@cockroachlabs/icons"; import { Radio } from "antd"; +import classNames from "classnames/bind"; +import React, { useState } from "react"; import { Button } from "../button"; import styles from "../statementsPage/statementTypeSelect.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts index 96853f5c69a2..d48be32b8008 100644 --- a/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/selectors/activeExecutions.selectors.ts @@ -10,15 +10,15 @@ import { createSelector } from "reselect"; -import { ActiveExecutions } from "src/activeExecutions/types"; -import { AppState } from "src/store"; -import { selectActiveExecutionsCombiner } from "src/selectors/activeExecutionsCommon.selectors"; -import { selectExecutionID } from "src/selectors/common"; import { getActiveTransaction, getContentionDetailsFromLocksAndTxns, getActiveStatement, } from "src/activeExecutions/activeStatementUtils"; +import { ActiveExecutions } from "src/activeExecutions/types"; +import { selectActiveExecutionsCombiner } from "src/selectors/activeExecutionsCommon.selectors"; +import { selectExecutionID } from "src/selectors/common"; +import { AppState } from "src/store"; // This file contains selector functions used across active execution // pages that are specific to cluster-ui. diff --git a/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts b/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts index a7bc587ae68c..20acbe2e3d78 100644 --- a/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts +++ b/pkg/ui/workspaces/cluster-ui/src/selectors/common.ts @@ -18,6 +18,9 @@ import { txnFingerprintIdAttr, } from "src/util"; +import { StmtInsightEvent } from "../insights"; +import { AppState } from "../store"; + // The functions in this file are agnostic to the different shape of each // state in db-console and cluster-ui. This file contains selector functions // and combiners that can be reused across both packages. @@ -47,3 +50,6 @@ export const selectTransactionFingerprintID = ( _state: unknown, props: RouteComponentProps, ): string | null => getMatchParamByName(props.match, txnFingerprintIdAttr); + +export const selectStmtInsights = (state: AppState): StmtInsightEvent[] => + state.adminUI?.stmtInsights?.data?.results; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx index 3aeb3b7e0e9f..2e64f2aff5d5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/emptySessionsTablePlaceholder.tsx @@ -10,10 +10,10 @@ import React from "react"; -import { EmptyTable, EmptyTableProps } from "src/empty"; -import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; -import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; import { Anchor } from "src/anchor"; +import emptyTableResultsImg from "src/assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "src/assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "src/empty"; import { sessionsTable } from "src/util"; const footer = ( diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx index fb66b15886c9..14d3d1cfa5db 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetails.tsx @@ -8,51 +8,51 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Helmet } from "react-helmet"; -import { RouteComponentProps } from "react-router-dom"; -import { Col, Row } from "antd"; import { ArrowLeft } from "@cockroachlabs/icons"; +import { Col, Row } from "antd"; import classNames from "classnames/bind"; -import moment from "moment-timezone"; import isNil from "lodash/isNil"; +import moment from "moment-timezone"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { RouteComponentProps } from "react-router-dom"; -import { DurationToMomentDuration, TimestampToMoment } from "src/util/convert"; -import { Bytes, DATE_FORMAT_24_TZ, Count } from "src/util/format"; +import { commonStyles } from "src/common"; import { SqlBox, SqlBoxSize } from "src/sql/box"; +import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { NodeLink } from "src/statementsTable/statementsTableContent"; +import { UIConfigState } from "src/store"; import { ICancelQueryRequest, ICancelSessionRequest, } from "src/store/terminateQuery"; -import { UIConfigState } from "src/store"; -import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; -import { commonStyles } from "src/common"; import { createTimeScaleFromDateRange, TimeScale } from "src/timeScaleDropdown"; -import { getMatchParamByName } from "src/util/query"; import { sessionAttr } from "src/util/constants"; +import { DurationToMomentDuration, TimestampToMoment } from "src/util/convert"; +import { Bytes, DATE_FORMAT_24_TZ, Count } from "src/util/format"; +import { getMatchParamByName } from "src/util/query"; -import { CircleFilled } from "../icon"; -import { Text, TextTypes } from "../text"; import { Button } from "../button"; -import { SummaryCard, SummaryCardItem } from "../summaryCard"; -import LoadingError from "../sqlActivity/errorComponent"; +import { CircleFilled } from "../icon"; import { Loading } from "../loading"; +import LoadingError from "../sqlActivity/errorComponent"; +import { SummaryCard, SummaryCardItem } from "../summaryCard"; +import { Text, TextTypes } from "../text"; import { Timestamp } from "../timestamp"; import { FixLong } from "../util"; import styles from "./sessionDetails.module.scss"; +import { + getStatusClassname, + getStatusString, + SessionInfo, +} from "./sessionsTable"; import TerminateQueryModal, { TerminateQueryModalRef, } from "./terminateQueryModal"; import TerminateSessionModal, { TerminateSessionModalRef, } from "./terminateSessionModal"; -import { - getStatusClassname, - getStatusString, - SessionInfo, -} from "./sessionsTable"; const cx = classNames.bind(styles); const statementsPageCx = classNames.bind(statementsPageStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx index e6259f9a20b7..3624b3fa6d1f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsConnected.tsx @@ -12,18 +12,18 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { analyticsActions, AppState } from "src/store"; +import { actions as nodesLivenessActions } from "src/store/liveness"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { + actions as nodesActions, + nodeDisplayNameByIDSelector, +} from "src/store/nodes"; import { actions as sessionsActions, selectSession, selectSessionDetailsUiConfig, } from "src/store/sessions"; import { actions as terminateQueryActions } from "src/store/terminateQuery"; -import { - actions as nodesActions, - nodeDisplayNameByIDSelector, -} from "src/store/nodes"; -import { actions as localStorageActions } from "src/store/localStorage"; -import { actions as nodesLivenessActions } from "src/store/liveness"; import { TimeScale } from "src/timeScaleDropdown"; import { selectIsTenant } from "../store/uiConfig"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts index 076d241f1af7..0961b0d021ed 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.fixture.ts @@ -10,11 +10,11 @@ import { createMemoryHistory } from "history"; -import { sessionAttr } from "src/util/constants"; import { CancelSessionRequestMessage, CancelQueryRequestMessage, } from "src/api/terminateQueryApi"; +import { sessionAttr } from "src/util/constants"; import { SessionDetailsProps } from "./sessionDetails"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx index 436c09c905ed..00541a33e40e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionDetailsPage.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx index 5beb92ad8d7d..9400ee3c4f6e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsDetailsConnected.stories.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; -import createSagaMiddleware from "redux-saga"; -import { Provider } from "react-redux"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; +import { Route } from "react-router-dom"; import { applyMiddleware, combineReducers, @@ -26,7 +26,7 @@ import { Store, StoreEnhancer, } from "redux"; -import { Route } from "react-router-dom"; +import createSagaMiddleware from "redux-saga"; import { AppState, sagas, rootReducer } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts index 760d15c4a260..feebf499e6de 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.fixture.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createMemoryHistory } from "history"; import Long from "long"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { util } from "protobufjs"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx index 94bd29c76557..7994be5a84dc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withBackground, withRouterProvider } from "src/storybook/decorators"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx index c83b237915eb..66ea73dc03ef 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPage.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import classNames from "classnames/bind"; import isNil from "lodash/isNil"; import merge from "lodash/merge"; -import { RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import moment from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; -import { syncHistory } from "src/util/query"; +import { Loading } from "src/loading"; import { Pagination } from "src/pagination"; import { SortSetting, @@ -23,13 +23,13 @@ import { updateSortSettingQueryParamsOnTab, ColumnDescriptor, } from "src/sortedtable"; -import { Loading } from "src/loading"; +import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { ICancelSessionRequest, ICancelQueryRequest, } from "src/store/terminateQuery"; -import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { TimestampToMoment, unset } from "src/util"; +import { syncHistory } from "src/util/query"; import ColumnsSelector, { SelectOption, @@ -50,20 +50,20 @@ import { } from "../statsTableUtil/statsTableUtil"; import { TableStatistics } from "../tableStatistics"; +import { EmptySessionsTablePlaceholder } from "./emptySessionsTablePlaceholder"; import sessionPageStyles from "./sessionPage.module.scss"; -import TerminateQueryModal, { - TerminateQueryModalRef, -} from "./terminateQueryModal"; -import TerminateSessionModal, { - TerminateSessionModalRef, -} from "./terminateSessionModal"; import { getStatusString, makeSessionsColumns, SessionInfo, SessionsSortedTable, } from "./sessionsTable"; -import { EmptySessionsTablePlaceholder } from "./emptySessionsTablePlaceholder"; +import TerminateQueryModal, { + TerminateQueryModalRef, +} from "./terminateQueryModal"; +import TerminateSessionModal, { + TerminateSessionModalRef, +} from "./terminateSessionModal"; const statementsPageCx = classNames.bind(statementsPageStyles); const sessionsPageCx = classNames.bind(sessionPageStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx index 9eef9413c6ac..56bea07c3be0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.stories.tsx @@ -8,16 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; -import createSagaMiddleware from "redux-saga"; -import { Provider } from "react-redux"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, @@ -25,6 +24,7 @@ import { createStore, Store, } from "redux"; +import createSagaMiddleware from "redux-saga"; import { AppState, rootReducer, sagas } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx index 8aaa16533d25..f71999f84961 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsPageConnected.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { createSelector } from "reselect"; import { analyticsActions, AppState } from "src/store"; -import { SessionsState, actions as sessionsActions } from "src/store/sessions"; import { actions as localStorageActions } from "src/store/localStorage"; +import { SessionsState, actions as sessionsActions } from "src/store/sessions"; import { actions as terminateQueryActions, ICancelQueryRequest, diff --git a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx index 91a3adc98f16..97e3c4c0a679 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sessions/sessionsTable.tsx @@ -8,26 +8,26 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; -import moment from "moment-timezone"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Icon, Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React from "react"; +import { Link } from "react-router-dom"; +import { Button } from "src/button/button"; +import { + Dropdown, + DropdownOption as DropdownItem, +} from "src/dropdown/dropdown"; +import { CircleFilled } from "src/icon/circleFilled"; +import { ColumnDescriptor, SortedTable } from "src/sortedtable/sortedtable"; import { DurationToMomentDuration, DurationToNumber, TimestampToMoment, } from "src/util/convert"; import { BytesWithPrecision, Count, DATE_FORMAT } from "src/util/format"; -import { ColumnDescriptor, SortedTable } from "src/sortedtable/sortedtable"; -import { CircleFilled } from "src/icon/circleFilled"; -import { - Dropdown, - DropdownOption as DropdownItem, -} from "src/dropdown/dropdown"; -import { Button } from "src/button/button"; import { statisticsTableTitles, @@ -36,9 +36,9 @@ import { import { Timestamp } from "../timestamp"; import { computeOrUseStmtSummary, FixLong } from "../util"; +import styles from "./sessionsTable.module.scss"; import { TerminateQueryModalRef } from "./terminateQueryModal"; import { TerminateSessionModalRef } from "./terminateSessionModal"; -import styles from "./sessionsTable.module.scss"; type ISession = cockroach.server.serverpb.ISession; type Status = cockroach.server.serverpb.Session.Status; diff --git a/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx b/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx index 37a7cff5c215..ff46da78e629 100644 --- a/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/settings/booleanSetting.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import { Tooltip } from "antd"; import classNames from "classnames/bind"; +import * as React from "react"; import { CircleFilled } from "src/icon"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx index 1a13e408058f..786bc983d72e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.spec.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { assert } from "chai"; -import { mount, ReactWrapper } from "enzyme"; import classNames from "classnames/bind"; -import sumBy from "lodash/sumBy"; +import { mount, ReactWrapper } from "enzyme"; import each from "lodash/each"; import sortBy from "lodash/sortBy"; +import sumBy from "lodash/sumBy"; +import React from "react"; import styles from "src/sortabletable/sortabletable.module.scss"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx index 10ed25673591..6fd5a9b01226 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { SortedTable } from "./"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx index 156d67d37ff1..710b8639f64e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/sortedtable.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import * as Long from "long"; +import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import { History } from "history"; +import orderBy from "lodash/orderBy"; +import times from "lodash/times"; +import * as Long from "long"; import { Moment } from "moment-timezone"; +import React from "react"; import { createSelector } from "reselect"; -import times from "lodash/times"; -import classNames from "classnames/bind"; -import { Tooltip } from "@cockroachlabs/ui-components"; -import orderBy from "lodash/orderBy"; import { EmptyPanel, EmptyPanelProps } from "../empty"; import styles from "./sortedtable.module.scss"; -import { TableSpinner } from "./tableSpinner"; import { TableHead } from "./tableHead"; import { TableRow } from "./tableRow"; +import { TableSpinner } from "./tableSpinner"; export interface ISortedTablePagination { current: number; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx index ccc331e75d0b..abedc80a937f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableHead/tableHead.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { ExpandableConfig, SortableColumn, SortSetting } from "../sortedtable"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx index 4daddd116dcf..85473d90d05e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableRow/tableRow.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { ExpandableConfig, SortableColumn } from "../sortedtable"; -import styles from "./tableRow.module.scss"; import { RowCell } from "./rowCell"; +import styles from "./tableRow.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx index 82ea917d9194..9693f1ec70f8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sortedtable/tableSpinner/tableSpinner.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Spinner } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./tableSpinner.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx b/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx index 3f907912040c..8ce62b1d7cfa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sql/box.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { FormatQuery } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx b/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx index f933426bfce9..5b89d7653897 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sql/highlight.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import hljs from "highlight.js/lib/core"; import sqlLangSyntax from "highlight.js/lib/languages/pgsql"; import React from "react"; -import classNames from "classnames/bind"; -import styles from "./sqlhighlight.module.scss"; import { SqlBoxProps } from "./box"; +import styles from "./sqlhighlight.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx index b615e44658f2..1743e3bbe02c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/clearStats.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useState } from "react"; import classNames from "classnames/bind"; +import React, { useCallback, useState } from "react"; -import { StatisticType } from "../statsTableUtil/statsTableUtil"; import { Modal } from "../modal"; +import { StatisticType } from "../statsTableUtil/statsTableUtil"; import { Text } from "../text"; import styles from "./sqlActivity.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx index e77452c6779c..d233cacde984 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; import moment from "moment-timezone"; +import React from "react"; import { isRequestError, RequestError } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx index 9f8a6cbed0b0..3717e1b78bda 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; +import { mockStmtStats, Stmt } from "src/api/testUtils"; +import { Filters } from "src/queryFilter/filter"; import { convertRawStmtsToAggregateStatistics, filterStatementsData, getAppsFromStmtsResponse, } from "src/sqlActivity/util"; -import { mockStmtStats, Stmt } from "src/api/testUtils"; -import { Filters } from "src/queryFilter/filter"; import { INTERNAL_APP_NAME_PREFIX, unset } from "../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx index 564fcf3f6fe0..1db1e596df8b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx @@ -10,16 +10,16 @@ import { createSelector } from "@reduxjs/toolkit"; -import { containAny } from "src/util/arrays"; +import { SqlStatsResponse } from "src/api/statementsApi"; +import { Filters, getTimeValueInSeconds } from "src/queryFilter"; +import { AggregateStatistics } from "src/statementsTable"; import { CollectedStatementStatistics, flattenStatementStats, } from "src/util/appStats/appStats"; -import { FixFingerprintHexValue } from "src/util/format"; +import { containAny } from "src/util/arrays"; import { INTERNAL_APP_NAME_PREFIX, unset } from "src/util/constants"; -import { SqlStatsResponse } from "src/api/statementsApi"; -import { Filters, getTimeValueInSeconds } from "src/queryFilter"; -import { AggregateStatistics } from "src/statementsTable"; +import { FixFingerprintHexValue } from "src/util/format"; // filterBySearchQuery returns true if a search query matches the statement. export function filterBySearchQuery( diff --git a/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx b/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx index c81c364edafd..719f62d1bd96 100644 --- a/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/sqlActivityRootControls/sqlActivityRootControls.tsx @@ -11,12 +11,12 @@ import React from "react"; import { useHistory, useLocation } from "react-router-dom"; -import { viewAttr, tabAttr } from "src/util"; -import { queryByName } from "src/util/query"; import { SelectWithDescription, Option, } from "src/selectWithDescription/selectWithDescription"; +import { viewAttr, tabAttr } from "src/util"; +import { queryByName } from "src/util/query"; export type SQLActivityRootControlsProps = { options: Option[]; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts index 218c72f45dff..3d03eac83957 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.fixture.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import noop from "lodash/noop"; +import moment from "moment-timezone"; import { ExecutionStatus } from "../activeExecutions"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx index b979cc09281e..8babc5c06d81 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; -import { createSandbox } from "sinon"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; +import { createSandbox } from "sinon"; import * as sqlApi from "../api/sqlApi"; import { MockSqlResponse } from "../util/testing"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx index e1242a890a71..cb6eef37ed3d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetails.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; import { ArrowLeft } from "@cockroachlabs/icons"; -import Helmet from "react-helmet"; +import { Col, Row, Tabs } from "antd"; import classNames from "classnames/bind"; +import React, { useEffect, useState } from "react"; +import Helmet from "react-helmet"; import { useHistory, match } from "react-router-dom"; -import { Col, Row, Tabs } from "antd"; -import { commonStyles } from "src/common"; -import { Button } from "src/button"; -import { SqlBox, SqlBoxSize } from "src/sql/box"; -import { getMatchParamByName } from "src/util/query"; import { ActiveStatement, ExecutionContentionDetails, } from "src/activeExecutions"; +import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { SqlBox, SqlBoxSize } from "src/sql/box"; +import { getMatchParamByName } from "src/util/query"; -import LoadingError from "../sqlActivity/errorComponent"; -import { Loading } from "../loading"; +import { getExplainPlanFromGist } from "../api/decodePlanGistApi"; import { getIdxRecommendationsFromExecution } from "../api/idxRecForStatementApi"; +import { Loading } from "../loading"; import { SortSetting } from "../sortedtable"; +import LoadingError from "../sqlActivity/errorComponent"; import { executionIdAttr } from "../util"; -import { getExplainPlanFromGist } from "../api/decodePlanGistApi"; import { ActiveStatementDetailsOverviewTab } from "./activeStatementDetailsOverviewTab"; import { Insights } from "./planDetails"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx index 95cd04c62acb..2e196941d2c8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsConnected.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as sessionsActions } from "src/store/sessions"; import { selecteActiveStatement, selectContentionDetailsForStatement, } from "src/selectors/activeExecutions.selectors"; +import { actions as sessionsActions } from "src/store/sessions"; import { selectHasAdminRole } from "src/store/uiConfig"; import { AppState } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx index c4e53ec75173..a499350cd64a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/activeStatementDetailsOverviewTab.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import React from "react"; import { Link } from "react-router-dom"; -import { Col, Row } from "antd"; import "antd/lib/col/style"; import "antd/lib/row/style"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import { ActiveStatement, ExecutionContentionDetails, } from "src/activeExecutions"; -import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; import { StatusIcon } from "src/activeExecutions/statusIcon"; -import { DATE_FORMAT_24_TZ, Duration } from "src/util"; +import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; +import { DATE_FORMAT_24_TZ, Duration } from "src/util"; import { Timestamp } from "../timestamp"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts index ab84b6d1ff4c..38f669a03ddb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsUtils.ts @@ -10,8 +10,8 @@ import moment from "moment-timezone"; -import { TimeScale, toDateRange } from "src/timeScaleDropdown"; import { DiagnosticStatuses } from "src/statementsDiagnostics"; +import { TimeScale, toDateRange } from "src/timeScaleDropdown"; import { StatementDiagnosticsReport } from "../../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx index 586249b4884c..073c5caf5c82 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.spec.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { Button } from "@cockroachlabs/ui-components"; import { assert } from "chai"; import { mount, ReactWrapper } from "enzyme"; -import { MemoryRouter } from "react-router-dom"; -import { Button } from "@cockroachlabs/ui-components"; import moment from "moment-timezone"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; -import { TestStoreProvider } from "src/test-utils"; import { SortedTable } from "src/sortedtable"; +import { TestStoreProvider } from "src/test-utils"; import { TimeScale } from "src/timeScaleDropdown"; import { StatementDiagnosticsReport } from "../../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx index 6fc15fd90eae..f7ad2e269f71 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/diagnostics/diagnosticsView.tsx @@ -8,36 +8,36 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; -import classnames from "classnames/bind"; import { Button, Icon, InlineAlert } from "@cockroachlabs/ui-components"; -import moment from "moment-timezone"; +import classnames from "classnames/bind"; import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React from "react"; +import { Link } from "react-router-dom"; +import emptyListResultsImg from "src/assets/emptyState/empty-list-results.svg"; import { Button as CancelButton } from "src/button"; -import { SummaryCard } from "src/summaryCard"; +import { EmptyTable } from "src/empty"; +import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; import { ActivateDiagnosticsModalRef, DiagnosticStatusBadge, } from "src/statementsDiagnostics"; -import emptyListResultsImg from "src/assets/emptyState/empty-list-results.svg"; -import { EmptyTable } from "src/empty"; +import { SummaryCard } from "src/summaryCard"; import { TimeScale, timeScale1hMinOptions, TimeScaleDropdown, } from "src/timeScaleDropdown"; -import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable"; import timeScaleStyles from "src/timeScaleDropdown/timeScale.module.scss"; -import { DATE_FORMAT_24_TZ } from "../../util"; -import { Timestamp } from "../../timestamp"; -import { FormattedTimescale } from "../../timeScaleDropdown/formattedTimeScale"; import { StatementDiagnosticsReport, withBasePath } from "../../api"; +import { FormattedTimescale } from "../../timeScaleDropdown/formattedTimeScale"; +import { Timestamp } from "../../timestamp"; +import { DATE_FORMAT_24_TZ } from "../../util"; -import styles from "./diagnosticsView.module.scss"; import { filterByTimeScale, getDiagnosticsStatus } from "./diagnosticsUtils"; +import styles from "./diagnosticsView.module.scss"; const timeScaleStylesCx = classNames.bind(timeScaleStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx index a6df85199aae..913ced9051fd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/planDetails.tsx @@ -8,23 +8,23 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useState } from "react"; -import { Helmet } from "react-helmet"; import { ArrowLeft } from "@cockroachlabs/icons"; import { Col, Row } from "antd"; import classNames from "classnames/bind"; +import React, { useContext, useState } from "react"; +import { Helmet } from "react-helmet"; import { Button } from "../../button"; -import { SqlBox, SqlBoxSize } from "../../sql"; -import { SortSetting } from "../../sortedtable"; +import { CockroachCloudContext } from "../../contexts"; +import { InsightRecommendation, InsightType } from "../../insights"; import { InsightsSortedTable, makeInsightsColumns, } from "../../insightsTable/insightsTable"; -import styles from "../statementDetails.module.scss"; -import { CockroachCloudContext } from "../../contexts"; -import { InsightRecommendation, InsightType } from "../../insights"; +import { SortSetting } from "../../sortedtable"; +import { SqlBox, SqlBoxSize } from "../../sql"; import { SummaryCard, SummaryCardItem } from "../../summaryCard"; +import { Timestamp } from "../../timestamp"; import { Count, DATE_FORMAT_24_TZ, @@ -34,7 +34,7 @@ import { RenderCount, TimestampToMoment, } from "../../util"; -import { Timestamp } from "../../timestamp"; +import styles from "../statementDetails.module.scss"; import { formatIndexes, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx index 6f5f34b5c745..fcaa46cf60fd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planDetails/plansTable.tsx @@ -8,14 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ReactNode } from "react"; -import { Tooltip } from "@cockroachlabs/ui-components"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React, { ReactNode } from "react"; import { Link } from "react-router-dom"; import { ColumnDescriptor, SortedTable } from "src/sortedtable"; +import { Anchor } from "../../anchor"; +import { Timestamp, Timezone } from "../../timestamp"; import { Duration, formatNumberForDisplay, @@ -30,8 +32,6 @@ import { EncodeDatabaseTableIndexUri, EncodeDatabaseTableUri, } from "../../util"; -import { Anchor } from "../../anchor"; -import { Timestamp, Timezone } from "../../timestamp"; import styles from "./plansTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx index bdab06c4a327..09a2748150d3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { assert } from "chai"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { assert } from "chai"; import { FlatPlanNode, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx index 88c75acd3132..edd38511d1e8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { PlanView } from "./planView"; import { logicalPlan, globalProperties } from "./planView.fixtures"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx index 4b0047c72109..4dabb2ebddaa 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planView.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { Fragment } from "react"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Tooltip } from "@cockroachlabs/ui-components"; -import values from "lodash/values"; +import classNames from "classnames/bind"; import sortBy from "lodash/sortBy"; +import values from "lodash/values"; +import React, { Fragment } from "react"; import { getAttributeTooltip, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts index dd0a981a5619..b54c0c795681 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.fixture.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; -import Long from "long"; import { createMemoryHistory } from "history"; import noop from "lodash/noop"; +import Long from "long"; +import moment from "moment-timezone"; import { StatementDetailsResponse } from "../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts index 125cb5c2c6c7..7c7ca18a661b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.selectors.ts @@ -8,13 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import { createSelector } from "@reduxjs/toolkit"; -import { RouteComponentProps } from "react-router-dom"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSelector } from "@reduxjs/toolkit"; +import Long from "long"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; import { AppState } from "../store"; +import { selectTimeScale } from "../store/utils/selectors"; +import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; import { appNamesAttr, statementAttr, @@ -22,8 +24,6 @@ import { queryByName, generateStmtDetailsToID, } from "../util"; -import { TimeScale, toRoundedDateRange } from "../timeScaleDropdown"; -import { selectTimeScale } from "../store/utils/selectors"; type StatementDetailsResponseMessage = cockroach.server.serverpb.StatementDetailsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx index 093c0197b893..44b30138a092 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.spec.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; import { assert } from "chai"; -import { createSandbox } from "sinon"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; +import { createSandbox } from "sinon"; import { StatementDetails, StatementDetailsProps } from "./statementDetails"; import { getStatementDetailsPropsFixture } from "./statementDetails.fixture"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx index 4fb6860433fa..4b3230968535 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.stories.tsx @@ -8,14 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, @@ -23,12 +24,11 @@ import { createStore, Store, } from "redux"; -import { Provider } from "react-redux"; import { AppState, rootReducer } from "../store"; -import { getStatementDetailsPropsFixture } from "./statementDetails.fixture"; import { StatementDetails } from "./statementDetails"; +import { getStatementDetailsPropsFixture } from "./statementDetails.fixture"; const history = createMemoryHistory(); const routerReducer = connectRouter(history); diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx index 1caa7ce303f7..a638d472a528 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetails.tsx @@ -8,21 +8,30 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ReactNode, useContext } from "react"; -import { Col, Row, Tabs } from "antd"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { InlineAlert, Text } from "@cockroachlabs/ui-components"; import { ArrowLeft } from "@cockroachlabs/icons"; +import { InlineAlert, Text } from "@cockroachlabs/ui-components"; +import { Col, Row, Tabs } from "antd"; +import classNames from "classnames/bind"; import isNil from "lodash/isNil"; import Long from "long"; +import moment from "moment-timezone"; +import React, { ReactNode, useContext } from "react"; import { Helmet } from "react-helmet"; import { Link, RouteComponentProps } from "react-router-dom"; -import classNames from "classnames/bind"; import { AlignedData, Options } from "uplot"; -import moment from "moment-timezone"; import { Anchor } from "src/anchor"; +import { StatementDetailsRequest } from "src/api/statementsApi"; +import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { getValidErrorsList, Loading } from "src/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { SqlBox, SqlBoxSize } from "src/sql"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; +import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; +import timeScaleStyles from "src/timeScaleDropdown/timeScale.module.scss"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; import { appAttr, appNamesAttr, @@ -39,36 +48,17 @@ import { Count, longToInt, } from "src/util"; -import { getValidErrorsList, Loading } from "src/loading"; -import { Button } from "src/button"; -import { SqlBox, SqlBoxSize } from "src/sql"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; -import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import timeScaleStyles from "src/timeScaleDropdown/timeScale.module.scss"; -import { commonStyles } from "src/common"; -import { StatementDetailsRequest } from "src/api/statementsApi"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import { UIConfigState } from "../store"; -import { - getValidOption, - TimeScale, - timeScale1hMinOptions, - TimeScaleDropdown, - toRoundedDateRange, -} from "../timeScaleDropdown"; -import LoadingError from "../sqlActivity/errorComponent"; -import { - ActivateDiagnosticsModalRef, - ActivateStatementDiagnosticsModal, -} from "../statementsDiagnostics"; -import { Delayed } from "../delayed"; import { InsertStmtDiagnosticRequest, InsightRecommendation, StatementDiagnosticsReport, StmtInsightsReq, } from "../api"; +import { CockroachCloudContext } from "../contexts"; +import { Delayed } from "../delayed"; +import { AxisUnits } from "../graphs"; +import { BarGraphTimeSeries, XScale } from "../graphs/bargraph"; import { getStmtInsightRecommendations, InsightType, @@ -78,14 +68,27 @@ import { InsightsSortedTable, makeInsightsColumns, } from "../insightsTable/insightsTable"; -import { CockroachCloudContext } from "../contexts"; +import insightTableStyles from "../insightsTable/insightsTable.module.scss"; +import LoadingError from "../sqlActivity/errorComponent"; +import { + ActivateDiagnosticsModalRef, + ActivateStatementDiagnosticsModal, +} from "../statementsDiagnostics"; +import { UIConfigState } from "../store"; +import { + getValidOption, + TimeScale, + timeScale1hMinOptions, + TimeScaleDropdown, + toRoundedDateRange, +} from "../timeScaleDropdown"; import { FormattedTimescale } from "../timeScaleDropdown/formattedTimeScale"; import { Timestamp } from "../timestamp"; -import insightTableStyles from "../insightsTable/insightsTable.module.scss"; -import { AxisUnits } from "../graphs"; -import { BarGraphTimeSeries, XScale } from "../graphs/bargraph"; import { filterByTimeScale } from "./diagnostics/diagnosticsUtils"; +import { DiagnosticsView } from "./diagnostics/diagnosticsView"; +import { PlanDetails } from "./planDetails"; +import styles from "./statementDetails.module.scss"; import { generateContentionTimeseries, generateExecCountTimeseries, @@ -95,9 +98,6 @@ import { generateCPUTimeseries, generateClientWaitTimeseries, } from "./timeseriesUtils"; -import styles from "./statementDetails.module.scss"; -import { DiagnosticsView } from "./diagnostics/diagnosticsView"; -import { PlanDetails } from "./planDetails"; type StatementDetailsResponse = cockroach.server.serverpb.StatementDetailsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts index 54cbdb28a2c4..fb0f70bff27f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts @@ -8,53 +8,53 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { withRouter, RouteComponentProps } from "react-router-dom"; import { connect } from "react-redux"; +import { withRouter, RouteComponentProps } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as sqlDetailsStatsActions } from "src/store/statementDetails"; -import { actions as sqlStatsActions } from "src/store/sqlStats"; import { - actions as statementDiagnosticsActions, - selectDiagnosticsReportsByStatementFingerprint, -} from "src/store/statementDiagnostics"; + StmtInsightsReq, + InsertStmtDiagnosticRequest, + StatementDetailsRequest, + StatementDiagnosticsReport, +} from "src/api"; +import { selectRequestTime } from "src/statementsPage/statementsPage.selectors"; import { actions as analyticsActions } from "src/store/analytics"; -import { actions as localStorageActions } from "src/store/localStorage"; import { actions as statementFingerprintInsightActions, selectStatementFingerprintInsights, } from "src/store/insights/statementFingerprintInsights"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { actions as sqlStatsActions } from "src/store/sqlStats"; +import { actions as sqlDetailsStatsActions } from "src/store/statementDetails"; import { - StmtInsightsReq, - InsertStmtDiagnosticRequest, - StatementDetailsRequest, - StatementDiagnosticsReport, -} from "src/api"; + actions as statementDiagnosticsActions, + selectDiagnosticsReportsByStatementFingerprint, +} from "src/store/statementDiagnostics"; import { getMatchParamByName, statementAttr } from "src/util"; -import { selectRequestTime } from "src/statementsPage/statementsPage.selectors"; -import { TimeScale } from "../timeScaleDropdown"; +import { AppState, uiConfigActions } from "../store"; import { actions as nodeLivenessActions } from "../store/liveness"; import { nodeRegionsByIDSelector, actions as nodesActions, } from "../store/nodes"; -import { selectTimeScale } from "../store/utils/selectors"; import { selectIsTenant, selectHasViewActivityRedactedRole, selectHasAdminRole, } from "../store/uiConfig"; -import { AppState, uiConfigActions } from "../store"; +import { selectTimeScale } from "../store/utils/selectors"; +import { TimeScale } from "../timeScaleDropdown"; -import { - selectStatementDetails, - selectStatementDetailsUiConfig, -} from "./statementDetails.selectors"; import { StatementDetails, StatementDetailsDispatchProps, } from "./statementDetails"; +import { + selectStatementDetails, + selectStatementDetailsUiConfig, +} from "./statementDetails.selectors"; // For tenant cases, we don't show information about node, regions and // diagnostics. diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx index 861ad1e387ce..fecfd88ef5a4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; +import React from "react"; import { Button } from "../button"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx index c5200496d91b..fa6327fc803c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/activateStatementDiagnosticsModal.tsx @@ -8,6 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { InlineAlert } from "@cockroachlabs/ui-components"; import { Checkbox, Divider, @@ -19,17 +20,16 @@ import { Row, Col, } from "antd"; -import React, { useCallback, useImperativeHandle, useState } from "react"; import classNames from "classnames/bind"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import React, { useCallback, useImperativeHandle, useState } from "react"; -import { Modal } from "src/modal"; import { Anchor } from "src/anchor"; +import { Modal } from "src/modal"; import { Text, TextTypes } from "src/text"; import { statementDiagnostics, statementsSql } from "src/util"; -import { InsertStmtDiagnosticRequest } from "../api"; import { crlTheme } from "../antdTheme"; +import { InsertStmtDiagnosticRequest } from "../api"; import styles from "./activateStatementDiagnosticsModal.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx index 1bd2771cc75f..f0bc0b7241a8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsDiagnostics/diagnosticStatusBadge.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { Tooltip } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; +import React from "react"; -import { Badge } from "src/badge"; import { Anchor } from "src/anchor"; +import { Badge } from "src/badge"; import { statementDiagnostics } from "src/util"; -import { DiagnosticStatuses } from "./diagnosticStatuses"; import styles from "./diagnosticStatusBadge.module.scss"; +import { DiagnosticStatuses } from "./diagnosticStatuses"; interface OwnProps { status: DiagnosticStatuses; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx index ca282630d9ad..6b6350665ec3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/activeStatementsView.tsx @@ -8,31 +8,32 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; import moment, { Moment } from "moment-timezone"; +import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; -import { InlineAlert } from "@cockroachlabs/ui-components"; -import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; -import { Loading } from "src/loading/loading"; -import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; import { ActiveStatement, ActiveStatementFilters, ExecutionStatus, } from "src/activeExecutions"; +import RefreshControl from "src/activeExecutions/refreshControl/refreshControl"; +import { Loading } from "src/loading/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; +import { Pagination } from "src/pagination"; import { Filter } from "src/queryFilter"; +import { getActiveStatementFiltersFromURL } from "src/queryFilter/utils"; +import { Search } from "src/search/search"; +import { + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; import LoadingError from "src/sqlActivity/errorComponent"; import { queryByName, syncHistory } from "src/util/query"; -import { getActiveStatementFiltersFromURL } from "src/queryFilter/utils"; -import { Pagination } from "src/pagination"; -import RefreshControl from "src/activeExecutions/refreshControl/refreshControl"; +import { ActiveStatementsSection } from "../activeExecutions/activeStatementsSection"; import { ACTIVE_STATEMENT_SEARCH_PARAM, getAppsFromActiveExecutions, @@ -43,7 +44,6 @@ import { defaultFilters, getFullFiltersAsStringRecord, } from "../queryFilter"; -import { ActiveStatementsSection } from "../activeExecutions/activeStatementsSection"; import { getTableSortFromURL } from "../sortedtable/getTableSortFromURL"; import styles from "./statementsPage.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx index 9de8fe78b38d..46db08f13922 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/emptyStatementsPlaceholder.tsx @@ -11,13 +11,13 @@ import React from "react"; import { Link } from "react-router-dom"; -import { EmptyTable, EmptyTableProps } from "src/empty"; import { Anchor } from "src/anchor"; -import { statementsTable, tabAttr, viewAttr } from "src/util"; import { commonStyles } from "src/common"; +import { EmptyTable, EmptyTableProps } from "src/empty"; +import { statementsTable, tabAttr, viewAttr } from "src/util"; -import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "../assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; import { StatementViewType } from "./statementPageTypes"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts index 63ffe6b5250b..a0eac866f660 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.fixture.ts @@ -9,16 +9,16 @@ // licenses/APL.txt. /* eslint-disable prettier/prettier */ -import moment from "moment-timezone"; -import { createMemoryHistory } from "history"; -import Long from "long"; -import noop from "lodash/noop"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { createMemoryHistory } from "history"; +import noop from "lodash/noop"; +import Long from "long"; +import moment from "moment-timezone"; -import { RequestError } from "src/util"; import { DEFAULT_STATS_REQ_OPTIONS } from "src/api/statementsApi"; import { mockStmtStats } from "src/api/testUtils"; +import { RequestError } from "src/util"; import { StatementDiagnosticsReport } from "../api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx index 4d8caeb6d79e..ce0d98fd1c1a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.spec.tsx @@ -12,8 +12,8 @@ import { assert } from "chai"; import { filterBySearchQuery } from "src/sqlActivity/util"; -import { AggregateStatistics } from "../statementsTable"; import { FlatPlanNode } from "../statementDetails"; +import { AggregateStatistics } from "../statementsTable"; describe("StatementsPage", () => { test("filterBySearchQuery", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx index 2659ecf5b3b8..f604f19579f9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.stories.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; import cloneDeep from "lodash/cloneDeep"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; import { StatementsPage } from "./statementsPage"; import statementsPagePropsFixture, { diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx index cb933196d138..157d4a01d823 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.tsx @@ -8,39 +8,42 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { RouteComponentProps } from "react-router-dom"; +import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import flatMap from "lodash/flatMap"; -import merge from "lodash/merge"; import groupBy from "lodash/groupBy"; import isString from "lodash/isString"; -import classNames from "classnames/bind"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import merge from "lodash/merge"; import moment from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; -import { getValidErrorsList, Loading } from "src/loading"; +import { + SqlStatsSortType, + StatementsRequest, + createCombinedStmtsRequest, + SqlStatsSortOptions, +} from "src/api/statementsApi"; +import { RequestState } from "src/api/types"; +import { isSelectedColumn } from "src/columnsSelector/utils"; import { Delayed } from "src/delayed"; +import { getValidErrorsList, Loading } from "src/loading"; import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { Pagination, ResultsPerPageLabel } from "src/pagination"; +import { Search } from "src/search"; +import { SearchCriteria } from "src/searchCriteria/searchCriteria"; import { handleSortSettingFromQueryString, SortSetting, updateSortSettingQueryParamsOnTab, } from "src/sortedtable"; -import { Search } from "src/search"; -import { Pagination, ResultsPerPageLabel } from "src/pagination"; -import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; +import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; import { ActivateDiagnosticsModalRef, ActivateStatementDiagnosticsModal, } from "src/statementsDiagnostics"; -import sortableTableStyles from "src/sortedtable/sortedtable.module.scss"; -import { - SqlStatsSortType, - StatementsRequest, - createCombinedStmtsRequest, - SqlStatsSortOptions, -} from "src/api/statementsApi"; -import { isSelectedColumn } from "src/columnsSelector/utils"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; +import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; import { STATS_LONG_LOADING_DURATION, getSortLabel, @@ -48,45 +51,16 @@ import { getSubsetWarning, getReqSortColumn, } from "src/util/sqlActivityConstants"; -import { SearchCriteria } from "src/searchCriteria/searchCriteria"; -import { RequestState } from "src/api/types"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { - filterStatementsData, - convertRawStmtsToAggregateStatisticsMemoized, - getAppsFromStmtsResponseMemoized, -} from "../sqlActivity/util"; import { InsertStmtDiagnosticRequest, StatementDiagnosticsReport, SqlStatsResponse, StatementDiagnosticsResponse, } from "../api"; +import ColumnsSelector from "../columnsSelector/columnsSelector"; import { commonStyles } from "../common"; -import { - getValidOption, - TimeScale, - timeScale1hMinOptions, - toRoundedDateRange, -} from "../timeScaleDropdown"; -import LoadingError from "../sqlActivity/errorComponent"; -import ClearStats from "../sqlActivity/clearStats"; -import { UIConfigState } from "../store"; import { SelectOption } from "../multiSelectCheckbox/multiSelectCheckbox"; -import ColumnsSelector from "../columnsSelector/columnsSelector"; -import { ISortedTablePagination } from "../sortedtable"; -import { - getLabel, - StatisticTableColumnKeys, -} from "../statsTableUtil/statsTableUtil"; -import { - AggregateStatistics, - makeStatementsColumns, - populateRegionNodeForStatements, - StatementsSortedTable, -} from "../statementsTable"; import { calculateActiveFilters, defaultFilters, @@ -96,9 +70,35 @@ import { SelectedFilters, updateFiltersQueryParamsOnTab, } from "../queryFilter"; +import { ISortedTablePagination } from "../sortedtable"; +import ClearStats from "../sqlActivity/clearStats"; +import LoadingError from "../sqlActivity/errorComponent"; +import { + filterStatementsData, + convertRawStmtsToAggregateStatisticsMemoized, + getAppsFromStmtsResponseMemoized, +} from "../sqlActivity/util"; +import { + AggregateStatistics, + makeStatementsColumns, + populateRegionNodeForStatements, + StatementsSortedTable, +} from "../statementsTable"; +import { + getLabel, + StatisticTableColumnKeys, +} from "../statsTableUtil/statsTableUtil"; +import { UIConfigState } from "../store"; +import { + getValidOption, + TimeScale, + timeScale1hMinOptions, + toRoundedDateRange, +} from "../timeScaleDropdown"; +import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { StatementViewType } from "./statementPageTypes"; import { EmptyStatementsPlaceholder } from "./emptyStatementsPlaceholder"; +import { StatementViewType } from "./statementPageTypes"; import styles from "./statementsPage.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx index 19a829d2c60e..aa34fcc7c0bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.stories.tsx @@ -8,16 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { createMemoryHistory } from "history"; -import createSagaMiddleware from "redux-saga"; -import { Provider } from "react-redux"; import { ConnectedRouter, connectRouter, routerMiddleware, } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, @@ -25,6 +24,7 @@ import { createStore, Store, } from "redux"; +import createSagaMiddleware from "redux-saga"; import { AppState, rootReducer, sagas } from "src/store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx index 793bc6d572d0..68b399246718 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageConnected.tsx @@ -12,39 +12,47 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { StatementsRequest } from "src/api/statementsApi"; import { AppState, uiConfigActions } from "src/store"; -import { actions as statementDiagnosticsActions } from "src/store/statementDiagnostics"; import { actions as analyticsActions } from "src/store/analytics"; +import { actions as databasesListActions } from "src/store/databasesList"; import { actions as localStorageActions, updateStmtsPageLimitAction, updateStmsPageReqSortAction, } from "src/store/localStorage"; import { actions as sqlStatsActions } from "src/store/sqlStats"; -import { actions as databasesListActions } from "src/store/databasesList"; -import { StatementsRequest } from "src/api/statementsApi"; +import { actions as statementDiagnosticsActions } from "src/store/statementDiagnostics"; +import { + InsertStmtDiagnosticRequest, + StatementDiagnosticsReport, + SqlStatsSortType, +} from "../api"; import { actions as nodesActions, nodeRegionsByIDSelector, } from "../store/nodes"; -import { - selectTimeScale, - selectStmtsPageLimit, - selectStmtsPageReqSort, -} from "../store/utils/selectors"; import { selectIsTenant, selectHasViewActivityRedactedRole, selectHasAdminRole, } from "../store/uiConfig"; -import { TimeScale } from "../timeScaleDropdown"; import { - InsertStmtDiagnosticRequest, - StatementDiagnosticsReport, - SqlStatsSortType, -} from "../api"; + selectTimeScale, + selectStmtsPageLimit, + selectStmtsPageReqSort, +} from "../store/utils/selectors"; +import { TimeScale } from "../timeScaleDropdown"; +import { + mapDispatchToActiveStatementsPageProps, + mapStateToActiveStatementsPageProps, +} from "./activeStatementsPage.selectors"; +import { + ActiveStatementsViewDispatchProps, + ActiveStatementsViewStateProps, +} from "./activeStatementsView"; import { StatementsPageDispatchProps, StatementsPageStateProps, @@ -61,14 +69,6 @@ import { StatementsPageRoot, StatementsPageRootProps, } from "./statementsPageRoot"; -import { - ActiveStatementsViewDispatchProps, - ActiveStatementsViewStateProps, -} from "./activeStatementsView"; -import { - mapDispatchToActiveStatementsPageProps, - mapStateToActiveStatementsPageProps, -} from "./activeStatementsPage.selectors"; type StateProps = { fingerprintsPageProps: StatementsPageStateProps & RouteComponentProps; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx index 9441a5bdafd6..d3e611d2be02 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPageRoot.tsx @@ -10,6 +10,7 @@ import React from "react"; +import { Anchor } from "src/anchor"; import { Option } from "src/selectWithDescription/selectWithDescription"; import { SQLActivityRootControls } from "src/sqlActivityRootControls/sqlActivityRootControls"; import { @@ -17,7 +18,6 @@ import { StatementsPageProps, } from "src/statementsPage/statementsPage"; import { statementsSql } from "src/util/docs"; -import { Anchor } from "src/anchor"; import { ActiveStatementsView, diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx index c46893cab475..0b92c302a42d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { MemoryRouter } from "react-router-dom"; import statementsPagePropsFixture from "src/statementsPage/statementsPage.fixture"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx index ab274e3eac14..f05e95143506 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx @@ -8,22 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import classNames from "classnames/bind"; +import React from "react"; -import { - FixLong, - longToInt, - StatementSummary, - StatementStatistics, - Count, - TimestampToNumber, - TimestampToMoment, - unset, - DurationCheckSample, -} from "src/util"; -import { DATE_FORMAT, Duration } from "src/util/format"; import { countBarChart, bytesReadBarChart, @@ -35,19 +23,31 @@ import { retryBarChart, workloadPctBarChart, } from "src/barCharts"; -import { ActivateDiagnosticsModalRef } from "src/statementsDiagnostics"; +import { BarChartOptions } from "src/barCharts/barChartFactory"; import { ColumnDescriptor, longListWithTooltip, SortedTable, } from "src/sortedtable"; -import { BarChartOptions } from "src/barCharts/barChartFactory"; +import { ActivateDiagnosticsModalRef } from "src/statementsDiagnostics"; +import { + FixLong, + longToInt, + StatementSummary, + StatementStatistics, + Count, + TimestampToNumber, + TimestampToMoment, + unset, + DurationCheckSample, +} from "src/util"; +import { DATE_FORMAT, Duration } from "src/util/format"; +import { StatementDiagnosticsReport } from "../api"; import { statisticsTableTitles, StatisticType, } from "../statsTableUtil/statsTableUtil"; -import { StatementDiagnosticsReport } from "../api"; import { Timestamp } from "../timestamp"; import styles from "./statementsTable.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx index 08e1732d8294..31dd79187625 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTableContent.tsx @@ -8,30 +8,30 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; +import { EllipsisVertical } from "@cockroachlabs/icons"; +import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; import noop from "lodash/noop"; -import { Tooltip } from "@cockroachlabs/ui-components"; -import { EllipsisVertical } from "@cockroachlabs/icons"; import moment from "moment-timezone"; +import React from "react"; +import { Link } from "react-router-dom"; +import { withBasePath } from "src/api/basePath"; +import { StatementDiagnosticsReport } from "src/api/statementDiagnosticsApi"; +import { Button } from "src/button"; +import { Dropdown } from "src/dropdown"; +import { getHighlightedText } from "src/highlightedText"; import { ActivateDiagnosticsModalRef, DiagnosticStatusBadge, } from "src/statementsDiagnostics"; -import { getHighlightedText } from "src/highlightedText"; import { AggregateStatistics } from "src/statementsTable"; -import { Dropdown } from "src/dropdown"; -import { Button } from "src/button"; import { propsToQueryString, computeOrUseStmtSummary, appNamesAttr, unset, } from "src/util"; -import { withBasePath } from "src/api/basePath"; -import { StatementDiagnosticsReport } from "src/api/statementDiagnosticsApi"; import styles from "./statementsTableContent.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx b/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx index 8871cdba4e0d..5180a6dbc897 100644 --- a/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/statsTableUtil/statsTableUtil.tsx @@ -8,10 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "@cockroachlabs/ui-components"; +import React from "react"; import { Anchor } from "src/anchor"; +import { Timezone } from "src/timestamp"; import { contentionTime, planningExecutionTime, @@ -22,7 +23,6 @@ import { statementsSql, writtenToDisk, } from "src/util"; -import { Timezone } from "src/timestamp"; // Single place for column names. Used in table columns and in columns selector. export const statisticsColumnLabels = { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts index 21c3bf2fe233..5f00cdb54f6c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.reducer.ts @@ -10,11 +10,11 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { DOMAIN_NAME } from "../utils"; import { SettingsRequestMessage, SettingsResponseMessage, } from "../../api/clusterSettingsApi"; +import { DOMAIN_NAME } from "../utils"; export type ClusterSettingsState = { data: SettingsResponseMessage; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts index b75f466ca0e8..731a5e0b5368 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.spec.ts @@ -10,13 +10,13 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { getClusterSettings, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts index eed038984dc1..5803df2e7da9 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.saga.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getClusterSettings, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts index 937ef0418c65..108b1048b2bc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/clusterSettings/clusterSettings.selectors.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { AppState } from "../reducers"; import { greaterOrEqualThanVersion, indexUnusedDuration } from "../../util"; +import { AppState } from "../reducers"; export const selectAutomaticStatsCollectionEnabled = ( state: AppState, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts index be6580c55b95..e28158579edd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.spec.ts @@ -10,13 +10,13 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { indexUnusedDuration } from "src/util/constants"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts index 7adade519b88..8d196ce774cd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.saga.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; -import moment from "moment"; import { PayloadAction } from "@reduxjs/toolkit"; +import moment from "moment"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { DatabaseDetailsReqParams, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts index c32b3b058bbb..f19f5e54f3cb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetails.selectors.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { localStorageSelector } from "../utils/selectors"; import { LocalStorageKeys } from "../localStorage"; import { AppState } from "../reducers"; +import { localStorageSelector } from "../utils/selectors"; export const selectDatabaseDetailsViewModeSetting = (state: AppState) => { const localStorage = localStorageSelector(state); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts index 65f6c2d1df68..f7da818c4d75 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.spec.ts @@ -9,13 +9,13 @@ // licenses/APL.txt. import { PayloadAction } from "@reduxjs/toolkit"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { DatabaseDetailsSpanStatsReqParams, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts index 7952ed0b8afb..4dfc94611b1d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseDetails/databaseDetailsSpanStats.saga.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { DatabaseDetailsSpanStatsReqParams, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts index 14902a8f77d3..784c8d120dbc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.reducer.ts @@ -16,8 +16,8 @@ import { TableDetailsReqParams, TableDetailsResponse, } from "../../api"; -import { DOMAIN_NAME } from "../utils"; import { generateTableID } from "../../util"; +import { DOMAIN_NAME } from "../utils"; type TableDetailsWithKey = { tableDetailsResponse: SqlApiResponse<TableDetailsResponse>; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts index c06a49e400b9..13dbef6546d8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.spec.ts @@ -10,22 +10,22 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; +import moment from "moment"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; -import moment from "moment"; -import { generateTableID, indexUnusedDuration } from "../../util"; import { TableDetailsResponse, getTableDetails, SqlApiResponse, TableDetailsReqParams, } from "../../api"; +import { generateTableID, indexUnusedDuration } from "../../util"; import { actions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts index a355271fe466..6265ee41a0a8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databaseTableDetails/tableDetails.saga.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; -import moment from "moment"; import { PayloadAction } from "@reduxjs/toolkit"; +import moment from "moment"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { ErrorWithKey, getTableDetails, TableDetailsReqParams } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts index be4dc2daf75d..a60ed58d09b3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.spec.ts @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { DatabasesListResponse, getDatabasesList } from "../../api"; +import { actions, DatabasesListState, reducer } from "./databasesList.reducers"; import { refreshDatabasesListSaga, requestDatabasesListSaga, } from "./databasesList.saga"; -import { actions, DatabasesListState, reducer } from "./databasesList.reducers"; describe("DatabasesList sagas", () => { const databasesListResponse: DatabasesListResponse = { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts index 9dfffb3a19f2..db3b17976247 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.saga.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import moment from "moment-timezone"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getDatabasesList } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts index 4740dc2dc8d8..0574c57ce132 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/databasesList/databasesList.selectors.ts @@ -10,11 +10,11 @@ import { createSelector } from "reselect"; -import { adminUISelector, localStorageSelector } from "../utils/selectors"; -import { LocalStorageKeys } from "../localStorage"; +import { Filters } from "../../queryFilter"; import { SortSetting } from "../../sortedtable"; +import { LocalStorageKeys } from "../localStorage"; import { AppState } from "../reducers"; -import { Filters } from "../../queryFilter"; +import { adminUISelector, localStorageSelector } from "../utils/selectors"; export const databasesListSelector = createSelector( adminUISelector, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts index 24dd1f9b434e..8a8b277684e0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.reducer.ts @@ -10,14 +10,14 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { DOMAIN_NAME } from "../utils"; import { ErrorWithKey } from "../../api"; -import { generateTableID } from "../../util"; import { TableIndexStatsRequest, TableIndexStatsResponse, TableIndexStatsResponseWithKey, } from "../../api/indexDetailsApi"; +import { generateTableID } from "../../util"; +import { DOMAIN_NAME } from "../utils"; export type IndexStatsState = { data?: TableIndexStatsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts index c518f7c7d583..1ed886a81c49 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.spec.ts @@ -11,13 +11,13 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; import Long from "long"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { expectSaga } from "redux-saga-test-plan"; import { getIndexStats, @@ -26,17 +26,17 @@ import { } from "../../api/indexDetailsApi"; import { generateTableID } from "../../util"; -import { - refreshIndexStatsSaga, - requestIndexStatsSaga, - resetIndexStatsSaga, -} from "./indexStats.sagas"; import { actions, IndexStatsReducerState, reducer, ResetIndexUsageStatsPayload, } from "./indexStats.reducer"; +import { + refreshIndexStatsSaga, + requestIndexStatsSaga, + resetIndexStatsSaga, +} from "./indexStats.sagas"; import RecommendationType = cockroach.sql.IndexRecommendation.RecommendationType; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts index 147f5c722edc..1ac4d2e84426 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/indexStats/indexStats.sagas.ts @@ -8,6 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; import { all, @@ -17,19 +18,17 @@ import { takeLatest, takeEvery, } from "redux-saga/effects"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { ErrorWithKey } from "src/api/statementsApi"; import { CACHE_INVALIDATION_PERIOD } from "src/store/utils"; -import { generateTableID } from "../../util"; import { getIndexStats, resetIndexStats, TableIndexStatsRequest, TableIndexStatsResponseWithKey, } from "../../api/indexDetailsApi"; -import { maybeError } from "../../util"; +import { generateTableID, maybeError } from "../../util"; import { actions as indexStatsActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts index 65a1785b6bf9..2ba4e752ca0f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.reducer.ts @@ -11,10 +11,10 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment, { Moment } from "moment-timezone"; -import { DOMAIN_NAME } from "src/store/utils"; +import { SqlApiResponse, TxnInsightDetailsReqErrs } from "src/api"; import { ErrorWithKey } from "src/api/statementsApi"; import { TxnInsightDetails } from "src/insights"; -import { SqlApiResponse, TxnInsightDetailsReqErrs } from "src/api"; +import { DOMAIN_NAME } from "src/store/utils"; import { TxnInsightDetailsRequest, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts index d3a037873783..c5b3367fbb41 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest, takeEvery } from "redux-saga/effects"; import { ErrorWithKey, SqlApiResponse } from "src/api"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts index c327a1e15c1b..1fc97668872e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insightDetails/transactionInsightDetails/transactionInsightDetails.selectors.ts @@ -10,11 +10,10 @@ import { createSelector } from "reselect"; -import { AppState } from "src/store/reducers"; -import { selectID } from "src/selectors/common"; -import { selectTxnInsightDetailsCombiner } from "src/selectors/insightsCommon.selectors"; import { TxnInsightEvent } from "src/insights"; -import { selectStmtInsights } from "src/store/insights/statementInsights"; +import { selectID, selectStmtInsights } from "src/selectors/common"; +import { selectTxnInsightDetailsCombiner } from "src/selectors/insightsCommon.selectors"; +import { AppState } from "src/store/reducers"; const selectTxnContentionInsightsDetails = createSelector( (state: AppState) => state.adminUI?.txnInsightDetails.cachedData, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts index 97abc6a8404b..8e7d91c1a888 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.reducer.ts @@ -13,8 +13,8 @@ import moment, { Moment } from "moment-timezone"; import { SqlApiResponse, ErrorWithKey, StmtInsightsReq } from "src/api"; -import { DOMAIN_NAME } from "../../utils"; import { StmtInsightEvent } from "../../../insights"; +import { DOMAIN_NAME } from "../../utils"; export type StatementFingerprintInsightsState = { data: SqlApiResponse<StmtInsightEvent[]> | null; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts index d986858787ac..59cd8aa6e516 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { ErrorWithKey, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts index b07bc2449b3e..0ab67ef5d5e0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementFingerprintInsights/statementFingerprintInsights.selectors.ts @@ -10,8 +10,8 @@ import { createSelector } from "reselect"; -import { AppState } from "src/store/reducers"; import { selectStatementFingerprintID } from "src/selectors/common"; +import { AppState } from "src/store/reducers"; export const selectStatementFingerprintInsights = createSelector( (state: AppState) => state.adminUI?.statementFingerprintInsights?.cachedData, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts index f13647f1da21..d310098ed679 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.reducer.ts @@ -11,8 +11,8 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment from "moment-timezone"; -import { StmtInsightEvent } from "src/insights"; import { SqlApiResponse, StmtInsightsReq } from "src/api"; +import { StmtInsightEvent } from "src/insights"; import { DOMAIN_NAME } from "../../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts index 0ec4c29ae0ec..8f6b80c9e2cc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { StmtInsightsReq, getStmtInsightsApi } from "src/api/stmtInsightsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts index 263e15b4aac8..c4a00708f25f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/statementInsights/statementInsights.selectors.ts @@ -10,17 +10,18 @@ import { createSelector } from "reselect"; -import { localStorageSelector } from "src/store/utils/selectors"; -import { AppState } from "src/store/reducers"; +import { InsightEnumToLabel } from "src/insights"; +import { + selectStatementFingerprintID, + selectID, + selectStmtInsights, +} from "src/selectors/common"; import { selectStatementInsightDetailsCombiner, selectStatementInsightDetailsCombinerByFingerprint, } from "src/selectors/insightsCommon.selectors"; -import { selectStatementFingerprintID, selectID } from "src/selectors/common"; -import { InsightEnumToLabel, StmtInsightEvent } from "src/insights"; - -export const selectStmtInsights = (state: AppState): StmtInsightEvent[] => - state.adminUI?.stmtInsights?.data?.results; +import { AppState } from "src/store/reducers"; +import { localStorageSelector } from "src/store/utils/selectors"; export const selectStmtInsightsError = (state: AppState): Error | null => state.adminUI?.stmtInsights?.lastError; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts index 1d3ef642b45f..c60ad7235d3f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.reducer.ts @@ -11,8 +11,8 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment, { Moment } from "moment-timezone"; -import { TxnInsightEvent } from "src/insights"; import { SqlApiResponse, TxnInsightsRequest } from "src/api"; +import { TxnInsightEvent } from "src/insights"; import { DOMAIN_NAME } from "../../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts index 8dcb868bc438..a141aeb8be47 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.sagas.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getTxnInsightsApi, TxnInsightsRequest } from "src/api/txnInsightsApi"; -import { actions as txnActions } from "../transactionInsights/transactionInsights.reducer"; import { maybeError } from "../../../util"; +import { actions as txnActions } from "../transactionInsights/transactionInsights.reducer"; export function* refreshTransactionInsightsSaga( action?: PayloadAction<TxnInsightsRequest>, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts index 8865beb721ec..3c2c865f67dd 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/insights/transactionInsights/transactionInsights.selectors.ts @@ -10,10 +10,10 @@ import { createSelector } from "reselect"; -import { AppState } from "src/store/reducers"; -import { localStorageSelector } from "src/store/utils/selectors"; import { TxnInsightEvent } from "src/insights"; import { selectTransactionFingerprintID } from "src/selectors/common"; +import { AppState } from "src/store/reducers"; +import { localStorageSelector } from "src/store/utils/selectors"; import { FixFingerprintHexValue } from "../../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts index 8be54ae3e4a4..ab1138d9ad58 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.reducer.ts @@ -18,8 +18,8 @@ import { JobResponseWithKey, } from "src/api/jobsApi"; -import { DOMAIN_NAME } from "../utils"; import { RequestState } from "../../api"; +import { DOMAIN_NAME } from "../utils"; export type JobState = RequestState<JobResponse>; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts index ef12ebdaf3f1..f04c9c638eca 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.spec.ts @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { PayloadAction } from "@reduxjs/toolkit"; +import Long from "long"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import Long from "long"; -import { PayloadAction } from "@reduxjs/toolkit"; -import moment from "moment-timezone"; import { ErrorWithKey, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts index 6fde7ba742b5..a875ed7824be 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobDetails/job.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { getJob, JobRequest, JobResponseWithKey } from "src/api/jobsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts index 59ac3975581f..4fbfdebbd263 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobProfiler.reducer.ts @@ -11,12 +11,12 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment from "moment-timezone"; -import { createInitialState, RequestState } from "src/api/types"; import { CollectExecutionDetailsRequest, ListJobProfilerExecutionDetailsRequest, ListJobProfilerExecutionDetailsResponse, } from "src/api"; +import { createInitialState, RequestState } from "src/api/types"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts index 6cbcefb0f16b..cb1745a4b5bf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.spec.ts @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import moment from "moment-timezone"; import { getJobs } from "src/api/jobsApi"; @@ -25,8 +25,8 @@ import { earliestRetainedTime, } from "../../jobs/jobsPage/jobsPage.fixture"; -import { refreshJobsSaga, requestJobsSaga } from "./jobs.sagas"; import { actions, reducer, JobsState } from "./jobs.reducer"; +import { refreshJobsSaga, requestJobsSaga } from "./jobs.sagas"; describe("jobs sagas", () => { const lastUpdated = moment.utc(new Date("2023-02-21T12:00:00.000Z")); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts index d7c9806af326..8c31d72022db 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/jobs/jobs.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { getJobs, JobsRequest } from "src/api/jobsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts index 4daa0edd041c..93b36c7776f0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.fixtures.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; import { NodeLivenessStatus } from "./nodeLivenessStatus"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts index a1a78e7f3e3d..1d10f95c13e5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts index 65c8c0f82d64..9bc7f0dad854 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.spec.ts @@ -9,18 +9,18 @@ // licenses/APL.txt. import { expectSaga } from "redux-saga-test-plan"; -import { throwError } from "redux-saga-test-plan/providers"; import * as matchers from "redux-saga-test-plan/matchers"; +import { throwError } from "redux-saga-test-plan/providers"; import { getLiveness } from "src/api/livenessApi"; +import { getLivenessResponse } from "./liveness.fixtures"; +import { actions, reducer, LivenessState } from "./liveness.reducer"; import { receivedLivenessSaga, refreshLivenessSaga, requestLivenessSaga, } from "./liveness.sagas"; -import { actions, reducer, LivenessState } from "./liveness.reducer"; -import { getLivenessResponse } from "./liveness.fixtures"; describe("Liveness sagas", () => { const livenessResponse = getLivenessResponse(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts index 275b5838af6c..4bef8503bfd2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/liveness/liveness.sagas.ts @@ -13,8 +13,8 @@ import { all, call, put, delay, takeLatest } from "redux-saga/effects"; import { getLiveness } from "src/api/livenessApi"; import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "src/store/utils"; -import { rootActions } from "../rootActions"; import { maybeError } from "../../util"; +import { rootActions } from "../rootActions"; import { actions } from "./liveness.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts index fb046a5875fe..6bb107a82d23 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.reducer.ts @@ -10,13 +10,13 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { defaultFilters, Filters } from "src/queryFilter/"; -import { WorkloadInsightEventFilters } from "src/insights"; import { SqlStatsSortType, DEFAULT_STATS_REQ_OPTIONS, } from "src/api/statementsApi"; import { ViewMode } from "src/databaseDetailsPage/types"; +import { WorkloadInsightEventFilters } from "src/insights"; +import { defaultFilters, Filters } from "src/queryFilter/"; import { TimeScale, defaultTimeScaleSelected } from "../../timeScaleDropdown"; import { DOMAIN_NAME } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts index 9669e41fca8c..0ab3934e8e8a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.spec.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { expectSaga, testSaga } from "redux-saga-test-plan"; import { takeEvery, takeLatest } from "redux-saga/effects"; +import { expectSaga, testSaga } from "redux-saga-test-plan"; import { actions as stmtInsightActions } from "src/store/insights/statementInsights/statementInsights.reducer"; import { actions as txnInsightActions } from "src/store/insights/transactionInsights/transactionInsights.reducer"; @@ -18,12 +18,12 @@ import { actions as txnStatsActions } from "src/store/transactionStats"; import { defaultTimeScaleSelected } from "../../timeScaleDropdown"; +import { actions } from "./localStorage.reducer"; import { localStorageSaga, updateLocalStorageItemSaga, updateTimeScale, } from "./localStorage.saga"; -import { actions } from "./localStorage.reducer"; const ts = defaultTimeScaleSelected; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts index fd238131f5c8..f631b294b31b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/localStorage/localStorage.saga.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { PayloadAction } from "@reduxjs/toolkit"; import { AnyAction } from "redux"; import { all, call, takeEvery, takeLatest, put } from "redux-saga/effects"; -import { PayloadAction } from "@reduxjs/toolkit"; -import { actions as sqlStatsActions } from "src/store/sqlStats"; import { actions as stmtInsightActions } from "src/store/insights/statementInsights"; import { actions as txnInsightActions } from "src/store/insights/transactionInsights"; +import { actions as sqlStatsActions } from "src/store/sqlStats"; import { actions as txnStatsActions } from "src/store/transactionStats"; import { TimeScale } from "src/timeScaleDropdown"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts index aeea0ff2ce2b..5cf144f80e54 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.fixtures.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; import { INodeStatus } from "../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts index 1c5e0a1244f8..e684534f1220 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts index 49a6b1c684a5..e9dacede1aef 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.spec.ts @@ -9,20 +9,20 @@ // licenses/APL.txt. import { expectSaga } from "redux-saga-test-plan"; -import { throwError } from "redux-saga-test-plan/providers"; import * as matchers from "redux-saga-test-plan/matchers"; +import { throwError } from "redux-saga-test-plan/providers"; import { getNodes } from "src/api/nodesApi"; import { accumulateMetrics } from "../../util"; +import { getNodesResponse } from "./nodes.fixtures"; +import { actions, reducer, NodesState } from "./nodes.reducer"; import { receivedNodesSaga, requestNodesSaga, refreshNodesSaga, } from "./nodes.sagas"; -import { actions, reducer, NodesState } from "./nodes.reducer"; -import { getNodesResponse } from "./nodes.fixtures"; describe("Nodes sagas", () => { const nodesResponse = getNodesResponse(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts index 4e4c2d0666a7..f486f986190f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.sagas.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, delay, takeLatest } from "redux-saga/effects"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { all, call, put, delay, takeLatest } from "redux-saga/effects"; import { getNodes } from "src/api/nodesApi"; import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "src/store/utils"; -import { rootActions } from "../rootActions"; import { maybeError } from "../../util"; +import { rootActions } from "../rootActions"; import { actions } from "./nodes.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts index eb83adc01221..8eec20f9040d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/nodes/nodes.selectors.ts @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSelector } from "@reduxjs/toolkit"; import isEmpty from "lodash/isEmpty"; import { accumulateMetrics } from "src/util/proto"; -import { AppState } from "../reducers"; import { getDisplayName } from "../../nodes"; import { livenessStatusByNodeIDSelector } from "../liveness"; +import { AppState } from "../reducers"; type ILocality = cockroach.roachpb.ILocality; export const nodeStatusesSelector = (state: AppState) => diff --git a/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts index 6873d23c73ee..4da2d1c88221 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/reducers.spec.ts @@ -12,8 +12,8 @@ import { assert } from "chai"; import { createStore } from "redux"; import { rootReducer } from "./reducers"; -import { actions as sqlStatsActions } from "./sqlStats"; import { rootActions } from "./rootActions"; +import { actions as sqlStatsActions } from "./sqlStats"; describe("rootReducer", () => { it("resets redux state on RESET_STATE action", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts b/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts index 96c9a33f4792..20ab065e7170 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/reducers.ts @@ -15,10 +15,24 @@ import { ClusterLocksReqState, reducer as clusterLocks, } from "./clusterLocks/clusterLocks.reducer"; +import { + ClusterSettingsState, + reducer as clusterSettings, +} from "./clusterSettings/clusterSettings.reducer"; +import { + KeyedDatabaseDetailsState, + KeyedDatabaseDetailsSpanStatsState, + databaseDetailsReducer, + databaseDetailsSpanStatsReducer, +} from "./databaseDetails"; import { DatabasesListState, reducer as databasesList, } from "./databasesList/databasesList.reducers"; +import { + KeyedTableDetailsState, + reducer as tableDetails, +} from "./databaseTableDetails/tableDetails.reducer"; import { IndexStatsReducerState, reducer as indexStats, @@ -27,6 +41,10 @@ import { reducer as txnInsightDetails, TxnInsightDetailsCachedState, } from "./insightDetails/transactionInsightDetails"; +import { + reducer as statementFingerprintInsights, + StatementFingerprintInsightsCachedState, +} from "./insights/statementFingerprintInsights"; import { reducer as stmtInsights, StmtInsightsState, @@ -37,9 +55,14 @@ import { } from "./insights/transactionInsights"; import { JobDetailsReducerState, reducer as job } from "./jobDetails"; import { JobsState, reducer as jobs } from "./jobs"; +import { + JobProfilerExecutionDetailFilesState, + reducer as executionDetailFiles, +} from "./jobs/jobProfiler.reducer"; import { LivenessState, reducer as liveness } from "./liveness"; import { LocalStorageState, reducer as localStorage } from "./localStorage"; import { NodesState, reducer as nodes } from "./nodes"; +import { rootActions } from "./rootActions"; import { reducer as schemaInsights, SchemaInsightsState, @@ -58,31 +81,8 @@ import { reducer as terminateQuery, TerminateQueryState, } from "./terminateQuery"; -import { reducer as uiConfig, UIConfigState } from "./uiConfig"; -import { - reducer as statementFingerprintInsights, - StatementFingerprintInsightsCachedState, -} from "./insights/statementFingerprintInsights"; import { reducer as txnStats, TxnStatsState } from "./transactionStats"; -import { - ClusterSettingsState, - reducer as clusterSettings, -} from "./clusterSettings/clusterSettings.reducer"; -import { - KeyedDatabaseDetailsState, - KeyedDatabaseDetailsSpanStatsState, - databaseDetailsReducer, - databaseDetailsSpanStatsReducer, -} from "./databaseDetails"; -import { - KeyedTableDetailsState, - reducer as tableDetails, -} from "./databaseTableDetails/tableDetails.reducer"; -import { - JobProfilerExecutionDetailFilesState, - reducer as executionDetailFiles, -} from "./jobs/jobProfiler.reducer"; -import { rootActions } from "./rootActions"; +import { reducer as uiConfig, UIConfigState } from "./uiConfig"; export type AdminUiState = { statementDiagnostics: StatementDiagnosticsState; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts index 50f2b008bc4f..e6cd083c7418 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sagas.ts @@ -11,31 +11,31 @@ import { SagaIterator } from "redux-saga"; import { all, fork } from "redux-saga/effects"; -import { localStorageSaga } from "./localStorage"; -import { statementsDiagnosticsSagas } from "./statementDiagnostics"; -import { nodesSaga } from "./nodes"; -import { jobsSaga } from "./jobs"; -import { jobSaga } from "./jobDetails"; -import { livenessSaga } from "./liveness"; +import { clusterLocksSaga } from "./clusterLocks/clusterLocks.saga"; +import { clusterSettingsSaga } from "./clusterSettings/clusterSettings.saga"; +import { databaseDetailsSaga } from "./databaseDetails"; +import { databaseDetailsSpanStatsSaga } from "./databaseDetails/databaseDetailsSpanStats.saga"; import { databasesListSaga } from "./databasesList"; -import { sessionsSaga } from "./sessions"; -import { terminateSaga } from "./terminateQuery"; -import { notifificationsSaga } from "./notifications"; -import { sqlStatsSaga } from "./sqlStats"; -import { sqlDetailsStatsSaga } from "./statementDetails"; +import { tableDetailsSaga } from "./databaseTableDetails"; import { indexStatsSaga } from "./indexStats"; -import { clusterLocksSaga } from "./clusterLocks/clusterLocks.saga"; -import { transactionInsightsSaga } from "./insights/transactionInsights/transactionInsights.sagas"; import { transactionInsightDetailsSaga } from "./insightDetails/transactionInsightDetails"; +import { statementFingerprintInsightsSaga } from "./insights/statementFingerprintInsights"; import { statementInsightsSaga } from "./insights/statementInsights"; +import { transactionInsightsSaga } from "./insights/transactionInsights/transactionInsights.sagas"; +import { jobSaga } from "./jobDetails"; +import { jobsSaga } from "./jobs"; +import { livenessSaga } from "./liveness"; +import { localStorageSaga } from "./localStorage"; +import { nodesSaga } from "./nodes"; +import { notifificationsSaga } from "./notifications"; import { schemaInsightsSaga } from "./schemaInsights"; -import { uiConfigSaga } from "./uiConfig"; -import { statementFingerprintInsightsSaga } from "./insights/statementFingerprintInsights"; +import { sessionsSaga } from "./sessions"; +import { sqlStatsSaga } from "./sqlStats"; +import { sqlDetailsStatsSaga } from "./statementDetails"; +import { statementsDiagnosticsSagas } from "./statementDiagnostics"; +import { terminateSaga } from "./terminateQuery"; import { txnStatsSaga } from "./transactionStats"; -import { clusterSettingsSaga } from "./clusterSettings/clusterSettings.saga"; -import { databaseDetailsSaga } from "./databaseDetails"; -import { tableDetailsSaga } from "./databaseTableDetails"; -import { databaseDetailsSpanStatsSaga } from "./databaseDetails/databaseDetailsSpanStats.saga"; +import { uiConfigSaga } from "./uiConfig"; export function* sagas(cacheInvalidationPeriod?: number): SagaIterator { yield all([ diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts index ddd1a5974205..0266a1ed5fdb 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.reducer.ts @@ -13,8 +13,8 @@ import moment, { Moment } from "moment-timezone"; import { SchemaInsightReqParams, SqlApiResponse } from "src/api"; -import { DOMAIN_NAME } from "../utils"; import { InsightRecommendation } from "../../insights"; +import { DOMAIN_NAME } from "../utils"; export type SchemaInsightsState = { data: SqlApiResponse<InsightRecommendation[]>; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts index 0e334389eb60..ceb2824d1f2a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.spec.ts @@ -8,27 +8,27 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import moment from "moment-timezone"; import { getSchemaInsights, SqlApiResponse } from "../../api"; import { InsightRecommendation } from "../../insights"; -import { - refreshSchemaInsightsSaga, - requestSchemaInsightsSaga, -} from "./schemaInsights.sagas"; import { actions, reducer, SchemaInsightsState, } from "./schemaInsights.reducer"; +import { + refreshSchemaInsightsSaga, + requestSchemaInsightsSaga, +} from "./schemaInsights.sagas"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts index 0d011c3bfdcd..0e313d09a7b6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.sagas.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeLatest } from "redux-saga/effects"; import { PayloadAction } from "@reduxjs/toolkit"; +import { all, call, put, takeLatest } from "redux-saga/effects"; import { SchemaInsightReqParams, getSchemaInsights } from "../../api"; import { maybeError } from "../../util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts index c8d49993e773..84e30f762e3b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/schemaInsights/schemaInsights.selectors.ts @@ -10,8 +10,8 @@ import { createSelector } from "reselect"; -import { adminUISelector, localStorageSelector } from "../utils/selectors"; import { insightType } from "../../insights"; +import { adminUISelector, localStorageSelector } from "../utils/selectors"; const selectSchemaInsightState = createSelector( adminUISelector, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts index 8a51880a95af..5b9faf0a5be0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment, { Moment } from "moment-timezone"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts index a4e19dcdda5a..0472fb83bd1a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.sagas.ts @@ -21,9 +21,9 @@ import { import { getSessions } from "src/api/sessionsApi"; +import { maybeError } from "../../util"; import { actions as clusterLockActions } from "../clusterLocks/clusterLocks.reducer"; import { selectIsTenant } from "../uiConfig"; -import { maybeError } from "../../util"; import { actions } from "./sessions.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts index 3c9bb56d6b15..e5ed63dbe8cc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sessions/sessions.selectors.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; import { RouteComponentProps } from "react-router-dom"; +import { createSelector } from "reselect"; +import { byteArrayToUuid } from "src/sessions/sessionsTable"; import { AppState } from "src/store"; import { SessionsState } from "src/store/sessions"; import { sessionAttr } from "src/util/constants"; import { getMatchParamByName } from "src/util/query"; -import { byteArrayToUuid } from "src/sessions/sessionsTable"; export const selectSession = createSelector( (state: AppState) => state.adminUI?.sessions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts index 264ad865bc3f..18ad15c6ffb5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import moment from "moment-timezone"; import { StatementsRequest } from "src/api/statementsApi"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts index f25780cf0ac6..69e227306946 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.spec.ts @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import Long from "long"; -import moment from "moment-timezone"; -import { getCombinedStatements } from "src/api/statementsApi"; import { resetSQLStats } from "src/api/sqlStatsApi"; +import { getCombinedStatements } from "src/api/statementsApi"; import { actions as sqlDetailsStatsActions } from "../statementDetails/statementDetails.reducer"; +import { actions, reducer, SQLStatsState } from "./sqlStats.reducer"; import { refreshSQLStatsSaga, requestSQLStatsSaga, resetSQLStatsSaga, } from "./sqlStats.sagas"; -import { actions, reducer, SQLStatsState } from "./sqlStats.reducer"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts index 7a20a3f9a1c3..4f868217f307 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/sqlStats/sqlStats.sagas.ts @@ -11,16 +11,16 @@ import { PayloadAction } from "@reduxjs/toolkit"; import { all, call, put, takeLatest, takeEvery } from "redux-saga/effects"; +import { resetSQLStats } from "src/api/sqlStatsApi"; import { getCombinedStatements, StatementsRequest, } from "src/api/statementsApi"; -import { resetSQLStats } from "src/api/sqlStatsApi"; import { actions as localStorageActions } from "src/store/localStorage"; import { maybeError } from "../../util"; -import { actions as txnStatsActions } from "../transactionStats"; import { actions as sqlDetailsStatsActions } from "../statementDetails/statementDetails.reducer"; +import { actions as txnStatsActions } from "../transactionStats"; import { actions as sqlStatsActions, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts index 20aac5fc043c..8ec4b381999d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.reducer.ts @@ -18,8 +18,8 @@ import { StatementDetailsResponseWithKey, } from "src/api/statementsApi"; -import { DOMAIN_NAME } from "../utils"; import { generateStmtDetailsToID } from "../../util"; +import { DOMAIN_NAME } from "../utils"; export type SQLDetailsStatsState = { data: StatementDetailsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts index 797833d15608..a426e3a70126 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDetails/statementDetails.sagas.spec.ts @@ -8,29 +8,29 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; -import { expectSaga } from "redux-saga-test-plan"; import Long from "long"; +import moment from "moment-timezone"; +import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import moment from "moment-timezone"; import { getStatementDetails } from "src/api/statementsApi"; -import { - refreshSQLDetailsStatsSaga, - requestSQLDetailsStatsSaga, -} from "./statementDetails.sagas"; import { actions, reducer, SQLDetailsStatsReducerState, } from "./statementDetails.reducer"; +import { + refreshSQLDetailsStatsSaga, + requestSQLDetailsStatsSaga, +} from "./statementDetails.sagas"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts index 8520746b68c8..cc3f310e8a65 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.reducer.ts @@ -10,12 +10,12 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { DOMAIN_NAME, noopReducer } from "../utils"; import { CancelStmtDiagnosticRequest, InsertStmtDiagnosticRequest, StatementDiagnosticsResponse, } from "../../api"; +import { DOMAIN_NAME, noopReducer } from "../utils"; export type StatementDiagnosticsState = { data: StatementDiagnosticsResponse; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts index 9a352e3b4b1b..d6f50f68bbca 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.spec.ts @@ -8,19 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import moment from "moment-timezone"; +import { call } from "redux-saga/effects"; import { expectSaga } from "redux-saga-test-plan"; import { throwError } from "redux-saga-test-plan/providers"; -import { call } from "redux-saga/effects"; -import moment from "moment-timezone"; -import { - createDiagnosticsReportSaga, - requestStatementsDiagnosticsSaga, - cancelDiagnosticsReportSaga, - StatementDiagnosticsState, - actions, - reducer, -} from "src/store/statementDiagnostics"; import { createStatementDiagnosticsReport, cancelStatementDiagnosticsReport, @@ -31,6 +23,14 @@ import { CancelStmtDiagnosticRequest, CancelStmtDiagnosticResponse, } from "src/api/statementDiagnosticsApi"; +import { + createDiagnosticsReportSaga, + requestStatementsDiagnosticsSaga, + cancelDiagnosticsReportSaga, + StatementDiagnosticsState, + actions, + reducer, +} from "src/store/statementDiagnostics"; describe("statementsDiagnostics sagas", () => { describe("createDiagnosticsReportSaga", () => { diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts index 47370f791137..c0796d2b09e8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.sagas.ts @@ -24,8 +24,8 @@ import { } from "src/api/statementDiagnosticsApi"; import { maybeError } from "src/util"; -import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { rootActions } from "../rootActions"; +import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { actions } from "./statementDiagnostics.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts index bbd9fcd9cb21..5ad2ac89cca7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/statementDiagnostics/statementDiagnostics.selectors.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; -import orderBy from "lodash/orderBy"; import groupBy from "lodash/groupBy"; import mapValues from "lodash/mapValues"; +import orderBy from "lodash/orderBy"; import moment from "moment-timezone"; +import { createSelector } from "reselect"; -import { AppState } from "../reducers"; import { StatementDiagnosticsReport } from "../../api"; +import { AppState } from "../reducers"; export const statementDiagnostics = createSelector( (state: AppState) => state.adminUI, diff --git a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts index 1d3f55b320dd..36348e72aa54 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.reducer.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { DOMAIN_NAME, noopReducer } from "../utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts index 463209699d02..f6b839d26971 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/terminateQuery/terminateQuery.sagas.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { PayloadAction } from "@reduxjs/toolkit"; import { all, call, put, takeEvery } from "redux-saga/effects"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { terminateQuery, terminateSession } from "src/api/terminateQueryApi"; import { actions as sessionsActions } from "src/store/sessions"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts b/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts index 45ae67a7b124..d51ba6247f54 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/transactionStats/txnStats.sagas.spec.ts @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import Long from "long"; +import moment from "moment-timezone"; import { expectSaga } from "redux-saga-test-plan"; +import * as matchers from "redux-saga-test-plan/matchers"; import { EffectProviders, StaticProvider, throwError, } from "redux-saga-test-plan/providers"; -import * as matchers from "redux-saga-test-plan/matchers"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import Long from "long"; -import moment from "moment-timezone"; import { getFlushedTxnStatsApi } from "src/api/statementsApi"; -import { refreshTxnStatsSaga, requestTxnStatsSaga } from "./txnStats.sagas"; import { actions, reducer, TxnStatsState } from "./txnStats.reducer"; +import { refreshTxnStatsSaga, requestTxnStatsSaga } from "./txnStats.sagas"; const lastUpdated = moment(); diff --git a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts index 2fcfa9de5f14..031008efb16e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.reducer.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import merge from "lodash/merge"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { DOMAIN_NAME, noopReducer } from "../utils"; export type UserSQLRolesRequest = cockroach.server.serverpb.UserSQLRolesRequest; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts index 4cac194ddede..d244dc8b5d22 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/uiConfig/uiConfig.sagas.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, delay, put, takeLatest } from "redux-saga/effects"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { all, call, delay, put, takeLatest } from "redux-saga/effects"; import { getUserSQLRoles } from "../../api/userApi"; -import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { maybeError, getLogger } from "../../util"; import { rootActions } from "../rootActions"; +import { CACHE_INVALIDATION_PERIOD, throttleWithReset } from "../utils"; import { actions } from "./uiConfig.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts b/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts index 094077b28637..0601ca204df3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts +++ b/pkg/ui/workspaces/cluster-ui/src/store/utils/sagaEffects/throttleWithReset.ts @@ -8,8 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { ActionPattern } from "@redux-saga/types"; import { ForkEffect } from "@redux-saga/core/effects"; +import { ActionPattern } from "@redux-saga/types"; +import { Action } from "redux"; +import { buffers, Task } from "redux-saga"; import { actionChannel, cancel, @@ -18,8 +20,6 @@ import { race, take, } from "redux-saga/effects"; -import { buffers, Task } from "redux-saga"; -import { Action } from "redux"; /*** * Extended version of default `redux-saga/effects/throttle` effect implementation diff --git a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx index 6faaf8e8673b..43947b914eb7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withBackground.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { PartialStoryFn, StoryContext } from "@storybook/addons"; +import React from "react"; export const withBackground = ( storyFn: PartialStoryFn, diff --git a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx index f5a90121f68a..43e7818c4851 100644 --- a/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/storybook/decorators/withRouterProvider.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Provider } from "react-redux"; +import { PartialStoryFn, StoryContext } from "@storybook/addons"; import { ConnectedRouter, connectRouter } from "connected-react-router"; import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; import { createStore, combineReducers } from "redux"; -import { PartialStoryFn, StoryContext } from "@storybook/addons"; const history = createMemoryHistory(); const routerReducer = connectRouter(history); diff --git a/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts b/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts index 0c49d628cca6..109b609d5aa8 100644 --- a/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts +++ b/pkg/ui/workspaces/cluster-ui/src/storybook/fixtures/randomName.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import join from "lodash/join"; -import sample from "lodash/sample"; import random from "lodash/random"; +import sample from "lodash/sample"; export function randomName(): string { // Add more! Have fun. diff --git a/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx b/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx index 28f4d2422db4..66febf5b39ea 100644 --- a/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/summaryCard/index.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classnames from "classnames/bind"; import { Tooltip } from "antd"; +import classnames from "classnames/bind"; +import React from "react"; import { CircleFilled } from "src/icon"; diff --git a/pkg/ui/workspaces/cluster-ui/src/table/table.tsx b/pkg/ui/workspaces/cluster-ui/src/table/table.tsx index 24fea61b73b8..2085f8347975 100644 --- a/pkg/ui/workspaces/cluster-ui/src/table/table.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/table/table.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { CaretDownOutlined, CaretRightOutlined } from "@ant-design/icons"; import { Table as AntTable, ConfigProvider } from "antd"; import classnames from "classnames/bind"; import isArray from "lodash/isArray"; -import { CaretDownOutlined, CaretRightOutlined } from "@ant-design/icons"; +import React from "react"; import styles from "./table.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx b/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx index 43f4189f9ff4..32d578bdf333 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tableStatistics/tableStatistics.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; import moment from "moment-timezone"; +import React from "react"; import { Button } from "src/button"; import { ResultsPerPageLabel } from "src/pagination"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; import { TimeScale } from "src/timeScaleDropdown"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; import { ISortedTablePagination } from "../sortedtable"; +import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; import { statisticsClasses } from "../transactionsPage/transactionsPageClasses"; const { statistic, countTitle } = statisticsClasses; diff --git a/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx b/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx index d9785194fcf6..f862ccd2138b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/test-utils/testStoreProvider.tsx @@ -8,7 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { + ConnectedRouter, + connectRouter, + routerMiddleware, +} from "connected-react-router"; +import { createMemoryHistory } from "history"; import React from "react"; +import { Provider } from "react-redux"; import { Action, Store, @@ -16,13 +23,6 @@ import { combineReducers, applyMiddleware, } from "redux"; -import { Provider } from "react-redux"; -import { - ConnectedRouter, - connectRouter, - routerMiddleware, -} from "connected-react-router"; -import { createMemoryHistory } from "history"; import { AppState, rootReducer } from "src/store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/text/text.tsx b/pkg/ui/workspaces/cluster-ui/src/text/text.tsx index cc7afe112700..13348552e8ac 100644 --- a/pkg/ui/workspaces/cluster-ui/src/text/text.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/text/text.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import classNames from "classnames/bind"; +import * as React from "react"; import styles from "./text.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx index 848f22e25571..2e67d469e98e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/formattedTimeScale.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; import moment from "moment-timezone"; +import React, { useContext } from "react"; import { Timezone } from "src/timestamp"; import { TimezoneContext } from "../contexts"; import { dateFormat, timeFormat } from "./timeScaleDropdown"; -import { toRoundedDateRange } from "./utils"; import { TimeScale } from "./timeScaleTypes"; +import { toRoundedDateRange } from "./utils"; export const FormattedTimescale = (props: { ts: TimeScale; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx index a7a811188c6d..d152cbcc967e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/rangeSelect.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState, useRef } from "react"; import { Button, Dropdown } from "antd"; -import moment, { Moment } from "moment-timezone"; import classNames from "classnames/bind"; +import moment, { Moment } from "moment-timezone"; +import React, { useState, useRef } from "react"; import { DateRangeMenu } from "src/dateRangeMenu"; import { CaretDown } from "src/icon/caretDown"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx index 7d73c50d91bb..899cadda0ae7 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeFrameControls.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import classNames from "classnames/bind"; -import { Button, Tooltip } from "antd"; import { CaretLeft, CaretRight } from "@cockroachlabs/icons"; +import { Button, Tooltip } from "antd"; +import classNames from "classnames/bind"; +import React from "react"; -import { ArrowDirection } from "./timeScaleTypes"; import styles from "./timeFrameControls.module.scss"; +import { ArrowDirection } from "./timeScaleTypes"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx index 50f3fceb3fa4..39db82b402b5 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.spec.tsx @@ -8,16 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; +import { render } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { assert } from "chai"; import { mount } from "enzyme"; import moment from "moment-timezone"; +import React, { useState } from "react"; import { MemoryRouter } from "react-router"; -import { assert } from "chai"; -import { render } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; import { timeFormat as customMenuTimeFormat } from "../dateRangeMenu"; +import RangeSelect from "./rangeSelect"; +import { TimeFrameControls } from "./timeFrameControls"; import { formatRangeSelectSelected, generateDisabledArrows, @@ -27,8 +29,6 @@ import { TimeScaleDropdown, } from "./timeScaleDropdown"; import * as timescale from "./timeScaleTypes"; -import { TimeFrameControls } from "./timeFrameControls"; -import RangeSelect from "./rangeSelect"; import { TimeWindow, ArrowDirection, TimeScale } from "./timeScaleTypes"; /** diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx index e8337f5a9aaf..27edf40fb236 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.stories.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; import { storiesOf } from "@storybook/react"; import moment from "moment-timezone"; +import React, { useState } from "react"; import { TimeScaleDropdown } from "./timeScaleDropdown"; import { defaultTimeScaleOptions, defaultTimeScaleSelected } from "./utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx index 92d781b7b990..7c2be368c642 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleDropdown.tsx @@ -8,26 +8,26 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext, useMemo } from "react"; -import moment from "moment-timezone"; import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React, { useContext, useMemo } from "react"; import { TimezoneContext } from "../contexts"; import { FormatWithTimezone, getLogger } from "../util"; +import RangeSelect, { + RangeOption, + Selected as RangeSelectSelected, +} from "./rangeSelect"; +import { TimeFrameControls } from "./timeFrameControls"; +import styles from "./timeScale.module.scss"; import { ArrowDirection, TimeScale, TimeScaleOptions, TimeWindow, } from "./timeScaleTypes"; -import { TimeFrameControls } from "./timeFrameControls"; -import RangeSelect, { - RangeOption, - Selected as RangeSelectSelected, -} from "./rangeSelect"; import { defaultTimeScaleOptions, findClosestTimeScale } from "./utils"; -import styles from "./timeScale.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx index 76af4b7b9f53..6a4a0450c7ad 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/timeScaleLabel.tsx @@ -8,19 +8,19 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useContext } from "react"; -import moment from "moment-timezone"; -import classNames from "classnames/bind"; import { Icon } from "@cockroachlabs/ui-components"; import { Tooltip } from "antd"; +import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; -import { Timezone } from "src/timestamp"; import { TimezoneContext } from "src/contexts/timezoneContext"; +import { Timezone } from "src/timestamp"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { dateFormat, timeFormat } from "./timeScaleDropdown"; import { FormattedTimescale } from "./formattedTimeScale"; +import { dateFormat, timeFormat } from "./timeScaleDropdown"; import { TimeScale } from "./timeScaleTypes"; import { toRoundedDateRange } from "./utils"; diff --git a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx index 7a8f7238b8de..4a5eeee6e28c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timeScaleDropdown/utils.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { assert } from "chai"; +import moment from "moment-timezone"; import { TimeScale } from "./timeScaleTypes"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx b/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx index 05485767de39..3b38f68303ec 100644 --- a/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/timestamp/timestamp.tsx @@ -11,8 +11,8 @@ import { Moment } from "moment-timezone"; import React, { useContext } from "react"; -import { FormatWithTimezone } from "../util"; import { CoordinatedUniversalTime, TimezoneContext } from "../contexts"; +import { FormatWithTimezone } from "../util"; export function Timezone() { const timezone = useContext(TimezoneContext); diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx index df145ce6bddb..bef2cd6db3e2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import Long from "long"; import React, { useEffect } from "react"; -import classNames from "classnames/bind"; -import { Loading } from "src/loading"; import { GetTraceResponse } from "src/api"; +import { Loading } from "src/loading"; import styles from "../snapshot.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx index e53a628c1c78..a31cd38a6e1c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotComponent.tsx @@ -8,23 +8,23 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Helmet } from "react-helmet"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Button, Icon } from "@cockroachlabs/ui-components"; -import React, { useMemo } from "react"; import classNames from "classnames/bind"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import React, { useMemo } from "react"; +import { Helmet } from "react-helmet"; -import { commonStyles } from "src/common"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; -import { Dropdown } from "src/dropdown"; -import { Loading } from "src/loading"; -import { TimestampToMoment } from "src/util"; -import { SortSetting } from "src/sortedtable"; import { GetTracingSnapshotResponse, ListTracingSnapshotsResponse, } from "src/api"; +import { commonStyles } from "src/common"; +import { Dropdown } from "src/dropdown"; +import { Loading } from "src/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { SortSetting } from "src/sortedtable"; +import { TimestampToMoment } from "src/util"; import styles from "../snapshot.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx index ba73d4506b90..927dd5e13dad 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.spec.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { render } from "@testing-library/react"; -import React from "react"; -import { MemoryRouter } from "react-router-dom"; import * as H from "history"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; import { RecordingMode, diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx index b414df184bd5..9db2df53589a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/snapshotPage.tsx @@ -10,10 +10,10 @@ import { join } from "path"; -import React, { useCallback, useEffect } from "react"; -import { RouteComponentProps } from "react-router-dom"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import React, { useCallback, useEffect } from "react"; +import { RouteComponentProps } from "react-router-dom"; import { ListTracingSnapshotsResponse, @@ -23,13 +23,13 @@ import { RecordingMode, GetTraceResponse, } from "src/api/tracezApi"; +import { Breadcrumbs } from "src/breadcrumbs"; import { SortSetting } from "src/sortedtable"; import { getMatchParamByName, syncHistory } from "src/util"; -import { Breadcrumbs } from "src/breadcrumbs"; +import { RawTraceComponent } from "./rawTraceComponent"; import { SnapshotComponent } from "./snapshotComponent"; import { SpanComponent } from "./spanComponent"; -import { RawTraceComponent } from "./rawTraceComponent"; // This component does some manual route management and navigation. // This is because the data model doesn't match the ideal route form. diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx index 554aef0adb6b..a6431d20111e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanComponent.tsx @@ -8,31 +8,31 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useMemo, useState } from "react"; -import moment from "moment-timezone"; -import { Helmet } from "react-helmet"; -import classNames from "classnames/bind"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Switch } from "antd"; +import classNames from "classnames/bind"; import Long from "long"; +import moment from "moment-timezone"; +import React, { useCallback, useMemo, useState } from "react"; +import { Helmet } from "react-helmet"; import { useHistory } from "react-router-dom"; -import { commonStyles } from "src/common"; -import { Loading } from "src/loading"; -import { TimestampToMoment } from "src/util"; -import { SortSetting } from "src/sortedtable"; import { GetTracingSnapshotResponse, SetTraceRecordingTypeResponse, Span, } from "src/api"; -import { CircleFilled } from "src/icon"; import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { CircleFilled } from "src/icon"; +import { Loading } from "src/loading"; +import { SortSetting } from "src/sortedtable"; +import { TimestampToMoment } from "src/util"; import styles from "../snapshot.module.scss"; -import { SpanTable, formatDurationHours, TagCell } from "./spanTable"; import { SpanMetadataTable } from "./spanMetadataTable"; +import { SpanTable, formatDurationHours, TagCell } from "./spanTable"; import RecordingMode = cockroach.util.tracing.tracingpb.RecordingMode; diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx index 59e0b97f9bab..76db9845862c 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanMetadataTable.tsx @@ -7,16 +7,16 @@ // 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. -import moment from "moment-timezone"; -import React, { useState } from "react"; import { Nodes } from "@cockroachlabs/icons"; -import classNames from "classnames/bind"; import { Tooltip } from "antd"; +import classNames from "classnames/bind"; +import moment from "moment-timezone"; +import React, { useState } from "react"; import { NamedOperationMetadata } from "src/api/tracezApi"; import { EmptyTable } from "src/empty"; -import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import { CircleFilled } from "src/icon"; +import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import styles from "../snapshot.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx index 78c2ca9d6bac..ca9788cc61f3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/spanTable.tsx @@ -7,20 +7,20 @@ // 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. -import moment from "moment-timezone"; -import React, { useState } from "react"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { Nodes, Caution, Plus, Minus } from "@cockroachlabs/icons"; import classNames from "classnames/bind"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { Link } from "react-router-dom"; import Long from "long"; +import moment from "moment-timezone"; +import React, { useState } from "react"; +import { Link } from "react-router-dom"; import { Span, Snapshot } from "src/api/tracezApi"; +import { Dropdown } from "src/dropdown"; import { EmptyTable } from "src/empty"; +import { CircleFilled } from "src/icon"; import { ColumnDescriptor, SortSetting, SortedTable } from "src/sortedtable"; import { TimestampToMoment } from "src/util"; -import { CircleFilled } from "src/icon"; -import { Dropdown } from "src/dropdown"; import styles from "../snapshot.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx index fe9edc821c4d..5c92e730ce53 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetails.tsx @@ -15,23 +15,23 @@ import React, { useEffect } from "react"; import Helmet from "react-helmet"; import { Link, match, useHistory } from "react-router-dom"; -import { Button } from "src/button"; -import { commonStyles } from "src/common"; -import { SqlBox, SqlBoxSize } from "src/sql/box"; -import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import { ActiveTransaction, ExecutionContentionDetails, } from "src/activeExecutions"; import { StatusIcon } from "src/activeExecutions/statusIcon"; +import { Button } from "src/button"; +import { commonStyles } from "src/common"; +import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; +import { SqlBox, SqlBoxSize } from "src/sql/box"; +import { SummaryCard, SummaryCardItem } from "src/summaryCard"; import summaryCardStyles from "src/summaryCard/summaryCard.module.scss"; -import { getMatchParamByName } from "src/util/query"; import { executionIdAttr, DATE_FORMAT_24_TZ } from "src/util"; -import { WaitTimeInsightsPanel } from "src/detailsPanels/waitTimeInsightsPanel"; +import { getMatchParamByName } from "src/util/query"; import styles from "../statementDetails/statementDetails.module.scss"; -import { capitalize, Duration } from "../util/format"; import { Timestamp } from "../timestamp"; +import { capitalize, Duration } from "../util/format"; const cx = classNames.bind(styles); const summaryCardStylesCx = classNames.bind(summaryCardStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx index 19fae2946d46..aacee27ac1c0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/activeTransactionDetailsConnected.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as sessionsActions } from "src/store/sessions"; import { selectActiveTransaction, selectContentionDetailsForTransaction, } from "src/selectors/activeExecutions.selectors"; +import { actions as sessionsActions } from "src/store/sessions"; import { AppState } from "../store"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts index 1b592541e4b7..89c66350c104 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.fixture.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { createMemoryHistory } from "history"; import Long from "long"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { StatementsResponse } from "src/store/sqlStats/sqlStats.reducer"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx index 6a2954a05b0c..1efcd3b0abb3 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; import noop from "lodash/noop"; import moment from "moment-timezone"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; import { nodeRegions, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx index 2dd02c065e8d..52bb678ce69d 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.tsx @@ -7,12 +7,8 @@ // 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. -import React, { useContext } from "react"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import classNames from "classnames/bind"; -import { RouteComponentProps } from "react-router-dom"; -import { Helmet } from "react-helmet"; -import moment from "moment-timezone"; +import { ArrowLeft } from "@cockroachlabs/icons"; import { InlineAlert, Tooltip, @@ -20,12 +16,22 @@ import { Heading, } from "@cockroachlabs/ui-components"; import { Col, Row } from "antd"; -import { ArrowLeft } from "@cockroachlabs/icons"; -import Long from "long"; +import classNames from "classnames/bind"; import get from "lodash/get"; +import Long from "long"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; +import { Helmet } from "react-helmet"; +import { RouteComponentProps } from "react-router-dom"; -import { PageConfig, PageConfigItem } from "src/pageConfig"; import { SqlStatsSortType } from "src/api/statementsApi"; +import { PageConfig, PageConfigItem } from "src/pageConfig"; +import { + populateRegionNodeForStatements, + makeStatementsColumns, +} from "src/statementsTable/statementsTable"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; +import { Transaction } from "src/transactionsTable"; import { Bytes, calculateTotalWorkload, @@ -36,30 +42,7 @@ import { appNamesAttr, unset, } from "src/util"; -import { Transaction } from "src/transactionsTable"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import { - populateRegionNodeForStatements, - makeStatementsColumns, -} from "src/statementsTable/statementsTable"; -import { - SortedTable, - ISortedTablePagination, - SortSetting, -} from "../sortedtable"; -import { Pagination } from "../pagination"; -import { TableStatistics } from "../tableStatistics"; -import { baseHeadingClasses } from "../transactionsPage/transactionsPageClasses"; -import { Button } from "../button"; -import { tableClasses } from "../transactionsTable/transactionsTableClasses"; -import { SqlBox } from "../sql"; -import { aggregateStatements } from "../transactionsPage/utils"; -import { Loading } from "../loading"; -import { SummaryCard, SummaryCardItem } from "../summaryCard"; -import { UIConfigState } from "../store"; -import LoadingError from "../sqlActivity/errorComponent"; -import { formatTwoPlaces } from "../barCharts"; import { createCombinedStmtsRequest, InsightRecommendation, @@ -68,11 +51,33 @@ import { StatementsRequest, TxnInsightsRequest, } from "../api"; +import { formatTwoPlaces } from "../barCharts"; +import { Button } from "../button"; +import { CockroachCloudContext } from "../contexts"; import { getTxnInsightRecommendations, InsightType, TxnInsightEvent, } from "../insights"; +import { + InsightsSortedTable, + makeInsightsColumns, +} from "../insightsTable/insightsTable"; +import insightTableStyles from "../insightsTable/insightsTable.module.scss"; +import { Loading } from "../loading"; +import { Pagination } from "../pagination"; +import { + SortedTable, + ISortedTablePagination, + SortSetting, +} from "../sortedtable"; +import { SqlBox } from "../sql"; +import LoadingError from "../sqlActivity/errorComponent"; +import statementsStyles from "../statementsPage/statementsPage.module.scss"; +import { UIConfigState } from "../store"; +import { SummaryCard, SummaryCardItem } from "../summaryCard"; +import summaryCardStyles from "../summaryCard/summaryCard.module.scss"; +import { TableStatistics } from "../tableStatistics"; import { getValidOption, TimeScale, @@ -81,15 +86,10 @@ import { timeScaleRangeToObj, toRoundedDateRange, } from "../timeScaleDropdown"; -import { - InsightsSortedTable, - makeInsightsColumns, -} from "../insightsTable/insightsTable"; -import { CockroachCloudContext } from "../contexts"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import insightTableStyles from "../insightsTable/insightsTable.module.scss"; -import statementsStyles from "../statementsPage/statementsPage.module.scss"; -import summaryCardStyles from "../summaryCard/summaryCard.module.scss"; +import { baseHeadingClasses } from "../transactionsPage/transactionsPageClasses"; +import { aggregateStatements } from "../transactionsPage/utils"; +import { tableClasses } from "../transactionsTable/transactionsTableClasses"; import transactionDetailsStyles from "./transactionDetails.modules.scss"; import { diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx index 52ec6c365ef0..aae7f0c2da9e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsConnected.tsx @@ -12,35 +12,35 @@ import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; import { Dispatch } from "redux"; -import { actions as localStorageActions } from "src/store/localStorage"; +import { StatementsRequest } from "src/api/statementsApi"; import { AppState, uiConfigActions } from "src/store"; -import { actions as sqlStatsActions } from "src/store/sqlStats"; -import { actions as txnStatsActions } from "src/store/transactionStats"; import { actions as transactionInsights, selectTxnInsightsByFingerprint, } from "src/store/insights/transactionInsights"; -import { StatementsRequest } from "src/api/statementsApi"; +import { actions as localStorageActions } from "src/store/localStorage"; +import { actions as sqlStatsActions } from "src/store/sqlStats"; +import { actions as txnStatsActions } from "src/store/transactionStats"; import { selectRequestTime } from "src/transactionsPage/transactionsPage.selectors"; +import { TxnInsightsRequest } from "../api"; +import { actions as analyticsActions } from "../store/analytics"; +import { + nodeRegionsByIDSelector, + actions as nodesActions, +} from "../store/nodes"; import { selectIsTenant, selectHasViewActivityRedactedRole, selectHasAdminRole, } from "../store/uiConfig"; -import { - nodeRegionsByIDSelector, - actions as nodesActions, -} from "../store/nodes"; import { selectTimeScale, selectTxnsPageLimit, selectTxnsPageReqSort, } from "../store/utils/selectors"; -import { txnFingerprintIdAttr, getMatchParamByName } from "../util"; import { TimeScale } from "../timeScaleDropdown"; -import { actions as analyticsActions } from "../store/analytics"; -import { TxnInsightsRequest } from "../api"; +import { txnFingerprintIdAttr, getMatchParamByName } from "../util"; import { TransactionDetails, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx index be3d7b138caa..f7290b872f5f 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetailsUtils.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "@reduxjs/toolkit"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { match } from "react-router"; +import { createSelector } from "@reduxjs/toolkit"; import { Location } from "history"; import cloneDeep from "lodash/cloneDeep"; +import { match } from "react-router"; -import { statementFingerprintIdsToText } from "../transactionsPage/utils"; import { SqlStatsResponse } from "../api"; +import { statementFingerprintIdsToText } from "../transactionsPage/utils"; import { addExecStats, aggregateNumericStats, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx index e6b673605ef7..13b7caefda94 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsPage.selectors.tsx @@ -24,13 +24,13 @@ import { selectActiveTransactions, selectClusterLocksMaxApiSizeReached, } from "src/selectors/activeExecutions.selectors"; +import { selectIsAutoRefreshEnabled } from "src/statementsPage/activeStatementsPage.selectors"; import { LocalStorageKeys, actions as localStorageActions, } from "src/store/localStorage"; import { actions as sessionsActions } from "src/store/sessions"; import { selectIsTenant } from "src/store/uiConfig"; -import { selectIsAutoRefreshEnabled } from "src/statementsPage/activeStatementsPage.selectors"; import { localStorageSelector } from "../store/utils/selectors"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx index 06485f23370b..5939b51e5e0e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/activeTransactionsView.tsx @@ -8,44 +8,44 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect, useState } from "react"; -import classNames from "classnames/bind"; -import { useHistory } from "react-router-dom"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import classNames from "classnames/bind"; import moment, { Moment } from "moment-timezone"; +import React, { useEffect, useState } from "react"; +import { useHistory } from "react-router-dom"; -import { - ISortedTablePagination, - SortSetting, -} from "src/sortedtable/sortedtable"; -import { Loading } from "src/loading/loading"; -import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; -import { Search } from "src/search/search"; import { ActiveTransaction, ActiveStatementFilters, ActiveTransactionFilters, ExecutionStatus, } from "src/activeExecutions"; -import LoadingError from "src/sqlActivity/errorComponent"; import { ActiveTransactionsSection } from "src/activeExecutions/activeTransactionsSection"; +import { RefreshControl } from "src/activeExecutions/refreshControl"; +import { Loading } from "src/loading/loading"; +import { PageConfig, PageConfigItem } from "src/pageConfig/pageConfig"; import { Pagination } from "src/pagination"; -import { queryByName, syncHistory } from "src/util/query"; -import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; import { getActiveTransactionFiltersFromURL } from "src/queryFilter/utils"; -import { RefreshControl } from "src/activeExecutions/refreshControl"; +import { Search } from "src/search/search"; +import { getTableSortFromURL } from "src/sortedtable/getTableSortFromURL"; +import { + ISortedTablePagination, + SortSetting, +} from "src/sortedtable/sortedtable"; +import LoadingError from "src/sqlActivity/errorComponent"; +import { queryByName, syncHistory } from "src/util/query"; import { filterActiveTransactions, getAppsFromActiveExecutions, } from "../activeExecutions/activeStatementUtils"; -import styles from "../statementsPage/statementsPage.module.scss"; import { calculateActiveFilters, Filter, getFullFiltersAsStringRecord, inactiveFiltersState, } from "../queryFilter"; +import styles from "../statementsPage/statementsPage.module.scss"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx index 50d555aff7b7..e72717e6d453 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/emptyTransactionsPlaceholder.tsx @@ -11,14 +11,14 @@ import React from "react"; import { Link } from "react-router-dom"; -import { tabAttr, viewAttr } from "src/util"; import { commonStyles } from "src/common"; +import { tabAttr, viewAttr } from "src/util"; -import { EmptyTable, EmptyTableProps } from "../empty"; import { Anchor } from "../anchor"; -import { transactionsTable } from "../util"; -import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; import emptyTableResultsImg from "../assets/emptyState/empty-table-results.svg"; +import magnifyingGlassImg from "../assets/emptyState/magnifying-glass.svg"; +import { EmptyTable, EmptyTableProps } from "../empty"; +import { transactionsTable } from "../util"; import { TransactionViewType } from "./transactionsPageTypes"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts index c5c06ab40a0e..2086933e2dcf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactions.fixture.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { createMemoryHistory } from "history"; import Long from "long"; import moment from "moment-timezone"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { SortSetting } from "../sortedtable"; import { Filters } from "../queryFilter"; +import { SortSetting } from "../sortedtable"; import { TimeScale } from "../timeScaleDropdown"; const history = createMemoryHistory({ initialEntries: ["/transactions"] }); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx index 71598bf47fb0..fcf64a472cd0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; import cloneDeep from "lodash/cloneDeep"; import extend from "lodash/extend"; import noop from "lodash/noop"; +import React from "react"; +import { MemoryRouter } from "react-router-dom"; -import { RequestError } from "../util"; import { RequestState, SqlStatsResponse, SqlStatsSortOptions } from "../api"; +import { RequestError } from "../util"; import { columns, diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx index 1c38a3924b43..1abe19966696 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.tsx @@ -8,16 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { InlineAlert } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; -import { RouteComponentProps } from "react-router-dom"; import flatMap from "lodash/flatMap"; -import merge from "lodash/merge"; import isString from "lodash/isString"; -import { InlineAlert } from "@cockroachlabs/ui-components"; +import merge from "lodash/merge"; import moment from "moment-timezone"; +import React from "react"; +import { RouteComponentProps } from "react-router-dom"; -import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; import { SqlStatsSortType, createCombinedStmtsRequest, @@ -25,6 +24,9 @@ import { SqlStatsSortOptions, SqlStatsResponse, } from "src/api/statementsApi"; +import { SearchCriteria } from "src/searchCriteria/searchCriteria"; +import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; +import { Timestamp, TimestampToMoment, syncHistory, unique } from "src/util"; import { STATS_LONG_LOADING_DURATION, getSortLabel, @@ -32,13 +34,16 @@ import { getSubsetWarning, getReqSortColumn, } from "src/util/sqlActivityConstants"; -import { SearchCriteria } from "src/searchCriteria/searchCriteria"; -import { TimeScaleLabel } from "src/timeScaleDropdown/timeScaleLabel"; -import { Loading } from "../loading"; +import { RequestState } from "../api"; +import ColumnsSelector from "../columnsSelector/columnsSelector"; +import { isSelectedColumn } from "../columnsSelector/utils"; +import { commonStyles } from "../common"; import { Delayed } from "../delayed"; +import { Loading } from "../loading"; +import { SelectOption } from "../multiSelectCheckbox/multiSelectCheckbox"; import { PageConfig, PageConfigItem } from "../pageConfig"; -import { Search } from "../search"; +import { Pagination, ResultsPerPageLabel } from "../pagination"; import { Filter, Filters, @@ -47,41 +52,37 @@ import { updateFiltersQueryParamsOnTab, SelectedFilters, } from "../queryFilter"; -import { UIConfigState } from "../store"; -import ColumnsSelector from "../columnsSelector/columnsSelector"; -import { SelectOption } from "../multiSelectCheckbox/multiSelectCheckbox"; +import { Search } from "../search"; +import { + handleSortSettingFromQueryString, + ISortedTablePagination, + SortSetting, + updateSortSettingQueryParamsOnTab, +} from "../sortedtable"; +import ClearStats from "../sqlActivity/clearStats"; +import LoadingError from "../sqlActivity/errorComponent"; +import styles from "../statementsPage/statementsPage.module.scss"; import { getLabel, StatisticTableColumnKeys, } from "../statsTableUtil/statsTableUtil"; -import ClearStats from "../sqlActivity/clearStats"; -import LoadingError from "../sqlActivity/errorComponent"; -import { commonStyles } from "../common"; +import { UIConfigState } from "../store"; import { TimeScale, timeScale1hMinOptions, getValidOption, toRoundedDateRange, } from "../timeScaleDropdown"; -import { isSelectedColumn } from "../columnsSelector/utils"; import timeScaleStyles from "../timeScaleDropdown/timeScale.module.scss"; -import { RequestState } from "../api"; -import { Pagination, ResultsPerPageLabel } from "../pagination"; -import { - handleSortSettingFromQueryString, - ISortedTablePagination, - SortSetting, - updateSortSettingQueryParamsOnTab, -} from "../sortedtable"; import { makeTransactionsColumns, TransactionInfo, TransactionsTable, } from "../transactionsTable"; -import styles from "../statementsPage/statementsPage.module.scss"; -import { TransactionViewType } from "./transactionsPageTypes"; import { EmptyTransactionsPlaceholder } from "./emptyTransactionsPlaceholder"; +import { statisticsClasses } from "./transactionsPageClasses"; +import { TransactionViewType } from "./transactionsPageTypes"; import { generateRegion, generateRegionNode, @@ -89,7 +90,6 @@ import { searchTransactionsData, filterTransactions, } from "./utils"; -import { statisticsClasses } from "./transactionsPageClasses"; const cx = classNames.bind(styles); const timeScaleStylesCx = classNames.bind(timeScaleStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts index 2bfc2163d166..9b8605393ebf 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageClasses.ts @@ -10,8 +10,8 @@ import classNames from "classnames/bind"; -import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; +import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import { commonStyles } from "../common"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx index cd8f0fe6ae35..2b601047ebe0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageConnected.tsx @@ -12,28 +12,40 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { Dispatch } from "redux"; +import { SqlStatsSortType, StatementsRequest } from "src/api/statementsApi"; import { AppState, uiConfigActions } from "src/store"; import { actions as nodesActions } from "src/store/nodes"; import { actions as sqlStatsActions } from "src/store/sqlStats"; import { actions as txnStatsActions } from "src/store/transactionStats"; -import { SqlStatsSortType, StatementsRequest } from "src/api/statementsApi"; -import { selectHasAdminRole, selectIsTenant } from "../store/uiConfig"; +import { Filters } from "../queryFilter"; +import { actions as analyticsActions } from "../store/analytics"; +import { + actions as localStorageActions, + updateTxnsPageLimitAction, + updateTxnsPageReqSortAction, +} from "../store/localStorage"; import { nodeRegionsByIDSelector } from "../store/nodes"; +import { selectHasAdminRole, selectIsTenant } from "../store/uiConfig"; import { selectTxnsPageLimit, selectTxnsPageReqSort, selectTimeScale, } from "../store/utils/selectors"; -import { - actions as localStorageActions, - updateTxnsPageLimitAction, - updateTxnsPageReqSortAction, -} from "../store/localStorage"; -import { Filters } from "../queryFilter"; -import { actions as analyticsActions } from "../store/analytics"; import { TimeScale } from "../timeScaleDropdown"; +import { + mapStateToActiveTransactionsPageProps, + mapDispatchToActiveTransactionsPageProps, +} from "./activeTransactionsPage.selectors"; +import { + ActiveTransactionsViewStateProps, + ActiveTransactionsViewDispatchProps, +} from "./activeTransactionsView"; +import { + TransactionsPageStateProps, + TransactionsPageDispatchProps, +} from "./transactionsPage"; import { selectTxnColumns, selectSortSetting, @@ -41,22 +53,10 @@ import { selectSearch, selectRequestTime, } from "./transactionsPage.selectors"; -import { - TransactionsPageStateProps, - TransactionsPageDispatchProps, -} from "./transactionsPage"; import { TransactionsPageRoot, TransactionsPageRootProps, } from "./transactionsPageRoot"; -import { - mapStateToActiveTransactionsPageProps, - mapDispatchToActiveTransactionsPageProps, -} from "./activeTransactionsPage.selectors"; -import { - ActiveTransactionsViewStateProps, - ActiveTransactionsViewDispatchProps, -} from "./activeTransactionsView"; type StateProps = { fingerprintsPageProps: TransactionsPageStateProps & RouteComponentProps; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx index cb9b077a218a..fc9ab35a7987 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPageRoot.tsx @@ -10,18 +10,18 @@ import React from "react"; +import { Anchor } from "src/anchor"; import { Option } from "src/selectWithDescription/selectWithDescription"; import { SQLActivityRootControls } from "src/sqlActivityRootControls/sqlActivityRootControls"; -import { Anchor } from "src/anchor"; import { statementsSql } from "../util/docs"; -import { TransactionViewType } from "./transactionsPageTypes"; -import { TransactionsPageProps } from "./transactionsPage"; import { ActiveTransactionsView, ActiveTransactionsViewProps, } from "./activeTransactionsView"; +import { TransactionsPageProps } from "./transactionsPage"; +import { TransactionViewType } from "./transactionsPageTypes"; import { TransactionsPage } from "."; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts index 0a59da983376..02062d779a2e 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.spec.ts @@ -8,19 +8,19 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { assert } from "chai"; import Long from "long"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { Filters } from "../queryFilter"; +import { data, nodeRegions } from "./transactions.fixture"; import { filterTransactions, generateRegion, getStatementsByFingerprintId, statementFingerprintIdsToText, } from "./utils"; -import { data, nodeRegions } from "./transactions.fixture"; type Statement = protos.cockroach.server.serverpb.StatementsResponse.ICollectedStatementStatistics; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts index 9c5474bc43e6..1b80c95138e2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsBarCharts.ts @@ -11,9 +11,9 @@ import * as protos from "@cockroachlabs/crdb-protobuf-client"; import classNames from "classnames/bind"; -import { stdDevLong, Duration, Bytes, longToInt } from "src/util"; import { barChartFactory } from "src/barCharts/barChartFactory"; import { bar, approximify } from "src/barCharts/utils"; +import { stdDevLong, Duration, Bytes, longToInt } from "src/util"; import styles from "../barCharts/barCharts.module.scss"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx index f534ac82daa3..23e3cb5dbac6 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsCells/transactionsCells.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; import { Tooltip } from "@cockroachlabs/ui-components"; import classNames from "classnames/bind"; +import React from "react"; +import { Link } from "react-router-dom"; import { getHighlightedText } from "src/highlightedText"; import { limitText } from "src/util"; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx index 595dd40a34fa..b90d51149545 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTable.tsx @@ -8,10 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; import classNames from "classnames/bind"; +import React from "react"; +import statsTablePageStyles from "src/statementsTable/statementsTableContent.module.scss"; import { FixFingerprintHexValue, Count, @@ -21,8 +22,8 @@ import { appNamesAttr, propsToQueryString, } from "src/util"; -import statsTablePageStyles from "src/statementsTable/statementsTableContent.module.scss"; +import { BarChartOptions } from "../barCharts/barChartFactory"; import { SortedTable, ISortedTablePagination, @@ -37,7 +38,6 @@ import { statementFingerprintIdsToText, statementFingerprintIdsToSummarizedText, } from "../transactionsPage/utils"; -import { BarChartOptions } from "../barCharts/barChartFactory"; import { transactionsCountBarChart, @@ -49,8 +49,8 @@ import { transactionsNetworkBytesBarChart, transactionsRetryBarChart, } from "./transactionsBarCharts"; -import { tableClasses } from "./transactionsTableClasses"; import { transactionLink } from "./transactionsCells"; +import { tableClasses } from "./transactionsTableClasses"; export type Transaction = protos.cockroach.server.serverpb.StatementsResponse.IExtendedCollectedTransactionStatistics; diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts index 37b87270db58..48810f83e93b 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsTable/transactionsTableClasses.ts @@ -10,9 +10,9 @@ import classNames from "classnames/bind"; +import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; import statementsPageStyles from "src/statementsPage/statementsPage.module.scss"; import statementsTableStyles from "src/statementsTable/statementsTableContent.module.scss"; -import sortedTableStyles from "src/sortedtable/sortedtable.module.scss"; const sortedTableCx = classNames.bind(sortedTableStyles); const statementsTableCx = classNames.bind(statementsTableStyles); diff --git a/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts b/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts index 7b5210a723e8..61789860f824 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/appStats/appStats.ts @@ -11,9 +11,9 @@ import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import Long from "long"; +import { uniqueLong, unique } from "src/util/arrays"; import { TimestampToNumber, DurationToNumber } from "src/util/convert"; import { FixLong } from "src/util/fixLong"; -import { uniqueLong, unique } from "src/util/arrays"; export type StatementStatistics = cockroach.sql.IStatementStatistics; export type ExecStats = cockroach.sql.IExecStats; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts b/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts index 7ac915b3c009..c30a4502d6f4 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/convert.spec.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { fromNumber } from "long"; +import moment from "moment-timezone"; import { NanoToMilli, diff --git a/pkg/ui/workspaces/cluster-ui/src/util/convert.ts b/pkg/ui/workspaces/cluster-ui/src/util/convert.ts index d1b0a5950284..b284ba043be1 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/convert.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/convert.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import * as protos from "@cockroachlabs/crdb-protobuf-client"; import { fromNumber } from "long"; +import moment from "moment-timezone"; export type Timestamp = protos.google.protobuf.ITimestamp; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx b/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx index c302b2265fbf..075f5051c639 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/util/hooks.spec.tsx @@ -8,7 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { render, cleanup, @@ -17,6 +16,7 @@ import { waitFor, } from "@testing-library/react"; import moment from "moment-timezone"; +import React from "react"; import { useScheduleFunction } from "./hooks"; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts b/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts index 9d47839d42d9..78949ecd60ec 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/hooks.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { useEffect, useCallback, useRef } from "react"; import moment from "moment/moment"; +import { useEffect, useCallback, useRef } from "react"; export const usePrevious = <T>(value: T): T | undefined => { const ref = useRef<T>(); diff --git a/pkg/ui/workspaces/cluster-ui/src/util/proto.ts b/pkg/ui/workspaces/cluster-ui/src/util/proto.ts index f4ec7f1a61a9..da051a875131 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/proto.ts +++ b/pkg/ui/workspaces/cluster-ui/src/util/proto.ts @@ -7,9 +7,9 @@ // 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. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import has from "lodash/has"; import sumBy from "lodash/sumBy"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; export type INodeStatus = cockroach.server.status.statuspb.INodeStatus; const nodeStatus: INodeStatus = null; diff --git a/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx b/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx index 0b125e31a779..f30d4e984f68 100644 --- a/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/util/sqlActivityConstants.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { duration } from "moment-timezone"; import classNames from "classnames/bind"; +import { duration } from "moment-timezone"; +import React from "react"; import { SqlStatsSortOptions, SqlStatsSortType } from "src/api/statementsApi"; import styles from "src/sqlActivity/sqlActivity.module.scss"; diff --git a/pkg/ui/workspaces/db-console/.eslintrc.json b/pkg/ui/workspaces/db-console/.eslintrc.json index 2a38f15ec5b8..d67c6208b79a 100644 --- a/pkg/ui/workspaces/db-console/.eslintrc.json +++ b/pkg/ui/workspaces/db-console/.eslintrc.json @@ -50,6 +50,10 @@ "import/order": [ "error", { + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, "newlines-between": "always", "groups": [ "builtin", diff --git a/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx b/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx index a9e26bf186cf..3450747bfa30 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/routes/visualization.tsx @@ -8,9 +8,9 @@ import React from "react"; import { Redirect, Route, Switch } from "react-router-dom"; +import ClusterOverview from "src/views/cluster/containers/clusterOverview"; import ClusterViz from "src/views/clusterviz/containers/map"; import NodeList from "src/views/clusterviz/containers/map/nodeList"; -import ClusterOverview from "src/views/cluster/containers/clusterOverview"; export const CLUSTERVIZ_ROOT = "/overview/map"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx index 07c4419b0123..92a47fcfd8f4 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/index.tsx @@ -6,22 +6,22 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import classNames from "classnames"; import React from "react"; import { connect } from "react-redux"; import { Link } from "react-router-dom"; -import classNames from "classnames"; import nodeMapScreenshot from "assets/nodeMapSteps/3-seeMap.png"; import questionMap from "assets/questionMap.svg"; -import { allNodesHaveLocality } from "src/util/localities"; import { instructionsBoxCollapsedSelector, setInstructionsBoxCollapsed, } from "src/redux/alerts"; -import { AdminUIState, AppDispatch } from "src/redux/state"; -import { nodeStatusesSelector } from "src/redux/nodes"; import { LocalityTier } from "src/redux/localities"; +import { nodeStatusesSelector } from "src/redux/nodes"; +import { AdminUIState, AppDispatch } from "src/redux/state"; import * as docsURL from "src/util/docs"; +import { allNodesHaveLocality } from "src/util/localities"; import "./instructionsBox.styl"; interface InstructionsBoxProps { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts index f13216bebf62..842e1ee4c7f2 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/instructionsBox/instructionsBox.spec.ts @@ -5,8 +5,8 @@ // the License. You may obtain a copy of the License at // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import { showInstructionsBox } from "src/views/clusterviz/components/instructionsBox"; import { LocalityTier } from "src/redux/localities"; +import { showInstructionsBox } from "src/views/clusterviz/components/instructionsBox"; describe("InstructionsBox component", () => { describe("showInstructionsBox", () => { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx index eee429012649..42b7d509d033 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/capacityArc.tsx @@ -6,9 +6,14 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import { util } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { + NodeArcPercentageTooltip, + NodeArcUsedCapacityTooltip, + NodeArcTotalCapacityTooltip, +} from "src/views/clusterviz/components/nodeOrLocality/tooltips"; import * as PathMath from "src/views/clusterviz/util/pathmath"; import { BACKGROUND_BLUE, @@ -16,11 +21,6 @@ import { LIGHT_TEXT_BLUE, MAIN_BLUE, } from "src/views/shared/colors"; -import { - NodeArcPercentageTooltip, - NodeArcUsedCapacityTooltip, - NodeArcTotalCapacityTooltip, -} from "src/views/clusterviz/components/nodeOrLocality/tooltips"; const ARC_INNER_RADIUS = 56; const ARC_WIDTH = 6; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx index d4c0789fe25d..d2ac7e9f2164 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/components/nodeOrLocality/tooltips.tsx @@ -9,11 +9,11 @@ import React from "react"; import { Tooltip, Anchor } from "src/components"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { howAreCapacityMetricsCalculatedOverview, clusterStore, } from "src/util/docs"; -import { TooltipProps } from "src/components/tooltip/tooltip"; export const NodeArcPercentageTooltip: React.FC< TooltipProps & { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx index c28b0a0eaf2b..3212e2230951 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/breadcrumbs.tsx @@ -6,15 +6,15 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; -import { Link } from "react-router-dom"; import { util } from "@cockroachlabs/cluster-ui"; import clone from "lodash/clone"; +import React from "react"; +import { Link } from "react-router-dom"; -import { generateLocalityRoute, getLocalityLabel } from "src/util/localities"; import { LocalityTier } from "src/redux/localities"; -import { trustIcon } from "src/util/trust"; import { CLUSTERVIZ_ROOT } from "src/routes/visualization"; +import { generateLocalityRoute, getLocalityLabel } from "src/util/localities"; +import { trustIcon } from "src/util/trust"; import mapPinIcon from "!!raw-loader!assets/mapPin.svg"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx index eae21852e73e..b91a99fd101e 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/circleLayout.tsx @@ -8,10 +8,10 @@ import React from "react"; +import { cockroach } from "src/js/protos"; import { LocalityTree } from "src/redux/localities"; -import { getChildLocalities } from "src/util/localities"; import { LivenessStatus } from "src/redux/nodes"; -import { cockroach } from "src/js/protos"; +import { getChildLocalities } from "src/util/localities"; import { LocalityView } from "./localityView"; import { NodeView } from "./nodeView"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx index 9ed504d66d3a..19a98aed57b5 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.spec.tsx @@ -6,9 +6,9 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import { shallow } from "enzyme"; import { createMemoryHistory, History } from "history"; +import React from "react"; import { match as Match } from "react-router-dom"; import { refreshCluster } from "src/redux/apiReducers"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx index f7952681395d..a36133ac5593 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/index.tsx @@ -6,23 +6,23 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import { Loading } from "@cockroachlabs/cluster-ui"; +import cn from "classnames"; import React from "react"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; -import cn from "classnames"; -import { Loading } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps, withRouter } from "react-router-dom"; +import { Dropdown } from "src/components/dropdown"; +import { refreshCluster } from "src/redux/apiReducers"; +import { selectEnterpriseEnabled } from "src/redux/license"; +import { AdminUIState } from "src/redux/state"; +import { parseLocalityRoute } from "src/util/localities"; +import { parseSplatParams } from "src/util/parseSplatParams"; +import TimeScaleDropdown from "src/views/cluster/containers/timeScaleDropdownWithSearchParams"; import { Breadcrumbs } from "src/views/clusterviz/containers/map/breadcrumbs"; import NeedEnterpriseLicense from "src/views/clusterviz/containers/map/needEnterpriseLicense"; import NodeCanvasContainer from "src/views/clusterviz/containers/map/nodeCanvasContainer"; -import TimeScaleDropdown from "src/views/cluster/containers/timeScaleDropdownWithSearchParams"; import swapByLicense from "src/views/shared/containers/licenseSwap"; -import { parseLocalityRoute } from "src/util/localities"; -import { AdminUIState } from "src/redux/state"; -import { selectEnterpriseEnabled } from "src/redux/license"; -import { Dropdown } from "src/components/dropdown"; -import { parseSplatParams } from "src/util/parseSplatParams"; -import { refreshCluster } from "src/redux/apiReducers"; const NodeCanvasContent = swapByLicense( NeedEnterpriseLicense, diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx index ac8b01cb3534..5cc96f5ef904 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/localityView.tsx @@ -11,18 +11,18 @@ import { RouteComponentProps } from "react-router"; import { withRouter } from "react-router-dom"; import { LocalityTree } from "src/redux/localities"; +import { sumNodeStats, LivenessStatus } from "src/redux/nodes"; import { CLUSTERVIZ_ROOT } from "src/routes/visualization"; import { generateLocalityRoute, getLocalityLabel, getLeaves, } from "src/util/localities"; -import { sumNodeStats, LivenessStatus } from "src/redux/nodes"; import { pluralize } from "src/util/pluralize"; import { trustIcon } from "src/util/trust"; -import { Sparklines } from "src/views/clusterviz/components/nodeOrLocality/sparklines"; import { CapacityArc } from "src/views/clusterviz/components/nodeOrLocality/capacityArc"; import { Labels } from "src/views/clusterviz/components/nodeOrLocality/labels"; +import { Sparklines } from "src/views/clusterviz/components/nodeOrLocality/sparklines"; import liveIcon from "!!raw-loader!assets/livenessIcons/live.svg"; import localityIcon from "!!raw-loader!assets/localityIcon.svg"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx index 189698551de2..ad61e32fb1f1 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/mapLayout.tsx @@ -6,19 +6,19 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import * as d3 from "d3"; -import isEqual from "lodash/isEqual"; import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; import map from "lodash/map"; +import React from "react"; import * as protos from "src/js/protos"; import { LocalityTree } from "src/redux/localities"; import { LocationTree } from "src/redux/locations"; +import { LivenessStatus } from "src/redux/nodes"; import { getChildLocalities } from "src/util/localities"; import { findOrCalculateLocation } from "src/util/locations"; import * as vector from "src/util/vector"; -import { LivenessStatus } from "src/redux/nodes"; import { LocalityView } from "./localityView"; import { WorldMap } from "./worldmap"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx index 0dfb6ecc0dc8..164abd84f10a 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/needEnterpriseLicense.tsx @@ -11,8 +11,8 @@ import React from "react"; import step1Img from "assets/nodeMapSteps/1-getLicense.png"; import step2Img from "assets/nodeMapSteps/2-setKey.svg"; import step3Img from "assets/nodeMapSteps/3-seeMap.png"; -import { NodeCanvasContainerOwnProps } from "src/views/clusterviz/containers/map/nodeCanvasContainer"; import * as docsURL from "src/util/docs"; +import { NodeCanvasContainerOwnProps } from "src/views/clusterviz/containers/map/nodeCanvasContainer"; import "./needEnterpriseLicense.styl"; // This takes the same props as the NodeCanvasContainer which it is swapped out with. diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx index e6f85e3565fb..ad59a4e0516b 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvas.tsx @@ -6,25 +6,25 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import debounce from "lodash/debounce"; import isEmpty from "lodash/isEmpty"; +import React from "react"; import { Link } from "react-router-dom"; -import { LivenessStatus } from "src/redux/nodes"; +import { cockroach } from "src/js/protos"; import { LocalityTier, LocalityTree } from "src/redux/localities"; import { LocationTree } from "src/redux/locations"; +import { LivenessStatus } from "src/redux/nodes"; import { CLUSTERVIZ_ROOT } from "src/routes/visualization"; import { generateLocalityRoute, getLocalityLabel } from "src/util/localities"; import { trustIcon } from "src/util/trust"; -import { cockroach } from "src/js/protos"; import InstructionsBox, { showInstructionsBox, } from "src/views/clusterviz/components/instructionsBox"; -import { MapLayout } from "./mapLayout"; -import { renderAsMap } from "./layout"; import { CircleLayout } from "./circleLayout"; +import { renderAsMap } from "./layout"; +import { MapLayout } from "./mapLayout"; import arrowUpIcon from "!!raw-loader!assets/arrowUp.svg"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx index 6bad44ec81a1..2367da3c5de2 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeCanvasContainer.tsx @@ -6,12 +6,12 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import { Loading } from "@cockroachlabs/cluster-ui"; import isNil from "lodash/isNil"; import React from "react"; import { connect } from "react-redux"; import { withRouter, RouteComponentProps } from "react-router-dom"; import { createSelector } from "reselect"; -import { Loading } from "@cockroachlabs/cluster-ui"; import { cockroach } from "src/js/protos"; import { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx index 20029b7b822b..c65ca021af74 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeList.tsx @@ -9,8 +9,8 @@ import React from "react"; import { RouteComponentProps } from "react-router-dom"; -import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; import { Dropdown } from "src/components/dropdown"; +import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; import "./nodesList.styl"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx index afdb9a21c173..11352a59d4ea 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/nodeView.tsx @@ -6,24 +6,24 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; +import { util } from "@cockroachlabs/cluster-ui"; import moment from "moment-timezone"; +import React from "react"; import { Link } from "react-router-dom"; -import { util } from "@cockroachlabs/cluster-ui"; -import { INodeStatus } from "src/util/proto"; +import { cockroach } from "src/js/protos"; import { nodeCapacityStats, livenessNomenclature } from "src/redux/nodes"; +import { INodeStatus } from "src/util/proto"; import { trustIcon } from "src/util/trust"; -import { Labels } from "src/views/clusterviz/components/nodeOrLocality/labels"; import { CapacityArc } from "src/views/clusterviz/components/nodeOrLocality/capacityArc"; +import { Labels } from "src/views/clusterviz/components/nodeOrLocality/labels"; import { Sparklines } from "src/views/clusterviz/components/nodeOrLocality/sparklines"; -import { cockroach } from "src/js/protos"; -import nodeIcon from "!!raw-loader!assets/nodeIcon.svg"; +import NodeLivenessStatus = cockroach.kv.kvserver.liveness.livenesspb.NodeLivenessStatus; import deadIcon from "!!raw-loader!assets/livenessIcons/dead.svg"; -import suspectIcon from "!!raw-loader!assets/livenessIcons/suspect.svg"; import liveIcon from "!!raw-loader!assets/livenessIcons/live.svg"; -import NodeLivenessStatus = cockroach.kv.kvserver.liveness.livenesspb.NodeLivenessStatus; +import suspectIcon from "!!raw-loader!assets/livenessIcons/suspect.svg"; +import nodeIcon from "!!raw-loader!assets/nodeIcon.svg"; type ILiveness = cockroach.kv.kvserver.liveness.livenesspb.ILiveness; interface NodeViewProps { diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx index 6e1496a468a6..dd1b5392e8be 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/sparkline.tsx @@ -6,13 +6,13 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt +import { util } from "@cockroachlabs/cluster-ui"; import d3 from "d3"; import React from "react"; -import { util } from "@cockroachlabs/cluster-ui"; +import { BACKGROUND_BLUE, MAIN_BLUE } from "src/views/shared/colors"; import { MetricsDataComponentProps } from "src/views/shared/components/metricQuery"; import createChartComponent from "src/views/shared/util/d3-react"; -import { BACKGROUND_BLUE, MAIN_BLUE } from "src/views/shared/colors"; interface SparklineConfig { width: number; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx index 29c9fae458de..6b1dc929ca7d 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/worldmap.tsx @@ -6,8 +6,8 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; import * as d3 from "d3"; +import React from "react"; import shapes from "./world.json"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts index 27f3d792a1e2..8a352cf74521 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts +++ b/pkg/ui/workspaces/db-console/ccl/src/views/clusterviz/containers/map/zoom.ts @@ -7,8 +7,8 @@ // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt import * as d3 from "d3"; -import isEmpty from "lodash/isEmpty"; import clone from "lodash/clone"; +import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; import * as vector from "src/util/vector"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx index 0636588ae6e8..8829f8e57030 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/reports/containers/stores/encryption.tsx @@ -6,15 +6,15 @@ // // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt -import React from "react"; -import Long from "long"; -import moment from "moment-timezone"; -import * as protosccl from "@cockroachlabs/crdb-protobuf-client-ccl"; import { util } from "@cockroachlabs/cluster-ui"; +import * as protosccl from "@cockroachlabs/crdb-protobuf-client-ccl"; import isEmpty from "lodash/isEmpty"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; -import * as protos from "src/js/protos"; import { EncryptionStatusProps } from "oss/src/views/reports/containers/stores/encryption"; +import * as protos from "src/js/protos"; import { FixLong } from "src/util/fixLong"; diff --git a/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx b/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx index 2720f5d913e6..561c111b11a0 100644 --- a/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx +++ b/pkg/ui/workspaces/db-console/ccl/src/views/shared/components/licenseType/index.tsx @@ -8,9 +8,9 @@ import React from "react"; +import OSSLicenseType from "oss/src/views/shared/components/licenseType"; import DebugAnnotation from "src/views/shared/components/debugAnnotation"; import swapByLicense from "src/views/shared/containers/licenseSwap"; -import OSSLicenseType from "oss/src/views/shared/components/licenseType"; export class CCLLicenseType extends React.Component<{}, {}> { render() { diff --git a/pkg/ui/workspaces/db-console/src/app.spec.tsx b/pkg/ui/workspaces/db-console/src/app.spec.tsx index 1c0fffc5e25a..6314e03ee83f 100644 --- a/pkg/ui/workspaces/db-console/src/app.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/app.spec.tsx @@ -60,10 +60,10 @@ stubComponentInModule( ); // NOTE: All imports should go after `stubComponentInModule` functions calls. +import { screen, render } from "@testing-library/react"; +import { createMemoryHistory, MemoryHistory } from "history"; import React from "react"; import { Action, Store } from "redux"; -import { createMemoryHistory, MemoryHistory } from "history"; -import { screen, render } from "@testing-library/react"; import { App } from "src/app"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/app.tsx b/pkg/ui/workspaces/db-console/src/app.tsx index efc46fd4a503..5df22507d0bd 100644 --- a/pkg/ui/workspaces/db-console/src/app.tsx +++ b/pkg/ui/workspaces/db-console/src/app.tsx @@ -8,6 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { + CockroachCloudContext, + crlTheme, + ConfigProvider as ClusterUIConfigProvider, +} from "@cockroachlabs/cluster-ui"; +import { ConfigProvider } from "antd"; import { ConnectedRouter } from "connected-react-router"; import { History } from "history"; import "nvd3/build/nv.d3.min.css"; @@ -16,11 +22,11 @@ import { Provider, ReactReduxContext } from "react-redux"; import { Redirect, Route, Switch } from "react-router-dom"; import "react-select/dist/react-select.css"; import { Action, Store } from "redux"; -import { CockroachCloudContext , crlTheme, ConfigProvider as ClusterUIConfigProvider } from "@cockroachlabs/cluster-ui"; -import { ConfigProvider } from "antd"; +import { TimezoneProvider } from "src/contexts/timezoneProvider"; import { AdminUIState } from "src/redux/state"; import { createLoginRoute, createLogoutRoute } from "src/routes/login"; +import { RedirectToStatementDetails } from "src/routes/RedirectToStatementDetails"; import visualizationRoutes from "src/routes/visualization"; import { aggregatedTsAttr, @@ -49,49 +55,47 @@ import { EventPage } from "src/views/cluster/containers/events"; import NodeGraphs from "src/views/cluster/containers/nodeGraphs"; import NodeLogs from "src/views/cluster/containers/nodeLogs"; import NodeOverview from "src/views/cluster/containers/nodeOverview"; -import { DatabasesPage } from "src/views/databases/databasesPage"; import { DatabaseDetailsPage } from "src/views/databases/databaseDetailsPage"; +import { DatabasesPage } from "src/views/databases/databasesPage"; import { DatabaseTablePage } from "src/views/databases/databaseTablePage"; import { IndexDetailsPage } from "src/views/databases/indexDetailsPage"; import Raft from "src/views/devtools/containers/raft"; import RaftMessages from "src/views/devtools/containers/raftMessages"; import RaftRanges from "src/views/devtools/containers/raftRanges"; -import JobsPage from "src/views/jobs/jobsPage"; +import HotRangesPage from "src/views/hotRanges/index"; import JobDetails from "src/views/jobs/jobDetails"; +import JobsPage from "src/views/jobs/jobsPage"; +import KeyVisualizerPage from "src/views/keyVisualizer"; import { ConnectedDecommissionedNodeHistory } from "src/views/reports"; import Certificates from "src/views/reports/containers/certificates"; import CustomChart from "src/views/reports/containers/customChart"; import Debug from "src/views/reports/containers/debug"; import EnqueueRange from "src/views/reports/containers/enqueueRange"; +import HotRanges from "src/views/reports/containers/hotranges"; import Localities from "src/views/reports/containers/localities"; import Network from "src/views/reports/containers/network"; import Nodes from "src/views/reports/containers/nodes"; import ProblemRanges from "src/views/reports/containers/problemRanges"; import Range from "src/views/reports/containers/range"; import ReduxDebug from "src/views/reports/containers/redux"; -import HotRanges from "src/views/reports/containers/hotranges"; -import SchedulesPage from "src/views/schedules/schedulesPage"; -import ScheduleDetails from "src/views/schedules/scheduleDetails"; import Settings from "src/views/reports/containers/settings"; +import StatementsDiagnosticsHistoryView from "src/views/reports/containers/statementDiagnosticsHistory"; import Stores from "src/views/reports/containers/stores"; +import ScheduleDetails from "src/views/schedules/scheduleDetails"; +import SchedulesPage from "src/views/schedules/schedulesPage"; +import SessionDetails from "src/views/sessions/sessionDetails"; import SQLActivityPage from "src/views/sqlActivity/sqlActivityPage"; import StatementDetails from "src/views/statements/statementDetails"; -import SessionDetails from "src/views/sessions/sessionDetails"; -import TransactionDetails from "src/views/transactions/transactionDetails"; -import StatementsDiagnosticsHistoryView from "src/views/reports/containers/statementDiagnosticsHistory"; -import { RedirectToStatementDetails } from "src/routes/RedirectToStatementDetails"; -import HotRangesPage from "src/views/hotRanges/index"; import { SnapshotRouter } from "src/views/tracez_v2/snapshotRoutes"; -import KeyVisualizerPage from "src/views/keyVisualizer"; -import { TimezoneProvider } from "src/contexts/timezoneProvider"; +import TransactionDetails from "src/views/transactions/transactionDetails"; import "styl/app.styl"; -import ActiveStatementDetails from "./views/statements/activeStatementDetailsConnected"; -import ActiveTransactionDetails from "./views/transactions/activeTransactionDetailsConnected"; import InsightsOverviewPage from "./views/insights/insightsOverview"; -import TransactionInsightDetailsPage from "./views/insights/transactionInsightDetailsPage"; import StatementInsightDetailsPage from "./views/insights/statementInsightDetailsPage"; +import TransactionInsightDetailsPage from "./views/insights/transactionInsightDetailsPage"; import { JwtAuthTokenPage } from "./views/jwt/jwtAuthToken"; +import ActiveStatementDetails from "./views/statements/activeStatementDetailsConnected"; +import ActiveTransactionDetails from "./views/transactions/activeTransactionDetailsConnected"; // NOTE: If you are adding a new path to the router, and that path contains any // components that are personally identifying information, you MUST update the @@ -119,380 +123,414 @@ export const App: React.FC<AppProps> = (props: AppProps) => { {/* Apply CRL theme twice, with ConfigProvider instance from Db Console and imported instance from Cluster UI as it applies theme imported components only. */} <ClusterUIConfigProvider theme={crlTheme}> - <ConfigProvider theme={crlTheme}> - <Switch> - {/* login */} - {createLoginRoute()} - {createLogoutRoute(store)} - <Route path="/jwt/:oidc" component={JwtAuthTokenPage} /> - <Route path="/"> - <Layout> - <Switch> - <Redirect exact from="/" to="/overview" /> - {/* overview page */} - {visualizationRoutes()} + <ConfigProvider theme={crlTheme}> + <Switch> + {/* login */} + {createLoginRoute()} + {createLogoutRoute(store)} + <Route path="/jwt/:oidc" component={JwtAuthTokenPage} /> + <Route path="/"> + <Layout> + <Switch> + <Redirect exact from="/" to="/overview" /> + {/* overview page */} + {visualizationRoutes()} - {/* time series metrics */} - <Redirect - exact - from="/metrics" - to="/metrics/overview/cluster" - /> - <Redirect - exact - from={`/metrics/:${dashboardNameAttr}`} - to={`/metrics/:${dashboardNameAttr}/cluster`} - /> - <Route - exact - path={`/metrics/:${dashboardNameAttr}/cluster`} - component={NodeGraphs} - /> - <Redirect - exact - path={`/metrics/:${dashboardNameAttr}/node`} - to={`/metrics/:${dashboardNameAttr}/cluster`} - /> - <Route - exact - path={`/metrics/:${dashboardNameAttr}/node/:${nodeIDAttr}`} - component={NodeGraphs} - /> - <Route - exact - path={`/metrics/:${dashboardNameAttr}/node/:${nodeIDAttr}/tenant/:${tenantNameAttr}`} - component={NodeGraphs} - /> - <Route - exact - path={`/metrics/:${dashboardNameAttr}/cluster/tenant/:${tenantNameAttr}`} - component={NodeGraphs} - /> + {/* time series metrics */} + <Redirect + exact + from="/metrics" + to="/metrics/overview/cluster" + /> + <Redirect + exact + from={`/metrics/:${dashboardNameAttr}`} + to={`/metrics/:${dashboardNameAttr}/cluster`} + /> + <Route + exact + path={`/metrics/:${dashboardNameAttr}/cluster`} + component={NodeGraphs} + /> + <Redirect + exact + path={`/metrics/:${dashboardNameAttr}/node`} + to={`/metrics/:${dashboardNameAttr}/cluster`} + /> + <Route + exact + path={`/metrics/:${dashboardNameAttr}/node/:${nodeIDAttr}`} + component={NodeGraphs} + /> + <Route + exact + path={`/metrics/:${dashboardNameAttr}/node/:${nodeIDAttr}/tenant/:${tenantNameAttr}`} + component={NodeGraphs} + /> + <Route + exact + path={`/metrics/:${dashboardNameAttr}/cluster/tenant/:${tenantNameAttr}`} + component={NodeGraphs} + /> - {/* node details */} - <Redirect exact from="/node" to="/overview/list" /> - <Route - exact - path={`/node/:${nodeIDAttr}`} - component={NodeOverview} - /> - <Route - exact - path={`/node/:${nodeIDAttr}/logs`} - component={NodeLogs} - /> + {/* node details */} + <Redirect exact from="/node" to="/overview/list" /> + <Route + exact + path={`/node/:${nodeIDAttr}`} + component={NodeOverview} + /> + <Route + exact + path={`/node/:${nodeIDAttr}/logs`} + component={NodeLogs} + /> - {/* events & jobs */} - <Route path="/events" component={EventPage} /> - <Route exact path="/jobs" component={JobsPage} /> - <Route path={`/jobs/:${idAttr}`} component={JobDetails} /> + {/* events & jobs */} + <Route path="/events" component={EventPage} /> + <Route exact path="/jobs" component={JobsPage} /> + <Route + path={`/jobs/:${idAttr}`} + component={JobDetails} + /> - <Route exact path="/schedules" component={SchedulesPage} /> - <Route - path={`/schedules/:${idAttr}`} - component={ScheduleDetails} - /> + <Route + exact + path="/schedules" + component={SchedulesPage} + /> + <Route + path={`/schedules/:${idAttr}`} + component={ScheduleDetails} + /> - {/* databases */} - <Route exact path="/databases" component={DatabasesPage} /> - <Redirect exact from="/databases/tables" to="/databases" /> - <Redirect exact from="/databases/grants" to="/databases" /> - <Redirect - from={`/databases/database/:${databaseNameAttr}/table/:${tableNameAttr}`} - to={`/database/:${databaseNameAttr}/table/:${tableNameAttr}`} - /> + {/* databases */} + <Route + exact + path="/databases" + component={DatabasesPage} + /> + <Redirect + exact + from="/databases/tables" + to="/databases" + /> + <Redirect + exact + from="/databases/grants" + to="/databases" + /> + <Redirect + from={`/databases/database/:${databaseNameAttr}/table/:${tableNameAttr}`} + to={`/database/:${databaseNameAttr}/table/:${tableNameAttr}`} + /> - <Redirect exact from="/database" to="/databases" /> - <Route - exact - path={`/database/:${databaseNameAttr}`} - component={DatabaseDetailsPage} - /> - <Redirect - exact - from={`/database/:${databaseNameAttr}/table`} - to={`/database/:${databaseNameAttr}`} - /> - <Route - exact - path={`/database/:${databaseNameAttr}/table/:${tableNameAttr}`} - component={DatabaseTablePage} - /> - <Route - exact - path={`/database/:${databaseNameAttr}/table/:${tableNameAttr}/index/:${indexNameAttr}`} - component={IndexDetailsPage} - /> - <Redirect - exact - from={`/database/:${databaseNameAttr}/table/:${tableNameAttr}/index`} - to={`/database/:${databaseNameAttr}/table/:${tableNameAttr}`} - /> + <Redirect exact from="/database" to="/databases" /> + <Route + exact + path={`/database/:${databaseNameAttr}`} + component={DatabaseDetailsPage} + /> + <Redirect + exact + from={`/database/:${databaseNameAttr}/table`} + to={`/database/:${databaseNameAttr}`} + /> + <Route + exact + path={`/database/:${databaseNameAttr}/table/:${tableNameAttr}`} + component={DatabaseTablePage} + /> + <Route + exact + path={`/database/:${databaseNameAttr}/table/:${tableNameAttr}/index/:${indexNameAttr}`} + component={IndexDetailsPage} + /> + <Redirect + exact + from={`/database/:${databaseNameAttr}/table/:${tableNameAttr}/index`} + to={`/database/:${databaseNameAttr}/table/:${tableNameAttr}`} + /> - {/* data distribution */} - <Route - exact - path="/data-distribution" - component={DataDistributionPage} - /> + {/* data distribution */} + <Route + exact + path="/data-distribution" + component={DataDistributionPage} + /> - {/* SQL activity */} - <Route - exact - path="/sql-activity" - component={SQLActivityPage} - /> + {/* SQL activity */} + <Route + exact + path="/sql-activity" + component={SQLActivityPage} + /> - {/* Active executions */} - <Route - exact - path={`/execution/statement/:${executionIdAttr}`} - component={ActiveStatementDetails} - /> + {/* Active executions */} + <Route + exact + path={`/execution/statement/:${executionIdAttr}`} + component={ActiveStatementDetails} + /> - <Route - exact - path={`/execution/transaction/:${executionIdAttr}`} - component={ActiveTransactionDetails} - /> + <Route + exact + path={`/execution/transaction/:${executionIdAttr}`} + component={ActiveTransactionDetails} + /> - {/* statement statistics */} - <Redirect - exact - from={`/statements`} - to={`/sql-activity?${tabAttr}=Statements&${viewAttr}=fingerprints`} - /> - <Redirect - exact - from={`/statements/:${appAttr}`} - to={`/statements?${appAttr}=:${appAttr}`} - /> - <Route - exact - path={`/statement/:${implicitTxnAttr}/:${statementAttr}`} - component={StatementDetails} - /> - <Route - exact - path={`/statements/:${appAttr}/:${statementAttr}`} - render={RedirectToStatementDetails} - /> - <Route - exact - path={`/statements/:${appAttr}/:${implicitTxnAttr}/:${statementAttr}`} - render={RedirectToStatementDetails} - /> - <Route - exact - path={`/statements/:${appAttr}/:${databaseAttr}/:${implicitTxnAttr}/:${statementAttr}`} - render={RedirectToStatementDetails} - /> - <Route - exact - path={`/statement/:${implicitTxnAttr}/:${statementAttr}`} - render={RedirectToStatementDetails} - /> - <Route - exact - path={`/statement/:${databaseAttr}/:${implicitTxnAttr}/:${statementAttr}`} - render={RedirectToStatementDetails} - /> - <Redirect - exact - from={`/statement`} - to={`/sql-activity?${tabAttr}=Statements&view=fingerprints`} - /> + {/* statement statistics */} + <Redirect + exact + from={`/statements`} + to={`/sql-activity?${tabAttr}=Statements&${viewAttr}=fingerprints`} + /> + <Redirect + exact + from={`/statements/:${appAttr}`} + to={`/statements?${appAttr}=:${appAttr}`} + /> + <Route + exact + path={`/statement/:${implicitTxnAttr}/:${statementAttr}`} + component={StatementDetails} + /> + <Route + exact + path={`/statements/:${appAttr}/:${statementAttr}`} + render={RedirectToStatementDetails} + /> + <Route + exact + path={`/statements/:${appAttr}/:${implicitTxnAttr}/:${statementAttr}`} + render={RedirectToStatementDetails} + /> + <Route + exact + path={`/statements/:${appAttr}/:${databaseAttr}/:${implicitTxnAttr}/:${statementAttr}`} + render={RedirectToStatementDetails} + /> + <Route + exact + path={`/statement/:${implicitTxnAttr}/:${statementAttr}`} + render={RedirectToStatementDetails} + /> + <Route + exact + path={`/statement/:${databaseAttr}/:${implicitTxnAttr}/:${statementAttr}`} + render={RedirectToStatementDetails} + /> + <Redirect + exact + from={`/statement`} + to={`/sql-activity?${tabAttr}=Statements&view=fingerprints`} + /> - {/* sessions */} - <Redirect - exact - from={`/sessions`} - to={`/sql-activity?${tabAttr}=Sessions`} - /> - <Route - exact - path={`/session/:${sessionAttr}`} - component={SessionDetails} - /> + {/* sessions */} + <Redirect + exact + from={`/sessions`} + to={`/sql-activity?${tabAttr}=Sessions`} + /> + <Route + exact + path={`/session/:${sessionAttr}`} + component={SessionDetails} + /> - {/* transactions */} - <Redirect - exact - from={`/transactions`} - to={`/sql-activity?${tabAttr}=Transactions`} - /> - <Route - exact - path={`/transaction/:${txnFingerprintIdAttr}`} - component={TransactionDetails} - /> - <Redirect - exact - from={`/transaction/:${aggregatedTsAttr}/:${txnFingerprintIdAttr}`} - to={`/transaction/:${txnFingerprintIdAttr}`} - /> + {/* transactions */} + <Redirect + exact + from={`/transactions`} + to={`/sql-activity?${tabAttr}=Transactions`} + /> + <Route + exact + path={`/transaction/:${txnFingerprintIdAttr}`} + component={TransactionDetails} + /> + <Redirect + exact + from={`/transaction/:${aggregatedTsAttr}/:${txnFingerprintIdAttr}`} + to={`/transaction/:${txnFingerprintIdAttr}`} + /> - {/* Insights */} - <Route - exact - path="/insights" - component={InsightsOverviewPage} - /> - <Route - path={`/insights/transaction/:${idAttr}`} - component={TransactionInsightDetailsPage} - /> - <Route - path={`/insights/statement/:${idAttr}`} - component={StatementInsightDetailsPage} - /> + {/* Insights */} + <Route + exact + path="/insights" + component={InsightsOverviewPage} + /> + <Route + path={`/insights/transaction/:${idAttr}`} + component={TransactionInsightDetailsPage} + /> + <Route + path={`/insights/statement/:${idAttr}`} + component={StatementInsightDetailsPage} + /> - {/* debug pages */} - <Route exact path="/debug" component={Debug} /> - <Route path="/debug/tracez" component={SnapshotRouter} /> - <Route exact path="/debug/redux" component={ReduxDebug} /> - <Route exact path="/debug/chart" component={CustomChart} /> - <Route - exact - path="/debug/enqueue_range" - component={EnqueueRange} - /> - <Route - exact - path="/debug/hotranges" - component={HotRanges} - /> - <Route - exact - path="/debug/hotranges/:node_id" - component={HotRanges} - /> - <Route - exact - path={`/keyvisualizer`} - component={KeyVisualizerPage} - /> - <Route path="/raft"> - <Raft> - <Switch> - <Redirect exact from="/raft" to="/raft/ranges" /> - <Route - exact - path="/raft/ranges" - component={RaftRanges} - /> - <Route - exact - path="/raft/messages/all" - component={RaftMessages} - /> - <Route - exact - path={`/raft/messages/node/:${nodeIDAttr}`} - component={RaftMessages} - /> - </Switch> - </Raft> - </Route> + {/* debug pages */} + <Route exact path="/debug" component={Debug} /> + <Route + path="/debug/tracez" + component={SnapshotRouter} + /> + <Route + exact + path="/debug/redux" + component={ReduxDebug} + /> + <Route + exact + path="/debug/chart" + component={CustomChart} + /> + <Route + exact + path="/debug/enqueue_range" + component={EnqueueRange} + /> + <Route + exact + path="/debug/hotranges" + component={HotRanges} + /> + <Route + exact + path="/debug/hotranges/:node_id" + component={HotRanges} + /> + <Route + exact + path={`/keyvisualizer`} + component={KeyVisualizerPage} + /> + <Route path="/raft"> + <Raft> + <Switch> + <Redirect exact from="/raft" to="/raft/ranges" /> + <Route + exact + path="/raft/ranges" + component={RaftRanges} + /> + <Route + exact + path="/raft/messages/all" + component={RaftMessages} + /> + <Route + exact + path={`/raft/messages/node/:${nodeIDAttr}`} + component={RaftMessages} + /> + </Switch> + </Raft> + </Route> - <Route - exact - path="/reports/problemranges" - component={ProblemRanges} - /> - <Route - exact - path={`/reports/problemranges/:${nodeIDAttr}`} - component={ProblemRanges} - /> - <Route - exact - path="/reports/localities" - component={Localities} - /> - <Route - exact - path={`/reports/network/:${nodeIDAttr}`} - component={Network} - /> - <Redirect - from={`/reports/network`} - to={`/reports/network/region`} - /> - <Route exact path="/reports/nodes" component={Nodes} /> - <Route - exact - path="/reports/nodes/history" - component={ConnectedDecommissionedNodeHistory} - /> - <Route - exact - path="/reports/settings" - component={Settings} - /> - <Route - exact - path={`/reports/certificates/:${nodeIDAttr}`} - component={Certificates} - /> - <Route - exact - path={`/reports/range/:${rangeIDAttr}`} - component={Range} - /> - <Route - exact - path={`/reports/stores/:${nodeIDAttr}`} - component={Stores} - /> - <Route - exact - path={`/reports/statements/diagnosticshistory`} - component={StatementsDiagnosticsHistoryView} - /> - {/* hot ranges */} - <Route - exact - path={`/hotranges`} - component={HotRangesPage} - /> - {/* old route redirects */} - <Redirect - exact - from="/cluster" - to="/metrics/overview/cluster" - /> - <Redirect - from={`/cluster/all/:${dashboardNameAttr}`} - to={`/metrics/:${dashboardNameAttr}/cluster`} - /> - <Redirect - from={`/cluster/node/:${nodeIDAttr}/:${dashboardNameAttr}`} - to={`/metrics/:${dashboardNameAttr}/node/:${nodeIDAttr}`} - /> - <Redirect exact from="/cluster/nodes" to="/overview/list" /> - <Redirect - exact - from={`/cluster/nodes/:${nodeIDAttr}`} - to={`/node/:${nodeIDAttr}`} - /> - <Redirect - from={`/cluster/nodes/:${nodeIDAttr}/logs`} - to={`/node/:${nodeIDAttr}/logs`} - /> - <Redirect from="/cluster/events" to="/events" /> + <Route + exact + path="/reports/problemranges" + component={ProblemRanges} + /> + <Route + exact + path={`/reports/problemranges/:${nodeIDAttr}`} + component={ProblemRanges} + /> + <Route + exact + path="/reports/localities" + component={Localities} + /> + <Route + exact + path={`/reports/network/:${nodeIDAttr}`} + component={Network} + /> + <Redirect + from={`/reports/network`} + to={`/reports/network/region`} + /> + <Route exact path="/reports/nodes" component={Nodes} /> + <Route + exact + path="/reports/nodes/history" + component={ConnectedDecommissionedNodeHistory} + /> + <Route + exact + path="/reports/settings" + component={Settings} + /> + <Route + exact + path={`/reports/certificates/:${nodeIDAttr}`} + component={Certificates} + /> + <Route + exact + path={`/reports/range/:${rangeIDAttr}`} + component={Range} + /> + <Route + exact + path={`/reports/stores/:${nodeIDAttr}`} + component={Stores} + /> + <Route + exact + path={`/reports/statements/diagnosticshistory`} + component={StatementsDiagnosticsHistoryView} + /> + {/* hot ranges */} + <Route + exact + path={`/hotranges`} + component={HotRangesPage} + /> + {/* old route redirects */} + <Redirect + exact + from="/cluster" + to="/metrics/overview/cluster" + /> + <Redirect + from={`/cluster/all/:${dashboardNameAttr}`} + to={`/metrics/:${dashboardNameAttr}/cluster`} + /> + <Redirect + from={`/cluster/node/:${nodeIDAttr}/:${dashboardNameAttr}`} + to={`/metrics/:${dashboardNameAttr}/node/:${nodeIDAttr}`} + /> + <Redirect + exact + from="/cluster/nodes" + to="/overview/list" + /> + <Redirect + exact + from={`/cluster/nodes/:${nodeIDAttr}`} + to={`/node/:${nodeIDAttr}`} + /> + <Redirect + from={`/cluster/nodes/:${nodeIDAttr}/logs`} + to={`/node/:${nodeIDAttr}/logs`} + /> + <Redirect from="/cluster/events" to="/events" /> - <Redirect exact from="/nodes" to="/overview/list" /> + <Redirect exact from="/nodes" to="/overview/list" /> - {/* 404 */} - <Route path="*" component={NotFound} /> - </Switch> - </Layout> - </Route> - </Switch> - </ConfigProvider> + {/* 404 */} + <Route path="*" component={NotFound} /> + </Switch> + </Layout> + </Route> + </Switch> + </ConfigProvider> </ClusterUIConfigProvider> - </TimezoneProvider> + </TimezoneProvider> </CockroachCloudContext.Provider> </ConnectedRouter> </Provider> diff --git a/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx b/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx index 96b54969e781..8ee06e212f28 100644 --- a/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx +++ b/pkg/ui/workspaces/db-console/src/components/anchor/anchor.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import styles from "./anchor.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/button/button.tsx b/pkg/ui/workspaces/db-console/src/components/button/button.tsx index dabe48b4cc91..1af4177fb5a4 100644 --- a/pkg/ui/workspaces/db-console/src/components/button/button.tsx +++ b/pkg/ui/workspaces/db-console/src/components/button/button.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { ButtonHTMLAttributes } from "react"; import classNames from "classnames/bind"; +import React, { ButtonHTMLAttributes } from "react"; import styles from "./button.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx b/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx index a607f80eb0b4..181990678f4d 100644 --- a/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx +++ b/pkg/ui/workspaces/db-console/src/components/dropdown/dropdown.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import cn from "classnames"; import { CaretDownOutlined } from "@ant-design/icons"; +import cn from "classnames"; +import React from "react"; import { Button } from "src/components/button"; diff --git a/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx b/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx index 7c045616712c..45f1546fba77 100644 --- a/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx +++ b/pkg/ui/workspaces/db-console/src/components/empty/empty.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import heroBannerLp from "assets/heroBannerLp.png"; import { Anchor, Button, Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx index c7459a29ec27..c6e802d16b1a 100644 --- a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.stories.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; -import { styledWrapper } from "src/util/decorators"; import { Anchor } from "src/components"; +import { styledWrapper } from "src/util/decorators"; import { InlineAlert } from "./inlineAlert"; diff --git a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx index afc6991477c2..8d4c276868e3 100644 --- a/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx +++ b/pkg/ui/workspaces/db-console/src/components/inlineAlert/inlineAlert.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useMemo } from "react"; import classNames from "classnames/bind"; +import React, { useMemo } from "react"; import ErrorIcon from "assets/error-circle.svg"; import InfoIcon from "assets/info-filled-circle.svg"; diff --git a/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx b/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx index 49ddddc03e92..2f16371751da 100644 --- a/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx +++ b/pkg/ui/workspaces/db-console/src/components/input/textInput.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import cn from "classnames"; +import React from "react"; import { Text, TextTypes } from "src/components"; import "./input.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/link/link.tsx b/pkg/ui/workspaces/db-console/src/components/link/link.tsx index 3da3ae82180e..3d0f750c24e9 100644 --- a/pkg/ui/workspaces/db-console/src/components/link/link.tsx +++ b/pkg/ui/workspaces/db-console/src/components/link/link.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classnames from "classnames/bind"; import React from "react"; import { Link as LinkTo, LinkProps } from "react-router-dom"; -import classnames from "classnames/bind"; import styles from "./link.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx b/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx index d4bd9a785928..e3639357c796 100644 --- a/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx +++ b/pkg/ui/workspaces/db-console/src/components/modal/modal.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Modal as AntModal } from "antd"; +import React from "react"; import "antd/lib/modal/style"; import { Button, Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx b/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx index 8546c8c2faae..314ef2808f70 100644 --- a/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx +++ b/pkg/ui/workspaces/db-console/src/components/outsideEventHandler/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; +import React from "react"; import "./outsideEventHandler.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx b/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx index 30b70afef833..b9e481845d40 100644 --- a/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx +++ b/pkg/ui/workspaces/db-console/src/components/rangeCalendar/dateRangeLabel.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Moment } from "moment-timezone"; +import React from "react"; import { Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/select/select.tsx b/pkg/ui/workspaces/db-console/src/components/select/select.tsx index 5b477f6976d9..f1c4f76c48d4 100644 --- a/pkg/ui/workspaces/db-console/src/components/select/select.tsx +++ b/pkg/ui/workspaces/db-console/src/components/select/select.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import { default as AntSelect, SelectProps as AntSelectProps, } from "antd/es/select"; import cn from "classnames"; +import * as React from "react"; import "./select.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx b/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx index c552cd417bb7..5612490e78f3 100644 --- a/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx +++ b/pkg/ui/workspaces/db-console/src/components/sideNavigation/sideNavigation.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import cn from "classnames"; +import * as React from "react"; import { Text, TextTypes } from "src/components"; diff --git a/pkg/ui/workspaces/db-console/src/components/text/text.tsx b/pkg/ui/workspaces/db-console/src/components/text/text.tsx index 1a8341e62475..283495e3d575 100644 --- a/pkg/ui/workspaces/db-console/src/components/text/text.tsx +++ b/pkg/ui/workspaces/db-console/src/components/text/text.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import cn from "classnames"; +import * as React from "react"; import "./text.styl"; diff --git a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx index 390c44368eba..d4d33cd0d23e 100644 --- a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.stories.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; +import { Tooltip } from "src/components/tooltip/tooltip"; +import { nodeLocalityFixture } from "src/components/tooltip/tooltip.fixtures"; +import { LivenessStatus } from "src/redux/nodes"; +import { styledWrapper } from "src/util/decorators"; import * as ClusterTooltips from "src/views/cluster/containers/clusterOverview/tooltips"; -import * as NodeOverviewTooltips from "src/views/cluster/containers/nodeOverview/tooltips"; -import * as CapacityArkTooltips from "src/views/clusterviz/components/nodeOrLocality/tooltips"; import * as GraphTooltips from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; -import { ToolTipWrapper } from "src/views/shared/components/toolTip"; +import * as NodeOverviewTooltips from "src/views/cluster/containers/nodeOverview/tooltips"; +import { AggregatedNodeStatus } from "src/views/cluster/containers/nodesOverview"; import { plainNodeTooltips, getNodeStatusDescription, getStatusDescription, NodeLocalityColumn, } from "src/views/cluster/containers/nodesOverview/tooltips"; -import { AggregatedNodeStatus } from "src/views/cluster/containers/nodesOverview"; -import { LivenessStatus } from "src/redux/nodes"; -import { Tooltip } from "src/components/tooltip/tooltip"; -import { styledWrapper } from "src/util/decorators"; -import { nodeLocalityFixture } from "src/components/tooltip/tooltip.fixtures"; +import * as CapacityArkTooltips from "src/views/clusterviz/components/nodeOrLocality/tooltips"; +import { ToolTipWrapper } from "src/views/shared/components/toolTip"; const triggerStyle: React.CSSProperties = { width: "300px", diff --git a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx index b7e0c2a0e019..4e3e3ee254a9 100644 --- a/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx +++ b/pkg/ui/workspaces/db-console/src/components/tooltip/tooltip.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import { default as AntTooltip, TooltipProps as AntTooltipProps, } from "antd/es/tooltip"; import cn from "classnames"; +import * as React from "react"; import "./tooltip.styl"; diff --git a/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx b/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx index 3713d3583dd0..91e2b14f8ef8 100644 --- a/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx +++ b/pkg/ui/workspaces/db-console/src/contexts/timezoneProvider.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { TimezoneContext } from "@cockroachlabs/cluster-ui"; import React, { useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { TimezoneContext } from "@cockroachlabs/cluster-ui"; +import { refreshSettings } from "src/redux/apiReducers"; import { selectClusterSettings, selectTimezoneSetting, } from "src/redux/clusterSettings"; -import { refreshSettings } from "src/redux/apiReducers"; export const TimezoneProvider = (props: any) => { // Refresh cluster settings if needed. diff --git a/pkg/ui/workspaces/db-console/src/index.tsx b/pkg/ui/workspaces/db-console/src/index.tsx index 87ec91fed83e..3f61dbe000dc 100644 --- a/pkg/ui/workspaces/db-console/src/index.tsx +++ b/pkg/ui/workspaces/db-console/src/index.tsx @@ -12,8 +12,8 @@ import * as ReactDOM from "react-dom"; import "src/polyfills"; import "src/protobufInit"; -import { alertDataSync } from "src/redux/alerts"; import { App } from "src/app"; +import { alertDataSync } from "src/redux/alerts"; import { history } from "src/redux/history"; import { createAdminUIStore } from "src/redux/state"; import "src/redux/analytics"; diff --git a/pkg/ui/workspaces/db-console/src/protobufInit.ts b/pkg/ui/workspaces/db-console/src/protobufInit.ts index 977d64116c83..f36fb5ab305c 100644 --- a/pkg/ui/workspaces/db-console/src/protobufInit.ts +++ b/pkg/ui/workspaces/db-console/src/protobufInit.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as protobuf from "protobufjs/minimal"; import Long from "long"; +import * as protobuf from "protobufjs/minimal"; protobuf.util.Long = Long as any; protobuf.configure(); diff --git a/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts b/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts index 3a58e5e6798b..aaa21830c8f5 100644 --- a/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/alerts.spec.ts @@ -8,18 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Store } from "redux"; -import moment from "moment-timezone"; import { createHashHistory } from "history"; import Long from "long"; +import moment from "moment-timezone"; +import { Store } from "redux"; import * as protos from "src/js/protos"; import { cockroach } from "src/js/protos"; +import { versionsSelector } from "src/redux/nodes"; import { API_PREFIX } from "src/util/api"; import fetchMock from "src/util/fetch-mock"; -import { versionsSelector } from "src/redux/nodes"; -import { AdminUIState, AppDispatch, createAdminUIStore } from "./state"; import { AlertLevel, alertDataSync, @@ -34,12 +33,6 @@ import { clusterPreserveDowngradeOptionDismissedSetting, clusterPreserveDowngradeOptionOvertimeSelector, } from "./alerts"; -import { - VERSION_DISMISSED_KEY, - INSTRUCTIONS_BOX_COLLAPSED_KEY, - setUIDataKey, - isInFlight, -} from "./uiData"; import { livenessReducerObj, versionReducerObj, @@ -49,6 +42,13 @@ import { settingsReducerObj, } from "./apiReducers"; import { loginSuccess } from "./login"; +import { AdminUIState, AppDispatch, createAdminUIStore } from "./state"; +import { + VERSION_DISMISSED_KEY, + INSTRUCTIONS_BOX_COLLAPSED_KEY, + setUIDataKey, + isInFlight, +} from "./uiData"; import MembershipStatus = cockroach.kv.kvserver.liveness.livenesspb.MembershipStatus; diff --git a/pkg/ui/workspaces/db-console/src/redux/alerts.ts b/pkg/ui/workspaces/db-console/src/redux/alerts.ts index c6c369415eba..22b24c796a45 100644 --- a/pkg/ui/workspaces/db-console/src/redux/alerts.ts +++ b/pkg/ui/workspaces/db-console/src/redux/alerts.ts @@ -13,36 +13,26 @@ * to display based on the current redux state. */ -import moment from "moment-timezone"; -import { createSelector } from "reselect"; -import { Store, Dispatch, Action, AnyAction } from "redux"; -import { ThunkAction } from "redux-thunk"; +import filter from "lodash/filter"; import has from "lodash/has"; -import without from "lodash/without"; import isEmpty from "lodash/isEmpty"; -import filter from "lodash/filter"; import isNil from "lodash/isNil"; +import without from "lodash/without"; +import moment from "moment-timezone"; +import { Store, Dispatch, Action, AnyAction } from "redux"; +import { ThunkAction } from "redux-thunk"; +import { createSelector } from "reselect"; -import { longToInt } from "src/util/fixLong"; -import * as docsURL from "src/util/docs"; import { singleVersionSelector, numNodesByVersionsTagSelector, numNodesByVersionsSelector, } from "src/redux/nodes"; +import * as docsURL from "src/util/docs"; +import { longToInt } from "src/util/fixLong"; import { getDataFromServer } from "../util/dataFromServer"; -import { LocalSetting } from "./localsettings"; -import { - VERSION_DISMISSED_KEY, - INSTRUCTIONS_BOX_COLLAPSED_KEY, - saveUIData, - loadUIData, - isInFlight, - UIDataState, - UIDataStatus, -} from "./uiData"; import { refreshCluster, refreshNodes, @@ -50,11 +40,21 @@ import { refreshHealth, refreshSettings, } from "./apiReducers"; -import { AdminUIState, AppDispatch } from "./state"; import { selectClusterSettings, selectClusterSettingVersion, } from "./clusterSettings"; +import { LocalSetting } from "./localsettings"; +import { AdminUIState, AppDispatch } from "./state"; +import { + VERSION_DISMISSED_KEY, + INSTRUCTIONS_BOX_COLLAPSED_KEY, + saveUIData, + loadUIData, + isInFlight, + UIDataState, + UIDataStatus, +} from "./uiData"; export enum AlertLevel { NOTIFICATION, diff --git a/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts b/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts index 0b63de0b0939..f57b7ac79ccd 100644 --- a/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/analytics.spec.ts @@ -15,9 +15,9 @@ import { Store } from "redux"; import * as protos from "src/js/protos"; -import { history } from "./history"; import { AnalyticsSync, defaultRedactions } from "./analytics"; import { clusterReducerObj, nodesReducerObj } from "./apiReducers"; +import { history } from "./history"; import { AdminUIState, createAdminUIStore } from "./state"; describe("analytics listener", function () { diff --git a/pkg/ui/workspaces/db-console/src/redux/analytics.ts b/pkg/ui/workspaces/db-console/src/redux/analytics.ts index 415619dafee0..48ff5fc65a29 100644 --- a/pkg/ui/workspaces/db-console/src/redux/analytics.ts +++ b/pkg/ui/workspaces/db-console/src/redux/analytics.ts @@ -10,14 +10,14 @@ import Analytics from "analytics-node"; import { Location } from "history"; -import { Store } from "redux"; import each from "lodash/each"; import isEmpty from "lodash/isEmpty"; +import { Store } from "redux"; import * as protos from "src/js/protos"; +import { history } from "src/redux/history"; import { versionsSelector } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; -import { history } from "src/redux/history"; import { COCKROACHLABS_ADDR } from "src/util/cockroachlabsAPI"; type ClusterResponse = protos.cockroach.server.serverpb.IClusterResponse; diff --git a/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts b/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts index ec69a368316b..fda5db1fae9f 100644 --- a/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/apiReducers.spec.ts @@ -9,10 +9,10 @@ // licenses/APL.txt. import { api as clusterUiApi, util } from "@cockroachlabs/cluster-ui"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createMemoryHistory } from "history"; import merge from "lodash/merge"; import moment from "moment-timezone"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { RouteComponentProps } from "react-router"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts b/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts index 7707906e3aa9..b6078e368aa1 100644 --- a/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts +++ b/pkg/ui/workspaces/db-console/src/redux/apiReducers.ts @@ -8,29 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action, combineReducers } from "redux"; -import { ThunkAction, ThunkDispatch } from "redux-thunk"; -import moment from "moment-timezone"; import { api as clusterUiApi, util, StmtInsightEvent, TxnInsightEvent, } from "@cockroachlabs/cluster-ui"; -import Long from "long"; -import { createSelector, ParametricSelector } from "reselect"; -import { RouteComponentProps } from "react-router"; -import map from "lodash/map"; import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; +import map from "lodash/map"; +import Long from "long"; +import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router"; +import { Action, combineReducers } from "redux"; +import { ThunkAction, ThunkDispatch } from "redux-thunk"; +import { createSelector, ParametricSelector } from "reselect"; -import * as protos from "src/js/protos"; -import { INodeStatus, RollupStoreMetrics } from "src/util/proto"; -import { versionCheck } from "src/util/cockroachlabsAPI"; import { VersionList } from "src/interfaces/cockroachlabs"; +import * as protos from "src/js/protos"; import * as api from "src/util/api"; +import { versionCheck } from "src/util/cockroachlabsAPI"; +import { INodeStatus, RollupStoreMetrics } from "src/util/proto"; -import { AdminUIState } from "./state"; import { CachedDataReducer, CachedDataReducerState, @@ -39,6 +38,7 @@ import { PaginatedCachedDataReducer, PaginatedCachedDataReducerState, } from "./cachedDataReducer"; +import { AdminUIState } from "./state"; const { generateStmtDetailsToID, HexStringToInt64String, generateTableID } = util; diff --git a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts index 6eef799e5864..488b5bbaec5f 100644 --- a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import isError from "lodash/isError" -import { Action } from "redux"; import moment from "moment-timezone"; +import { Action } from "redux"; import { CachedDataReducer, diff --git a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts index 784f58b36a19..82e12e26d598 100644 --- a/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts +++ b/pkg/ui/workspaces/db-console/src/redux/cachedDataReducer.ts @@ -16,18 +16,18 @@ import assert from "assert"; -import isNil from "lodash/isNil"; +import { util as clusterUiUtil } from "@cockroachlabs/cluster-ui"; +import { push } from "connected-react-router"; +import { createHashHistory } from "history"; import clone from "lodash/clone"; -import { Action } from "redux"; +import isNil from "lodash/isNil"; import moment from "moment-timezone"; -import { push } from "connected-react-router"; +import { Action } from "redux"; import { ThunkAction, ThunkDispatch } from "redux-thunk"; -import { createHashHistory } from "history"; -import { util as clusterUiUtil } from "@cockroachlabs/cluster-ui"; +import { PayloadAction, WithRequest } from "src/interfaces/action"; import { getLoginPage } from "src/redux/login"; import { APIRequestFn } from "src/util/api"; -import { PayloadAction, WithRequest } from "src/interfaces/action"; import { clearTenantCookie } from "./cookies"; diff --git a/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts b/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts index 1ab09041f4a5..b73d48519474 100644 --- a/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts +++ b/pkg/ui/workspaces/db-console/src/redux/clusterSettings/clusterSettings.selectors.ts @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; -import moment from "moment-timezone"; import { CoordinatedUniversalTime, util } from "@cockroachlabs/cluster-ui"; +import moment from "moment-timezone"; +import { createSelector } from "reselect"; -import { AdminUIState } from "src/redux/state"; import { cockroach } from "src/js/protos"; +import { AdminUIState } from "src/redux/state"; import { indexUnusedDuration } from "src/util/constants"; export const selectClusterSettings = createSelector( diff --git a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts index a8a03d6d8e5d..7d72e8227362 100644 --- a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.spec.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { expectSaga } from "redux-saga-test-plan"; import Analytics from "analytics-node"; +import { expectSaga } from "redux-saga-test-plan"; import { signUpEmailSubscription } from "./customAnalyticsSagas"; import { signUpForEmailSubscription } from "./customAnanlyticsActions"; diff --git a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts index 76bf98ed545f..19118f4d675a 100644 --- a/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/customAnalytics/customAnalyticsSagas.ts @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { call, put, takeEvery } from "redux-saga/effects"; import Analytics from "analytics-node"; +import { call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "src/interfaces/action"; -import { COCKROACHLABS_ADDR } from "src/util/cockroachlabsAPI"; import { emailSubscriptionAlertLocalSetting } from "src/redux/alerts"; +import { COCKROACHLABS_ADDR } from "src/util/cockroachlabsAPI"; import { EMAIL_SUBSCRIPTION_SIGN_UP, diff --git a/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts b/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts index 3c3f33e43009..751465497153 100644 --- a/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts +++ b/pkg/ui/workspaces/db-console/src/redux/hotRanges.ts @@ -10,8 +10,8 @@ import { createSelector } from "reselect"; -import { AdminUIState } from "src/redux/state"; import { cockroach } from "src/js/protos"; +import { AdminUIState } from "src/redux/state"; import { LocalSetting } from "./localsettings"; diff --git a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts index decf21445f64..a491180e290d 100644 --- a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.spec.ts @@ -12,18 +12,18 @@ import { expectSaga } from "redux-saga-test-plan"; import { call, select } from "redux-saga-test-plan/matchers"; import { throwError } from "redux-saga-test-plan/providers"; -import { resetIndexUsageStats } from "src/util/api"; import { cockroach } from "src/js/protos"; +import { resetIndexUsageStats } from "src/util/api"; -import { - resetIndexUsageStatsSaga, - selectIndexStatsKeys, -} from "./indexUsageStatsSagas"; import { resetIndexUsageStatsFailedAction, resetIndexUsageStatsCompleteAction, resetIndexUsageStatsAction, } from "./indexUsageStatsActions"; +import { + resetIndexUsageStatsSaga, + selectIndexStatsKeys, +} from "./indexUsageStatsSagas"; describe("Index Usage Stats sagas", () => { describe("resetIndexUsageStatsSaga", () => { diff --git a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts index 34de36835b1a..fe3f20bb27f0 100644 --- a/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/indexUsageStats/indexUsageStatsSagas.ts @@ -11,15 +11,15 @@ import { all, call, put, takeEvery, select } from "redux-saga/effects"; import { createSelector } from "reselect"; +import { PayloadAction } from "src/interfaces/action"; import { cockroach } from "src/js/protos"; import { invalidateIndexStats, KeyedCachedDataReducerState, refreshIndexStats, } from "src/redux/apiReducers"; -import { IndexStatsResponseMessage, resetIndexUsageStats } from "src/util/api"; import { AdminUIState } from "src/redux/state"; -import { PayloadAction } from "src/interfaces/action"; +import { IndexStatsResponseMessage, resetIndexUsageStats } from "src/util/api"; import { RESET_INDEX_USAGE_STATS, diff --git a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts index f04925559db0..600ae50bda57 100644 --- a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts +++ b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsActions.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action } from "redux"; import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; import { PayloadAction } from "src/interfaces/action"; diff --git a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts index 481a2610d57d..be980dc4cb8d 100644 --- a/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/jobs/jobsSagas.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { PayloadAction } from "@reduxjs/toolkit"; import { all, call, put, takeEvery } from "redux-saga/effects"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { refreshListExecutionDetailFiles } from "oss/src/redux/apiReducers"; diff --git a/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts b/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts index 802379e7cc9e..c6da2ec31e61 100644 --- a/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/localities.spec.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import merge from "lodash/merge"; import { createMemoryHistory } from "history"; +import merge from "lodash/merge"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/localities.ts b/pkg/ui/workspaces/db-console/src/redux/localities.ts index bbd1275213ff..5de1ff03d78e 100644 --- a/pkg/ui/workspaces/db-console/src/redux/localities.ts +++ b/pkg/ui/workspaces/db-console/src/redux/localities.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import groupBy from "lodash/groupBy"; import isEmpty from "lodash/isEmpty"; import mapValues from "lodash/mapValues"; -import groupBy from "lodash/groupBy"; import partition from "lodash/partition"; import { createSelector } from "reselect"; diff --git a/pkg/ui/workspaces/db-console/src/redux/localsettings.ts b/pkg/ui/workspaces/db-console/src/redux/localsettings.ts index bb6fe8744447..542743855873 100644 --- a/pkg/ui/workspaces/db-console/src/redux/localsettings.ts +++ b/pkg/ui/workspaces/db-console/src/redux/localsettings.ts @@ -19,12 +19,12 @@ * it should be given the full redux treatment with unique modification actions. */ -import { createSelector, Selector } from "reselect"; -import { Action } from "redux"; -import { call, takeEvery } from "redux-saga/effects"; +import { util } from "@cockroachlabs/cluster-ui"; import clone from "lodash/clone"; import isNil from "lodash/isNil"; -import { util } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; +import { call, takeEvery } from "redux-saga/effects"; +import { createSelector, Selector } from "reselect"; import { PayloadAction } from "src/interfaces/action"; diff --git a/pkg/ui/workspaces/db-console/src/redux/login.ts b/pkg/ui/workspaces/db-console/src/redux/login.ts index 03c22d31d8ed..70909dcad563 100644 --- a/pkg/ui/workspaces/db-console/src/redux/login.ts +++ b/pkg/ui/workspaces/db-console/src/redux/login.ts @@ -13,10 +13,10 @@ import { Action } from "redux"; import { ThunkAction } from "redux-thunk"; import { createSelector } from "reselect"; -import { userLogin, userLogout } from "src/util/api"; +import { cockroach } from "src/js/protos"; import { AdminUIState } from "src/redux/state"; import { LOGIN_PAGE, LOGOUT_PAGE } from "src/routes/login"; -import { cockroach } from "src/js/protos"; +import { userLogin, userLogout } from "src/util/api"; import { getDataFromServer } from "src/util/dataFromServer"; import { clearTenantCookie } from "./cookies"; diff --git a/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts b/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts index 77f111a4dcb9..b732e2165cbc 100644 --- a/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/metrics.spec.ts @@ -9,15 +9,15 @@ // licenses/APL.txt. import {keys} from "d3"; -import map from "lodash/map"; import flatMap from "lodash/flatMap"; +import map from "lodash/map"; import Long from "long"; +import { call, put, delay } from "redux-saga/effects"; import { expectSaga, testSaga } from "redux-saga-test-plan"; import * as matchers from "redux-saga-test-plan/matchers"; -import { call, put, delay } from "redux-saga/effects"; -import { queryTimeSeries, TimeSeriesQueryRequestMessage } from "src/util/api"; import * as protos from "src/js/protos"; +import { queryTimeSeries, TimeSeriesQueryRequestMessage } from "src/util/api"; import * as metrics from "./metrics"; diff --git a/pkg/ui/workspaces/db-console/src/redux/metrics.ts b/pkg/ui/workspaces/db-console/src/redux/metrics.ts index b86211104476..b4ca22063870 100644 --- a/pkg/ui/workspaces/db-console/src/redux/metrics.ts +++ b/pkg/ui/workspaces/db-console/src/redux/metrics.ts @@ -15,17 +15,17 @@ * in the reducer by a unique ID. */ -import { Action } from "redux"; -import { delay, take, fork, call, all, put } from "redux-saga/effects"; +import { util } from "@cockroachlabs/cluster-ui"; import clone from "lodash/clone"; +import flatMap from "lodash/flatMap"; import groupBy from "lodash/groupBy"; import map from "lodash/map"; -import flatMap from "lodash/flatMap"; -import { util } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; +import { delay, take, fork, call, all, put } from "redux-saga/effects"; -import { queryTimeSeries } from "src/util/api"; import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { queryTimeSeries } from "src/util/api"; type TSRequest = protos.cockroach.ts.tspb.TimeSeriesQueryRequest; type TSResponse = protos.cockroach.ts.tspb.TimeSeriesQueryResponse; diff --git a/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts b/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts index 565eefbcffff..f34032f47fd1 100644 --- a/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/nodes.spec.ts @@ -11,9 +11,10 @@ import { createHashHistory, createMemoryHistory } from "history"; import merge from "lodash/merge"; -import { MetricConstants, INodeStatus } from "src/util/proto"; import * as protos from "src/js/protos"; +import { MetricConstants, INodeStatus } from "src/util/proto"; +import { nodesReducerObj, livenessReducerObj } from "./apiReducers"; import { nodeDisplayNameByIDSelector, selectCommissionedNodeStatuses, @@ -22,7 +23,6 @@ import { sumNodeStats, numNodesByVersionsTagSelector, } from "./nodes"; -import { nodesReducerObj, livenessReducerObj } from "./apiReducers"; import { AdminUIState, createAdminUIStore } from "./state"; function makeNodesState( diff --git a/pkg/ui/workspaces/db-console/src/redux/nodes.ts b/pkg/ui/workspaces/db-console/src/redux/nodes.ts index 153eb8eeee39..0a5187d2c798 100644 --- a/pkg/ui/workspaces/db-console/src/redux/nodes.ts +++ b/pkg/ui/workspaces/db-console/src/redux/nodes.ts @@ -8,9 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; import countBy from "lodash/countBy" import each from "lodash/each" import filter from "lodash/filter" +import first from "lodash/first" +import flow from "lodash/flow" +import groupBy from "lodash/groupBy" import head from "lodash/head" import isArray from "lodash/isArray" import isEmpty from "lodash/isEmpty" @@ -18,20 +22,16 @@ import isNil from "lodash/isNil" import isUndefined from "lodash/isUndefined" import keyBy from "lodash/keyBy" import map from "lodash/map" -import uniqBy from "lodash/uniqBy" -import uniq from "lodash/uniq" -import first from "lodash/first" import sortBy from "lodash/sortBy" -import groupBy from "lodash/groupBy" -import flow from "lodash/flow" +import uniq from "lodash/uniq" +import uniqBy from "lodash/uniqBy" import { createSelector } from "reselect"; -import { util } from "@cockroachlabs/cluster-ui"; import * as protos from "src/js/protos"; +import { cockroach } from "src/js/protos"; import { Pick } from "src/util/pick"; -import { NoConnection } from "src/views/reports/containers/network"; import { nullOfReturnType } from "src/util/types"; -import { cockroach } from "src/js/protos"; +import { NoConnection } from "src/views/reports/containers/network"; import { AdminUIState } from "./state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts index 8e3fe9adba6e..ae62d4eaeda6 100644 --- a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.spec.ts @@ -13,6 +13,7 @@ import { channel } from "redux-saga"; import { delay, call } from "redux-saga/effects"; import { expectSaga, testSaga } from "redux-saga-test-plan"; +import { queryManagerReducer } from "./reducer"; import { refresh, autoRefresh, @@ -25,7 +26,6 @@ import { DEFAULT_REFRESH_INTERVAL, DEFAULT_RETRY_DELAY, } from "./saga"; -import { queryManagerReducer } from "./reducer"; describe("Query Management Saga", function () { let queryCounterCalled = 0; diff --git a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts index 4a6728e88ed5..67d595da821f 100644 --- a/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts +++ b/pkg/ui/workspaces/db-console/src/redux/queryManager/saga.ts @@ -8,6 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; import moment from "moment-timezone"; import { Action } from "redux"; import { channel, Task, Channel } from "redux-saga"; @@ -21,7 +22,6 @@ import { take, delay, } from "redux-saga/effects"; -import { util } from "@cockroachlabs/cluster-ui"; import { queryBegin, queryComplete, queryError } from "./reducer"; diff --git a/pkg/ui/workspaces/db-console/src/redux/sagas.ts b/pkg/ui/workspaces/db-console/src/redux/sagas.ts index 1b5c3fdf8066..5d352e94f224 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/sagas.ts @@ -12,15 +12,15 @@ import { all, fork } from "redux-saga/effects"; import { timeScaleSaga } from "src/redux/timeScale"; -import { queryMetricsSaga } from "./metrics"; -import { localSettingsSaga } from "./localsettings"; -import { customAnalyticsSaga } from "./customAnalytics"; -import { statementsSaga } from "./statements"; import { analyticsSaga } from "./analyticsSagas"; -import { sessionsSaga } from "./sessions"; -import { sqlStatsSaga } from "./sqlStats"; +import { customAnalyticsSaga } from "./customAnalytics"; import { indexUsageStatsSaga } from "./indexUsageStats"; import { jobsSaga } from "./jobs/jobsSagas"; +import { localSettingsSaga } from "./localsettings"; +import { queryMetricsSaga } from "./metrics"; +import { sessionsSaga } from "./sessions"; +import { sqlStatsSaga } from "./sqlStats"; +import { statementsSaga } from "./statements"; export default function* rootSaga() { yield all([ diff --git a/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx b/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx index 38c6cd9b6cf5..3b884a17d43b 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx +++ b/pkg/ui/workspaces/db-console/src/redux/sessions/sessionsSagas.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { all, call, put, takeEvery } from "redux-saga/effects"; import { Action } from "redux"; +import { all, call, put, takeEvery } from "redux-saga/effects"; import { PayloadAction } from "src/interfaces/action"; -import { terminateQuery, terminateSession } from "src/util/api"; -import { invalidateSessions, refreshSessions } from "src/redux/apiReducers"; +import { cockroach } from "src/js/protos"; import { terminateQueryAlertLocalSetting, terminateSessionAlertLocalSetting, } from "src/redux/alerts"; -import { cockroach } from "src/js/protos"; +import { invalidateSessions, refreshSessions } from "src/redux/apiReducers"; +import { terminateQuery, terminateSession } from "src/util/api"; import ICancelSessionRequest = cockroach.server.serverpb.ICancelSessionRequest; diff --git a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts index dafe44659444..df7ba30017ed 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.spec.ts @@ -12,16 +12,16 @@ import { expectSaga } from "redux-saga-test-plan"; import { call } from "redux-saga-test-plan/matchers"; import { throwError } from "redux-saga-test-plan/providers"; -import { resetSQLStats } from "src/util/api"; +import { cockroach } from "src/js/protos"; import { apiReducersReducer, invalidateStatements, invalidateAllStatementDetails, } from "src/redux/apiReducers"; -import { cockroach } from "src/js/protos"; +import { resetSQLStats } from "src/util/api"; -import { resetSQLStatsSaga } from "./sqlStatsSagas"; import { resetSQLStatsFailedAction } from "./sqlStatsActions"; +import { resetSQLStatsSaga } from "./sqlStatsSagas"; describe("SQL Stats sagas", () => { describe("resetSQLStatsSaga", () => { diff --git a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts index 65764853dc97..cd01254ae948 100644 --- a/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/sqlStats/sqlStatsSagas.ts @@ -11,11 +11,11 @@ import { all, call, put, takeEvery } from "redux-saga/effects"; import { cockroach } from "src/js/protos"; -import { resetSQLStats } from "src/util/api"; import { invalidateAllStatementDetails, invalidateStatements, } from "src/redux/apiReducers"; +import { resetSQLStats } from "src/util/api"; import { RESET_SQL_STATS, resetSQLStatsFailedAction } from "./sqlStatsActions"; diff --git a/pkg/ui/workspaces/db-console/src/redux/state.ts b/pkg/ui/workspaces/db-console/src/redux/state.ts index f2123dd87a6a..6cafe8fd389c 100644 --- a/pkg/ui/workspaces/db-console/src/redux/state.ts +++ b/pkg/ui/workspaces/db-console/src/redux/state.ts @@ -8,6 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { + connectRouter, + routerMiddleware, + RouterState, +} from "connected-react-router"; +import { History } from "history"; import identity from "lodash/identity"; import { createStore, @@ -19,27 +26,20 @@ import { } from "redux"; import createSagaMiddleware from "redux-saga"; import thunk, { ThunkDispatch } from "redux-thunk"; -import { - connectRouter, - routerMiddleware, - RouterState, -} from "connected-react-router"; -import { History } from "history"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { createSelector } from "reselect"; import { DataFromServer } from "src/util/dataFromServer"; +import { initializeAnalytics } from "./analytics"; import { apiReducersReducer, APIReducersState } from "./apiReducers"; import { hoverReducer, HoverState } from "./hover"; import { localSettingsReducer, LocalSettingsState } from "./localsettings"; +import { loginReducer, LoginAPIState } from "./login"; import { metricsReducer, MetricsState } from "./metrics"; import { queryManagerReducer, QueryManagerState } from "./queryManager/reducer"; +import rootSaga from "./sagas"; import { timeScaleReducer, TimeScaleState } from "./timeScale"; import { uiDataReducer, UIDataState } from "./uiData"; -import { loginReducer, LoginAPIState } from "./login"; -import rootSaga from "./sagas"; -import { initializeAnalytics } from "./analytics"; import FeatureFlags = cockroach.server.serverpb.FeatureFlags; diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts index a4199a876dd7..a81c6e4c702d 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsActions.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action } from "redux"; import { TimeScale, api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import { Action } from "redux"; import { PayloadAction } from "src/interfaces/action"; diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts index e864b2094c46..f7439e2af2ff 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.spec.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { expectSaga } from "redux-saga-test-plan"; import { call } from "redux-saga-test-plan/matchers"; import { throwError } from "redux-saga-test-plan/providers"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; import { PayloadAction, WithRequest } from "src/interfaces/action"; import { diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts index f55a5c0987dd..c608831603c7 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSagas.ts @@ -8,6 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { + TimeScale, + api as clusterApi, + api as clusterUiApi, +} from "@cockroachlabs/cluster-ui"; import { all, call, @@ -16,23 +21,18 @@ import { takeEvery, takeLatest, } from "redux-saga/effects"; -import { - TimeScale, - api as clusterApi, - api as clusterUiApi, -} from "@cockroachlabs/cluster-ui"; import { PayloadAction, WithRequest } from "src/interfaces/action"; +import { + createStatementDiagnosticsAlertLocalSetting, + cancelStatementDiagnosticsAlertLocalSetting, +} from "src/redux/alerts"; import { invalidateStatementDiagnosticsRequests, RECEIVE_STATEMENT_DIAGNOSTICS_REPORT, refreshStatementDiagnosticsRequests, statementDiagnosticInvalidationPeriod, } from "src/redux/apiReducers"; -import { - createStatementDiagnosticsAlertLocalSetting, - cancelStatementDiagnosticsAlertLocalSetting, -} from "src/redux/alerts"; import { setTimeScale } from "src/redux/timeScale"; import { diff --git a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts index f3ebc42e29a0..df0438e13d0a 100644 --- a/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts +++ b/pkg/ui/workspaces/db-console/src/redux/statements/statementsSelectors.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import orderBy from "lodash/orderBy"; +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import flow from "lodash/flow"; import groupBy from "lodash/groupBy"; import mapValues from "lodash/mapValues"; -import flow from "lodash/flow"; -import { createSelector } from "reselect"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import orderBy from "lodash/orderBy"; import moment from "moment-timezone"; +import { createSelector } from "reselect"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/redux/timeScale.ts b/pkg/ui/workspaces/db-console/src/redux/timeScale.ts index 3ebc67f52696..48c0b7f30e68 100644 --- a/pkg/ui/workspaces/db-console/src/redux/timeScale.ts +++ b/pkg/ui/workspaces/db-console/src/redux/timeScale.ts @@ -13,19 +13,19 @@ * metrics graphs in the ui. */ -import { Action } from "redux"; -import { put, takeEvery, all } from "redux-saga/effects"; -import cloneDeep from "lodash/cloneDeep"; import { defaultTimeScaleOptions, TimeScale } from "@cockroachlabs/cluster-ui"; +import cloneDeep from "lodash/cloneDeep"; import moment from "moment-timezone"; +import { Action } from "redux"; +import { put, takeEvery, all } from "redux-saga/effects"; import { createSelector } from "reselect"; import { PayloadAction } from "src/interfaces/action"; -import { AdminUIState } from "src/redux/state"; import { getValueFromSessionStorage, setLocalSetting, } from "src/redux/localsettings"; +import { AdminUIState } from "src/redux/state"; import { invalidateExecutionInsights, diff --git a/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts b/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts index 1ba25000302d..4ac744bdd7ed 100644 --- a/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts +++ b/pkg/ui/workspaces/db-console/src/redux/uiData.spec.ts @@ -9,12 +9,12 @@ // licenses/APL.txt. import keys from "lodash/keys" -import { Action } from "redux"; import * as protobuf from "protobufjs/minimal"; +import { Action } from "redux"; -import fetchMock from "src/util/fetch-mock"; import * as protos from "src/js/protos"; import * as api from "src/util/api"; +import fetchMock from "src/util/fetch-mock"; import * as uidata from "./uiData"; diff --git a/pkg/ui/workspaces/db-console/src/redux/uiData.ts b/pkg/ui/workspaces/db-console/src/redux/uiData.ts index 5583d134ac62..7286006a19fc 100644 --- a/pkg/ui/workspaces/db-console/src/redux/uiData.ts +++ b/pkg/ui/workspaces/db-console/src/redux/uiData.ts @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Action, Dispatch } from "redux"; -import * as protobuf from "protobufjs/minimal"; -import isNil from "lodash/isNil"; import clone from "lodash/clone"; import each from "lodash/each"; import filter from "lodash/filter"; -import map from "lodash/map"; import has from "lodash/has"; +import isNil from "lodash/isNil"; +import map from "lodash/map"; +import * as protobuf from "protobufjs/minimal"; +import { Action, Dispatch } from "redux"; -import { getUIData, setUIData } from "src/util/api"; import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { getUIData, setUIData } from "src/util/api"; import { AdminUIState } from "./state"; diff --git a/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx b/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx index 6ae89210162f..6e625918bcf7 100644 --- a/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/routes/RedirectToStatementDetails.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { StatementLinkTarget } from "@cockroachlabs/cluster-ui"; import React from "react"; import { Redirect, match as Match } from "react-router-dom"; -import { StatementLinkTarget } from "@cockroachlabs/cluster-ui"; -import { getMatchParamByName } from "src/util/query"; import { appAttr, databaseAttr, implicitTxnAttr, statementAttr, } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; type Props = { match: Match; diff --git a/pkg/ui/workspaces/db-console/src/routes/visualization.tsx b/pkg/ui/workspaces/db-console/src/routes/visualization.tsx index bab0c6361572..b5575659ebfb 100644 --- a/pkg/ui/workspaces/db-console/src/routes/visualization.tsx +++ b/pkg/ui/workspaces/db-console/src/routes/visualization.tsx @@ -11,8 +11,8 @@ import React from "react"; import { Route, Switch, Redirect } from "react-router-dom"; -import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; import ClusterOverview from "src/views/cluster/containers/clusterOverview"; +import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; class NodesWrapper extends React.Component<{}, {}> { render() { diff --git a/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx b/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx index 320fc88321fc..06836c31d2d7 100644 --- a/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx +++ b/pkg/ui/workspaces/db-console/src/test-utils/connectedMount.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { mount, ReactWrapper } from "enzyme"; -import { Action, Store } from "redux"; -import { Provider } from "react-redux"; import { ConnectedRouter } from "connected-react-router"; +import { mount, ReactWrapper } from "enzyme"; import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; +import { Action, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts b/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts index d3f46ed1a7d4..32a2d10c8f98 100644 --- a/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts +++ b/pkg/ui/workspaces/db-console/src/test-utils/fakeMetricsDataGenerationMiddleware.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Store, Action, Dispatch } from "redux"; -import Long from "long"; import clone from "lodash/clone"; +import Long from "long"; +import { Store, Action, Dispatch } from "redux"; -import { AdminUIState } from "src/redux/state"; -import { RECEIVE, RequestWithResponse, WithID } from "src/redux/metrics"; import { PayloadAction } from "src/interfaces/action"; import { cockroach } from "src/js/protos"; +import { RECEIVE, RequestWithResponse, WithID } from "src/redux/metrics"; +import { AdminUIState } from "src/redux/state"; import ITimeSeriesDatapoint = cockroach.ts.tspb.ITimeSeriesDatapoint; diff --git a/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx b/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx index 524ce90c30a4..17e5ae2f81f7 100644 --- a/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx +++ b/pkg/ui/workspaces/db-console/src/test-utils/renderWithProviders.tsx @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { configureStore } from "@reduxjs/toolkit"; -import { Provider } from "react-redux"; -import { createMemoryHistory } from "history"; import { connectRouter } from "connected-react-router"; +import { createMemoryHistory } from "history"; +import React from "react"; +import { Provider } from "react-redux"; -import { AdminUIState, flagsReducer } from "src/redux/state"; import { apiReducersReducer } from "src/redux/apiReducers"; import { hoverReducer } from "src/redux/hover"; import { localSettingsReducer } from "src/redux/localsettings"; +import { loginReducer } from "src/redux/login"; import { metricsReducer } from "src/redux/metrics"; import { queryManagerReducer } from "src/redux/queryManager/reducer"; +import { AdminUIState, flagsReducer } from "src/redux/state"; import { timeScaleReducer } from "src/redux/timeScale"; import { uiDataReducer } from "src/redux/uiData"; -import { loginReducer } from "src/redux/login"; import type { PreloadedState } from "@reduxjs/toolkit"; diff --git a/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts b/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts index 194fc4baab75..5f3b9aa5ccc6 100644 --- a/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/analytics/trackPaginate.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import get from "lodash/get"; -import isString from "lodash/isString"; import isNumber from "lodash/isNumber"; +import isString from "lodash/isString"; import { track } from "./trackPaginate"; diff --git a/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts b/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts index 82323d17c3d8..f19a6ad1499d 100644 --- a/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/analytics/trackSearch.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import get from "lodash/get"; -import isString from "lodash/isString"; import isNumber from "lodash/isNumber"; +import isString from "lodash/isString"; import { track } from "./trackSearch"; diff --git a/pkg/ui/workspaces/db-console/src/util/api.spec.ts b/pkg/ui/workspaces/db-console/src/util/api.spec.ts index 363394489e32..958b86918b8b 100644 --- a/pkg/ui/workspaces/db-console/src/util/api.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/api.spec.ts @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; import isError from "lodash/isError"; import startsWith from "lodash/startsWith"; -import moment from "moment-timezone"; import Long from "long"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import moment from "moment-timezone"; import { REMOTE_DEBUGGING_ERROR_TEXT, diff --git a/pkg/ui/workspaces/db-console/src/util/decorators.tsx b/pkg/ui/workspaces/db-console/src/util/decorators.tsx index 765bd6fa6ef8..01cf8250ff42 100644 --- a/pkg/ui/workspaces/db-console/src/util/decorators.tsx +++ b/pkg/ui/workspaces/db-console/src/util/decorators.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { ConnectedRouter, connectRouter } from "connected-react-router"; +import { createMemoryHistory } from "history"; import React from "react"; -import { RenderFunction } from "storybook__react"; import { Provider } from "react-redux"; import { combineReducers, createStore } from "redux"; -import { ConnectedRouter, connectRouter } from "connected-react-router"; -import { createMemoryHistory } from "history"; +import { RenderFunction } from "storybook__react"; const history = createMemoryHistory(); const routerReducer = connectRouter(history); diff --git a/pkg/ui/workspaces/db-console/src/util/fakeApi.ts b/pkg/ui/workspaces/db-console/src/util/fakeApi.ts index 1f12924efb29..00578ca5185d 100644 --- a/pkg/ui/workspaces/db-console/src/util/fakeApi.ts +++ b/pkg/ui/workspaces/db-console/src/util/fakeApi.ts @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as $protobuf from "protobufjs"; import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; -import moment from "moment-timezone"; import { SqlTxnResult } from "@cockroachlabs/cluster-ui/dist/types/api"; +import moment from "moment-timezone"; +import * as $protobuf from "protobufjs"; import { cockroach } from "src/js/protos"; import { API_PREFIX, STATUS_PREFIX } from "src/util/api"; diff --git a/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx b/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx index 0aeaeb273b1f..d46a89fc826b 100644 --- a/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx +++ b/pkg/ui/workspaces/db-console/src/util/highlightedText.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./highlightedText.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/util/localities.spec.ts b/pkg/ui/workspaces/db-console/src/util/localities.spec.ts index 44294e8cb6a5..675c5859f07c 100644 --- a/pkg/ui/workspaces/db-console/src/util/localities.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/localities.spec.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import * as protos from "src/js/protos"; -import { LocalityTier, LocalityTree } from "src/redux/localities"; import { cockroach } from "src/js/protos"; +import { LocalityTier, LocalityTree } from "src/redux/localities"; import { generateLocalityRoute, diff --git a/pkg/ui/workspaces/db-console/src/util/localities.ts b/pkg/ui/workspaces/db-console/src/util/localities.ts index 65a1f1cfe56d..f9c1d36f7d67 100644 --- a/pkg/ui/workspaces/db-console/src/util/localities.ts +++ b/pkg/ui/workspaces/db-console/src/util/localities.ts @@ -9,8 +9,8 @@ // licenses/APL.txt. import forEach from "lodash/forEach"; -import isNil from "lodash/isNil"; import isEmpty from "lodash/isEmpty"; +import isNil from "lodash/isNil"; import values from "lodash/values"; import { LocalityTier, LocalityTree } from "src/redux/localities"; diff --git a/pkg/ui/workspaces/db-console/src/util/locations.ts b/pkg/ui/workspaces/db-console/src/util/locations.ts index e4503bc86076..600197e29784 100644 --- a/pkg/ui/workspaces/db-console/src/util/locations.ts +++ b/pkg/ui/workspaces/db-console/src/util/locations.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import some from "lodash/some"; import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; +import some from "lodash/some"; import values from "lodash/values"; import { LocalityTier, LocalityTree } from "src/redux/localities"; diff --git a/pkg/ui/workspaces/db-console/src/util/query.spec.ts b/pkg/ui/workspaces/db-console/src/util/query.spec.ts index 284a1f19112c..9cc176838d91 100644 --- a/pkg/ui/workspaces/db-console/src/util/query.spec.ts +++ b/pkg/ui/workspaces/db-console/src/util/query.spec.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Location } from "history"; import mapValues from "lodash/mapValues"; import toString from "lodash/toString"; -import { Location } from "history"; import Long from "long"; import { propsToQueryString, queryByName } from "./query"; diff --git a/pkg/ui/workspaces/db-console/src/util/query.ts b/pkg/ui/workspaces/db-console/src/util/query.ts index 220ae483965a..650e29536334 100644 --- a/pkg/ui/workspaces/db-console/src/util/query.ts +++ b/pkg/ui/workspaces/db-console/src/util/query.ts @@ -9,9 +9,9 @@ // licenses/APL.txt. import { Location } from "history"; +import compact from "lodash/compact"; import isNull from "lodash/isNull"; import isUndefined from "lodash/isUndefined"; -import compact from "lodash/compact"; import map from "lodash/map"; import { match as Match } from "react-router-dom"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx index 6292cfb5fb99..77c540705654 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/Search/index.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. import { Button, Form, Input } from "antd"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import CancelIcon from "assets/cancel.svg"; import SearchIcon from "assets/search.svg"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx index bc84dc934a2f..92f8b6702793 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/Search/search.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { Search } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx index f145992a9048..f608e13c6202 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/index.tsx @@ -14,8 +14,8 @@ import { Link, withRouter, RouteComponentProps } from "react-router-dom"; import { SideNavigation } from "src/components"; import "./navigation-bar.styl"; -import { AdminUIState } from "src/redux/state"; import { isSingleNodeCluster } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; interface RouteParam { path: string; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx index b26673a1aea6..738c49063557 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/layoutSidebar/layoutSidebar.spec.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow } from "enzyme"; import { createMemoryHistory, History } from "history"; +import React from "react"; import { match as Match } from "react-router"; import { Sidebar } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx index caeb19bfb459..d2239f4b8bc7 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/loginIndicator/loginIndicator.tsx @@ -11,12 +11,12 @@ import React from "react"; import { connect } from "react-redux"; +import { doLogout, LoginState, selectLoginState } from "src/redux/login"; import { AdminUIState, AppDispatch } from "src/redux/state"; import { trustIcon } from "src/util/trust"; +import UserMenu from "src/views/app/components/userMenu"; import Popover from "src/views/shared/components/popover"; import UserAvatar from "src/views/shared/components/userAvatar"; -import UserMenu from "src/views/app/components/userMenu"; -import { doLogout, LoginState, selectLoginState } from "src/redux/login"; import unlockedIcon from "!!raw-loader!assets/unlocked.svg"; import "./loginIndicator.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx index 8caf84320b96..2573c750e07b 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.spec.tsx @@ -7,9 +7,9 @@ // 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. -import React from "react"; import { shallow } from "enzyme"; import fetchMock from "fetch-mock"; +import React from "react"; import { getCookieValue } from "src/redux/cookies"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx index 9e41e4182ea3..3941b48a95c4 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/components/tenantDropdown/tenantDropdown.tsx @@ -7,8 +7,8 @@ // 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. -import React from "react"; import { Dropdown } from "@cockroachlabs/cluster-ui"; +import React from "react"; import { getCookieValue, setCookie } from "src/redux/cookies"; import { isSystemTenant } from "src/redux/tenants"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx index db06caa362c5..be2043d9014a 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/alertBanner/index.tsx @@ -9,12 +9,12 @@ // licenses/APL.txt. import React from "react"; -import { Action, Dispatch, bindActionCreators } from "redux"; import { connect } from "react-redux"; +import { Action, Dispatch, bindActionCreators } from "redux"; -import { AlertBox } from "src/views/shared/components/alertBox"; import { Alert, bannerAlertsSelector } from "src/redux/alerts"; import { AdminUIState } from "src/redux/state"; +import { AlertBox } from "src/views/shared/components/alertBox"; import { AlertMessage } from "src/views/shared/components/alertMessage"; import "./alertbanner.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx index 5603c0325a7d..f95f32213eda 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/layout/index.tsx @@ -8,24 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Badge } from "@cockroachlabs/cluster-ui"; import React from "react"; import { Helmet } from "react-helmet"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; -import { Badge } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -import NavigationBar from "src/views/app/components/layoutSidebar"; -import ErrorBoundary from "src/views/app/components/errorMessage/errorBoundary"; -import TimeWindowManager from "src/views/app/containers/metricsTimeManager"; -import AlertBanner from "src/views/app/containers/alertBanner"; -import RequireLogin from "src/views/login/requireLogin"; -import { - clusterIdSelector, - clusterNameSelector, - clusterVersionLabelSelector, -} from "src/redux/nodes"; -import { AdminUIState } from "src/redux/state"; -import LoginIndicator from "src/views/app/components/loginIndicator"; import { GlobalNavigation, CockroachLabsLockupIcon, @@ -35,7 +23,19 @@ import { Text, TextTypes, } from "src/components"; +import { + clusterIdSelector, + clusterNameSelector, + clusterVersionLabelSelector, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import { getDataFromServer } from "src/util/dataFromServer"; +import ErrorBoundary from "src/views/app/components/errorMessage/errorBoundary"; +import NavigationBar from "src/views/app/components/layoutSidebar"; +import LoginIndicator from "src/views/app/components/loginIndicator"; +import AlertBanner from "src/views/app/containers/alertBanner"; +import TimeWindowManager from "src/views/app/containers/metricsTimeManager"; +import RequireLogin from "src/views/login/requireLogin"; import "./layout.styl"; import "./layoutPanel.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx index c4bd786b02e2..f9d3b37f9de8 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/licenseNotification/licenseNotification.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Tooltip } from "antd"; -import { useSelector } from "react-redux"; import classNames from "classnames/bind"; import moment from "moment"; +import React from "react"; +import { useSelector } from "react-redux"; import ErrorIcon from "assets/error-circle.svg"; import InfoIcon from "assets/info-filled-circle.svg"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx index 27aa0547b3e3..ececd9ee571a 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/index.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import isEqual from "lodash/isEqual"; +import moment from "moment-timezone"; import React from "react"; import { connect } from "react-redux"; -import moment from "moment-timezone"; -import isEqual from "lodash/isEqual"; import { AdminUIState } from "src/redux/state"; import * as timewindow from "src/redux/timeScale"; diff --git a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx index 80dab4baba59..52fe6e6bf615 100644 --- a/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/app/containers/metricsTimeManager/metricsTimeManager.spec.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow } from "enzyme"; -import moment from "moment-timezone"; import clone from "lodash/clone"; +import moment from "moment-timezone"; +import React from "react"; import * as timewindow from "src/redux/timeScale"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx index bf5f2def85d6..9b025b9c9e1a 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/index.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import moment from "moment-timezone"; -import { createSelector } from "reselect"; import { calculateXAxisDomain, calculateYAxisDomain, @@ -24,15 +21,20 @@ import { TimeWindow, WithTimezone, } from "@cockroachlabs/cluster-ui"; -import uPlot from "uplot"; -import "uplot/dist/uPlot.min.css"; -import Long from "long"; import { Tooltip } from "antd"; -import flatMap from "lodash/flatMap"; import filter from "lodash/filter"; +import flatMap from "lodash/flatMap"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; +import { createSelector } from "reselect"; +import uPlot from "uplot"; +import "uplot/dist/uPlot.min.css"; import * as protos from "src/js/protos"; import { hoverOff, hoverOn, HoverState } from "src/redux/hover"; +import { isSecondaryTenant } from "src/redux/tenants"; +import { unique } from "src/util/arrays"; import { findChildrenOfType } from "src/util/find"; import { canShowMetric, @@ -40,6 +42,7 @@ import { formatMetricData, formattedSeries, } from "src/views/cluster/util/graphs"; +import { MonitoringIcon } from "src/views/shared/components/icons/monitoring"; import { Axis, AxisProps, @@ -48,9 +51,6 @@ import { MetricsDataComponentProps, QueryTimeInfo, } from "src/views/shared/components/metricQuery"; -import { isSecondaryTenant } from "src/redux/tenants"; -import { MonitoringIcon } from "src/views/shared/components/icons/monitoring"; -import { unique } from "src/util/arrays"; import "./linegraph.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx index b8bbe5dae8fc..34c1b0bccf9c 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/components/linegraph/linegraph.spec.tsx @@ -8,22 +8,22 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { shallow, ShallowWrapper } from "enzyme"; -import React from "react"; -import uPlot from "uplot"; -import isEmpty from "lodash/isEmpty"; -import flatMap from "lodash/flatMap"; import { calculateXAxisDomain, calculateYAxisDomain, util, } from "@cockroachlabs/cluster-ui"; +import { shallow, ShallowWrapper } from "enzyme"; +import flatMap from "lodash/flatMap"; +import isEmpty from "lodash/isEmpty"; import Long from "long"; +import React from "react"; +import uPlot from "uplot"; -import * as timewindow from "src/redux/timeScale"; import * as protos from "src/js/protos"; -import { Axis } from "src/views/shared/components/metricQuery"; +import * as timewindow from "src/redux/timeScale"; import { configureUPlotLineChart } from "src/views/cluster/util/graphs"; +import { Axis } from "src/views/shared/components/metricQuery"; import LineGraph, { fillGaps, InternalLineGraph, OwnProps } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx index 8ca81c7108cf..697fdaab85fa 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/capacity.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import d3 from "d3"; import { util } from "@cockroachlabs/cluster-ui"; +import d3 from "d3"; const LOW_DISK_SPACE_RATIO = 0.15; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx index a79ad6cfbc5b..6d67b10afa6d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/index.tsx @@ -8,21 +8,21 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; import classNames from "classnames"; import d3 from "d3"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { createSelector } from "reselect"; -import { util } from "@cockroachlabs/cluster-ui"; import spinner from "assets/spinner.gif"; -import { AdminUIState } from "src/redux/state"; -import { nodeSumsSelector } from "src/redux/nodes"; -import createChartComponent from "src/views/shared/util/d3-react"; import { refreshNodes, refreshLiveness } from "src/redux/apiReducers"; -import OverviewListAlerts from "src/views/shared/containers/alerts/overviewListAlerts"; +import { nodeSumsSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import EmailSubscription from "src/views/dashboard/emailSubscription"; +import OverviewListAlerts from "src/views/shared/containers/alerts/overviewListAlerts"; +import createChartComponent from "src/views/shared/util/d3-react"; import capacityChart from "./capacity"; import "./cluster.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx index abd586e0ccd3..b0fc3cb4218c 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/clusterOverview/tooltips.tsx @@ -11,6 +11,7 @@ import React from "react"; import { Tooltip, Anchor } from "src/components"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { clusterStore, nodeLivenessIssues, @@ -18,7 +19,6 @@ import { reviewOfCockroachTerminology, howAreCapacityMetricsCalculatedOverview, } from "src/util/docs"; -import { TooltipProps } from "src/components/tooltip/tooltip"; export const CapacityUsageTooltip: React.FC<TooltipProps> = props => ( <Tooltip diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/index.tsx index 2e4977db5db0..87fe27b4d200 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/index.tsx @@ -8,21 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Loading } from "@cockroachlabs/cluster-ui"; +import forEach from "lodash/forEach"; import map from "lodash/map"; import sortBy from "lodash/sortBy"; -import forEach from "lodash/forEach"; import React from "react"; -import { createSelector } from "reselect"; -import { connect } from "react-redux"; import Helmet from "react-helmet"; +import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { Loading } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; import { InfoTooltip } from "src/components/infoTooltip"; -import * as docsURL from "src/util/docs"; -import { FixLong } from "src/util/fixLong"; import { cockroach } from "src/js/protos"; -import { AdminUIState } from "src/redux/state"; import { refreshDataDistribution, refreshNodes, @@ -34,6 +31,9 @@ import { selectLivenessRequestStatus, selectNodeRequestStatus, } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import * as docsURL from "src/util/docs"; +import { FixLong } from "src/util/fixLong"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; import ReplicaMatrix, { SchemaObject } from "./replicaMatrix"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx index a5ab2ec3d77d..b2a2865e985d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; +import classNames from "classnames"; import isEqual from "lodash/isEqual"; import React, { Component } from "react"; -import classNames from "classnames"; -import { util } from "@cockroachlabs/cluster-ui"; -import { ToolTipWrapper } from "src/views/shared/components/toolTip"; import { cockroach, google } from "src/js/protos"; +import { ToolTipWrapper } from "src/views/shared/components/toolTip"; import { TreeNode, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/tree.ts b/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/tree.ts index 9f29d7038605..944efbf87b24 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/tree.ts +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/dataDistribution/tree.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import concat from "lodash/concat"; import forEach from "lodash/forEach"; import has from "lodash/has"; import isEqual from "lodash/isEqual"; +import range from "lodash/range"; import some from "lodash/some"; import sumBy from "lodash/sumBy"; -import range from "lodash/range"; -import concat from "lodash/concat"; export interface TreeNode<T> { name: string; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx index cd1a36e9f457..5f78ec1fb334 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/events.spec.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { mount, shallow } from "enzyme"; import { api as clusterUiApi } from "@cockroachlabs/cluster-ui"; +import { mount, shallow } from "enzyme"; import each from "lodash/each"; +import React from "react"; +import { refreshEvents } from "src/redux/apiReducers"; +import { allEvents } from "src/util/eventTypes"; import { EventBoxUnconnected as EventBox, EventRow, getEventInfo, } from "src/views/cluster/containers/events"; -import { refreshEvents } from "src/redux/apiReducers"; -import { allEvents } from "src/util/eventTypes"; import { ToolTipWrapper } from "src/views/shared/components/toolTip"; function makeEventBox( diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx index a50db1e14b68..e8d8643ae82d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/events/index.tsx @@ -8,13 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import map from "lodash/map"; -import take from "lodash/take"; -import moment from "moment-timezone"; -import React, { useContext } from "react"; -import { Helmet } from "react-helmet"; -import { Link, RouteComponentProps, withRouter } from "react-router-dom"; -import { connect } from "react-redux"; import { Loading, SortSetting, @@ -25,6 +18,13 @@ import { WithTimezone, } from "@cockroachlabs/cluster-ui"; import { InlineAlert } from "@cockroachlabs/ui-components"; +import map from "lodash/map"; +import take from "lodash/take"; +import moment from "moment-timezone"; +import React, { useContext } from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import { refreshEvents } from "src/redux/apiReducers"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx index e012dbaf3173..94404ba1456c 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/changefeeds.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Axis, Metric } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx index d84e74fe1b21..2c40a16fa1f9 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/crossClusterReplication.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits, util } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { cockroach } from "src/js/protos"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; -import { cockroach } from "src/js/protos"; import { GraphDashboardProps } from "./dashboardUtils"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx index 2e6877a01cdb..6d716e44e8d5 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/distributed.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx index 29109f69e341..7d0a89a25ae4 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips.tsx @@ -10,8 +10,8 @@ import React from "react"; -import * as docsURL from "src/util/docs"; import { Anchor } from "src/components"; +import * as docsURL from "src/util/docs"; export const CapacityGraphTooltip: React.FC<{ tooltipSelection?: string }> = ({ tooltipSelection, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx index 9fa06bf0a79a..e5780cc2d76f 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/hardware.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { AvailableDiscCapacityGraphTooltip } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx index 3daa8477d3b6..eedd545c4ed5 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/logicalDataReplication.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits, util } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { cockroach } from "src/js/protos"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; -import { cockroach } from "src/js/protos"; import { GraphDashboardProps, nodeDisplayName } from "./dashboardUtils"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx index cf260e59b548..444d5ac7d143 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/networking.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Axis, Metric } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx index a60437dbe06f..2f487618880a 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overload.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx index dd41ca41b44c..231ab23c4981 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/overview.tsx @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { CapacityGraphTooltip } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx index ccb71b05a474..0773a435bc65 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/queues.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx index 9d1b061f8994..91c3682abfd3 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/replication.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; +import { cockroach } from "src/js/protos"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { CircuitBreakerTrippedReplicasTooltip, LogicalBytesGraphTooltip, PausedFollowersTooltip, ReceiverSnapshotsQueuedTooltip, } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; -import { cockroach } from "src/js/protos"; +import { Axis, Metric } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx index 786d76f162ef..9ba4790bca03 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/runtime.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx index 80c390cff037..1d2154dbdb59 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/sql.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { StatementDenialsClusterSettingsTooltip, TransactionRestartsToolTip, } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, nodeDisplayName } from "./dashboardUtils"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx index 54e1bbefbb43..5458b4a2f72f 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis, MetricProps } from "src/views/shared/components/metricQuery"; import { CapacityGraphTooltip, LiveBytesGraphTooltip, } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips"; +import { Metric, Axis, MetricProps } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx index 13bbce554c11..e50c8e445ab5 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/ttl.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import map from "lodash/map"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import map from "lodash/map"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; import { Metric, Axis } from "src/views/shared/components/metricQuery"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx index 4d6d2c3376d5..f6cb3be6c635 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/index.tsx @@ -8,33 +8,29 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import map from "lodash/map"; +import { Anchor, TimeScale } from "@cockroachlabs/cluster-ui"; import has from "lodash/has"; +import map from "lodash/map"; +import moment from "moment-timezone"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { withRouter, RouteComponentProps } from "react-router-dom"; -import { Anchor, TimeScale } from "@cockroachlabs/cluster-ui"; -import moment from "moment-timezone"; +import { createSelector } from "reselect"; -import { - nodeIDAttr, - dashboardNameAttr, - tenantNameAttr, -} from "src/util/constants"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; -import { - PageConfig, - PageConfigItem, -} from "src/views/shared/components/pageconfig"; -import { AdminUIState } from "src/redux/state"; +import { InlineAlert } from "src/components"; +import { PayloadAction } from "src/interfaces/action"; import { refreshNodes, refreshLiveness, refreshSettings, refreshTenantsList, } from "src/redux/apiReducers"; +import { + selectResolution10sStorageTTL, + selectResolution30mStorageTTL, +} from "src/redux/clusterSettings"; +import { getCookieValue } from "src/redux/cookies"; import { hoverStateSelector, HoverState, @@ -49,10 +45,12 @@ import { nodeIDsStringifiedSelector, selectStoreIDsByNodeID, } from "src/redux/nodes"; -import Alerts from "src/views/shared/containers/alerts"; -import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { getMatchParamByName } from "src/util/query"; -import { PayloadAction } from "src/interfaces/action"; +import { AdminUIState } from "src/redux/state"; +import { + containsApplicationTenants, + isSystemTenant, + tenantDropdownOptions, +} from "src/redux/tenants"; import { setMetricsFixedWindow, TimeWindow, @@ -60,41 +58,43 @@ import { setTimeScale, selectTimeScale, } from "src/redux/timeScale"; -import { InlineAlert } from "src/components"; -import { reduceStorageOfTimeSeriesDataOperationalFlags } from "src/util/docs"; import { - selectResolution10sStorageTTL, - selectResolution30mStorageTTL, -} from "src/redux/clusterSettings"; + nodeIDAttr, + dashboardNameAttr, + tenantNameAttr, +} from "src/util/constants"; import { getDataFromServer } from "src/util/dataFromServer"; -import { getCookieValue } from "src/redux/cookies"; +import { reduceStorageOfTimeSeriesDataOperationalFlags } from "src/util/docs"; +import { getMatchParamByName } from "src/util/query"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { - containsApplicationTenants, - isSystemTenant, - tenantDropdownOptions, -} from "src/redux/tenants"; + PageConfig, + PageConfigItem, +} from "src/views/shared/components/pageconfig"; +import Alerts from "src/views/shared/containers/alerts"; +import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import TimeScaleDropdown from "../timeScaleDropdownWithSearchParams"; +import changefeedsDashboard from "./dashboards/changefeeds"; +import crossClusterReplicationDashboard from "./dashboards/crossClusterReplication"; import { GraphDashboardProps, storeIDsForNode, } from "./dashboards/dashboardUtils"; +import distributedDashboard from "./dashboards/distributed"; +import hardwareDashboard from "./dashboards/hardware"; +import logicalDataReplicationDashboard from "./dashboards/logicalDataReplication"; +import networkingDashboard from "./dashboards/networking"; +import overloadDashboard from "./dashboards/overload"; import overviewDashboard from "./dashboards/overview"; +import queuesDashboard from "./dashboards/queues"; +import replicationDashboard from "./dashboards/replication"; +import requestsDashboard from "./dashboards/requests"; import runtimeDashboard from "./dashboards/runtime"; import sqlDashboard from "./dashboards/sql"; import storageDashboard from "./dashboards/storage"; -import replicationDashboard from "./dashboards/replication"; -import distributedDashboard from "./dashboards/distributed"; -import queuesDashboard from "./dashboards/queues"; -import requestsDashboard from "./dashboards/requests"; -import hardwareDashboard from "./dashboards/hardware"; -import changefeedsDashboard from "./dashboards/changefeeds"; -import overloadDashboard from "./dashboards/overload"; import ttlDashboard from "./dashboards/ttl"; -import crossClusterReplicationDashboard from "./dashboards/crossClusterReplication"; -import logicalDataReplicationDashboard from "./dashboards/logicalDataReplication"; -import networkingDashboard from "./dashboards/networking"; import ClusterSummaryBar from "./summaryBar"; interface GraphDashboard { diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx index ea92d184be00..783d3c318e4d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.spec.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { shallow, mount } from "enzyme"; +import React from "react"; import { MemoryRouter as Router } from "react-router-dom"; import { createSandbox } from "sinon"; -import { SummaryStatBreakdown } from "src/views/shared/components/summaryBar"; -import { renderWithProviders } from "src/test-utils/renderWithProviders"; import { NodeSummaryStats } from "src/redux/nodes"; import * as nodes from "src/redux/nodes"; +import { renderWithProviders } from "src/test-utils/renderWithProviders"; +import { SummaryStatBreakdown } from "src/views/shared/components/summaryBar"; import * as summaryBar from "./summaryBar"; import { ClusterNodeTotals } from "./summaryBar"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx index baeb019c0f54..7d2a361d987b 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/summaryBar.tsx @@ -8,14 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util } from "@cockroachlabs/cluster-ui"; +import * as d3 from "d3"; import React from "react"; import { useSelector } from "react-redux"; import { Link } from "react-router-dom"; -import * as d3 from "d3"; -import { util } from "@cockroachlabs/cluster-ui"; import { createSelector } from "reselect"; +import { Tooltip, Anchor } from "src/components"; import { nodeStatusesSelector, nodeSumsSelector } from "src/redux/nodes"; +import { howAreCapacityMetricsCalculated } from "src/util/docs"; import { EventBox } from "src/views/cluster/containers/events"; import { Metric } from "src/views/shared/components/metricQuery"; import { @@ -27,8 +29,6 @@ import { SummaryStatMessage, SummaryMetricsAggregator, } from "src/views/shared/components/summaryBar"; -import { Tooltip, Anchor } from "src/components"; -import { howAreCapacityMetricsCalculated } from "src/util/docs"; /** * ClusterNodeTotals displays a high-level breakdown of the nodes on the cluster diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx index aead0307dad2..6e12e72394bd 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeLogs/index.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import sortBy from "lodash/sortBy"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Loading, SortedTable, util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import sortBy from "lodash/sortBy"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; -import { INodeStatus } from "src/util/proto"; -import { nodeIDAttr } from "src/util/constants"; -import { LogEntriesResponseMessage } from "src/util/api"; -import { AdminUIState } from "src/redux/state"; import { refreshLogs, refreshNodes } from "src/redux/apiReducers"; -import { currentNode } from "src/views/cluster/containers/nodeOverview"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { getDisplayName } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { LogEntriesResponseMessage } from "src/util/api"; +import { nodeIDAttr } from "src/util/constants"; +import { INodeStatus } from "src/util/proto"; import { getMatchParamByName } from "src/util/query"; +import { currentNode } from "src/views/cluster/containers/nodeOverview"; import "./logs.styl"; type LogEntries = protos.cockroach.util.log.IEntry; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx index 64a86c8666c0..a2f8136f1baa 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/index.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import map from "lodash/map"; +import { Button, util, Timestamp } from "@cockroachlabs/cluster-ui"; +import { ArrowLeft } from "@cockroachlabs/icons"; import find from "lodash/find"; +import map from "lodash/map"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { Button, util, Timestamp } from "@cockroachlabs/cluster-ui"; -import { ArrowLeft } from "@cockroachlabs/icons"; import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx index 48acda2a520d..96c5b8dbb7b1 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeOverview/tooltips.tsx @@ -11,6 +11,7 @@ import React from "react"; import { Tooltip, Anchor } from "src/components"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { keyValuePairs, writeIntents, @@ -18,7 +19,6 @@ import { clusterStore, capacityMetrics, } from "src/util/docs"; -import { TooltipProps } from "src/components/tooltip/tooltip"; export type CellTooltipProps = { nodeName?: string; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx index 3f5b61a62a93..272abd7ecad7 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/index.tsx @@ -8,24 +8,29 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Link } from "react-router-dom"; -import { connect } from "react-redux"; -import moment, { Moment } from "moment-timezone"; -import { createSelector } from "reselect"; -import isUndefined from "lodash/isUndefined"; +import { Badge, BadgeProps, ColumnsConfig, SortSetting, Table, Timestamp, util, } from "@cockroachlabs/cluster-ui"; +import capitalize from "lodash/capitalize"; +import flow from "lodash/flow"; +import groupBy from "lodash/groupBy"; import head from "lodash/head"; import isEmpty from "lodash/isEmpty"; -import groupBy from "lodash/groupBy"; -import capitalize from "lodash/capitalize"; +import isUndefined from "lodash/isUndefined"; import last from "lodash/last"; import map from "lodash/map"; import orderBy from "lodash/orderBy"; -import take from "lodash/take"; import sum from "lodash/sum"; -import flow from "lodash/flow"; -import { Badge, BadgeProps, ColumnsConfig, SortSetting, Table, Timestamp, util, } from "@cockroachlabs/cluster-ui"; +import take from "lodash/take"; +import moment, { Moment } from "moment-timezone"; +import React from "react"; +import { connect } from "react-redux"; +import { Link } from "react-router-dom"; +import { createSelector } from "reselect"; +import { Text, TextTypes, Tooltip } from "src/components"; +import { cockroach } from "src/js/protos"; +import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; +import { LocalityTier } from "src/redux/localities"; +import { LocalSetting } from "src/redux/localsettings"; import { LivenessStatus, nodeCapacityStats, @@ -34,14 +39,9 @@ import { selectNodesSummaryValid, } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; -import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; -import { LocalSetting } from "src/redux/localsettings"; -import { INodeStatus, MetricConstants } from "src/util/proto"; -import { Text, TextTypes, Tooltip } from "src/components"; import { FixLong } from "src/util/fixLong"; import { getNodeLocalityTiers } from "src/util/localities"; -import { LocalityTier } from "src/redux/localities"; -import { cockroach } from "src/js/protos"; +import { INodeStatus, MetricConstants } from "src/util/proto"; import TableSection from "./tableSection"; import "./nodes.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx index 3e83f558c8b8..3136547bd68e 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/nodesOverview.spec.tsx @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; +import { SortSetting } from "@cockroachlabs/cluster-ui"; import { ReactWrapper } from "enzyme"; import times from "lodash/times"; import Long from "long"; -import { SortSetting } from "@cockroachlabs/cluster-ui"; +import React from "react"; -import { AdminUIState } from "src/redux/state"; -import { LocalSetting } from "src/redux/localsettings"; -import { connectedMount } from "src/test-utils"; import { cockroach } from "src/js/protos"; +import { LocalSetting } from "src/redux/localsettings"; import { livenessByNodeIDSelector, LivenessStatus } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { connectedMount } from "src/test-utils"; import { decommissionedNodesTableDataSelector, diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx index b9b5d4d6209d..19a20376caed 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tableSection.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { CaretLeftOutlined, CaretDownOutlined } from "@ant-design/icons"; +import cn from "classnames"; import * as React from "react"; import { connect } from "react-redux"; -import cn from "classnames"; -import { CaretLeftOutlined, CaretDownOutlined } from "@ant-design/icons"; import { Action, Dispatch } from "redux"; +import { Text, TextTypes } from "src/components"; import { LocalSetting, setLocalSetting } from "src/redux/localsettings"; import { AdminUIState } from "src/redux/state"; -import { Text, TextTypes } from "src/components"; import "./tableSection.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx index 3be0cc930c09..f01780a7894d 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/nodesOverview/tooltips.tsx @@ -11,10 +11,10 @@ import React from "react"; import { Anchor, Tooltip, Text } from "src/components"; -import { nodeLivenessIssues, howItWork, capacityMetrics } from "src/util/docs"; +import { TooltipProps } from "src/components/tooltip/tooltip"; import { LivenessStatus } from "src/redux/nodes"; +import { nodeLivenessIssues, howItWork, capacityMetrics } from "src/util/docs"; import { NodeStatusRow } from "src/views/cluster/containers/nodesOverview/index"; -import { TooltipProps } from "src/components/tooltip/tooltip"; import { AggregatedNodeStatus } from "."; diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx b/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx index f4270a6a8856..53fc7e13fdfd 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/cluster/containers/timeScaleDropdownWithSearchParams/index.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useEffect } from "react"; -import { useHistory } from "react-router-dom"; -import { connect } from "react-redux"; import { defaultTimeScaleOptions, TimeScaleDropdown, @@ -19,12 +16,15 @@ import { TimeWindow, findClosestTimeScale, } from "@cockroachlabs/cluster-ui"; -import { createSelector } from "reselect"; import moment from "moment-timezone"; +import React, { useEffect } from "react"; +import { connect } from "react-redux"; +import { useHistory } from "react-router-dom"; +import { createSelector } from "reselect"; -import * as timewindow from "src/redux/timeScale"; -import { AdminUIState } from "src/redux/state"; import { PayloadAction } from "src/interfaces/action"; +import { AdminUIState } from "src/redux/state"; +import * as timewindow from "src/redux/timeScale"; // The time scale dropdown from cluster-ui that updates route params as // options are selected. diff --git a/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts b/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts index a068151f5b37..700106d7da97 100644 --- a/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts +++ b/pkg/ui/workspaces/db-console/src/views/cluster/util/graphs.ts @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import isEmpty from "lodash/isEmpty"; +import { AxisDomain } from "@cockroachlabs/cluster-ui"; import each from "lodash/each"; +import isEmpty from "lodash/isEmpty"; import without from "lodash/without"; -import { AxisDomain } from "@cockroachlabs/cluster-ui"; +import React from "react"; import uPlot from "uplot"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx b/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx index d1b90f0b965a..1fe4232bf901 100644 --- a/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx +++ b/pkg/ui/workspaces/db-console/src/views/dashboard/emailSubscription.tsx @@ -11,17 +11,17 @@ import React from "react"; import { connect } from "react-redux"; -import { EmailSubscriptionForm } from "src/views/shared/components/emailSubscriptionForm"; +import { emailSubscriptionAlertLocalSetting } from "src/redux/alerts"; import { signUpForEmailSubscription } from "src/redux/customAnalytics"; -import { AdminUIState } from "src/redux/state"; import { clusterIdSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import { loadUIData, RELEASE_NOTES_SIGNUP_DISMISSED_KEY, saveUIData, } from "src/redux/uiData"; import { dismissReleaseNotesSignupForm } from "src/redux/uiDataSelectors"; -import { emailSubscriptionAlertLocalSetting } from "src/redux/alerts"; +import { EmailSubscriptionForm } from "src/views/shared/components/emailSubscriptionForm"; import "./emailSubscription.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts index 03b96ff03c71..bafe6cea0e78 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/index.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { DatabaseDetailsPage } from "@cockroachlabs/cluster-ui"; import { connect, ReactReduxContext } from "react-redux"; import { withRouter } from "react-router-dom"; -import { DatabaseDetailsPage } from "@cockroachlabs/cluster-ui"; import { mapStateToProps, mapDispatchToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts index e2554610208a..52e7dbdc040b 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.spec.ts @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import { RouteComponentProps } from "react-router-dom"; -import { bindActionCreators, Store } from "redux"; import { DatabaseDetailsPageActions, DatabaseDetailsPageData, @@ -19,7 +16,10 @@ import { ViewMode, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import { createMemoryHistory } from "history"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { databaseNameAttr, indexUnusedDuration } from "src/util/constants"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts index aa4f93441361..92819e41f523 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseDetailsPage/redux.ts @@ -8,7 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps } from "react-router"; import { DatabaseDetailsPageData, defaultFilters, @@ -16,24 +15,25 @@ import { ViewMode, deriveTableDetailsMemoized, } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps } from "react-router"; -import { LocalSetting } from "src/redux/localsettings"; import { refreshDatabaseDetails, refreshNodes, refreshTableDetails, } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; -import { databaseNameAttr } from "src/util/constants"; -import { getMatchParamByName } from "src/util/query"; -import { - nodeRegionsByIDSelector, - selectIsMoreThanOneNode, -} from "src/redux/nodes"; import { selectDropUnusedIndexDuration, selectIndexRecommendationsEnabled, } from "src/redux/clusterSettings"; +import { LocalSetting } from "src/redux/localsettings"; +import { + nodeRegionsByIDSelector, + selectIsMoreThanOneNode, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { databaseNameAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; const sortSettingTablesLocalSetting = new LocalSetting( "sortSetting/DatabasesDetailsTablesPage", diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts index 80cc6f13debe..ae0bda7295fc 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/index.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { DatabaseTablePage } from "@cockroachlabs/cluster-ui"; import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import { DatabaseTablePage } from "@cockroachlabs/cluster-ui"; import { mapStateToProps, mapDispatchToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts index e2687fe69916..2946cd439709 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.spec.ts @@ -8,10 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import Long from "long"; -import { RouteComponentProps } from "react-router-dom"; -import { bindActionCreators, Store } from "redux"; import { DatabaseTablePageActions, DatabaseTablePageData, @@ -20,7 +16,11 @@ import { util, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import { createMemoryHistory } from "history"; +import Long from "long"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts index bccfd14260fc..25997c732a71 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databaseTablePage/redux.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps } from "react-router"; import { DatabaseTablePageData, util, deriveIndexDetailsMemoized, deriveTablePageDetailsMemoized, } from "@cockroachlabs/cluster-ui"; +import { RouteComponentProps } from "react-router"; import { cockroach } from "src/js/protos"; import { @@ -24,21 +24,21 @@ import { refreshSettings, refreshUserSQLRoles, } from "src/redux/apiReducers"; -import { resetIndexUsageStatsAction } from "src/redux/indexUsageStats"; -import { AdminUIState } from "src/redux/state"; -import { - nodeRegionsByIDSelector, - selectIsMoreThanOneNode, -} from "src/redux/nodes"; -import { selectHasAdminRole } from "src/redux/user"; import { selectAutomaticStatsCollectionEnabled, selectDropUnusedIndexDuration, selectIndexRecommendationsEnabled, selectIndexUsageStatsEnabled, } from "src/redux/clusterSettings"; -import { getMatchParamByName } from "src/util/query"; +import { resetIndexUsageStatsAction } from "src/redux/indexUsageStats"; +import { + nodeRegionsByIDSelector, + selectIsMoreThanOneNode, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { selectHasAdminRole } from "src/redux/user"; import { databaseNameAttr, tableNameAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; const { TableIndexStatsRequest } = cockroach.server.serverpb; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts index 16a068faf1c6..51a6ced1519d 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/index.ts @@ -8,13 +8,13 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { DatabasesPage, DatabasesPageData, DatabasesPageActions, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts index bbb14d6c71eb..caad11fa2109 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.spec.ts @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import find from "lodash/find"; -import { bindActionCreators, Store } from "redux"; import { DatabasesPageActions, DatabasesPageData, @@ -19,10 +16,13 @@ import { api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { createMemoryHistory } from "history"; +import find from "lodash/find"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; -import * as fakeApi from "src/util/fakeApi"; import { indexUnusedDuration } from "src/util/constants"; +import * as fakeApi from "src/util/fakeApi"; import { mapDispatchToProps, mapStateToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts index f8a687f627f3..a5e3b27b8d2d 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/databasesPage/redux.ts @@ -8,15 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; import { DatabasesPageData, defaultFilters, Filters, deriveDatabaseDetailsMemoized, } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; -import { LocalSetting } from "src/redux/localsettings"; import { refreshDatabases, refreshDatabaseDetails, @@ -24,16 +23,17 @@ import { refreshSettings, refreshDatabaseDetailsSpanStats, } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; -import { - nodeRegionsByIDSelector, - selectIsMoreThanOneNode, -} from "src/redux/nodes"; import { selectAutomaticStatsCollectionEnabled, selectDropUnusedIndexDuration, selectIndexRecommendationsEnabled, } from "src/redux/clusterSettings"; +import { LocalSetting } from "src/redux/localsettings"; +import { + nodeRegionsByIDSelector, + selectIsMoreThanOneNode, +} from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; const selectLoading = createSelector( (state: AdminUIState) => state.cachedData.databases, diff --git a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts index 1c4cc254dcc8..3cbc7e114846 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/index.ts @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { IndexDetailsPage } from "@cockroachlabs/cluster-ui"; import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import { IndexDetailsPage } from "@cockroachlabs/cluster-ui"; import { mapStateToProps, mapDispatchToProps } from "./redux"; diff --git a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts index 387fe10f682a..199ed55cd9e7 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.spec.ts @@ -8,17 +8,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createMemoryHistory } from "history"; -import Long from "long"; -import { RouteComponentProps } from "react-router-dom"; -import { bindActionCreators, Store } from "redux"; import { IndexDetailPageActions, IndexDetailsPageData, util, TimeScale, } from "@cockroachlabs/cluster-ui"; +import { createMemoryHistory } from "history"; +import Long from "long"; import moment from "moment-timezone"; +import { RouteComponentProps } from "react-router-dom"; +import { bindActionCreators, Store } from "redux"; import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts index be3c22e4444c..772939e37989 100644 --- a/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts +++ b/pkg/ui/workspaces/db-console/src/views/databases/indexDetailsPage/redux.ts @@ -15,28 +15,28 @@ import { } from "@cockroachlabs/cluster-ui"; import { RouteComponentProps } from "react-router"; -import { AdminUIState } from "src/redux/state"; -import { getMatchParamByName } from "src/util/query"; -import { - databaseNameAttr, - tableNameAttr, - indexNameAttr, -} from "src/util/constants"; +import { cockroach } from "src/js/protos"; import { refreshIndexStats, refreshNodes, refreshUserSQLRoles, } from "src/redux/apiReducers"; import { resetIndexUsageStatsAction } from "src/redux/indexUsageStats"; -import { longToInt } from "src/util/fixLong"; -import { cockroach } from "src/js/protos"; +import { nodeRegionsByIDSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; import { selectHasViewActivityRedactedRole, selectHasAdminRole, } from "src/redux/user"; -import { nodeRegionsByIDSelector } from "src/redux/nodes"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; +import { + databaseNameAttr, + tableNameAttr, + indexNameAttr, +} from "src/util/constants"; +import { longToInt } from "src/util/fixLong"; +import { getMatchParamByName } from "src/util/query"; import TableIndexStatsRequest = cockroach.server.serverpb.TableIndexStatsRequest; const { RecommendationType } = cockroach.sql.IndexRecommendation; diff --git a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx index dd4bba7685d9..9e30c2139f21 100644 --- a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/index.tsx @@ -8,14 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { TimeScale } from "@cockroachlabs/cluster-ui"; import isString from "lodash/isString"; import map from "lodash/map"; import React from "react"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { TimeScale } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; +import { PayloadAction } from "src/interfaces/action"; import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; import { hoverOff as hoverOffAction, @@ -31,7 +32,9 @@ import { } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { TimeWindow, setMetricsFixedWindow } from "src/redux/timeScale"; import { nodeIDAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; import { GraphDashboardProps, storeIDsForNode, @@ -43,9 +46,6 @@ import { PageConfigItem, } from "src/views/shared/components/pageconfig"; import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { getMatchParamByName } from "src/util/query"; -import { PayloadAction } from "src/interfaces/action"; -import { TimeWindow, setMetricsFixedWindow } from "src/redux/timeScale"; import messagesDashboard from "./messages"; diff --git a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx index 519a8b780f5d..faf8b36eb337 100644 --- a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx +++ b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftMessages/messages.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { AxisUnits } from "@cockroachlabs/cluster-ui"; +import React from "react"; import LineGraph from "src/views/cluster/components/linegraph"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; import { GraphDashboardProps } from "src/views/cluster/containers/nodeGraphs/dashboards/dashboardUtils"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; export default function (props: GraphDashboardProps) { const { nodeSources, tooltipSelection } = props; diff --git a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx index db1400447e1d..461b77ff7e60 100644 --- a/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/devtools/containers/raftRanges/index.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import filter from "lodash/filter"; import flatMap from "lodash/flatMap"; +import flow from "lodash/flow"; import map from "lodash/map"; +import sortBy from "lodash/sortBy"; import uniq from "lodash/uniq"; import values from "lodash/values"; -import sortBy from "lodash/sortBy"; -import flow from "lodash/flow"; import React from "react"; import ReactPaginate from "react-paginate"; import { connect } from "react-redux"; import { Link, RouteComponentProps, withRouter } from "react-router-dom"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import * as protos from "src/js/protos"; import { refreshRaft } from "src/redux/apiReducers"; diff --git a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx index 83e6f19d0453..588ee4d801c9 100644 --- a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx +++ b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesFilter.tsx @@ -8,8 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useCallback, useEffect, useState, useMemo } from "react"; -import ReactDOM from "react-dom"; import { Button, FilterCheckboxOption, @@ -19,12 +17,14 @@ import { FilterSearchOption, } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import isEmpty from "lodash/isEmpty"; +import classNames from "classnames/bind"; import isArray from "lodash/isArray"; +import isEmpty from "lodash/isEmpty"; import isString from "lodash/isString"; -import classNames from "classnames/bind"; -import { useHistory } from "react-router-dom"; import noop from "lodash/noop"; +import React, { useCallback, useEffect, useState, useMemo } from "react"; +import ReactDOM from "react-dom"; +import { useHistory } from "react-router-dom"; import styles from "./hotRanges.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx index da9493cb4d25..f4631353bf90 100644 --- a/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/hotRanges/hotRangesTable.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { useState } from "react"; -import { Link } from "react-router-dom"; -import { Tooltip } from "antd"; import { ColumnDescriptor, SortedTable, @@ -21,19 +18,22 @@ import { EmptyTable, util, } from "@cockroachlabs/cluster-ui"; +import { Tooltip } from "antd"; import classNames from "classnames/bind"; import round from "lodash/round"; +import React, { useState } from "react"; import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import emptyTableResultsImg from "assets/emptyState/empty-table-results.svg"; +import { sortSettingLocalSetting } from "oss/src/redux/hotRanges"; +import { AdminUIState } from "oss/src/redux/state"; import { cockroach } from "src/js/protos"; import { performanceBestPracticesHotSpots, readsAndWritesOverviewPage, uiDebugPages, } from "src/util/docs"; -import { sortSettingLocalSetting } from "oss/src/redux/hotRanges"; -import { AdminUIState } from "oss/src/redux/state"; import styles from "./hotRanges.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx index 879221d31666..64cff3c8c43d 100644 --- a/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/hotRanges/index.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { useDispatch, useSelector } from "react-redux"; -import React, { useRef, useEffect, useState, useContext } from "react"; -import { Helmet } from "react-helmet"; import { Loading, Text, @@ -19,9 +16,12 @@ import { TimezoneContext, } from "@cockroachlabs/cluster-ui"; import classNames from "classnames/bind"; +import React, { useRef, useEffect, useState, useContext } from "react"; +import { Helmet } from "react-helmet"; +import { useDispatch, useSelector } from "react-redux"; -import { refreshHotRanges } from "src/redux/apiReducers"; import { cockroach } from "src/js/protos"; +import { refreshHotRanges } from "src/redux/apiReducers"; import { hotRangesSelector, isLoadingSelector, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx b/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx index c80ca4af87f9..cf411f68a393 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/insightsOverview.tsx @@ -11,16 +11,16 @@ // All changes made on this file, should also be done on the equivalent // file on managed-service repo. +import { commonStyles, util } from "@cockroachlabs/cluster-ui"; +import { Tabs } from "antd"; import React, { useState } from "react"; import Helmet from "react-helmet"; -import { Tabs } from "antd"; -import { commonStyles, util } from "@cockroachlabs/cluster-ui"; import { RouteComponentProps } from "react-router-dom"; import { tabAttr, viewAttr } from "src/util/constants"; -import WorkloadInsightsPage from "./workloadInsightsPage"; import SchemaInsightsPage from "./schemaInsightsPage"; +import WorkloadInsightsPage from "./workloadInsightsPage"; const { TabPane } = Tabs; diff --git a/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts b/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts index 6cd21f729bfc..4ce1c9917fb4 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts +++ b/pkg/ui/workspaces/db-console/src/views/insights/insightsSelectors.ts @@ -8,7 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { createSelector } from "reselect"; import { defaultFilters, WorkloadInsightEventFilters, @@ -24,6 +23,7 @@ import { api, util, } from "@cockroachlabs/cluster-ui"; +import { createSelector } from "reselect"; import { LocalSetting } from "src/redux/localsettings"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx index d3c276d34332..6ecaa1cd2e43 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/schemaInsightsPage.tsx @@ -8,8 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { SchemaInsightEventFilters, SchemaInsightsView, @@ -17,12 +15,16 @@ import { SchemaInsightsViewStateProps, SortSetting, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { refreshSchemaInsights, refreshUserSQLRoles, } from "src/redux/apiReducers"; +import { selectDropUnusedIndexDuration } from "src/redux/clusterSettings"; import { AdminUIState } from "src/redux/state"; +import { selectHasAdminRole } from "src/redux/user"; import { schemaInsightsFiltersLocalSetting, schemaInsightsSortLocalSetting, @@ -31,8 +33,6 @@ import { selectSchemaInsightsMaxApiReached, selectSchemaInsightsTypes, } from "src/views/insights/insightsSelectors"; -import { selectHasAdminRole } from "src/redux/user"; -import { selectDropUnusedIndexDuration } from "src/redux/clusterSettings"; const mapStateToProps = ( state: AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx index 4e5a15d0c2fb..76f24c09daa3 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/statementInsightDetailsPage.tsx @@ -15,12 +15,12 @@ import { import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { refreshUserSQLRoles } from "src/redux/apiReducers"; -import { selectStatementInsightDetails } from "src/views/insights/insightsSelectors"; +import { AdminUIState } from "src/redux/state"; import { setGlobalTimeScaleAction } from "src/redux/statements"; import { selectTimeScale } from "src/redux/timeScale"; import { selectHasAdminRole } from "src/redux/user"; +import { selectStatementInsightDetails } from "src/views/insights/insightsSelectors"; const mapStateToProps = ( state: AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx index 55ab6c755ba1..82d8ab76b131 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/transactionInsightDetailsPage.tsx @@ -20,14 +20,14 @@ import { refreshUserSQLRoles, } from "src/redux/apiReducers"; import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; +import { selectHasAdminRole } from "src/redux/user"; import { selectTxnInsightDetails, selectTransactionInsightDetailsError, selectTransactionInsightDetailsMaxSizeReached, } from "src/views/insights/insightsSelectors"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; -import { selectHasAdminRole } from "src/redux/user"; const mapStateToProps = ( state: AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx b/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx index dae35edbb696..724ad1166551 100644 --- a/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/insights/workloadInsightsPage.tsx @@ -8,8 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { WorkloadInsightEventFilters, SortSetting, @@ -20,10 +18,15 @@ import { WorkloadInsightsRootControl, WorkloadInsightsViewProps, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { bindActionCreators } from "redux"; import { refreshStmtInsights, refreshTxnInsights } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; import { filtersLocalSetting, selectStmtInsights, @@ -35,9 +38,6 @@ import { selectStmtInsightsMaxApiReached, selectTxnInsightsMaxApiReached, } from "src/views/insights/insightsSelectors"; -import { LocalSetting } from "src/redux/localsettings"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; export const insightStatementColumnsLocalSetting = new LocalSetting< AdminUIState, diff --git a/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx b/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx index c035e9e99c8e..9f34c8af9e98 100644 --- a/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/jobs/jobDetails.tsx @@ -13,10 +13,11 @@ import { selectID, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import long from "long"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import long from "long"; +import { collectExecutionDetailsAction } from "oss/src/redux/jobs/jobsActions"; import { createSelectorForKeyedCachedDataField, refreshListExecutionDetailFiles, @@ -24,9 +25,8 @@ import { refreshUserSQLRoles, } from "src/redux/apiReducers"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { ListJobProfilerExecutionDetailsResponseMessage } from "src/util/api"; -import { collectExecutionDetailsAction } from "oss/src/redux/jobs/jobsActions"; import { selectHasAdminRole } from "src/redux/user"; +import { ListJobProfilerExecutionDetailsResponseMessage } from "src/util/api"; const selectJob = createSelectorForKeyedCachedDataField("job", selectID); const selectExecutionDetailFiles = diff --git a/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx b/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx index e8db3d14f878..e5e1a1fa8404 100644 --- a/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx +++ b/pkg/ui/workspaces/db-console/src/views/jwt/jwtAuthToken.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Spinner } from "@cockroachlabs/ui-components"; import React, { useEffect, useState } from "react"; import Helmet from "react-helmet"; import { useParams } from "react-router-dom"; import Select, { Option } from "react-select"; -import { Spinner } from "@cockroachlabs/ui-components"; import ErrorCircle from "assets/error-circle.svg"; import { diff --git a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx index 3d98f042c6c7..e69b682bec86 100644 --- a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/index.tsx @@ -8,28 +8,28 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { connect } from "react-redux"; import { TimeScale, TimeScaleDropdown, TimeScaleOptions, util, } from "@cockroachlabs/cluster-ui"; -import { RouteComponentProps } from "react-router-dom"; import moment from "moment-timezone"; +import React from "react"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router-dom"; import { cockroach } from "src/js/protos"; +import { refreshSettings } from "src/redux/apiReducers"; +import { selectClusterSettings } from "src/redux/clusterSettings"; +import { AdminUIState } from "src/redux/state"; +import { selectTimeScale, setTimeScale } from "src/redux/timeScale"; import { getKeyVisualizerSamples } from "src/util/api"; -import KeyVisualizer from "src/views/keyVisualizer/keyVisualizer"; import { KeyVisSample, KeyVisualizerProps, } from "src/views/keyVisualizer/interfaces"; -import { AdminUIState } from "src/redux/state"; -import { selectClusterSettings } from "src/redux/clusterSettings"; -import { selectTimeScale, setTimeScale } from "src/redux/timeScale"; -import { refreshSettings } from "src/redux/apiReducers"; +import KeyVisualizer from "src/views/keyVisualizer/keyVisualizer"; import { BackToAdvanceDebug } from "../reports/containers/util"; diff --git a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx index 5fd10aaa31b2..2bd38e6470cb 100644 --- a/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx +++ b/pkg/ui/workspaces/db-console/src/views/keyVisualizer/keyVisualizer.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import throttle from "lodash/throttle"; +import React from "react"; import { CanvasHeight, diff --git a/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx b/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx index 266201e36b54..e75a3fe65d36 100644 --- a/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/login/loginPage.tsx @@ -14,9 +14,6 @@ import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import ErrorCircle from "assets/error-circle.svg"; -import { doLogin, LoginAPIState } from "src/redux/login"; -import { AdminUIState, AppDispatch } from "src/redux/state"; -import * as docsURL from "src/util/docs"; import { CockroachLabsLockupIcon, Button, @@ -25,6 +22,9 @@ import { Text, TextTypes, } from "src/components"; +import { doLogin, LoginAPIState } from "src/redux/login"; +import { AdminUIState, AppDispatch } from "src/redux/state"; +import * as docsURL from "src/util/docs"; import { OIDCGenerateJWTAuthTokenConnected, OIDCLoginConnected, diff --git a/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx b/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx index 1347ae5f0b49..d137800c6dbb 100644 --- a/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/login/logjnPage.stories.tsx @@ -7,8 +7,8 @@ // 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. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { withRouterDecorator } from "src/util/decorators"; diff --git a/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx b/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx index 93f2b7fadc42..d672045bb5a7 100644 --- a/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx +++ b/pkg/ui/workspaces/db-console/src/views/login/requireLogin.tsx @@ -9,11 +9,11 @@ // licenses/APL.txt. import React from "react"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { selectLoginState, LoginState, getLoginPage } from "src/redux/login"; +import { AdminUIState } from "src/redux/state"; interface RequireLoginProps { loginState: LoginState; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx index b586c9c28ddd..790df9abeeb9 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/components/nodeFilterList/index.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Location } from "history"; -import isEmpty from "lodash/isEmpty"; import forEach from "lodash/forEach"; -import map from "lodash/map"; -import join from "lodash/join"; +import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; -import split from "lodash/split"; +import join from "lodash/join"; +import map from "lodash/map"; import sortBy from "lodash/sortBy"; +import split from "lodash/split"; +import React from "react"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx index 1d6526be266c..18037b224eeb 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/certificates/index.tsx @@ -8,27 +8,27 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React, { Fragment } from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Loading, util } from "@cockroachlabs/cluster-ui"; -import map from "lodash/map"; -import isEqual from "lodash/isEqual"; import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; +import isNaN from "lodash/isNaN"; import join from "lodash/join"; +import map from "lodash/map"; import sortBy from "lodash/sortBy"; -import isNaN from "lodash/isNaN"; +import React, { Fragment } from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -import { BackToAdvanceDebug } from "src/views/reports/containers/util"; -import { getMatchParamByName } from "src/util/query"; -import { nodeIDAttr } from "src/util/constants"; -import { AdminUIState } from "src/redux/state"; +import * as protos from "src/js/protos"; import { certificatesRequestKey, refreshCertificates, } from "src/redux/apiReducers"; -import * as protos from "src/js/protos"; +import { AdminUIState } from "src/redux/state"; +import { nodeIDAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; +import { BackToAdvanceDebug } from "src/views/reports/containers/util"; interface CertificatesOwnProps { certificates: protos.cockroach.server.serverpb.CertificatesResponse; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx index 3654255e1dcf..ef6b21d76358 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/customMetric.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { AxisUnits } from "@cockroachlabs/cluster-ui"; import assign from "lodash/assign"; import isEmpty from "lodash/isEmpty"; import * as React from "react"; import Select, { Option } from "react-select"; -import { AxisUnits } from "@cockroachlabs/cluster-ui"; import * as protos from "src/js/protos"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { isSystemTenant } from "src/redux/tenants"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { MetricOption } from "./metricOption"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts index 78cd2ee23531..bfbe31b275dc 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.spec.ts @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import * as protos from "src/js/protos"; import { NodesSummary } from "src/redux/nodes"; import { INodeStatus } from "src/util/proto"; -import { GetSources } from "src/views/reports/containers/customChart/index"; -import * as protos from "src/js/protos"; import { CustomMetricState } from "src/views/reports/containers/customChart/customMetric"; +import { GetSources } from "src/views/reports/containers/customChart/index"; import TimeSeriesQueryAggregator = protos.cockroach.ts.tspb.TimeSeriesQueryAggregator; import TimeSeriesQueryDerivative = protos.cockroach.ts.tspb.TimeSeriesQueryDerivative; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx index f0e5ec9cd102..67c304c02f1b 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/index.tsx @@ -8,53 +8,53 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { AxisUnits, TimeScale } from "@cockroachlabs/cluster-ui"; +import flatMap from "lodash/flatMap"; +import flow from "lodash/flow"; +import has from "lodash/has"; +import isEmpty from "lodash/isEmpty"; +import keys from "lodash/keys"; import map from "lodash/map"; import sortBy from "lodash/sortBy"; import startsWith from "lodash/startsWith"; -import isEmpty from "lodash/isEmpty"; -import keys from "lodash/keys"; -import flatMap from "lodash/flatMap"; -import has from "lodash/has"; -import flow from "lodash/flow"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { AxisUnits, TimeScale } from "@cockroachlabs/cluster-ui"; +import TimeScaleDropdown from "oss/src/views/cluster/containers/timeScaleDropdownWithSearchParams"; +import { PayloadAction } from "src/interfaces/action"; import { refreshMetricMetadata, refreshNodes, refreshTenantsList, } from "src/redux/apiReducers"; -import { nodesSummarySelector, NodesSummary } from "src/redux/nodes"; -import { AdminUIState } from "src/redux/state"; -import LineGraph from "src/views/cluster/components/linegraph"; -import { DropdownOption } from "src/views/shared/components/dropdown"; -import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { Metric, Axis } from "src/views/shared/components/metricQuery"; -import TimeScaleDropdown from "oss/src/views/cluster/containers/timeScaleDropdownWithSearchParams"; -import { - PageConfig, - PageConfigItem, -} from "src/views/shared/components/pageconfig"; +import { getCookieValue } from "src/redux/cookies"; import { MetricsMetadata, metricsMetadataSelector, } from "src/redux/metricMetadata"; -import { INodeStatus } from "src/util/proto"; -import { queryByName } from "src/util/query"; -import { PayloadAction } from "src/interfaces/action"; +import { nodesSummarySelector, NodesSummary } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { tenantDropdownOptions } from "src/redux/tenants"; import { TimeWindow, setMetricsFixedWindow, selectTimeScale, setTimeScale, } from "src/redux/timeScale"; +import { INodeStatus } from "src/util/proto"; +import { queryByName } from "src/util/query"; +import LineGraph from "src/views/cluster/components/linegraph"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; -import { getCookieValue } from "src/redux/cookies"; -import { tenantDropdownOptions } from "src/redux/tenants"; +import { DropdownOption } from "src/views/shared/components/dropdown"; +import { Metric, Axis } from "src/views/shared/components/metricQuery"; +import { + PageConfig, + PageConfigItem, +} from "src/views/shared/components/pageconfig"; +import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import { CustomChartState, diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx index 8f4a6cf5c7fa..34b525c73b3e 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/customChart/metricOption.tsx @@ -8,9 +8,9 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classnames from "classnames"; import React from "react"; import { OptionComponentProps } from "react-select"; -import classnames from "classnames"; import "./metricOption.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx index 3dcf93fde8df..2eb436984669 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/debug/index.tsx @@ -13,16 +13,16 @@ import React, { useEffect, useState } from "react"; import { Helmet } from "react-helmet"; import { connect, useSelector } from "react-redux"; +import { InlineAlert } from "src/components"; +import { refreshNodes, refreshUserSQLRoles } from "src/redux/apiReducers"; +import { getCookieValue, setCookie } from "src/redux/cookies"; +import { nodeIDsStringifiedSelector } from "src/redux/nodes"; +import { AdminUIState, featureFlagSelector } from "src/redux/state"; +import { selectHasViewActivityRedactedRole } from "src/redux/user"; import { getDataFromServer } from "src/util/dataFromServer"; import DebugAnnotation from "src/views/shared/components/debugAnnotation"; import InfoBox from "src/views/shared/components/infoBox"; import LicenseType from "src/views/shared/components/licenseType"; -import { AdminUIState, featureFlagSelector } from "src/redux/state"; -import { nodeIDsStringifiedSelector } from "src/redux/nodes"; -import { refreshNodes, refreshUserSQLRoles } from "src/redux/apiReducers"; -import { selectHasViewActivityRedactedRole } from "src/redux/user"; -import { getCookieValue, setCookie } from "src/redux/cookies"; -import { InlineAlert } from "src/components"; import { PanelSection, PanelTitle, diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx index f2cdbd87c62a..3ffae2f81696 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/enqueueRange/index.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import moment from "moment-timezone"; import React, { Fragment } from "react"; import Helmet from "react-helmet"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import moment from "moment-timezone"; -import { enqueueRange } from "src/util/api"; import { cockroach } from "src/js/protos"; +import { enqueueRange } from "src/util/api"; import Print from "src/views/reports/containers/range/print"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import "./index.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx index a9db34ef7a4b..6b1bfa2a3c30 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/hotranges/index.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Button } from "@cockroachlabs/ui-components"; +import moment from "moment-timezone"; import React, { useCallback, useEffect, useState } from "react"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import moment from "moment-timezone"; -import { Button } from "@cockroachlabs/ui-components"; import { cockroach } from "src/js/protos"; import { getHotRanges } from "src/util/api"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx index 3c81c1e95bb4..31c23816bb6a 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/localities/index.tsx @@ -8,14 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Loading } from "@cockroachlabs/cluster-ui"; import isNil from "lodash/isNil"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { Loading } from "@cockroachlabs/cluster-ui"; import { refreshLocations, refreshNodes } from "src/redux/apiReducers"; +import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { LocalityTier, LocalityTree, @@ -31,7 +32,6 @@ import { AdminUIState } from "src/redux/state"; import { getNodeLocalityTiers } from "src/util/localities"; import { findMostSpecificLocation, hasLocation } from "src/util/locations"; import "./localities.styl"; -import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { BackToAdvanceDebug } from "../util"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx index 1b02deaf8a84..e8df6f37ab29 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/filter/index.tsx @@ -9,11 +9,11 @@ // licenses/APL.txt. import { Checkbox, Select } from "antd"; -import React from "react"; import classNames from "classnames"; +import React from "react"; -import Dropdown, { arrowRenderer } from "src/views/shared/components/dropdown"; import { OutsideEventHandler } from "src/components/outsideEventHandler"; +import Dropdown, { arrowRenderer } from "src/views/shared/components/dropdown"; import { NetworkFilter, NetworkSort } from ".."; import "./filter.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx index bc9ed0d46e5d..db1b89bd934d 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/index.tsx @@ -8,35 +8,37 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { util, Loading } from "@cockroachlabs/cluster-ui"; +import * as protos from "@cockroachlabs/crdb-protobuf-client"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { deviation as d3Deviation, mean as d3Mean } from "d3"; import capitalize from "lodash/capitalize"; +import filter from "lodash/filter"; +import flatMap from "lodash/flatMap"; import flow from "lodash/flow"; -import isUndefined from "lodash/isUndefined"; import isEmpty from "lodash/isEmpty"; -import sortBy from "lodash/sortBy"; +import isUndefined from "lodash/isUndefined"; +import map from "lodash/map"; import max from "lodash/max"; +import sortBy from "lodash/sortBy"; import union from "lodash/union"; import values from "lodash/values"; -import filter from "lodash/filter"; -import flatMap from "lodash/flatMap"; -import map from "lodash/map"; import moment from "moment-timezone"; +import { common } from "protobufjs"; import React, { Fragment } from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { withRouter, RouteComponentProps } from "react-router-dom"; -import * as protos from "@cockroachlabs/crdb-protobuf-client"; -import { util, Loading } from "@cockroachlabs/cluster-ui"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { common } from "protobufjs"; +import { createSelector } from "reselect"; +import { InlineAlert } from "src/components"; import { CachedDataReducerState, refreshConnectivity, refreshLiveness, refreshNodes, } from "src/redux/apiReducers"; +import { connectivitySelector } from "src/redux/connectivity"; import { NodesSummary, nodesSummarySelector, @@ -45,16 +47,14 @@ import { } from "src/redux/nodes"; import { AdminUIState } from "src/redux/state"; import { trackFilter, trackCollapseNodes } from "src/util/analytics"; +import { getDataFromServer } from "src/util/dataFromServer"; +import { getMatchParamByName } from "src/util/query"; import { getFilters, localityToString, NodeFilterList, NodeFilterListProps, } from "src/views/reports/components/nodeFilterList"; -import { getMatchParamByName } from "src/util/query"; -import { connectivitySelector } from "src/redux/connectivity"; -import { getDataFromServer } from "src/util/dataFromServer"; -import { InlineAlert } from "src/components"; import { Latency } from "./latency"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx index 763518497658..7d5699cecee5 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/index.tsx @@ -8,15 +8,15 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { Badge, Divider, Tooltip } from "antd"; import { ExclamationCircleOutlined, StopOutlined } from "@ant-design/icons"; +import { util } from "@cockroachlabs/cluster-ui"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import { Badge, Divider, Tooltip } from "antd"; +import { BadgeProps } from "antd/lib/badge"; import classNames from "classnames"; import map from "lodash/map"; -import { util } from "@cockroachlabs/cluster-ui"; import React from "react"; import { Link } from "react-router-dom"; -import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; -import { BadgeProps } from "antd/lib/badge"; import { Empty } from "src/components/empty"; import { livenessNomenclature } from "src/redux/nodes"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts index 443fc53e95aa..6e9dd7309321 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.fixtures.ts @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import moment from "moment-timezone"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import moment from "moment-timezone"; import { ILatencyProps } from "."; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx index fe30b484863a..976ac682d98f 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/latency/latency.stories.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; +import React from "react"; import { RenderFunction } from "storybook__react"; import { withRouterDecorator } from "src/util/decorators"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx index 6f188d577b3b..13152082a0fe 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/legend/index.tsx @@ -11,8 +11,8 @@ import { Tooltip } from "antd"; import React from "react"; -import { Chip } from "src/views/app/components/chip"; import { Text, TextTypes } from "src/components"; +import { Chip } from "src/views/app/components/chip"; import "./legend.styl"; interface ILegendProps { diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx index fd7a358e376e..4b017325a3fa 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/network/sort/index.tsx @@ -12,9 +12,9 @@ import { Checkbox, Divider } from "antd"; import React from "react"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { trackNetworkSort } from "src/util/analytics"; import { getMatchParamByName } from "src/util/query"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { NetworkFilter, NetworkSort } from ".."; import { Filter } from "../filter"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx index df129e954b91..a587d998ea98 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodeHistory/decommissionedNodeHistory.tsx @@ -8,14 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; -import { Moment } from "moment-timezone"; -import flow from "lodash/flow"; -import orderBy from "lodash/orderBy"; -import map from "lodash/map"; import { ColumnsConfig, Table, @@ -23,14 +15,22 @@ import { util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import flow from "lodash/flow"; +import map from "lodash/map"; +import orderBy from "lodash/orderBy"; +import { Moment } from "moment-timezone"; +import * as React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { AdminUIState } from "src/redux/state"; -import { nodesSummarySelector } from "src/redux/nodes"; -import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; +import { Text } from "src/components"; import { cockroach } from "src/js/protos"; +import { refreshLiveness, refreshNodes } from "src/redux/apiReducers"; import { LocalSetting } from "src/redux/localsettings"; -import { Text } from "src/components"; +import { nodesSummarySelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; import "./decommissionedNodeHistory.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx index b1d7cc20252e..e102691bcf69 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/nodes/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import classNames from "classnames"; -import Long from "long"; -import moment from "moment-timezone"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { withRouter, RouteComponentProps } from "react-router-dom"; import { util } from "@cockroachlabs/cluster-ui"; +import classNames from "classnames"; +import flow from "lodash/flow"; import get from "lodash/get"; -import join from "lodash/join"; import has from "lodash/has"; -import map from "lodash/map"; import isEmpty from "lodash/isEmpty"; import isEqual from "lodash/isEqual"; import isNil from "lodash/isNil"; -import flow from "lodash/flow"; -import uniq from "lodash/uniq"; +import join from "lodash/join"; +import map from "lodash/map"; import orderBy from "lodash/orderBy"; +import uniq from "lodash/uniq"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { withRouter, RouteComponentProps } from "react-router-dom"; import { InlineAlert } from "src/components"; import * as protos from "src/js/protos"; @@ -44,11 +44,11 @@ import { localityToString, NodeFilterList, } from "src/views/reports/components/nodeFilterList"; +import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { PageConfig, PageConfigItem, } from "src/views/shared/components/pageconfig"; -import Dropdown, { DropdownOption } from "src/views/shared/components/dropdown"; import { BackToAdvanceDebug } from "../util"; @@ -352,7 +352,8 @@ export class Nodes extends React.Component<NodesProps, LocalNodeState> { const inconsistent = !isNil(equality) && flow( - (nodeIds: string[]) => map(nodeIds, nodeID => this.props.nodeStatusByID[nodeID]), + (nodeIds: string[]) => + map(nodeIds, nodeID => this.props.nodeStatusByID[nodeID]), statuses => map(statuses, status => equality(status)), uniq, )(orderedNodeIDs).length > 1; @@ -435,8 +436,9 @@ export class Nodes extends React.Component<NodesProps, LocalNodeState> { } // Sort the node IDs and then convert them back to string for lookups. - const orderedNodeIDs = orderBy(nodeIDsContext, nodeID => nodeID) - .map(nodeID => nodeID.toString()); + const orderedNodeIDs = orderBy(nodeIDsContext, nodeID => nodeID).map( + nodeID => nodeID.toString(), + ); const dropdownOptions: DropdownOption[] = [ { diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx index af3c1790ad41..b56960793b8a 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/problemRanges/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import { Loading } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; -import flow from "lodash/flow"; import filter from "lodash/filter"; -import isEmpty from "lodash/isEmpty"; import flatMap from "lodash/flatMap"; -import map from "lodash/map"; -import sortBy from "lodash/sortBy"; -import sortedUniq from "lodash/sortedUniq"; +import flow from "lodash/flow"; +import isEmpty from "lodash/isEmpty"; import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; import keys from "lodash/keys"; +import map from "lodash/map"; import pickBy from "lodash/pickBy"; +import sortBy from "lodash/sortBy"; +import sortedUniq from "lodash/sortedUniq"; import values from "lodash/values"; +import Long from "long"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { Link, RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; import { @@ -36,8 +36,8 @@ import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { AdminUIState } from "src/redux/state"; import { nodeIDAttr } from "src/util/constants"; import { FixLong } from "src/util/fixLong"; -import ConnectionsTable from "src/views/reports/containers/problemRanges/connectionsTable"; import { getMatchParamByName } from "src/util/query"; +import ConnectionsTable from "src/views/reports/containers/problemRanges/connectionsTable"; import { BackToAdvanceDebug } from "src/views/reports/containers/util"; type NodeProblems$Properties = diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx index 026c1075c074..b21577d83c39 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/allocator.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Loading } from "@cockroachlabs/cluster-ui"; import isEmpty from "lodash/isEmpty"; import map from "lodash/map"; +import React from "react"; import * as protos from "src/js/protos"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx index 4a199e12a0e3..d820f7b4973b 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/connectionsTable.tsx @@ -8,18 +8,18 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import classNames from "classnames"; -import React from "react"; import { Loading } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; +import classNames from "classnames"; import flow from "lodash/flow"; +import isEmpty from "lodash/isEmpty"; +import isNil from "lodash/isNil"; import keys from "lodash/keys"; import map from "lodash/map"; import sortBy from "lodash/sortBy"; -import isEmpty from "lodash/isEmpty"; +import React from "react"; -import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import * as protos from "src/js/protos"; +import { CachedDataReducerState } from "src/redux/cachedDataReducer"; interface ConnectionsTableProps { range: CachedDataReducerState<protos.cockroach.server.serverpb.RangeResponse>; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx index f36c0c4d4d75..b504cab336e1 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; -import {cockroach} from "@cockroachlabs/crdb-protobuf-client"; import { Button, commonStyles } from "@cockroachlabs/cluster-ui"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; import { ArrowLeft } from "@cockroachlabs/icons"; -import isEqual from "lodash/isEqual"; -import isNil from "lodash/isNil"; -import isEmpty from "lodash/isEmpty"; -import some from "lodash/some"; -import orderBy from "lodash/orderBy"; import flatMap from "lodash/flatMap"; -import sortedUniqBy from "lodash/sortedUniqBy"; import flow from "lodash/flow"; import head from "lodash/head"; +import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; +import orderBy from "lodash/orderBy"; +import some from "lodash/some"; import sortBy from "lodash/sortBy"; +import sortedUniqBy from "lodash/sortedUniqBy"; +import Long from "long"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; import { @@ -40,13 +40,13 @@ import { CachedDataReducerState } from "src/redux/cachedDataReducer"; import { AdminUIState } from "src/redux/state"; import { rangeIDAttr } from "src/util/constants"; import { FixLong } from "src/util/fixLong"; +import { getMatchParamByName } from "src/util/query"; +import AllocatorOutput from "src/views/reports/containers/range/allocator"; import ConnectionsTable from "src/views/reports/containers/range/connectionsTable"; -import RangeTable from "src/views/reports/containers/range/rangeTable"; +import LeaseTable from "src/views/reports/containers/range/leaseTable"; import LogTable from "src/views/reports/containers/range/logTable"; -import AllocatorOutput from "src/views/reports/containers/range/allocator"; import RangeInfo from "src/views/reports/containers/range/rangeInfo"; -import LeaseTable from "src/views/reports/containers/range/leaseTable"; -import { getMatchParamByName } from "src/util/query"; +import RangeTable from "src/views/reports/containers/range/rangeTable"; import IRangeInfo = cockroach.server.serverpb.IRangeInfo; @@ -162,9 +162,7 @@ export class Range extends React.Component<RangeProps, {}> { } // Did we get any responses? - if ( - !some(range.data.responses_by_node_id, resp => resp.infos.length > 0) - ) { + if (!some(range.data.responses_by_node_id, resp => resp.infos.length > 0)) { return ( <ErrorPage rangeID={rangeID} @@ -197,9 +195,10 @@ export class Range extends React.Component<RangeProps, {}> { // Gather all replica IDs. const replicas = flow( - (infos: IRangeInfo[]) => flatMap(infos, info => info.state.state.desc.internal_replicas), + (infos: IRangeInfo[]) => + flatMap(infos, info => info.state.state.desc.internal_replicas), descriptors => sortBy(descriptors, d => d.replica_id), - descriptors => sortedUniqBy(descriptors, d => d.replica_id) + descriptors => sortedUniqBy(descriptors, d => d.replica_id), )(infos); return ( @@ -252,7 +251,12 @@ const mapDispatchToProps = { }; export default withRouter( - connect<RangeStateProps, RangeDispatchProps, RouteComponentProps, AdminUIState>( + connect< + RangeStateProps, + RangeDispatchProps, + RouteComponentProps, + AdminUIState + >( mapStateToProps, mapDispatchToProps, )(Range), diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx index ec4a35752c5b..b8df883a63db 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/leaseTable.tsx @@ -11,8 +11,8 @@ import head from "lodash/head"; import isEmpty from "lodash/isEmpty"; import isNil from "lodash/isNil"; -import reverse from "lodash/reverse"; import map from "lodash/map"; +import reverse from "lodash/reverse"; import React from "react"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx index 06214ee90865..6dd7b81195b6 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/logTable.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Loading, util } from "@cockroachlabs/cluster-ui"; import isEmpty from "lodash/isEmpty"; -import orderBy from "lodash/orderBy"; import map from "lodash/map"; +import orderBy from "lodash/orderBy"; +import React from "react"; import * as protos from "src/js/protos"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts index e7db912fdd99..b6daa39ad70b 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/print.ts @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import moment from "moment-timezone"; import { util } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; import has from "lodash/has"; -import round from "lodash/round"; import isEmpty from "lodash/isEmpty"; +import isNil from "lodash/isNil"; import join from "lodash/join"; +import round from "lodash/round"; +import Long from "long"; +import moment from "moment-timezone"; import * as protos from "src/js/protos"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx index 925cfaac116a..d2ae58c44014 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx @@ -8,30 +8,30 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import classNames from "classnames"; -import toLower from "lodash/toLower"; -import isNull from "lodash/isNull"; -import Long from "long"; -import moment from "moment-timezone"; -import React from "react"; import { util } from "@cockroachlabs/cluster-ui"; -import isNil from "lodash/isNil"; +import classNames from "classnames"; import concat from "lodash/concat"; -import join from "lodash/join"; -import isEqual from "lodash/isEqual"; -import map from "lodash/map"; -import head from "lodash/head"; import flow from "lodash/flow"; -import sortBy from "lodash/sortBy"; import forEach from "lodash/forEach"; +import head from "lodash/head"; +import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; +import isNull from "lodash/isNull"; +import join from "lodash/join"; +import map from "lodash/map"; import size from "lodash/size"; +import sortBy from "lodash/sortBy"; +import toLower from "lodash/toLower"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; -import RangeInfo from "src/views/reports/containers/range/rangeInfo"; -import Print from "src/views/reports/containers/range/print"; -import Lease from "src/views/reports/containers/range/lease"; -import { FixLong } from "src/util/fixLong"; import { cockroach } from "src/js/protos"; import * as protos from "src/js/protos"; +import { FixLong } from "src/util/fixLong"; +import Lease from "src/views/reports/containers/range/lease"; +import Print from "src/views/reports/containers/range/print"; +import RangeInfo from "src/views/reports/containers/range/rangeInfo"; import IRangeInfo = cockroach.server.serverpb.IRangeInfo; @@ -679,7 +679,7 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> { // We want to display ordered by store ID. const sortedStoreIDs = flow( (infos: IRangeInfo[]) => map(infos, info => info.source_store_id), - (storeIds) => sortBy(storeIds, id => id) + storeIds => sortBy(storeIds, id => id), )(infos); const dormantStoreIDs: Set<number> = new Set(); @@ -748,7 +748,9 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> { ? "range-table__cell--lease-holder" : "range-table__cell--lease-follower", ), - leaseType: this.createContent(leaseEpoch ? "epoch" : leaseLeader ? "leader" : "expiration"), + leaseType: this.createContent( + leaseEpoch ? "epoch" : leaseLeader ? "leader" : "expiration", + ), leaseEpoch: leaseEpoch ? this.createContent(lease.epoch) : rangeTableEmptyContent, @@ -925,10 +927,7 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> { info.state.circuit_breaker_error, ), locality: this.contentIf(size(info.locality.tiers) > 0, () => ({ - value: map( - info.locality.tiers, - tier => `${tier.key}: ${tier.value}`, - ), + value: map(info.locality.tiers, tier => `${tier.key}: ${tier.value}`), })), pausedFollowers: this.createContent( info.state.paused_replicas?.join(", "), diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx index 234cac8fd369..c84bba5612fd 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/redux/index.tsx @@ -8,11 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames"; import * as React from "react"; +import CopyToClipboard from "react-copy-to-clipboard"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; -import classNames from "classnames"; -import CopyToClipboard from "react-copy-to-clipboard"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { AdminUIState } from "src/redux/state"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx index 634a71b201c5..ef0e67bf27e5 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/settings/index.tsx @@ -8,11 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import isNil from "lodash/isNil"; -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Loading, ColumnDescriptor, @@ -21,11 +16,16 @@ import { util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import isNil from "lodash/isNil"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import * as protos from "src/js/protos"; import { refreshSettings } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; +import { AdminUIState } from "src/redux/state"; import { BackToAdvanceDebug } from "../util"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx index a6d9d8b143ce..524b1c471af6 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/statementDiagnosticsHistory/index.tsx @@ -8,12 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Helmet } from "react-helmet"; -import { connect } from "react-redux"; -import moment from "moment-timezone"; -import { Link } from "react-router-dom"; -import isUndefined from "lodash/isUndefined"; import { api as clusterUiApi, DownloadFile, @@ -28,25 +22,31 @@ import { util, Timestamp, } from "@cockroachlabs/cluster-ui"; +import isUndefined from "lodash/isUndefined"; +import moment from "moment-timezone"; +import React from "react"; +import { Helmet } from "react-helmet"; +import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import { Anchor, Button, Text, TextTypes, Tooltip } from "src/components"; -import HeaderSection from "src/views/shared/components/headerSection"; +import { trackCancelDiagnosticsBundleAction } from "src/redux/analyticsActions"; +import { + invalidateStatementDiagnosticsRequests, + refreshStatementDiagnosticsRequests, +} from "src/redux/apiReducers"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { trustIcon } from "src/util/trust"; +import { cancelStatementDiagnosticsReportAction } from "src/redux/statements"; import { selectStatementDiagnosticsReports, selectStatementByFingerprint, statementDiagnosticsReportsInFlight, } from "src/redux/statements/statementsSelectors"; -import { - invalidateStatementDiagnosticsRequests, - refreshStatementDiagnosticsRequests, -} from "src/redux/apiReducers"; +import { trackDownloadDiagnosticsBundle } from "src/util/analytics"; import { statementDiagnostics } from "src/util/docs"; import { summarize } from "src/util/sql/summarize"; -import { trackDownloadDiagnosticsBundle } from "src/util/analytics"; -import { cancelStatementDiagnosticsReportAction } from "src/redux/statements"; -import { trackCancelDiagnosticsBundleAction } from "src/redux/analyticsActions"; +import { trustIcon } from "src/util/trust"; +import HeaderSection from "src/views/shared/components/headerSection"; import "./statementDiagnosticsHistoryView.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx index 26ef9934934d..d34a208d4a2d 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/stores/index.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { Loading } from "@cockroachlabs/cluster-ui"; +import isEmpty from "lodash/isEmpty"; +import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; +import map from "lodash/map"; +import sortBy from "lodash/sortBy"; import React from "react"; import { Helmet } from "react-helmet"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { Loading } from "@cockroachlabs/cluster-ui"; -import isEqual from "lodash/isEqual"; -import isEmpty from "lodash/isEmpty"; -import map from "lodash/map"; -import isNil from "lodash/isNil"; -import sortBy from "lodash/sortBy"; import * as protos from "src/js/protos"; import { storesRequestKey, refreshStores } from "src/redux/apiReducers"; import { AdminUIState } from "src/redux/state"; import { nodeIDAttr } from "src/util/constants"; -import EncryptionStatus from "src/views/reports/containers/stores/encryption"; import { getMatchParamByName } from "src/util/query"; +import EncryptionStatus from "src/views/reports/containers/stores/encryption"; import { BackToAdvanceDebug } from "../util"; diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx index df1ce34f8a23..51de884b5fdc 100644 --- a/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx +++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/util.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { History } from "history"; import { Button, commonStyles } from "@cockroachlabs/cluster-ui"; import { ArrowLeft } from "@cockroachlabs/icons"; +import { History } from "history"; +import React from "react"; interface backProps { history: History; diff --git a/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx b/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx index 3b922f15968a..63cef9a4eb0f 100644 --- a/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/sessions/sessionDetails.tsx @@ -8,16 +8,11 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { SessionDetails, byteArrayToUuid } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; import { createSelector } from "reselect"; -import { connect } from "react-redux"; -import { SessionDetails, byteArrayToUuid } from "@cockroachlabs/cluster-ui"; -import { getMatchParamByName } from "src/util/query"; -import { sessionAttr } from "src/util/constants"; -import { Pick } from "src/util/pick"; -import { AdminUIState } from "src/redux/state"; -import { SessionsResponseMessage } from "src/util/api"; import { CachedDataReducerState, refreshLiveness, @@ -29,7 +24,12 @@ import { terminateQueryAction, terminateSessionAction, } from "src/redux/sessions/sessionsSagas"; +import { AdminUIState } from "src/redux/state"; import { setTimeScale } from "src/redux/timeScale"; +import { SessionsResponseMessage } from "src/util/api"; +import { sessionAttr } from "src/util/constants"; +import { Pick } from "src/util/pick"; +import { getMatchParamByName } from "src/util/query"; type SessionsState = Pick<AdminUIState, "cachedData", "sessions">; diff --git a/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx b/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx index 07b3aa99d0ce..fc55b15c5087 100644 --- a/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/sessions/sessionsPage.tsx @@ -8,24 +8,24 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { RouteComponentProps, withRouter } from "react-router-dom"; -import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { defaultFilters, Filters, SessionsPage, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; +import { createSelector } from "reselect"; -import { Pick } from "src/util/pick"; -import { AdminUIState } from "src/redux/state"; -import { LocalSetting } from "src/redux/localsettings"; import { CachedDataReducerState, refreshSessions } from "src/redux/apiReducers"; -import { SessionsResponseMessage } from "src/util/api"; +import { LocalSetting } from "src/redux/localsettings"; import { terminateQueryAction, terminateSessionAction, } from "src/redux/sessions/sessionsSagas"; +import { AdminUIState } from "src/redux/state"; +import { SessionsResponseMessage } from "src/util/api"; +import { Pick } from "src/util/pick"; type SessionsState = Pick<AdminUIState, "cachedData", "sessions">; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx index 644c14edb5d8..2974edf9aa59 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/alertBox/index.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; +import React from "react"; import { AlertInfo, AlertLevel } from "src/redux/alerts"; +import { trustIcon } from "src/util/trust"; import { warningIcon, notificationIcon, criticalIcon, } from "src/views/shared/components/icons"; -import { trustIcon } from "src/util/trust"; import "./alertbox.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx index 11c106505172..a3e951a760d5 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.stories.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { storiesOf } from "@storybook/react"; import noop from "lodash/noop"; +import React from "react"; -import { styledWrapper } from "src/util/decorators"; import { AlertLevel } from "src/redux/alerts"; +import { styledWrapper } from "src/util/decorators"; import { AlertMessage } from "./alertMessage"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx index 42e8928af90e..e61346d0406b 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/alertMessage/alertMessage.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; -import { Alert } from "antd"; import { CheckCircleFilled, CloseCircleFilled, InfoCircleFilled, WarningFilled, } from "@ant-design/icons"; +import { Alert } from "antd"; +import React from "react"; import { Link } from "react-router-dom"; import { AlertInfo, AlertLevel } from "src/redux/alerts"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx index 2736c9f7575f..e22c117cbc07 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/drawer/index.tsx @@ -8,10 +8,10 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { Drawer, Button, Divider } from "antd"; -import { Link } from "react-router-dom"; import classNames from "classnames/bind"; +import React from "react"; +import { Link } from "react-router-dom"; import styles from "./drawer.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx index 59df22aca824..012f98f08109 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/dropdown/index.tsx @@ -9,14 +9,14 @@ // licenses/APL.txt. import classNames from "classnames/bind"; -import Select from "react-select"; -import React from "react"; -import isNil from "lodash/isNil"; import includes from "lodash/includes"; +import isNil from "lodash/isNil"; +import React from "react"; +import Select from "react-select"; -import { leftArrow, rightArrow } from "src/views/shared/components/icons"; -import { trustIcon } from "src/util/trust"; import { CaretDown } from "src/components/icon/caretDown"; +import { trustIcon } from "src/util/trust"; +import { leftArrow, rightArrow } from "src/views/shared/components/icons"; import styles from "./dropdown.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx index 330dd3520d7c..1b0c7f387f5b 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/emailSubscriptionForm/emailSubscriptionForm.spec.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import { mount, ReactWrapper } from "enzyme"; +import React from "react"; import { EmailSubscriptionForm } from "./index"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx index f8b6d0141eb4..5d658e24704d 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/metricQuery/index.tsx @@ -29,15 +29,15 @@ * combine it with the result of a query to create some renderable output. */ -import React from "react"; -import Long from "long"; -import { History } from "history"; import { AxisUnits, TimeScale } from "@cockroachlabs/cluster-ui"; import { cockroach } from "@cockroachlabs/crdb-protobuf-client-ccl"; +import { History } from "history"; +import Long from "long"; +import React from "react"; -import { TimeWindow } from "src/redux/timeScale"; import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { TimeWindow } from "src/redux/timeScale"; import TimeSeriesQueryDerivative = protos.cockroach.ts.tspb.TimeSeriesQueryDerivative; type TSResponse = protos.cockroach.ts.tspb.TimeSeriesQueryResponse; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx index a6311f05a52a..7980c4ee305f 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/popover/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; +import React from "react"; import { OutsideEventHandler } from "src/components/outsideEventHandler"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx index 91d11fe8befa..35be3d9f23dc 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/box.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import { Highlight } from "./highlight"; import styles from "./sqlhighlight.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx index 356a549184bf..65c6dea46d63 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/sql/highlight.tsx @@ -8,12 +8,12 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import classNames from "classnames/bind"; import * as hljs from "highlight.js"; import React from "react"; -import classNames from "classnames/bind"; -import styles from "./sqlhighlight.module.styl"; import { SqlBoxProps } from "./box"; +import styles from "./sqlhighlight.module.styl"; const cx = classNames.bind(styles); diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx index 64166ec32f1c..e4abe940b052 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryBar/index.tsx @@ -8,16 +8,16 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classNames from "classnames"; import isNumber from "lodash/isNumber"; import last from "lodash/last"; import sum from "lodash/sum"; +import React from "react"; +import { InfoTooltip } from "src/components/infoTooltip"; import * as protos from "src/js/protos"; -import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import { MetricsDataComponentProps } from "src/views/shared/components/metricQuery"; -import { InfoTooltip } from "src/components/infoTooltip"; +import { MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; import "./summarybar.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx index 22a7eb147c89..e82022df6d31 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/summaryCard/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import React from "react"; import classnames from "classnames/bind"; +import React from "react"; import styles from "./summaryCard.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx index 0df770ac3819..e0b6500a0607 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/toolTip/index.tsx @@ -9,8 +9,8 @@ // licenses/APL.txt. import { Tooltip } from "antd"; -import React from "react"; import classNames from "classnames/bind"; +import React from "react"; import styles from "./tooltip.module.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx index 1ff9fcec45c5..5f42803252a1 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/components/userAvatar/index.tsx @@ -8,8 +8,8 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import * as React from "react"; import classNames from "classnames"; +import * as React from "react"; import "./userAvatar.styl"; diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx index b9913acfc760..64b92ae6d3e0 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/index.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import map from "lodash/map"; import React from "react"; -import { Dispatch, Action, bindActionCreators } from "redux"; import { connect } from "react-redux"; -import map from "lodash/map"; +import { Dispatch, Action, bindActionCreators } from "redux"; -import { AlertBox } from "src/views/shared/components/alertBox"; -import { AdminUIState } from "src/redux/state"; import { Alert, panelAlertsSelector } from "src/redux/alerts"; +import { AdminUIState } from "src/redux/state"; +import { AlertBox } from "src/views/shared/components/alertBox"; interface AlertSectionProps { /** diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx index 797d13b270ea..66b59526d655 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/alerts/overviewListAlerts.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import map from "lodash/map"; import React from "react"; -import { Dispatch, Action, bindActionCreators } from "redux"; import { connect } from "react-redux"; -import map from "lodash/map"; +import { Dispatch, Action, bindActionCreators } from "redux"; -import { AlertBox } from "src/views/shared/components/alertBox"; -import { AdminUIState } from "src/redux/state"; import { Alert, overviewListAlertsSelector } from "src/redux/alerts"; +import { AdminUIState } from "src/redux/state"; +import { AlertBox } from "src/views/shared/components/alertBox"; interface AlertSectionProps { /** diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx index 29327c1a6220..56882ebfac80 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/index.tsx @@ -8,11 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import Long from "long"; -import moment from "moment-timezone"; -import React from "react"; -import { connect } from "react-redux"; -import { createSelector } from "reselect"; import { util, TimeWindow, @@ -21,17 +16,29 @@ import { defaultTimeScaleOptions, } from "@cockroachlabs/cluster-ui"; import { History } from "history"; -import isNil from "lodash/isNil"; -import map from "lodash/map"; import isEqual from "lodash/isEqual"; +import isNil from "lodash/isNil"; import isObject from "lodash/isObject"; +import map from "lodash/map"; +import Long from "long"; +import moment from "moment-timezone"; +import React from "react"; +import { connect } from "react-redux"; +import { createSelector } from "reselect"; +import { PayloadAction } from "src/interfaces/action"; import * as protos from "src/js/protos"; +import { refreshSettings } from "src/redux/apiReducers"; +import { + selectResolution10sStorageTTL, + selectResolution30mStorageTTL, +} from "src/redux/clusterSettings"; import { MetricsQuery, requestMetrics as requestMetricsAction, } from "src/redux/metrics"; import { AdminUIState } from "src/redux/state"; +import { adjustTimeScale, selectMetricsTime } from "src/redux/timeScale"; import { findChildrenOfType } from "src/util/find"; import { Metric, @@ -39,13 +46,6 @@ import { MetricsDataComponentProps, QueryTimeInfo, } from "src/views/shared/components/metricQuery"; -import { PayloadAction } from "src/interfaces/action"; -import { refreshSettings } from "src/redux/apiReducers"; -import { adjustTimeScale, selectMetricsTime } from "src/redux/timeScale"; -import { - selectResolution10sStorageTTL, - selectResolution30mStorageTTL, -} from "src/redux/clusterSettings"; /** diff --git a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx index 3e84048f54ac..dd2cb907cfab 100644 --- a/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/shared/containers/metricDataProvider/metricDataProvider.spec.tsx @@ -15,6 +15,7 @@ import Long from "long"; import React, { Fragment } from "react"; import * as protos from "src/js/protos"; +import { refreshSettings } from "src/redux/apiReducers"; import { MetricsQuery, requestMetrics } from "src/redux/metrics"; import { Axis, @@ -23,7 +24,6 @@ import { QueryTimeInfo, } from "src/views/shared/components/metricQuery"; import { MetricsDataProviderUnconnected as MetricsDataProvider } from "src/views/shared/containers/metricDataProvider"; -import { refreshSettings } from "src/redux/apiReducers"; // TextGraph is a proof-of-concept component used to demonstrate that // MetricsDataProvider is working correctly. Used in tests. diff --git a/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx b/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx index df6df5c9e30c..0621c5a59b91 100644 --- a/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx @@ -11,16 +11,16 @@ // All changes made on this file, should also be done on the equivalent // file on managed-service repo. +import { commonStyles, util } from "@cockroachlabs/cluster-ui"; +import { Tabs } from "antd"; import React, { useState } from "react"; import Helmet from "react-helmet"; -import { Tabs } from "antd"; -import { commonStyles, util } from "@cockroachlabs/cluster-ui"; import { RouteComponentProps } from "react-router-dom"; +import { tabAttr, viewAttr } from "src/util/constants"; import SessionsPageConnected from "src/views/sessions/sessionsPage"; -import TransactionsPageConnected from "src/views/transactions/transactionsPage"; import StatementsPageConnected from "src/views/statements/statementsPage"; -import { tabAttr, viewAttr } from "src/util/constants"; +import TransactionsPageConnected from "src/views/transactions/transactionsPage"; const { TabPane } = Tabs; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx index 7cedaf304b7c..54d8977d4e1f 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementDetailsConnected.tsx @@ -16,13 +16,13 @@ import { import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { AdminUIState } from "src/redux/state"; +import { selectHasAdminRole } from "src/redux/user"; import { selectActiveStatement, selectContentionDetailsForStatement, } from "src/selectors"; -import { selectHasAdminRole } from "src/redux/user"; export default withRouter( connect< diff --git a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx index e6f02cdcce64..960dc03f49c2 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/activeStatementsSelectors.tsx @@ -14,14 +14,14 @@ import { SortSetting, } from "@cockroachlabs/cluster-ui"; +import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; +import { AdminUIState } from "src/redux/state"; import { selectActiveStatements, selectAppName, selectClusterLocksMaxApiSizeReached, } from "src/selectors"; -import { refreshLiveWorkload } from "src/redux/apiReducers"; -import { LocalSetting } from "src/redux/localsettings"; -import { AdminUIState } from "src/redux/state"; import { autoRefreshLocalSetting } from "../transactions/activeTransactionsSelectors"; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx b/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx index 95f5749c131b..515737328abc 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/statementDetails.tsx @@ -7,11 +7,6 @@ // 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. -import { connect } from "react-redux"; -import { withRouter } from "react-router-dom"; -import { createSelector } from "reselect"; -import Long from "long"; -import { RouteComponentProps } from "react-router"; import { StatementDetails, StatementDetailsDispatchProps, @@ -20,8 +15,19 @@ import { util, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import Long from "long"; import moment from "moment-timezone"; +import { connect } from "react-redux"; +import { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router-dom"; +import { createSelector } from "reselect"; +import { createStatementDiagnosticsAlertLocalSetting } from "src/redux/alerts"; +import { + trackCancelDiagnosticsBundleAction, + trackDownloadDiagnosticsBundleAction, + trackStatementDetailsSubnavSelectionAction, +} from "src/redux/analyticsActions"; import { refreshLiveness, refreshNodes, @@ -32,26 +38,20 @@ import { } from "src/redux/apiReducers"; import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { selectDiagnosticsReportsByStatementFingerprint } from "src/redux/statements/statementsSelectors"; import { cancelStatementDiagnosticsReportAction, createStatementDiagnosticsReportAction, setGlobalTimeScaleAction, } from "src/redux/statements"; -import { createStatementDiagnosticsAlertLocalSetting } from "src/redux/alerts"; +import { selectDiagnosticsReportsByStatementFingerprint } from "src/redux/statements/statementsSelectors"; +import { selectTimeScale } from "src/redux/timeScale"; import { selectHasAdminRole, selectHasViewActivityRedactedRole, } from "src/redux/user"; -import { - trackCancelDiagnosticsBundleAction, - trackDownloadDiagnosticsBundleAction, - trackStatementDetailsSubnavSelectionAction, -} from "src/redux/analyticsActions"; import { StatementDetailsResponseMessage } from "src/util/api"; -import { getMatchParamByName, queryByName } from "src/util/query"; import { appNamesAttr, statementAttr } from "src/util/constants"; -import { selectTimeScale } from "src/redux/timeScale"; +import { getMatchParamByName, queryByName } from "src/util/query"; import { requestTimeLocalSetting } from "./statementsPage"; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx b/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx index 495b557e996f..1e79ca5ad78f 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/statements.spec.tsx @@ -8,25 +8,25 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +import { TimeScale, toRoundedDateRange, util } from "@cockroachlabs/cluster-ui"; +import * as H from "history"; +import merge from "lodash/merge"; import Long from "long"; import moment from "moment-timezone"; import { RouteComponentProps } from "react-router-dom"; -import * as H from "history"; -import merge from "lodash/merge"; -import { TimeScale, toRoundedDateRange, util } from "@cockroachlabs/cluster-ui"; import "src/protobufInit"; import * as protos from "src/js/protos"; +import { AdminUIState, createAdminUIStore } from "src/redux/state"; import { appAttr, appNamesAttr, statementAttr, unset, } from "src/util/constants"; -import { AdminUIState, createAdminUIStore } from "src/redux/state"; -import { selectLastReset } from "./statementsPage"; import { selectStatementDetails } from "./statementDetails"; +import { selectLastReset } from "./statementsPage"; import ISensitiveInfo = protos.cockroach.sql.ISensitiveInfo; diff --git a/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx b/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx index 6d9c718ea475..01899c54adec 100644 --- a/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx @@ -8,10 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { bindActionCreators } from "redux"; -import { createSelector } from "reselect"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Filters, defaultFilters, @@ -24,7 +20,21 @@ import { StatementsPageRootProps, api, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; +import { bindActionCreators } from "redux"; +import { createSelector } from "reselect"; +import { + createStatementDiagnosticsAlertLocalSetting, + cancelStatementDiagnosticsAlertLocalSetting, +} from "src/redux/alerts"; +import { + trackApplySearchCriteriaAction, + trackCancelDiagnosticsBundleAction, + trackDownloadDiagnosticsBundleAction, + trackStatementsPaginationAction, +} from "src/redux/analyticsActions"; import { refreshNodes, refreshDatabases, @@ -34,32 +44,22 @@ import { createSelectorForCachedDataField, } from "src/redux/apiReducers"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; +import { LocalSetting } from "src/redux/localsettings"; +import { nodeRegionsByIDSelector } from "src/redux/nodes"; +import { resetSQLStatsAction } from "src/redux/sqlStats"; import { AdminUIState, AppDispatch } from "src/redux/state"; -import { PrintTime } from "src/views/reports/containers/range/print"; -import { - createStatementDiagnosticsAlertLocalSetting, - cancelStatementDiagnosticsAlertLocalSetting, -} from "src/redux/alerts"; -import { - selectHasViewActivityRedactedRole, - selectHasAdminRole, -} from "src/redux/user"; import { cancelStatementDiagnosticsReportAction, createOpenDiagnosticsModalAction, createStatementDiagnosticsReportAction, setGlobalTimeScaleAction, } from "src/redux/statements"; -import { - trackApplySearchCriteriaAction, - trackCancelDiagnosticsBundleAction, - trackDownloadDiagnosticsBundleAction, - trackStatementsPaginationAction, -} from "src/redux/analyticsActions"; -import { resetSQLStatsAction } from "src/redux/sqlStats"; -import { LocalSetting } from "src/redux/localsettings"; -import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { selectTimeScale } from "src/redux/timeScale"; +import { + selectHasViewActivityRedactedRole, + selectHasAdminRole, +} from "src/redux/user"; +import { PrintTime } from "src/views/reports/containers/range/print"; import { activeStatementsViewActions, diff --git a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx index 86450c755ac0..bd9ecbecf80b 100644 --- a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotPage.tsx @@ -14,9 +14,9 @@ import { SortSetting, api as clusterUiApi, } from "@cockroachlabs/cluster-ui"; +import Long from "long"; import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import Long from "long"; import { rawTraceKey, diff --git a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx index 44070ac5a9ca..c0c9de239500 100644 --- a/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx +++ b/pkg/ui/workspaces/db-console/src/views/tracez_v2/snapshotRoutes.tsx @@ -10,11 +10,11 @@ import { join } from "path"; -import { Route, Switch, useHistory, useRouteMatch } from "react-router-dom"; import React, { useEffect } from "react"; +import { Route, Switch, useHistory, useRouteMatch } from "react-router-dom"; -import SnapshotPage from "src/views/tracez_v2/snapshotPage"; import { getDataFromServer } from "src/util/dataFromServer"; +import SnapshotPage from "src/views/tracez_v2/snapshotPage"; const NodePicker: React.FC = () => { // If no node was provided, navigate explicitly to the local node. diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx index 9891cae17fad..d480c08f531d 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionDetailsConnected.tsx @@ -16,8 +16,8 @@ import { import { connect } from "react-redux"; import { RouteComponentProps, withRouter } from "react-router-dom"; -import { AdminUIState } from "src/redux/state"; import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { AdminUIState } from "src/redux/state"; import { selectActiveTransaction, selectContentionDetailsForTransaction, diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx index c5ca7ddb87f5..cb3689fdfe65 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/activeTransactionsSelectors.tsx @@ -15,14 +15,14 @@ import { SortSetting, } from "@cockroachlabs/cluster-ui"; +import { refreshLiveWorkload } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; +import { AdminUIState } from "src/redux/state"; import { selectAppName, selectActiveTransactions, selectClusterLocksMaxApiSizeReached, } from "src/selectors"; -import { refreshLiveWorkload } from "src/redux/apiReducers"; -import { LocalSetting } from "src/redux/localsettings"; -import { AdminUIState } from "src/redux/state"; export const ACTIVE_EXECUTIONS_IS_AUTOREFRESH_ENABLED = "isAutoRefreshEnabled/ActiveExecutions"; diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx index 2e5b92a674e3..c5f2e0dd4bfc 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/transactionDetails.tsx @@ -8,14 +8,14 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { withRouter } from "react-router-dom"; import { TransactionDetailsStateProps, TransactionDetailsDispatchProps, TransactionDetails, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; import { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router-dom"; import { refreshNodes, @@ -23,20 +23,20 @@ import { refreshTxnInsights, refreshUserSQLRoles, } from "src/redux/apiReducers"; -import { AdminUIState } from "src/redux/state"; import { nodeRegionsByIDSelector } from "src/redux/nodes"; +import { AdminUIState } from "src/redux/state"; +import { setGlobalTimeScaleAction } from "src/redux/statements"; +import { selectTimeScale } from "src/redux/timeScale"; +import { selectHasAdminRole } from "src/redux/user"; +import { txnFingerprintIdAttr } from "src/util/constants"; +import { getMatchParamByName } from "src/util/query"; +import { selectTxnInsightsByFingerprint } from "src/views/insights/insightsSelectors"; import { reqSortSetting, limitSetting, selectTxns, requestTimeLocalSetting, } from "src/views/transactions/transactionsPage"; -import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { selectTimeScale } from "src/redux/timeScale"; -import { selectTxnInsightsByFingerprint } from "src/views/insights/insightsSelectors"; -import { selectHasAdminRole } from "src/redux/user"; -import { getMatchParamByName } from "src/util/query"; -import { txnFingerprintIdAttr } from "src/util/constants"; export default withRouter( connect<TransactionDetailsStateProps, TransactionDetailsDispatchProps, RouteComponentProps, AdminUIState>( diff --git a/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx b/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx index 1505c7005a14..ece8ba837798 100644 --- a/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx +++ b/pkg/ui/workspaces/db-console/src/views/transactions/transactionsPage.tsx @@ -8,9 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -import { connect } from "react-redux"; -import { createSelector } from "reselect"; -import { RouteComponentProps, withRouter } from "react-router-dom"; import { Filters, defaultFilters, @@ -23,23 +20,26 @@ import { TransactionsPageRootProps, api, } from "@cockroachlabs/cluster-ui"; +import { connect } from "react-redux"; +import { RouteComponentProps, withRouter } from "react-router-dom"; import { bindActionCreators } from "redux"; +import { createSelector } from "reselect"; +import { trackApplySearchCriteriaAction } from "src/redux/analyticsActions"; import { createSelectorForCachedDataField, refreshNodes, refreshTxns, refreshUserSQLRoles, } from "src/redux/apiReducers"; +import { LocalSetting } from "src/redux/localsettings"; +import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { resetSQLStatsAction } from "src/redux/sqlStats"; import { AdminUIState } from "src/redux/state"; -import { selectHasAdminRole } from "src/redux/user"; -import { PrintTime } from "src/views/reports/containers/range/print"; -import { nodeRegionsByIDSelector } from "src/redux/nodes"; import { setGlobalTimeScaleAction } from "src/redux/statements"; -import { LocalSetting } from "src/redux/localsettings"; import { selectTimeScale } from "src/redux/timeScale"; -import { trackApplySearchCriteriaAction } from "src/redux/analyticsActions"; +import { selectHasAdminRole } from "src/redux/user"; +import { PrintTime } from "src/views/reports/containers/range/print"; import { activeTransactionsPageActionCreators,
6166df56cb097613b7ba405580484f3f0f0c534f
2018-01-26 14:53:57
marc
sql: add pg_catalog.pg_auth_members table.
false
add pg_catalog.pg_auth_members table.
sql
diff --git a/pkg/sql/information_schema.go b/pkg/sql/information_schema.go index 8f0ea3dbd6e1..828000a88e82 100644 --- a/pkg/sql/information_schema.go +++ b/pkg/sql/information_schema.go @@ -1063,7 +1063,7 @@ func forEachColumnInIndex( } func forEachRole( - ctx context.Context, origPlanner *planner, fn func(username string, isRole tree.DBool) error, + ctx context.Context, origPlanner *planner, fn func(username string, isRole bool) error, ) error { query := `SELECT username, "isRole" FROM system.users` p, cleanup := newInternalPlanner( @@ -1083,7 +1083,33 @@ func forEachRole( return errors.Errorf("isRole should be a boolean value, found %s instead", row[1].ResolvedType()) } - if err := fn(string(username), *isRole); err != nil { + if err := fn(string(username), bool(*isRole)); err != nil { + return err + } + } + return nil +} + +func forEachRoleMembership( + ctx context.Context, origPlanner *planner, fn func(role, member string, isAdmin bool) error, +) error { + query := `SELECT "role", "member", "isAdmin" FROM system.role_members` + p, cleanup := newInternalPlanner( + "for-each-role-member", origPlanner.txn, security.RootUser, + origPlanner.extendedEvalCtx.MemMetrics, origPlanner.ExecCfg(), + ) + defer cleanup() + rows, _ /* cols */, err := p.queryRows(ctx, query) + if err != nil { + return err + } + + for _, row := range rows { + roleName := tree.MustBeDString(row[0]) + memberName := tree.MustBeDString(row[1]) + isAdmin := row[2].(*tree.DBool) + + if err := fn(string(roleName), string(memberName), bool(*isAdmin)); err != nil { return err } } diff --git a/pkg/sql/logictest/testdata/logic_test/explain b/pkg/sql/logictest/testdata/logic_test/explain index 1f4659e5d0a8..e15e8144ef87 100644 --- a/pkg/sql/logictest/testdata/logic_test/explain +++ b/pkg/sql/logictest/testdata/logic_test/explain @@ -165,7 +165,7 @@ sort · · └── render · · └── filter · · └── values · · -· size 5 columns, 88 rows +· size 5 columns, 89 rows query TTT EXPLAIN SHOW DATABASE @@ -222,7 +222,7 @@ sort · · ├── render · · │ └── filter · · │ └── values · · - │ size 16 columns, 763 rows + │ size 16 columns, 767 rows └── render · · └── filter · · └── values · · diff --git a/pkg/sql/logictest/testdata/logic_test/information_schema b/pkg/sql/logictest/testdata/logic_test/information_schema index 1f0756deb830..ccca54934b92 100644 --- a/pkg/sql/logictest/testdata/logic_test/information_schema +++ b/pkg/sql/logictest/testdata/logic_test/information_schema @@ -251,6 +251,7 @@ information_schema views pg_catalog pg_am pg_catalog pg_attrdef pg_catalog pg_attribute +pg_catalog pg_auth_members pg_catalog pg_class pg_catalog pg_collation pg_catalog pg_constraint @@ -429,6 +430,7 @@ def other_db xyz BASE TABLE 3 def pg_catalog pg_am SYSTEM VIEW 1 def pg_catalog pg_attrdef SYSTEM VIEW 1 def pg_catalog pg_attribute SYSTEM VIEW 1 +def pg_catalog pg_auth_members SYSTEM VIEW 1 def pg_catalog pg_class SYSTEM VIEW 1 def pg_catalog pg_collation SYSTEM VIEW 1 def pg_catalog pg_constraint SYSTEM VIEW 1 diff --git a/pkg/sql/logictest/testdata/logic_test/pg_catalog b/pkg/sql/logictest/testdata/logic_test/pg_catalog index 0d612fff1654..6a5a4efd42e5 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_catalog +++ b/pkg/sql/logictest/testdata/logic_test/pg_catalog @@ -49,6 +49,7 @@ SHOW TABLES FROM pg_catalog pg_am pg_attrdef pg_attribute +pg_auth_members pg_class pg_collation pg_constraint @@ -1080,6 +1081,15 @@ oid rolname rolconnlimit rolpassword rolvaliduntil rolbypassrls ro 2901009604 root -1 ******** NULL false NULL 2499926009 testuser -1 ******** NULL false NULL +## pg_catalog.pg_auth_members + +query OOOB colnames +SELECT roleid, member, grantor, admin_option +FROM pg_catalog.pg_auth_members +---- +roleid member grantor admin_option +823966177 2901009604 NULL true + ## pg_catalog.pg_user query TOBBBBTTA colnames diff --git a/pkg/sql/pg_catalog.go b/pkg/sql/pg_catalog.go index 9476c315d653..ca9a36b1527f 100644 --- a/pkg/sql/pg_catalog.go +++ b/pkg/sql/pg_catalog.go @@ -60,6 +60,7 @@ var pgCatalog = virtualSchema{ pgCatalogAmTable, pgCatalogAttrDefTable, pgCatalogAttributeTable, + pgCatalogAuthMembersTable, pgCatalogClassTable, pgCatalogCollationTable, pgCatalogConstraintTable, @@ -231,6 +232,30 @@ CREATE TABLE pg_catalog.pg_attribute ( }, } +// See: https://www.postgresql.org/docs/9.6/static/catalog-pg-auth-members.html. +var pgCatalogAuthMembersTable = virtualSchemaTable{ + schema: ` +CREATE TABLE pg_catalog.pg_auth_members ( + roleid OID, + member OID, + grantor OID, + admin_option BOOL +); +`, + populate: func(ctx context.Context, p *planner, _ string, addRow func(...tree.Datum) error) error { + h := makeOidHasher() + return forEachRoleMembership(ctx, p, + func(roleName, memberName string, isAdmin bool) error { + return addRow( + h.UserOid(roleName), // roleid + h.UserOid(memberName), // member + tree.DNull, // grantor + tree.MakeDBool(tree.DBool(isAdmin)), // admin_option + ) + }) + }, +} + var ( relKindTable = tree.NewDString("r") relKindIndex = tree.NewDString("i") @@ -1340,23 +1365,24 @@ CREATE TABLE pg_catalog.pg_roles ( // include sensitive information such as password hashes. h := makeOidHasher() return forEachRole(ctx, p, - func(username string, isRole tree.DBool) error { + func(username string, isRole bool) error { isRoot := tree.DBool(username == security.RootUser || username == sqlbase.AdminRole) + isRoleDBool := tree.DBool(isRole) return addRow( - h.UserOid(username), // oid - tree.NewDName(username), // rolname - tree.MakeDBool(isRoot), // rolsuper - tree.MakeDBool(isRole), // rolinherit. Roles inherit by default. - tree.MakeDBool(isRoot), // rolcreaterole - tree.MakeDBool(isRoot), // rolcreatedb - tree.DBoolFalse, // rolcatupdate - tree.MakeDBool(!isRole), // rolcanlogin. Only users can login. - tree.DBoolFalse, // rolreplication - negOneVal, // rolconnlimit - passwdStarString, // rolpassword - tree.DNull, // rolvaliduntil - tree.DBoolFalse, // rolbypassrls - tree.DNull, // rolconfig + h.UserOid(username), // oid + tree.NewDName(username), // rolname + tree.MakeDBool(isRoot), // rolsuper + tree.MakeDBool(isRoleDBool), // rolinherit. Roles inherit by default. + tree.MakeDBool(isRoot), // rolcreaterole + tree.MakeDBool(isRoot), // rolcreatedb + tree.DBoolFalse, // rolcatupdate + tree.MakeDBool(!isRoleDBool), // rolcanlogin. Only users can login. + tree.DBoolFalse, // rolreplication + negOneVal, // rolconnlimit + passwdStarString, // rolpassword + tree.DNull, // rolvaliduntil + tree.DBoolFalse, // rolbypassrls + tree.DNull, // rolconfig ) }) }, @@ -1712,7 +1738,7 @@ CREATE TABLE pg_catalog.pg_user ( populate: func(ctx context.Context, p *planner, _ string, addRow func(...tree.Datum) error) error { h := makeOidHasher() return forEachRole(ctx, p, - func(username string, isRole tree.DBool) error { + func(username string, isRole bool) error { if isRole { return nil }
55ef8283a6ced432878f22788ec826dad84a99ad
2021-10-30 02:40:36
Tobias Grieger
kvserver: remove IsPreemptive()
false
remove IsPreemptive()
kvserver
diff --git a/pkg/kv/kvserver/raft.go b/pkg/kv/kvserver/raft.go index 027cab267414..8705d3048520 100644 --- a/pkg/kv/kvserver/raft.go +++ b/pkg/kv/kvserver/raft.go @@ -235,14 +235,6 @@ func (m *RaftMessageRequest) release() { raftMessageRequestPool.Put(m) } -// IsPreemptive returns whether this is a preemptive snapshot or a Raft -// snapshot. -func (h *SnapshotRequest_Header) IsPreemptive() bool { - // Preemptive snapshots are addressed to replica ID 0. No other requests to - // replica ID 0 are allowed. - return h.RaftMessageRequest.ToReplica.ReplicaID == 0 -} - // traceEntries records the provided event for all proposals corresponding // to the entries contained in ents. The vmodule level for raft must be at // least 1. diff --git a/pkg/kv/kvserver/store_raft.go b/pkg/kv/kvserver/store_raft.go index aa33add6a552..c1c06cc8f491 100644 --- a/pkg/kv/kvserver/store_raft.go +++ b/pkg/kv/kvserver/store_raft.go @@ -275,10 +275,6 @@ func (s *Store) processRaftRequestWithReplica( func (s *Store) processRaftSnapshotRequest( ctx context.Context, snapHeader *SnapshotRequest_Header, inSnap IncomingSnapshot, ) *roachpb.Error { - if snapHeader.IsPreemptive() { - return roachpb.NewError(errors.AssertionFailedf(`expected a raft or learner snapshot`)) - } - return s.withReplicaForRequest(ctx, &snapHeader.RaftMessageRequest, func( ctx context.Context, r *Replica, ) (pErr *roachpb.Error) { diff --git a/pkg/kv/kvserver/store_snapshot.go b/pkg/kv/kvserver/store_snapshot.go index 03e143e48c7a..779e6cf01642 100644 --- a/pkg/kv/kvserver/store_snapshot.go +++ b/pkg/kv/kvserver/store_snapshot.go @@ -556,10 +556,6 @@ func (s *Store) reserveSnapshot( func (s *Store) canAcceptSnapshotLocked( ctx context.Context, snapHeader *SnapshotRequest_Header, ) (*ReplicaPlaceholder, error) { - if snapHeader.IsPreemptive() { - return nil, errors.AssertionFailedf(`expected a raft or learner snapshot`) - } - // TODO(tbg): see the comment on desc.Generation for what seems to be a much // saner way to handle overlap via generational semantics. desc := *snapHeader.State.Desc @@ -686,10 +682,6 @@ func (s *Store) receiveSnapshot( } } - if header.IsPreemptive() { - return errors.AssertionFailedf(`expected a raft or learner snapshot`) - } - // Defensive check that any snapshot contains this store in the descriptor. storeID := s.StoreID() if _, ok := header.State.Desc.GetReplicaDescriptor(storeID); !ok {