How can I load data in same order as CSV on BigQuery

前端 未结 2 887
梦谈多话
梦谈多话 2021-01-29 00:22

Is it possible to load data in the same row order as in the original input CSV file? These files are not sorted in any particular order or by any particular column. Looks like a

2条回答
  •  猫巷女王i
    2021-01-29 00:26

    The only way to achieve this given the way BigQuery works behind the scenes would be to add an extra column to the csv that defines the desired order. BigQuery shuffles data around behind the scenes to optimise storage and query speed so relying on any order is impossible.

    But sorting is easy, so if your dataset contains the equivalent of a rownumber, you can always recover any ordering of rows with a simple sort.

提交回复
热议问题