Not able to query : Queryable State

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Not able to query : Queryable State

Ashish Tadose
Hi Flink community,

I have been trying to use QueryableState with my project.
It's always failing the query saying.

Job 461acde52fae479a6e02c6b2922cd9c1 not found


Both keys(one in queryablestate and one in query) are of same type containing same data.
Still I am not able to fetch the result.
Type of key Class :

case class Record(val fields: Seq[String], val ab: Double = 0.0, val cd: Double = 0.0, val count: Long = 0) extends Serializable with Addable[Record] with Comparable[Record]{

 override def +(other: Record) = {
   new Record(fields,
     ab + other.ab,
     cd + other.cd,
     count + other.count)
 }

 override def equals(obj: scala.Any): Boolean = {
   obj match {
     case other: Record => fields == other.fields
     case _ => false
   }
 }

 override def hashCode(): Int = {
   var hashCode = 0
   fields.foreach(x => hashCode= hashCode+ 31 * x.hashCode)
//    Math.abs(hashCode)
   hashCode
 }

 override def compareTo(o: Record): Int = {
     var i = 0
     i = i + (count - o.count).toInt
     i = i+ (ab - o.ab).toInt
     i = i+ (cd - o.cd).toInt
     return i
 }
}

Is there problem with serialization?
Can I not use complex object as key (it is implementing comparable)

Thanks,
Ashish