Databricks Generative AI Engineer Associate Question 226
Select 2You are working on a content recommendation system and need to leverage a Vector Search index for querying semantic similarity between text embeddings. You have already generated embeddings using a pre-trained model and stored them in a Delta table. What steps must you take to create and query a Vector Search index in Databricks?
- A
Use the
CREATE INDEXSQL command to create a Vector Search index on the Delta table. - B
Enable MLflow tracking to log the embeddings before creating the Vector Search index.
- C
Use the
CREATE VECTOR INDEXSQL command to build the index on the Delta table's embedding column. - D
Query the Vector Search index using SQL commands with functions like
APPROX_NEAREST_NEIGHBORSfor similarity search. - E
Convert the embeddings into a JSON format before creating the Vector Search index.
Show answer and explanation
Correct answers: C, D
Explanation
To create and query a Vector Search index in Databricks, the CREATE VECTOR INDEX SQL command is used to build the index on a Delta table's embedding column. Once the index is created, SQL functions like APPROX_NEAREST_NEIGHBORS can be used to perform similarity searches, enabling efficient semantic search capabilities. Steps like enabling MLflow tracking or converting embeddings to JSON are not relevant to this process.
- A. Incorrect.
The
CREATE INDEXSQL command is not used for creating Vector Search indices. The correct syntax in Databricks isCREATE VECTOR INDEX. - B. Incorrect.
While MLflow tracking is useful for logging models and experiments, it is not a required step for creating or querying a Vector Search index.
- C. Correct.
This is the correct method to create a Vector Search index in Databricks. The
CREATE VECTOR INDEXSQL command allows you to specify the Delta table and the column containing the embeddings. - D. Correct.
This is the correct method to query a Vector Search index. SQL functions like
APPROX_NEAREST_NEIGHBORSare used to perform similarity search efficiently. - E. Incorrect.
Converting embeddings into JSON format is not required for creating a Vector Search index. The embeddings can be directly stored in a Delta table column.