-
Notifications
You must be signed in to change notification settings - Fork 184
Ignore remote rewrites of vector search direct_access_index_spec.schema_json #5481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
janniklasrose
merged 8 commits into
main
from
janniklasrose/vector-search-acceptance-tests
Jun 12, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9cb3411
acceptance: normalize vector search index schema_json in test server
janniklasrose b63b466
direct: treat vector search schema_json type aliases as equal
janniklasrose 49097b3
acceptance: add local test for vector search schema_json type aliases
janniklasrose f032963
direct: ignore remote rewrites of vector search schema_json
janniklasrose 797889e
Changelog
janniklasrose e7b80f0
Merge branch 'main' into janniklasrose/vector-search-acceptance-tests
janniklasrose 08b792b
Remove comments from acceptance tests
janniklasrose 1afc728
Merge branch 'janniklasrose/vector-search-acceptance-tests' of github…
janniklasrose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
22 changes: 22 additions & 0 deletions
22
acceptance/bundle/resources/vector_search_indexes/schema_normalization/databricks.yml.tmpl
This file contains hidden or 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,22 @@ | ||
| bundle: | ||
| name: vs-index-schema-$UNIQUE_NAME | ||
|
|
||
| sync: | ||
| paths: [] | ||
|
|
||
| resources: | ||
| vector_search_endpoints: | ||
| my_endpoint: | ||
| name: vs-endpoint-$UNIQUE_NAME | ||
| endpoint_type: STANDARD | ||
| vector_search_indexes: | ||
| my_index: | ||
| name: main.default.vs_index_$UNIQUE_NAME | ||
| endpoint_name: ${resources.vector_search_endpoints.my_endpoint.name} | ||
| primary_key: id | ||
| index_type: DIRECT_ACCESS | ||
| direct_access_index_spec: | ||
| schema_json: '{"id":"integer","count":"long","small":"short","tiny":"byte","tags":"array<integer>","score":"float","label":"string","vector":"array<float>"}' | ||
| embedding_vector_columns: | ||
| - name: vector | ||
| embedding_dimension: 768 |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/resources/vector_search_indexes/schema_normalization/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
acceptance/bundle/resources/vector_search_indexes/schema_normalization/output.txt
This file contains hidden or 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,27 @@ | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/vs-index-schema-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> [CLI] vector-search-indexes get-index main.default.vs_index_[UNIQUE_NAME] | ||
| {"count":"bigint","id":"int","label":"string","score":"float","small":"smallint","tags":"array<int>","tiny":"tinyint","vector":"array<float>"} | ||
|
|
||
| >>> [CLI] bundle plan | ||
| Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.vector_search_endpoints.my_endpoint | ||
| delete resources.vector_search_indexes.my_index | ||
|
|
||
| This action will result in the deletion of the following Vector Search indexes. | ||
| For Delta Sync indexes, the source Delta Table is preserved but the embedding pipeline is removed. | ||
| For Direct Access indexes, all upserted vectors are permanently lost: | ||
| delete resources.vector_search_indexes.my_index | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/vs-index-schema-[UNIQUE_NAME]/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
18 changes: 18 additions & 0 deletions
18
acceptance/bundle/resources/vector_search_indexes/schema_normalization/script
This file contains hidden or 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,18 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
|
|
||
| cleanup() { | ||
| trace $CLI bundle destroy --auto-approve | ||
| rm -f out.requests.txt | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| trace $CLI bundle deploy | ||
|
|
||
| # The backend (and the test server) rewrite the schema on create, so | ||
| # get-index returns Spark type names and sorted keys, not the config literal. | ||
| index_name="main.default.vs_index_${UNIQUE_NAME}" | ||
| trace $CLI vector-search-indexes get-index "${index_name}" | jq -r '.direct_access_index_spec.schema_json' | ||
|
|
||
| # Re-plan must be a no-op: remote changes to schema_json are ignored | ||
| # (ignore_remote_changes), so the immutable spec does not plan a recreate. | ||
| trace $CLI bundle plan |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/vector_search_indexes/schema_normalization/test.toml
This file contains hidden or 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 @@ | ||
| Cloud = false |
This file contains hidden or 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 hidden or 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 hidden or 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,51 @@ | ||
| package testserver | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestNormalizeSchemaJSON(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| in string | ||
| want string | ||
| }{ | ||
| { | ||
| name: "user-facing type stored as Spark type name", | ||
| in: `{"id":"integer","vector":"array<float>"}`, | ||
| want: `{"id":"int","vector":"array<float>"}`, | ||
| }, | ||
| { | ||
| name: "all integer-family names", | ||
| in: `{"a":"long","b":"short","c":"byte"}`, | ||
| want: `{"a":"bigint","b":"smallint","c":"tinyint"}`, | ||
| }, | ||
| { | ||
| name: "array element type is mapped", | ||
| in: `{"tags":"array<integer>"}`, | ||
| want: `{"tags":"array<int>"}`, | ||
| }, | ||
| { | ||
| name: "matching spellings pass through and keys are sorted", | ||
| in: `{"y":"float","x":"string","z":"int"}`, | ||
| want: `{"x":"string","y":"float","z":"int"}`, | ||
| }, | ||
| { | ||
| name: "empty input", | ||
| in: "", | ||
| want: "", | ||
| }, | ||
| { | ||
| name: "non-object input is returned unchanged", | ||
| in: "not json", | ||
| want: "not json", | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| assert.Equal(t, tt.want, normalizeSchemaJSON(tt.in)) | ||
| }) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.