Skip to main content

MD_GET_FLIGHT_LOGS

Preview
This feature is in preview and is subject to change.

Returns the captured logs for a single Flight run. The output combines stdout and stderr in the order the runtime captured them.

Syntax

SELECT logs FROM MD_GET_FLIGHT_LOGS(
flight_id := '<flight_id>',
run_number := <n>
);

Parameters

ParameterTypeRequiredDescription
flight_idUUIDYesIdentifier of the Flight.
run_numberINTEGERYesThe run number to fetch logs for.

Return columns

ColumnTypeDescription
logsVARCHARThe full combined stdout/stderr captured during the run.

Behavior

  • Returns an error when no run with the given run_number exists for the Flight, or when the Flight itself doesn't exist.
  • Available for runs in any terminal status (SUCCEEDED, FAILED, CANCELLED) and during a RUNNING run.
  • Parameters must be literals or getvariable() calls. Subqueries and lateral join columns fail with a binder error; store dynamic values with SET VARIABLE first.
  • Pass arguments by name. The signature order is MD_GET_FLIGHT_LOGS(flight_id, run_number)flight_id first, then run_number.

Examples

Read the latest run's logs:

SET VARIABLE latest_run_number = (
SELECT max(run_number)
FROM MD_LIST_FLIGHT_RUNS(flight_id := '<flight_id>')
);

SELECT logs
FROM MD_GET_FLIGHT_LOGS(
flight_id := '<flight_id>',
run_number := getvariable('latest_run_number')
);

Read a specific run:

SELECT logs
FROM MD_GET_FLIGHT_LOGS(
flight_id := '80000000-0000-0000-0000-000000000001',
run_number := 42
);