CIRCE-JSON和SCALA净化对象处理
我必须使用Scala和Circe-Json编码类别以下格式创建JSON,
{
"actions":{
"action1":{
"read":[
{
"parq":[
{
"str":""
},
{
"tab":""
}
]
}
],
"transform":[
{
"transform":[
{
"col":""
},
{
"col_def":""
}
]
}
],
"write":[
{
"parq":[
{
"path":""
}
]
}
]
}
}
}
如何使用Scala Circe-Json编码来处理此对象?
时有问题
object test_oo extends App {
case class rtab(tableName:String)
case class rpath(path:String)
case class Rparquet(parquet:List[Map[String,String]])
val p = Rparquet(List(rpath("hdfs"),rtab("test_table"))).asJson
print(p)
}
我在读取嵌套数组对象错误
列表[可序列化的产品] 方法Asjson的论点不足:(隐式编码器: io.circe.encoder [yaml.test_oo.rparquet])io.circe.json。未指定 值参数编码器。 val p = rparquet(list(rpath(“ hdfs”),rtab(“ test_table”)))。asjson
im无法读取read_path和tab_name在同一情况类别类别中read_parquet,然后尝试编码任何一个人可以帮助我。
I have to create a json in the below format using scala and circe-json encoder classes
{
"actions":{
"action1":{
"read":[
{
"parq":[
{
"str":""
},
{
"tab":""
}
]
}
],
"transform":[
{
"transform":[
{
"col":""
},
{
"col_def":""
}
]
}
],
"write":[
{
"parq":[
{
"path":""
}
]
}
]
}
}
}
how to use scala circe-json encoder to process this object?
I have issue while read nested array objects
object test_oo extends App {
case class rtab(tableName:String)
case class rpath(path:String)
case class Rparquet(parquet:List[Map[String,String]])
val p = Rparquet(List(rpath("hdfs"),rtab("test_table"))).asJson
print(p)
}
Error below
List [Product with serializable]
not enough arguments for method asJson: (implicit encoder:
io.circe.Encoder[yaml.test_oo.Rparquet])io.circe.Json. Unspecified
value parameter encoder. val p =
Rparquet(List(rpath("hdfs"),rtab("test_table"))).asJson
Im not able read read_path and tab_name in same case class read_parquet and try encoding could any one help me on it
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论