Skip to content

Commit

Permalink
fix the sort key missing in tables having cluster by clause (matrixo…
Browse files Browse the repository at this point in the history
…rigin#12019)

fix the sort key missing in tables having a `cluster by` clause.

the sort key only exists in memory and is constructed when creating schema by reading checkpoint data.

the sort key will be used later in `metadata_scan` and judging if it is needed to `mergesort` columns.

Approved by: @XuPeng-SH
  • Loading branch information
gouhongshen authored Oct 8, 2023
1 parent 34b1197 commit 1c22af4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/vm/engine/tae/catalog/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ func (s *Schema) ReadFromBatch(bat *containers.Batch, offset int, targetTid uint
def.Hidden = i82bool(isHidden)
isClusterBy := bat.GetVectorByName((pkgcatalog.SystemColAttr_IsClusterBy)).Get(offset).(int8)
def.ClusterBy = i82bool(isClusterBy)
if def.ClusterBy {
def.SortKey = true
}
isAutoIncrement := bat.GetVectorByName((pkgcatalog.SystemColAttr_IsAutoIncrement)).Get(offset).(int8)
def.AutoIncrement = i82bool(isAutoIncrement)
def.Comment = string(bat.GetVectorByName((pkgcatalog.SystemColAttr_Comment)).Get(offset).([]byte))
Expand Down

0 comments on commit 1c22af4

Please sign in to comment.