File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ func ResourceSystemSchema() common.Resource {
1717 Type : schema .TypeString ,
1818 Computed : true ,
1919 }
20+ m ["full_name" ] = & schema.Schema {
21+ Type : schema .TypeString ,
22+ Computed : true ,
23+ }
2024 m ["state" ].Computed = true
2125 return m
2226 })
@@ -85,7 +89,12 @@ func ResourceSystemSchema() common.Resource {
8589 }
8690 for _ , schema := range systemSchemaInfo .Schemas {
8791 if schema .Schema == schemaName {
88- return common .StructToData (schema , systemSchema , d )
92+ err = common .StructToData (schema , systemSchema , d )
93+ if err != nil {
94+ return err
95+ }
96+ d .Set ("full_name" , fmt .Sprintf ("system.%s" , schemaName ))
97+ return nil
8998 }
9099 }
91100 return nil
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
1111)
1212
1313func TestSystemSchemaCreate (t * testing.T ) {
14- d , err := qa.ResourceFixture {
14+ qa.ResourceFixture {
1515 Fixtures : []qa.HTTPFixture {
1616 {
1717 Method : http .MethodGet ,
@@ -52,9 +52,11 @@ func TestSystemSchemaCreate(t *testing.T) {
5252 Resource : ResourceSystemSchema (),
5353 HCL : `schema = "access"` ,
5454 Create : true ,
55- }.Apply (t )
56- assert .NoError (t , err )
57- assert .Equal (t , "abc|access" , d .Id ())
55+ }.ApplyAndExpectData (t , map [string ]any {
56+ "schema" : "access" ,
57+ "id" : "abc|access" ,
58+ "full_name" : "system.access" ,
59+ })
5860}
5961
6062func TestSystemSchemaCreate_Error (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -23,19 +23,20 @@ resource "databricks_system_schema" "this" {
2323
2424The following arguments are available:
2525
26- * ` schema ` - (Required) Full name of the system schema.
26+ * ` schema ` - (Required) name of the system schema.
2727
2828## Attribute Reference
2929
3030In addition to all arguments above, the following attributes are exported:
3131
3232* ` id ` - the ID of system schema in form of ` metastore_id|schema_name ` .
3333* ` state ` - The current state of enablement for the system schema.
34+ * ` full_name ` - the full name of the system schema, in form of ` system.<schema> ` .
3435
3536## Import
3637
3738This resource can be imported by the metastore id and schema name
3839
3940``` bash
40- terraform import databricks_system_schema.this < metastore_id> | < schema_name>
41+ terraform import databricks_system_schema.this ' <metastore_id>|<schema_name>'
4142```
You can’t perform that action at this time.
0 commit comments