Skip to content

Add TypedEncoder for shapeless Record. #777

@tribbloid

Description

@tribbloid

Since RecordEncoder is already converting any product type into shapeless Record:

class RecordEncoder[F, G <: HList, H <: HList](
    implicit
    i0: LabelledGeneric.Aux[F, G],
    i1: DropUnitValues.Aux[G, H],
    i2: IsHCons[H],
    fields: Lazy[RecordEncoderFields[H]],
    newInstanceExprs: Lazy[NewInstanceExprs[G]],
    classTag: ClassTag[F])
    extends TypedEncoder[F] {
...

The only thing required is to break it into 2 stages, such that the intermediate HList/Record representation could serve as a more flexible type-level schema, it could even approximate the capability of the abandoned TypedDataFrame

I also realised that i0~i2 are not used in the function body. i2 is important to not accept HNil, but are i0 & i1 necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions