in ratatool-sampling/src/main/scala/com/spotify/ratatool/samplers/BigSamplerAvro.scala [204:220]
private def hashBytes(
fieldName: String,
fieldSchema: Schema,
fieldValue: AnyRef,
hasher: Hasher
): Hasher = {
// Types depend on whether v came from a specific or generic record
fieldValue match {
case sv: Array[Byte] => hasher.putBytes(sv)
case gv: ByteBuffer => hasher.putBytes(gv.array())
case fv: GenericFixed => hasher.putBytes(fv.bytes())
case _ =>
throw new UnsupportedOperationException(
s"Internal type of `${fieldName}` not consistent with `${fieldSchema.getType}`!"
)
}
}