Skip to content

Commit

Permalink
Check distribution on create table statement
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke committed Feb 13, 2024
1 parent 56c69ca commit 01487f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions router/qrouter/proxy_routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ func (qr *ProxyQrouter) CheckTableIsRoutable(ctx context.Context, node *lyx.Crea
entries = append(entries, elt.ColName)
}

// XXX: TBD: check also all columns
if _, err := qr.Mgr().QDB().GetRelationDistribution(ctx, node.TableName); err != nil {
return fmt.Errorf("create table stmt ignored: no distributions for this relation found")
}

// TODO: drop this with migration from sharding rule to distributions
if _, err := MatchShardingRule(ctx, node.TableName, entries, qr.mgr.QDB()); err == ErrRuleIntersect {
return nil
}
Expand Down

0 comments on commit 01487f7

Please sign in to comment.