Generate native warehouse SQL
Use transpile_only=true to inspect the native warehouse SQL generated from a Semantic SQL or Semantic REST query, without executing it.
You want to see, check, or reuse the native warehouse query that a Semantic SQL or Semantic REST request turns into. This recipe sets the query parameter transpile_only=true, so the API translates the semantic query into the warehouse's native language and returns it directly, without running it. The journey is send the semantic query with transpile_only=true → review the generated SQL → use it where you need it.
What this enables:
Steps
1. Send the query with transpile_only=true
Add transpile_only=true to the Semantic SQL endpoint:
curl --location \
'https://<DATAOS_FQDN>/vulcan/tenants/<DATAOS_TENANT_ID>/data-products/<DATAOS_TENANT_ID>-<resource-name>/api/v1/query/semantic/sql?transpile_only=true' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${DATAOS_TOKEN}" \
--data '{
"sql": "SELECT customer_profile.region_id, MEASURE(customer_profile.count) FROM customer_profile GROUP BY customer_profile.region_id LIMIT 10"
}'The same parameter works on the Semantic REST endpoint. Use the request body that the interface requires; only the query format changes.
Semantic SQL
/api/v1/query/semantic/sql?transpile_only=true
Semantic REST
/api/v1/query/semantic/rest?transpile_only=true
A transpile-only request returns directly. It works differently from a normal query execution:
Executes the query
Does not execute the query
Creates a statement ID
Does not create a statement ID
Requires status polling
Returns directly
Produces query results
Produces native warehouse SQL
May use cached results
Only performs query translation
2. Review the generated SQL
The API returns the query in the native language of the underlying warehouse. Depending on the warehouse, the generated query may use warehouse-specific:
Table and column references
Aggregation functions
Quoting conventions
Grouping logic
Filters and limits
Review its filters, joins, aggregations, and grouping to validate how your semantic query was translated.
3. Use the generated SQL
Because the query was not executed, there is no statement to poll and no result to download. Copy the generated query to test it in a warehouse client, or compare it with the query generated for another warehouse. To run the semantic query and get results, send it again without transpile_only=true.
Outcome
You can see exactly what a semantic query becomes in your warehouse's own SQL, so you can debug the translation or reuse the query without running it through DataOS.
References
Query API reference:
retry_on_recent_failureandtranspile_onlyon the Semantic REST/SQL endpointsRetrieve large result sets with pagination: for queries you do intend to execute and page through
Last updated
Was this helpful?