File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ message DistributedRelation {
14
14
repeated DistributionKeyEntry distributionKey = 2 ;
15
15
}
16
16
17
- message Distribution {
17
+ message Distribution {
18
18
string id = 1 ;
19
19
repeated string ColumnTypes = 2 ;
20
20
repeated DistributedRelation relations = 3 ;
Original file line number Diff line number Diff line change @@ -175,8 +175,8 @@ func (qr *ProxyQrouter) RecordDistributionKeyColumnValueOnRFQN(meta *RoutingMeta
175
175
} else {
176
176
// TODO: optimize
177
177
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 {
180
180
ok = true
181
181
break
182
182
}
@@ -471,10 +471,10 @@ func (qr *ProxyQrouter) deparseShardingMapping(
471
471
insertColsPos [c ] = i
472
472
}
473
473
474
- distributionKey := ds .Relations [rfqn .RelationName ].ColumnNames
474
+ distributionKey := ds .Relations [rfqn .RelationName ].DistributionKey
475
475
// TODO: check mapping by rules with multiple columns
476
476
for _ , col := range distributionKey {
477
- if val , ok := insertColsPos [col ]; ! ok {
477
+ if val , ok := insertColsPos [col . Column ]; ! ok {
478
478
return ComplexQuery
479
479
} else {
480
480
offsets = append (offsets , val )
You can’t perform that action at this time.
0 commit comments