A developer wants a quick check from SQL that a new Cortex Search service returns results. What should they use?
- Exam domain
- Retrieval with Cortex Search
- Difficulty
- Easy
- In this mock
- 5 questions on this domainPractise this domain
Why C is the answer
The SEARCH_PREVIEW function
Snowflake lists three ways to query a service: the Python API, the REST API, and the SEARCH_PREVIEW SQL function, which is useful for checking that a service returns results.
Remember: Test with SEARCH_PREVIEW.
In detail
- SEARCH_PREVIEW for SQL checks.
- Python or REST for apps.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. AI_COMPLETEWrong
AI_COMPLETE generates text; it does not query the service.
B. A Snowpark Container Services job, which is the only way to query the serviceWrong
No container job is needed.
C. The SEARCH_PREVIEW functionRight
Test with SEARCH_PREVIEW.
D. SHOW TABLESWrong
SHOW TABLES lists tables.
Use case
An illustrative scenario, not a real incident.
Illustrative: an engineer runs SEARCH_PREVIEW after creation before wiring the service into an app.
See it in different ways
flowchart TD
Q{"Where are you calling from?"}
Q -->|"SQL, to test"| A0["SEARCH_PREVIEW"]
Q -->|"Python app"| A1["Python API"]
Q -->|"Any client"| A2["REST API"]How to read this chart
- At "Where are you calling from?": if "SQL, to test", go to "SEARCH_PREVIEW"; if "Python app", go to "Python API"; if "Any client", go to "REST API".
flowchart LR S0["Wait for the index build"] --> S1["Run SEARCH_PREVIEW"] --> S2["Connect the app"]
How to read this chart
- Read it in order: Wait for the index build, then Run SEARCH_PREVIEW, then Connect the app.