USE hahn;
INSERT INTO {{output1}}
WITH TRUNCATE 
SELECT
    CAST((DENSE_RANK(query) OVER w) as String) AS key,
    CAST(rating as String) || '\t' || url || '\t0\t' || factors as value
FROM {{input1}}
WINDOW w AS (ORDER BY query);