You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case if case class contains case class, inner case class correctly interpreted as RECORD however, if custom mapper provided (as in example in documentation), schema generator treats it as field of custom type, but ToMappable derived in still treats it as RECORD.
This test (as per documentation) succeeds:
importshapeless.datatype.bigquery._importjava.net.URIimplicitvaluriBigQueryType=BigQueryType.at[URI]("STRING")(v =>URI.create(v.toString), _.toString)
caseclassPage(uri: URI, rank: Int)
valt=BigQueryType[Page]
valr= t.toTableRow(Page(URI.create("www.google.com"), 42))
// this is as expected
r.get("uri") ===="www.google.com"
while this fails:
importshapeless.datatype.bigquery._caseclassYuri(ss: String)
implicitvaluriBigQueryType=BigQueryType.at[Yuri]("STRING")(v =>newYuri(v.toString), _.ss)
caseclassPage(uri: Yuri, rank: Int)
valt=BigQueryType[Page]
valr= t.toTableRow(Page(newYuri("www.google.com"), 42))
// this FAILS, instead of string, it contains linked hash map.
r.get("uri") ===="www.google.com"
Note that the only difference here is that instead of system non-case URI class, custom case class Yuri is used (and if I switch it from being case class to normal class, the problem is gone).
I think that reason is that ToMappable.hconsToMappable0 (which constructs basing on internal structure of case class) implicit has bigger priority than ToMappable.hconsToMappable1 (which uses externally provided mapper).
The text was updated successfully, but these errors were encountered:
In case if case class contains case class, inner case class correctly interpreted as
RECORD
however, if custom mapper provided (as in example in documentation), schema generator treats it as field of custom type, butToMappable
derived in still treats it asRECORD
.This test (as per documentation) succeeds:
while this fails:
Note that the only difference here is that instead of system non-case
URI
class, custom case classYuri
is used (and if I switch it from being case class to normal class, the problem is gone).I think that reason is that
ToMappable.hconsToMappable0
(which constructs basing on internal structure of case class) implicit has bigger priority thanToMappable.hconsToMappable1
(which uses externally provided mapper).The text was updated successfully, but these errors were encountered: