Skip to content

Commit

Permalink
[Exporter] Exclude some system schemas from export (#4121)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [x] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] relevant acceptance tests are passing
- [ ] using Go SDK
  • Loading branch information
alexott authored Oct 18, 2024
1 parent b656822 commit 2dfee52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exporter/importables.go
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,9 @@ var resourcesMap map[string]importable = map[string]importable{
return err
}
for _, v := range systemSchemas {
if v.Schema == "information_schema" || v.Schema == "__internal_logging" {
continue
}
if v.State == catalog.SystemSchemaInfoStateEnableCompleted || v.State == catalog.SystemSchemaInfoStateEnableInitialized {
id := fmt.Sprintf("%s|%s", currentMetastore, v.Schema)
data := ic.Resources["databricks_system_schema"].Data(
Expand Down
4 changes: 4 additions & 0 deletions exporter/importables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,10 @@ func TestListSystemSchemasSuccess(t *testing.T) {
Schema: "access",
State: catalog.SystemSchemaInfoStateEnableCompleted,
},
{
Schema: "information_schema",
State: catalog.SystemSchemaInfoStateEnableCompleted,
},
{
Schema: "marketplace",
State: catalog.SystemSchemaInfoStateAvailable,
Expand Down

0 comments on commit 2dfee52

Please sign in to comment.