Open clairemcginty opened 1 year ago
Cause in in the ParquetBucketMetadata
, when class is a Product
, we expect to extract the key using the keyField[Secondary]
.
If magnolify's CaseMapper
has an effect on the key field name, the metadata, won't be able to access the field using the reflect Method
name.
As a 'dirty' workaround, users can define alias function for the key(s), respecting the storage casing, eg:
case class Event(userName: String, event: String, timestamp: Int) {
def user_name: String = userName
}
implicit val parquetType: ParquetType[Event] = ParquetType[Event](SnakeCaseMapper)
Clean fix would imply to give the bucket metadata a way to transform the key field into the proper chained calls Method[]
.
As construction of the metadata on the read side is done from json file only, injecting this custom mapping isn't straightforward
key getter does not work when a CaseMapper is required to translate field names:
repro: https://github.com/spotify/scio/compare/parquet-type-caseformat?expand=1