Skip to content

Commit 369329c

Browse files
committed
Fix build
1 parent 689adaa commit 369329c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

protos/distribution.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ message DistributedRelation {
1414
repeated DistributionKeyEntry distributionKey = 2;
1515
}
1616

17-
message Distribution{
17+
message Distribution {
1818
string id = 1;
1919
repeated string ColumnTypes = 2;
2020
repeated DistributedRelation relations = 3;

router/qrouter/proxy_routing.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ func (qr *ProxyQrouter) RecordDistributionKeyColumnValueOnRFQN(meta *RoutingMeta
175175
} else {
176176
// TODO: optimize
177177
ok := false
178-
for _, c := range ds.Relations[resolvedRelation.RelationName].ColumnNames {
179-
if c == colname {
178+
for _, c := range ds.Relations[resolvedRelation.RelationName].DistributionKey {
179+
if c.Column == colname {
180180
ok = true
181181
break
182182
}
@@ -471,10 +471,10 @@ func (qr *ProxyQrouter) deparseShardingMapping(
471471
insertColsPos[c] = i
472472
}
473473

474-
distributionKey := ds.Relations[rfqn.RelationName].ColumnNames
474+
distributionKey := ds.Relations[rfqn.RelationName].DistributionKey
475475
// TODO: check mapping by rules with multiple columns
476476
for _, col := range distributionKey {
477-
if val, ok := insertColsPos[col]; !ok {
477+
if val, ok := insertColsPos[col.Column]; !ok {
478478
return ComplexQuery
479479
} else {
480480
offsets = append(offsets, val)

0 commit comments

Comments
 (0)