Use a user-defined action to downsample and compress chunks