scala - Custom user defined types in Phantom Cassandra -
i trying create custom udt in phantom.
case class creationtrack(source_ip: string, created_by: string, created_at: uuid) abstract class registrations extends cassandratable[registrations, creationtrack] rootconnector { object creation_details extends jsoncolumn[creationtrack](this){ override def fromjson(obj: string): creationtrack = { jsonparser.parse(obj).extract[creationtrack] } override def tojson(obj: creationtrack): string = { compactrender(extraction.decompose(obj)) } } }
input given:
creationtrack("192.123.4.5","arun", uuids.timebased())
but getting,
invalid string constant{"source_ip":"192.123.4.5","created_by":"arun","created_at":{}}
i believe there issue uuid type casting on json conversion. got stucked here. help? in advance!
ps: know there option called @udt available in phantom-pro resolve issue. dont want use pro version here.
this solved problem , there module available in phantom-pro address udt/uda/udf support. details on website , github documentation, wanted question answered in case future googlers looking answer.
Comments
Post a Comment