Skip to content

Commit

Permalink
feat: change the schema tracker to track all UDFs
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Apr 17, 2024
1 parent 178e6e8 commit e31db38
Show file tree
Hide file tree
Showing 10 changed files with 1,305 additions and 268 deletions.
417 changes: 256 additions & 161 deletions go/vt/proto/query/query.pb.go

Large diffs are not rendered by default.

276 changes: 276 additions & 0 deletions go/vt/proto/query/query_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions go/vt/vtgate/schema/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ func (t *Tracker) loadUDFs(conn queryservice.QueryService, target *querypb.Targe
t.mu.Lock()
defer t.mu.Unlock()

err := conn.GetSchema(t.ctx, target, querypb.SchemaTableType_UDF_AGGREGATE, nil, func(schemaRes *querypb.GetSchemaResponse) error {
err := conn.GetSchema(t.ctx, target, querypb.SchemaTableType_UDFS, nil, func(schemaRes *querypb.GetSchemaResponse) error {
var udfs []string
for name := range schemaRes.TableDefinition {
udfs = append(udfs, name)
for _, udf := range schemaRes.Udfs {
if !udf.Aggregating {
continue
}
udfs = append(udfs, udf.Name)
}

t.udfs[target.Keyspace] = udfs
Expand Down
Loading

0 comments on commit e31db38

Please sign in to comment.