Hive为查询结果添加行号

注:Hive的版本要支持窗口函数

SELECT *  
FROM  
  (SELECT row_number() over (partition BY 1) AS rn,
          d.*
   FROM test d LIMIT 10) q