An engineering team wants to classify 2 million customer support tickets (column: tickettext) into 'billing', 'technical', or 'shipping' using an LLM deployed on a Databricks Model Serving endpoint named 'ticket-classifier'. Which SQL statement correctly invokes this endpoint using ai_query()?
Answer & explanation
Correct answer: D
WHY D is correct: This is the standard form of ai_query: the endpoint name first, then the request. returnType is optional for chat and foundation model endpoints, because they return text, so nothing else has to be declared.
WHY NOT B: The arguments are reversed. The endpoint name must come first and the request second; here the ticket text is passed as the endpoint name.
WHY NOT C: ai_classify runs on a Databricks-managed model and takes no endpoint argument, so it cannot send the tickets to the team's own ticket-classifier endpoint as the question requires.
WHY NOT A: ai_query has no model or prompt parameters. Its first two arguments are the endpoint and the request; named arguments are used for options such as returnType and failOnError.