diff --git a/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-1.0.xsd b/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-1.0.xsd index 415abea9..ae5234e7 100644 --- a/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-1.0.xsd +++ b/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-1.0.xsd @@ -81,4 +81,7 @@ + + + diff --git a/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-latest.xsd b/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-latest.xsd index 415abea9..ae5234e7 100644 --- a/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-latest.xsd +++ b/src/main/resources/www.liquibase.org/xml/ns/databricks/liquibase-databricks-latest.xsd @@ -81,4 +81,7 @@ + + + diff --git a/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.json b/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.json new file mode 100644 index 00000000..87d853ee --- /dev/null +++ b/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.json @@ -0,0 +1,85 @@ +{ + "databaseChangeLog": [ + { + "changeSet": { + "id": "1", + "author": "your.name", + "changes": [ + { + "createTable": { + "tableName": "test_table_clustered_new", + "columns": [ + { + "column": { + "name": "test_id", + "type": "int" + } + }, + { + "column": { + "name": "test_new", + "type": "int" + } + } + ], + "clusterColumns": "test_id,test_new" + } + } + ], + "rollback": [ + { + "dropTable": { + "tableName": "test_table_clustered_new" + } + } + ] + } + }, + { + "changeSet":{ + "id": 2, + "author":"your.name", + "changes":[ + { + "alterCluster": { + "tableName": "test_table_clustered_new", + "columns": [ + { + "column": { + "name": "test_id" + } + } + ] + } + } + ], + "rollback": [ + { + "empty": { + } + } + ] + } + }, + { + "changeSet": { + "id": 3, + "author": "your.name", + "changes": [ + { + "dropColumn": { + "columnName": "test_new", + "tableName": "test_table_clustered_new" + } + } + ], + "rollback": [ + { + "empty": { + } + } + ] + } + } + ] +} diff --git a/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.xml b/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.xml new file mode 100644 index 00000000..69d0008c --- /dev/null +++ b/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.xml @@ -0,0 +1,34 @@ + + + + + + + + test_id,test_new + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.yaml b/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.yaml new file mode 100644 index 00000000..714e4493 --- /dev/null +++ b/src/test/resources/liquibase/harness/change/changelogs/databricks/createClusteredTableNew.yaml @@ -0,0 +1,38 @@ +databaseChangeLog: + - changeSet: + id: 1 + author: your.name + changes: + - createTable: + tableName: test_table_clustered_new + columns: + - column: + name: test_id + type: int + - column: + name: test_new + type: int + clusterColumns: test_id, test_new + rollback: + dropTable: + tableName: test_table_clustered_new + - changeSet: + id: 2 + author: your.name + changes: + - alterCluster: + tableName: test_table_clustered_new + columns: + - column: + name: test_id + rollback: + empty + - changeSet: + id: 3 + author: your.name + changes: + - dropColumn: + columnName: test_new + tableName: test_table_clustered_new + rollback: + empty diff --git a/src/test/resources/liquibase/harness/change/expectedSnapshot/databricks/createClusteredTableNew.json b/src/test/resources/liquibase/harness/change/expectedSnapshot/databricks/createClusteredTableNew.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/src/test/resources/liquibase/harness/change/expectedSnapshot/databricks/createClusteredTableNew.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/src/test/resources/liquibase/harness/change/expectedSql/databricks/createClusteredTableNew.sql b/src/test/resources/liquibase/harness/change/expectedSql/databricks/createClusteredTableNew.sql new file mode 100644 index 00000000..898576e5 --- /dev/null +++ b/src/test/resources/liquibase/harness/change/expectedSql/databricks/createClusteredTableNew.sql @@ -0,0 +1,3 @@ +CREATE TABLE main.liquibase_harness_test_ds.test_table_clustered_new (test_id INT, test_new INT) USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) CLUSTER BY (test_id, test_new) +ALTER TABLE main.liquibase_harness_test_ds.test_table_clustered_new CLUSTER BY (test_id) +ALTER TABLE main.liquibase_harness_test_ds.test_table_clustered_new DROP COLUMN test_new \ No newline at end of file