Skip to content

Commit

Permalink
adds xmin boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Sep 20, 2023
1 parent ea1c853 commit 499dc7e
Show file tree
Hide file tree
Showing 6 changed files with 482 additions and 132 deletions.
18 changes: 18 additions & 0 deletions flow/connectors/utils/partition/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@ func createTIDPartition(start pgtype.TID, end pgtype.TID) *protos.QRepPartition
}
}

func createXMINPartition(start uint32, end uint32) *protos.QRepPartition {
return &protos.QRepPartition{
PartitionId: uuid.New().String(),
Range: &protos.PartitionRange{
Range: &protos.PartitionRange_XminRange{
XminRange: &protos.XMINPartitionRange{
Start: start,
End: end,
},
},
},
}
}

type PartitionHelper struct {
prevStart interface{}
prevEnd interface{}
Expand Down Expand Up @@ -174,6 +188,10 @@ func (p *PartitionHelper) AddPartition(start interface{}, end interface{}) error
p.partitions = append(p.partitions, createTIDPartition(v, end.(pgtype.TID)))
p.prevStart = v
p.prevEnd = end
case pgtype.Uint32:
p.partitions = append(p.partitions, createXMINPartition(v.Uint32, end.(uint32)))
p.prevStart = v
p.prevEnd = end
default:
return fmt.Errorf("unsupported type: %T", v)
}
Expand Down
Loading

0 comments on commit 499dc7e

Please sign in to comment.