SELECT 
    dist_id,
    target_id,
    stage,
    stage_id,
    component,
    CONCAT_WS('.', outroot, CONVERT(dist_id, CHAR)) as outdir,
    bytes,
    md5sum,
    name,
    distComponent.state,
    distComponent.fault
FROM    distRun
JOIN distComponent USING(dist_id)
