Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ resources:
database_instance_name: ${resources.database_instances.my_instance.name}
logical_database_name: ${resources.database_catalogs.my_catalog.database_name}
spec:
source_table_full_name: "samples.nyctaxi.trips"
# Use a unique source table per test run to avoid hitting the 20-table-per-source limit
source_table_full_name: "main.test_synced_$UNIQUE_NAME.trips_source"
scheduling_policy: SNAPSHOT
primary_key_columns:
- tpep_pickup_datetime
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Creating temporary source table: main.test_synced_[UNIQUE_NAME].trips_source
{
"full_name": "main.test_synced_[UNIQUE_NAME]"
}

>>> [CLI] bundle summary
Name: deploy-lakebase-synced-table-[UNIQUE_NAME]
Expand Down Expand Up @@ -50,3 +54,4 @@ All files and directories at the following location will be deleted: /Workspace/

Deleting files...
Destroy complete!
Cleaning up temporary source table
16 changes: 16 additions & 0 deletions acceptance/bundle/resources/synced_database_tables/basic/script
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
envsubst < databricks.yml.tmpl > databricks.yml

# Create a unique source table for this test run to avoid hitting the 20-table-per-source limit
echo "Creating temporary source table: main.test_synced_$UNIQUE_NAME.trips_source"
# Create schema using CLI
$CLI schemas create test_synced_$UNIQUE_NAME main -o json | jq '{full_name}'
# Create source table from samples.nyctaxi.trips using SQL API
# MSYS_NO_PATHCONV=1 prevents Git Bash on Windows from converting /api/... to C:/Program Files/Git/api/...
MSYS_NO_PATHCONV=1 $CLI api post "/api/2.0/sql/statements/" --json "{
\"warehouse_id\": \"$TEST_DEFAULT_WAREHOUSE_ID\",
\"statement\": \"CREATE TABLE main.test_synced_$UNIQUE_NAME.trips_source AS SELECT * FROM samples.nyctaxi.trips LIMIT 10\",
\"wait_timeout\": \"45s\"
}" > /dev/null

cleanup() {
trace $CLI bundle destroy --auto-approve
# Clean up the temporary source table
echo "Cleaning up temporary source table"
$CLI tables delete main.test_synced_$UNIQUE_NAME.trips_source || true
$CLI schemas delete main.test_synced_$UNIQUE_NAME || true
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ RecordRequests = false
Old = '\?o=\[(NUMID|ALPHANUMID)\]'
New = ''
Order = 1000

# Fake SQL endpoint for local tests
[[Server]]
Pattern = "POST /api/2.0/sql/statements/"
Response.Body = '{"status": {"state": "SUCCEEDED"}, "manifest": {"schema": {"columns": []}}}'

[[Server]]
Pattern = "DELETE /api/2.1/unity-catalog/tables/{name}"
Response.Body = '{"status": "OK"}'