Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiwei committed Dec 30, 2022
1 parent 83fe305 commit 9a2f160
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions table/tables/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func (c *index) GenIndexValue(sc *stmtctx.StatementContext, distinct bool, index
return tablecodec.GenIndexValuePortal(sc, c.tblInfo, c.idxInfo, c.needRestoredData, distinct, false, indexedValues, h, c.phyTblID, restoredData)
}

// getIndexedValue will produce the result like:
// 1. If not multi-valued index, return directly.
// 2. (i1, [m1,m2], i2, ...) ==> [(i1, m1, i2, ...), (i1, m2, i2, ...)]
// 3. (i1, null, i2, ...) ==> [(i1, null, i2, ...)]
// 4. (i1, [], i2, ...) ==> nothing.
func (c *index) getIndexedValue(indexedValues []types.Datum) [][]types.Datum {
if !c.idxInfo.MVIndex {
return [][]types.Datum{indexedValues}
Expand Down

0 comments on commit 9a2f160

Please sign in to comment.