0

我想接受我的输入并在我的输出中匹配每个文件相同数量的记录,即 1 个 parquet 文件输入 = 1 个 csv 文件输出。

4

1 回答 1

1
from transforms.api import transform, Output, Input


@transform(
    the_output=Output("my.awesome.output"),
    the_input=Input("my.awesome.input"),
)
def my_compute_function(the_input, the_output):

    the_output.write_dataframe(
        the_input.dataframe(),
        output_format="csv"
    )

如果你想控制文件大小的操作,你可以repartition()根据需要使用来控制每个文件的记录数(更多细节在这里

于 2022-01-31T20:38:31.613 回答