-
Notifications
You must be signed in to change notification settings - Fork 159
feat: Set connector refs for models #8591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
aff9d75
ce0379d
2f3eb90
9029867
cc65e71
233f3b4
49f6ac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,9 @@ func (p *Parser) parseModel(ctx context.Context, node *Node) error { | |
| inputProps = map[string]any{} | ||
| } | ||
|
|
||
| // kind is unspecified because all connectors are not explicit and may not exist as resource, will be resolved later | ||
| node.Refs = append(node.Refs, ResourceName{Name: inputConnector, Kind: ResourceKindUnspecified}) | ||
|
||
|
|
||
| // Special handling for adding SQL to the input properties | ||
| if sql := strings.TrimSpace(node.SQL); sql != "" { | ||
| refs, err := p.inferSQLRefs(node) | ||
|
|
@@ -154,6 +157,9 @@ func (p *Parser) parseModel(ctx context.Context, node *Node) error { | |
| if outputConnector == "" { | ||
| outputConnector = p.defaultOLAPConnector() | ||
| } | ||
|
|
||
| // kind is unspecified because all connectors are not explicit and may not exist as resource, will be resolved later | ||
| node.Refs = append(node.Refs, ResourceName{Name: outputConnector, Kind: ResourceKindUnspecified}) | ||
k-anshul marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| outputProps := tmp.Output.Properties | ||
|
|
||
| // Backwards compatibility: materialize can be specified outside of the output properties | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
node.Connectoris auto-populated with the default connector if not set. That seems problematic in this case because themodel(if it is an actual model, and not an external table) may have a different connector, which will actually be used here:rill/runtime/reconcilers/metrics_view.go
Line 84 in 1b15e01
The root of this issue comes from the annoying duplicate role of
model:for pointing both to other models and to external tables. I'm not sure, but it may be necessary to pull some of that handling into the parser here instead to handle this correctly.