{"action":"created","issue":{"url":"https://api.github.com/repos/outworkers/phantom/issues/813","repository_url":"https://api.github.com/repos/outworkers/phantom","labels_url":"https://api.github.com/repos/outworkers/phantom/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/outworkers/phantom/issues/813/comments","events_url":"https://api.github.com/repos/outworkers/phantom/issues/813/events","html_url":"https://github.com/outworkers/phantom/issues/813","id":300192353,"number":813,"title":"OptionalJsonColumn ignoring not parsable values","user":{"login":"aludwiko","id":2954053,"avatar_url":"https://avatars2.githubusercontent.com/u/2954053?v=4","gravatar_id":"","url":"https://api.github.com/users/aludwiko","html_url":"https://github.com/aludwiko","followers_url":"https://api.github.com/users/aludwiko/followers","following_url":"https://api.github.com/users/aludwiko/following{/other_user}","gists_url":"https://api.github.com/users/aludwiko/gists{/gist_id}","starred_url":"https://api.github.com/users/aludwiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aludwiko/subscriptions","organizations_url":"https://api.github.com/users/aludwiko/orgs","repos_url":"https://api.github.com/users/aludwiko/repos","events_url":"https://api.github.com/users/aludwiko/events{/privacy}","received_events_url":"https://api.github.com/users/aludwiko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-26T10:55:33Z","updated_at":"2018-02-26T18:50:28Z","closed_at":null,"author_association":"NONE","body":"`OptionalJsonColumn` is using a generic strategy for parsing values:\r\n```\r\n  class OptionalCol[RR](\r\n    implicit ev: Primitive[RR],\r\n    evOpt: Primitive[Option[RR]]\r\n  ) extends Col[Option[RR]] {\r\n    override def parse(r: Row): Try[Option[RR]] = ev.fromRow(name, r) match {\r\n      case Success(value) => Success(Some(value))\r\n      case Failure(_) => Success(None)\r\n    }\r\n  }\r\n```\r\nwhich in case of not parsable value will swallow the exception and return `None`. \r\n`None` vs. parsing exception is something completly different from business point of view."},"comment":{"url":"https://api.github.com/repos/outworkers/phantom/issues/comments/368607059","html_url":"https://github.com/outworkers/phantom/issues/813#issuecomment-368607059","issue_url":"https://api.github.com/repos/outworkers/phantom/issues/813","id":368607059,"user":{"login":"alexflav23","id":1645142,"avatar_url":"https://avatars2.githubusercontent.com/u/1645142?v=4","gravatar_id":"","url":"https://api.github.com/users/alexflav23","html_url":"https://github.com/alexflav23","followers_url":"https://api.github.com/users/alexflav23/followers","following_url":"https://api.github.com/users/alexflav23/following{/other_user}","gists_url":"https://api.github.com/users/alexflav23/gists{/gist_id}","starred_url":"https://api.github.com/users/alexflav23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexflav23/subscriptions","organizations_url":"https://api.github.com/users/alexflav23/orgs","repos_url":"https://api.github.com/users/alexflav23/repos","events_url":"https://api.github.com/users/alexflav23/events{/privacy}","received_events_url":"https://api.github.com/users/alexflav23/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T18:50:28Z","updated_at":"2018-02-26T18:50:28Z","author_association":"OWNER","body":"Hi @aludwiko This is a fair point, but you shouldn't really be inserting bad values in Cassandra, it's important to guarantee the store and retrieve function is a bijection, meaning you are not losing any valuable information by going \"in and out\" of Cassandra with the same bit of data.\r\n\r\nYou are pushing an application level concern to the library in that sense, `Option` columns were never designed to cope with parsing errors, which is exactly why they swallow them up. They are a DSL nicety around Cassandra `null`, not around inserting invalid JSON.\r\n\r\nAll that being said, we want to help here, so what do you feel would be the useful API?"}}
{"actor":{"display_login":"alexflav23"}}