{"action":"created","issue":{"url":"https://api.github.com/repos/websudos/phantom/issues/410","repository_url":"https://api.github.com/repos/websudos/phantom","labels_url":"https://api.github.com/repos/websudos/phantom/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/websudos/phantom/issues/410/comments","events_url":"https://api.github.com/repos/websudos/phantom/issues/410/events","html_url":"https://github.com/websudos/phantom/issues/410","id":130462081,"number":410,"title":"Issue with custom column types ","user":{"login":"lahirug","id":8514624,"avatar_url":"https://avatars.githubusercontent.com/u/8514624?v=3","gravatar_id":"","url":"https://api.github.com/users/lahirug","html_url":"https://github.com/lahirug","followers_url":"https://api.github.com/users/lahirug/followers","following_url":"https://api.github.com/users/lahirug/following{/other_user}","gists_url":"https://api.github.com/users/lahirug/gists{/gist_id}","starred_url":"https://api.github.com/users/lahirug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lahirug/subscriptions","organizations_url":"https://api.github.com/users/lahirug/orgs","repos_url":"https://api.github.com/users/lahirug/repos","events_url":"https://api.github.com/users/lahirug/events{/privacy}","received_events_url":"https://api.github.com/users/lahirug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-01T19:43:35Z","updated_at":"2016-02-05T11:19:07Z","closed_at":null,"body":"I created a custom column type as below and worked fine but when I try using Long instead timestamp I get an error. Please find my scala code and error below.\r\n\r\n  /** Helper to store durations without remembering the unit */\r\n  implicit object DurationPrimitive extends Primitive[Duration] {\r\n    override type PrimitiveType = Long\r\n    val cassandraType = CQLSyntax.Types.Long\r\n    def fromRow(row: Row, name: String): Option[Duration] = fromRow(name, row).toOption\r\n    override def asCql(value: Duration): String = {\r\n      value.toMillis.toString\r\n    }\r\n    override def fromRow(column: String, row: Row): Try[Duration] = nullCheck(column, row) {\r\n      r => Duration.ofMillis(r.getLong(column))\r\n    }\r\n    override def clz: Class[Long] = classOf[Long]\r\n    override def fromString(value: String): Duration = Duration.ofMillis(value.toLong)\r\n  }\r\n\r\n\r\nError\r\n\r\n\r\ncom.datastax.driver.core.exceptions.InvalidQueryException: Unknown type local.long\r\n    at com.datastax.driver.core.Responses$Error.asException(Responses.java:124)\r\n    at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:180)\r\n    at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:186)\r\n    at com.datastax.driver.core.RequestHandler.access$2300(RequestHandler.java:44)\r\n    at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:754)\r\n    at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:576)\r\n    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1007)\r\n    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:930)\r\n    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)\r\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)\r\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)\r\n    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)\r\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)\r\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)\r\n    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)\r\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)\r\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)\r\n    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)\r\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)\r\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)\r\n    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)\r\n    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)\r\n    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)\r\n    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)\r\n    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)\r\n    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)\r\n    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)\r\n    at java.lang.Thread.run(Thread.java:745)"},"comment":{"url":"https://api.github.com/repos/websudos/phantom/issues/comments/180304616","html_url":"https://github.com/websudos/phantom/issues/410#issuecomment-180304616","issue_url":"https://api.github.com/repos/websudos/phantom/issues/410","id":180304616,"user":{"login":"alexflav23","id":1645142,"avatar_url":"https://avatars.githubusercontent.com/u/1645142?v=3","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":"2016-02-05T11:19:07Z","updated_at":"2016-02-05T11:19:07Z","body":"Hi @lahirug,\r\n\r\nThank you for sharing, I didn't expect the first version to work because `BigInt` is the Cassandra type for timestamps. I think `CQLSyntax.Types.Long` is actually not used in the codebase and was added long ago by accident. I will follow up and flag it for deletion as necessary.\r\n\r\nIs `Instant` an `org.joda` primitive?\r\n\r\nRegards."}}