Skip to content

Commit

Permalink
materializations: use correct resource path when building InfoSchema …
Browse files Browse the repository at this point in the history
…in Open

Fixes a bug where an uninitialized resource was being used to populate the
resourcePaths list. The standard InfoSchema builder only really cares about the
"schema" part of the resource path, so this handling was actually working most
of the time when a materialization's tables were all in the same schema as its
metadata tables. But if there are tables in other schemas, they weren't being
property enumerated.
  • Loading branch information
williamhbaker committed Sep 30, 2024
1 parent c0c172f commit 9a05f53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion materialize-sql/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ func (d *Driver) NewTransactor(ctx context.Context, open pm.Request_Open) (m.Tra

var tables []Table
for index, spec := range open.Materialization.Bindings {
resourcePaths = append(resourcePaths, spec.ResourcePath)
var resource = endpoint.NewResource(endpoint)
resourcePaths = append(resourcePaths, resource.Path())

if err := pf.UnmarshalStrict(spec.ResourceConfigJson, resource); err != nil {
return nil, nil, fmt.Errorf("resource binding for collection %q: %w", spec.Collection.Name, err)
Expand Down

0 comments on commit 9a05f53

Please sign in to comment.