Skip to content

Commit

Permalink
use noOp cache instead of null when instantiating typedSparkeySideInp…
Browse files Browse the repository at this point in the history
…ut (#5469)

Co-authored-by: Michel Davit <[email protected]>
Co-authored-by: Michel Davit <[email protected]>
  • Loading branch information
3 people authored Sep 5, 2024
1 parent ee28d27 commit 078519c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,15 @@ package object sparkey extends SparkeyReaderInstances with SparkeyCoders {
decoder: Array[Byte] => T,
cache: Cache[String, T] = null
): SideInput[TypedSparkeyReader[T]] =
sparkeySideInput(basePath, reader => new TypedSparkeyReader[T](reader, decoder, cache))
sparkeySideInput(
basePath,
reader =>
new TypedSparkeyReader[T](
reader,
decoder,
Option(cache).getOrElse(Cache.noOp[String, T])
)
)

/**
* Create a SideInput of `CachedStringSparkeyReader` from a [[SparkeyUri]] base path, to be used
Expand Down

0 comments on commit 078519c

Please sign in to comment.