Hi Micheal,

Thanks for the response actually I have solved the issue. I was sharing my
knowledge how I solved that. For sinking scala classes like JAVA Pojo. We
have to convert that to
JavaStream first but in 1.4 that already done by connector so no need to do
that in 1.4

We have to write scala class like this.

@SerialVersionUID(507L)
@Table(keyspace = "twtt", name = "order")
class OrderFinal(
                       @BeanProperty var name: String,
                       @BeanProperty var userEmail: String)extends
Serializable
{
  def this() {
    this("NA", "NA")
  }
}

The variable name should be same as the column name in Cassandra table. If
we use case class in case of class than that will call
CassandraScalaProductSinkBuilder in the connector at that required query.
So we are making scala class as POJO class.
Scala class should be handled in connector separately. I will request the
feature for the same. While that this is workaround for scala developers.





‌

On Thu, Dec 28, 2017 at 11:28 AM, Michael Fong <mcfong.o...@gmail.com>
wrote:

> Hi, shashank agarwal
> <https://plus.google.com/u/1/102996216504701757998?prsrc=4>
>
>
> Not sure if I can answer fully your question, but after digging some code,
> I am not sure if C* connector totally supports Scala case class + CQL data
> mapping at the moment. I may be totally wrong, and you need to ask the
> flink dev about this. However, I have some toy examples that you could
> check out to see which uses CassandraScalaProductSinkBuilder + predefined
> CQL query + entity. I am not using Scala case class so may not fit your
> need.
>
> The example snippet you may find @
> https://github.com/mcfongtw/flink-cassandra-connector-examples/
>
> Regards,
>
> On Thu, Dec 28, 2017 at 1:11 PM, Michael Fong <mcfong.o...@gmail.com>
> wrote:
>
>> Hi, shashank agarwal
>>
>>
>> AFAIK, in java side, for a pojo data type, you don't need to set query
>> since the CQL data mapping would take care of that whereas dealing with
>> java tuples, you do need to provide a upsert query so that cassandra knows
>> what to insert into the table.
>> Scala tuple case is clear, same as java - providing a CQL query; however,
>> I don't know what's up with Scala pojo case (class) though...
>>
>> Regards,
>>
>> Michael
>>
>
>


-- 
Thanks Regards

SHASHANK AGARWAL
 ---  Trying to mobilize the things....

Reply via email to