USE hahn;
INSERT INTO {{output1}} WITH TRUNCATE
SELECT
    t1.intrasearch_reqid as req_id,
    t1.text as query,
    t1.url as url,
    t1.factors as factors,
    t1.dwell_time as dwell_time,
    t1.position as position,
    t1.req_ts as req_ts,
    t2.score as score
FROM
     {{input1}} AS t1
LEFT JOIN
    `//home/intrasearch/output/production/marks` AS t2
ON 
    t1.intrasearch_reqid=t2.request_id and t1.url=t2.url