How can I add row numbers for rows in PIG or HIVE?

前端 未结 8 1848
半阙折子戏
半阙折子戏 2020-12-17 02:18

I have a problem when adding row numbers using Apache Pig. The problem is that I have a STR_ID column and I want to add a ROW_NUM column for the data in STR_ID, which is the

8条回答
  •  囚心锁ツ
    2020-12-17 03:05

    Facebook posted a number of hive UDFs including NumberRows. Depending on your hive version (I believe 0.8) you may need to add an attribute to the class (stateful=true).

提交回复
热议问题