kedro IncrementalDataset 简单说明

IncrementalDataset 实现了一种增量数据处理的能力,基于了PartitionedDataset 同时包含了checkpoint 确保数据处理的准确性,对于
checkpoint 可以配置自己的函数

参考定义

  • 参考catalog 定义
my_partitioned_dataset:
  type: partitions.IncrementalDataset
  path: s3://my-bucket-name/path/to/folder
  dataset: pandas.CSVDataset
  checkpoint:
    # update the filepath and load_args, but keep the dataset type unchanged
    filepath: gcs://other-bucket/CHECKPOINT
    load_args:
      k1: v1
  • 自定义函数的catalog 配置
my_partitioned_dataset:
  type: partitions.IncrementalDataset
  path: s3://my-bucket-name/path/to/folder
  dataset: pandas.CSVDataset
  checkpoint:
    comparison_func: my_module.path.to.custom_comparison_function  # the path must be importable
  • 指定checkpoint 具体文件
my_partitioned_dataset:
  type: partitions.IncrementalDataset
  path: s3://my-bucket-name/path/to/folder
  dataset: pandas.CSVDataset
  checkpoint:
    force_checkpoint: 2020-01-01/data.csv

说明

增量能力还是很重要的,尤其是在数据量比较大的场景,使用好IncrementalDataset 可以提升数据处理速度

参考资料

https://docs.kedro.org/en/stable/data/partitioned_and_incremental_datasets.html

posted on 2024-10-01 08:00  荣锋亮  阅读(0)  评论(0编辑  收藏  举报

导航