在 Apache Beam 转换中对 CSV 列进行分组
Grouping CSV columns in Apache Beam transform
我有一个包含大约 200 列的 csv。我想对每一列进行分组,以便获得 col_name:[column] 对的 pcollection 作为元素。使用 beam python sdk 如何完成这样的事情?
您可以输出 (column_index, column_value) 的元组,然后您可以按列索引对它们进行分组。如果您有与每一列关联的名称,那么您可以输出 (column_name, column_value).
参考:https://beam.apache.org/documentation/programming-guide/#core-beam-transforms
我有一个包含大约 200 列的 csv。我想对每一列进行分组,以便获得 col_name:[column] 对的 pcollection 作为元素。使用 beam python sdk 如何完成这样的事情?
您可以输出 (column_index, column_value) 的元组,然后您可以按列索引对它们进行分组。如果您有与每一列关联的名称,那么您可以输出 (column_name, column_value).
参考:https://beam.apache.org/documentation/programming-guide/#core-beam-transforms