Write and validate a transformation query

Every transformation has one query: the SELECT statement that reads your source system. Write it on the Query step of the transformation editor, validate it, then save. The step sits between General and Dependencies in the wizard; the whole flow is on Build, test and finalize a transformation.

Write the query

  1. Open the transformation and go to Transformation > Query.
  2. Write the SELECT that reads your source system. It should return the columns you will map to the table's columns on the Mapping step.
  3. Where a value should change between runs, write a placeholder such as {current_date:DateTime} instead of a fixed value. Each placeholder appears as a parameter under the editor.
  4. To draft or change the query with AI, click AI in the editor header. See Generate and fix SQL with AI.
  5. To work in the full Editor, click Open in Editor. The query opens in a new console named after the transformation, and the popup minimises; see Consoles, saving and history.

Validate the query

Work with parameters

Copy the query

Copy in the editor header opens two actions:

ActionWhat it copies
Copy as isThe query exactly as written, placeholders untouched.
Copy parameters replacedThe query with each {name:Type} replaced by its value, quoting text, date and UUID values so the result stays valid SQL.

Copy is unavailable while the query is empty.

Restore an earlier version

  1. Click History in the editor header. It appears once the transformation has been saved; a new transformation has no versions yet, and the list reads "No query history yet".
  2. In the Versions list, pick a revision. The list holds one entry per saved revision, newest first, so the newest is the highest version number, shown as v1, v2 and so on.
  3. Look at the version under Query, or open Compare to see it next to your current text.
  4. Click Replace. The version replaces the query in the editor and the query is marked Not validated, so validate and save again.

Save and move on

Questions, answered

Why can't I move on from the Query step?

The step passes only when the query is filled and validated. An empty query is refused with "* Query must be filled to proceed"; a query that changed since its last check is refused with "Query not validated". The same messages appear when you click Apply or switch to another tab. Click Validate, wait for Validated, then click Next or Apply.

What does Validate do?

It runs your query and shows what it returns in a Query Data Preview window, so you can confirm the rows before mapping columns and testing. A successful run turns the header badge to Validated. The check does not save the query; click Apply to keep it.

Why did my query go back to Not validated?

The query stores the result of its last check. Any change to the query text, applying an AI suggestion or restoring an older version marks it Not validated again, and the step and its save are refused with "Query not validated" until you click Validate once more.

What are the {name:type} parameters?

A placeholder written as {name:Type}, such as {current_date:DateTime}, becomes a parameter: the query runs with the value you give it. Each one appears as a chip under the editor. Transformations come with current_date (the date the run works on), source_system (the name of the source system this transformation reads) and, for periodic patterns, synchronize_days; see Transformation patterns and load settings.

Why does a parameter stay after I remove it from my query?

current_date, source_system and synchronize_days are kept in the Parameters strip even when the query no longer uses them. A parameter you wrote yourself disappears again when you remove its placeholder from the text.

How do I change a parameter's value?

Click the chip under the editor. A small window opens with a Value box; change the value, then press Enter or click Save. The chip reads empty while it has no value, and the values are saved with the query when you save the step.

Why is the editor read-only while the query validates?

While a check runs, the editor is locked so the query cannot change under it. Wait for the result, or click Stop to cancel; nothing changes when you cancel, and the editor unlocks when the check finishes.

How do I restore an earlier version of my query?

Click History in the editor header, pick a revision in the Versions list, check it under Query or Compare, then click Replace. The version replaces the query and is marked Not validated, so validate and save again. History appears once the transformation has been saved.

What is the difference between Copy as is and Copy parameters replaced?

Copy as is copies the query exactly as written. Copy parameters replaced swaps every {name:Type} for its current value, quoting text, date and UUID values so the copied text stays valid SQL. Both live under Copy, which is unavailable while the query is empty.