title: Quill cassandra, codec not found error for an user defined data type
body: <p>I am using quill in my "play-scala" project as an cassandra driver. 
  I have a table with following structure -</p>
  
  <pre><code>CREATE TABLE user_data (
      id int,
      name string,
      addresses list&lt;frozen&lt;dwelltimebd&gt;&gt;
      PRIMARY KEY ((id, name))
  )
  </code></pre>
  
  <p>where ADDRESS is an user defined data type, as mentioned here -</p>
  
  <pre><code>CREATE TYPE ADDRESS (
      city string,
      country string
  );
  </code></pre>
  
  <p>The code written to access the data from this table is something like this - </p>
  
  <pre><code>object UserTable {
    case class addresses(city: String, country: String)
    case class userData ( id :Int, name :String, addresses : Seq[addresses])
  
      lazy val ctx = new CassandraAsyncContext[SnakeCase]("user")
  
      import ctx._
  
  implicit val seqAddressDecoder: Decoder[Seq[addresses]] =
      decoder[Seq[addresses]] { (row: Row) =&gt;
        (index) =&gt;
        row.getList(index, classOf[addresses]).asScala
      }
  
    implicit val seqAddressesEncoder: Encoder[Seq[addresses]] =
      encoder[Seq[addresses]] { (row: BoundStatement) =&gt;(idx, lista) =&gt;
        row.setList(idx, lista.toList.asJava, classOf[addresses])
      }
  
  
      def getUserData(id: Int, name: String) =  {
          val getAllDetail = quote {
            query[userData].filter(p =&gt; p.id == lift(id) &amp;&amp; p.name == lift(name))
          }
          val result: List[userData] = Await.result(ctx.run(
            getAllDetail
          ), Duration.Inf)
          result
      }
  }
  </code></pre>
  
  <p>On running the above code the following error is received, - </p>
  
  <pre><code>play.api.UnexpectedException: Unexpected exception[CodecNotFoundException: Codec not found for requested operation: [frozen&lt;user.addresses&gt; &lt;-&gt; models.databaseModels.UserTable$addresses]]
          at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:289)
          at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:220)
          at play.api.GlobalSettings$class.onError(GlobalSettings.scala:160)
          at play.api.DefaultGlobal$.onError(GlobalSettings.scala:188)
          at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:100)
          at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
          at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
          at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
          at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
          at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
  Caused by: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [frozen&lt;user.addresses&gt; &lt;-&gt; models.databaseModels.UserTable$addresses]
          at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:679)
          at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:526)
          at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:506)
          at com.datastax.driver.core.CodecRegistry.maybeCreateCodec(CodecRegistry.java:558)
          at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:524)
          at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:506)
          at com.datastax.driver.core.CodecRegistry.access$200(CodecRegistry.java:140)
          at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:211)
          at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:208)
          at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3542)
  </code></pre>
  
  <p>Could not resolve the issue, A few pointers that I received are that, </p>
  
  <pre><code>I need to first create Java TypeCodec and register it with the cluster. Then also need to implement row-codec for quill just to make it compile. 
  </code></pre>
  
  <p>from <a href="http://gitchat.org/getquill/quill/message/614779" rel="nofollow noreferrer">this post</a></p>
  
  <p>Could not understand on how to do it, Any help in this regard will be helpful. </p>