Skip to content

Commit 934115d

Browse files
author
James Cor
committed
comments
1 parent 5074e26 commit 934115d

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed

sql/expression/function/aggregation/window_framer.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,28 @@ func (f *rowFramerBase) Interval() (sql.WindowInterval, error) {
319319
// frame: {0,3}, {1,3}, {2,3}, {3,5}, {3,5}, {4,5}
320320
// rows: [0,1,2], [1,2], [2], [4,4,5], [4,4,5], [5]
321321
type rangeFramerBase struct {
322-
startNFollowing sql.Expression
323-
endNFollowing sql.Expression
324-
startNPreceding sql.Expression
325-
endNPreceding sql.Expression
322+
startNFollowing sql.Expression // optional
323+
endNFollowing sql.Expression // optional
324+
startNPreceding sql.Expression // optional
325+
endNPreceding sql.Expression // optional
326+
// boundary arithmetic on [orderBy] for range start value
327+
// is set unless [unboundedPreceding] is true
326328
startInclusion sql.Expression
329+
// boundary arithmetic on [orderBy] for range end value
330+
// is set unless [unboundedFollowing] is true
327331
endInclusion sql.Expression
332+
// reference expression for boundary calculation
328333
orderBy sql.Expression
329334

330335
idx int
331-
partitionEnd int
332-
frameStart int
333-
frameEnd int
334336
partitionStart int
335-
startCurrentRow bool
336-
endCurrentRow bool
337-
unboundedFollowing bool
338-
unboundedPreceding bool
337+
partitionEnd int
338+
frameStart int // optional
339+
frameEnd int // optional
340+
startCurrentRow bool // optional
341+
endCurrentRow bool // optional
342+
unboundedFollowing bool // optional
343+
unboundedPreceding bool // optional
339344
partitionSet bool
340345
}
341346

sql/index.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ type IndexLookup struct {
154154
Index Index
155155
Ranges RangeCollection
156156
VectorOrderAndLimit OrderAndLimit
157+
// IsPointLookup is true if the lookup will return one or zero
158+
// values; the range is null safe, the index is unique, every index
159+
// column has a range expression, and every range expression is an
160+
// exact equality.
157161
IsPointLookup bool
158162
IsEmptyRange bool
159163
IsSpatialLookup bool

sql/iters/rel_iters.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ type JsonTableColOpts struct {
160160
type JsonTableCol struct {
161161
err error
162162
Opts *JsonTableColOpts
163-
Path string
164-
Cols []*JsonTableCol
163+
Path string // if there are nested columns, this is a schema Path, otherwise it is a col Path
164+
Cols []*JsonTableCol // nested columns
165165
data []interface{}
166166
pos int
167167
currSib int
168-
finished bool
168+
finished bool // exhausted all rows in data
169169
}
170170

171171
// IsSibling returns if the jsonTableCol contains multiple columns

sql/plan/dbddl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ func (c *CreateSchema) WithChildren(children ...sql.Node) (sql.Node, error) {
113113
// DropDB removes a databases from the Catalog and updates the active database if it gets removed itself.
114114
type DropDB struct {
115115
Catalog sql.Catalog
116+
// EventScheduler is used to notify EventSchedulerStatus of database deletion,
117+
// so the events of this database in the scheduler will be removed.
116118
Scheduler sql.EventScheduler
117119
DbName string
118120
IfExists bool

sql/plan/subqueryalias.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type SubqueryAlias struct {
3333

3434
id sql.TableId
3535

36+
// OuterScopeVisibility is true when a SubqueryAlias (i.e. derived table) is contained in a subquery
3637
// expression and is eligible to have visibility to outer scopes of the query.
3738
OuterScopeVisibility bool
3839
Volatile bool

sql/plan/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var ErrUpdateUnexpectedSetResult = errors.NewKind("attempted to set field but ex
3232
type Update struct {
3333
UnaryNode
3434
checks sql.CheckConstraints
35+
// Returning is a list of expressions to return after the update operation. This feature is not
3536
// supported in MySQL's syntax, but is exposed through PostgreSQL's syntax.
3637
Returning []sql.Expression
3738
// IsJoin is true only for explicit UPDATE JOIN queries. It's possible for Update.IsJoin to be false and

0 commit comments

Comments
 (0)