Skip to content

Commit

Permalink
Merge pull request #4 from meshtrade/parquet-optim
Browse files Browse the repository at this point in the history
Add parquet serialisation empty data optimisation
  • Loading branch information
KyleSmith19091 authored Oct 30, 2024
2 parents 2587dc9 + f281f6f commit 5236c18
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions etl/parquet/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ func (s *ParquetSerialiser[T]) Serialise(ctx context.Context, p *pipeline.Pipeli
inputStruct = append(inputStruct, inValue)
}

// check if there is data to serialise
if len(inputStruct) == 0 {
outChannel := make(chan []byte, 1)
outChannel <- []byte{}
close(outChannel)
return outChannel, nil
}

// get the reflection value of the input slice
timeType := reflect.TypeOf(time.Time{})

Expand Down

0 comments on commit 5236c18

Please sign in to comment.