From c8265ec16e086c988868d8cc3b7bd854d213be90 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 26 Feb 2024 10:45:54 +0200 Subject: only rename .csv.tmp to .csv when the final result was written --- internal/mapr/globalgroupset.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/mapr/globalgroupset.go') diff --git a/internal/mapr/globalgroupset.go b/internal/mapr/globalgroupset.go index 2d7f10b..2b12898 100644 --- a/internal/mapr/globalgroupset.go +++ b/internal/mapr/globalgroupset.go @@ -79,10 +79,10 @@ func (g *GlobalGroupSet) SwapOut() *GroupSet { } // WriteResult writes the result of a mapreduce aggregation to an outfile. -func (g *GlobalGroupSet) WriteResult(query *Query) error { +func (g *GlobalGroupSet) WriteResult(query *Query, finalResult bool) error { g.semaphore <- struct{}{} defer func() { <-g.semaphore }() - return g.GroupSet.WriteResult(query) + return g.GroupSet.WriteResult(query, finalResult) } // Result returns the result of the mapreduce aggregation as a string. -- cgit v1.2.3