Changed: write only partition state/result for foreach projections/queries