generated from liquibase/liquibase-extension-example
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DAT-18896: [createTable] added tableFormat snapshot and generate chan…
…gelog functionality
- Loading branch information
Mykhailo Savchenko
committed
Oct 31, 2024
1 parent
85efece
commit a031ee9
Showing
5 changed files
with
111 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/test/resources/liquibase/harness/change/changelogs/databricks/createExternalCsvTable.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:databricks="http://www.liquibase.org/xml/ns/databricks" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> | ||
<changeSet id="1" author="mykhailo"> | ||
<createTable tableName="test_external_csv_table"> | ||
<column name="id" type="BIGINT"/> | ||
<column name="first_name" type="STRING"/> | ||
<column name="last_name" type="STRING"/> | ||
<column name="email" type="STRING"/> | ||
<column name="birthdate" type="DATE"/> | ||
<column name="added" type="TIMESTAMP"/> | ||
<databricks:extendedTableProperties tableFormat="CSV OPTIONS (header 'true', inferSchema 'false', path 's3://databricks-th/files/csv_table.csv')"/> | ||
</createTable> | ||
</changeSet> | ||
</databaseChangeLog> |
45 changes: 45 additions & 0 deletions
45
...esources/liquibase/harness/change/expectedSnapshot/databricks/createExternalCsvTable.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"snapshot": { | ||
"objects": { | ||
"liquibase.structure.core.Table": [ | ||
{ | ||
"table": { | ||
"name": "test_external_csv_table" | ||
} | ||
} | ||
], | ||
"liquibase.structure.core.Column": [ | ||
{ | ||
"column": { | ||
"name": "id" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"name": "first_name" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"name": "last_name" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"name": "email" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"name": "birthdate" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"name": "added" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...test/resources/liquibase/harness/change/expectedSql/databricks/createExternalCsvTable.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE main.liquibase_harness_test_ds.test_external_csv_table (id BIGINT, first_name STRING, last_name STRING, email STRING, birthdate date, added TIMESTAMP) USING CSV OPTIONS (header 'true', inferSchema 'false', path 's3://databricks-th/files/csv_table.csv') |