github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/sort.go (about) 1 // Copyright 2015 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package sql 12 13 import ( 14 "context" 15 16 "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" 17 "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" 18 ) 19 20 // sortNode represents a node that sorts the rows returned by its 21 // sub-node. 22 type sortNode struct { 23 plan planNode 24 ordering sqlbase.ColumnOrdering 25 // When alreadyOrderedPrefix is non-zero, the input is already ordered on 26 // the prefix ordering[:alreadyOrderedPrefix]. 27 alreadyOrderedPrefix int 28 } 29 30 func (n *sortNode) startExec(runParams) error { 31 panic("sortNode cannot be run in local mode") 32 } 33 34 func (n *sortNode) Next(params runParams) (bool, error) { 35 panic("sortNode cannot be run in local mode") 36 } 37 38 func (n *sortNode) Values() tree.Datums { 39 panic("sortNode cannot be run in local mode") 40 } 41 42 func (n *sortNode) Close(ctx context.Context) { 43 n.plan.Close(ctx) 44 }