0

Hi I am getting this compilation error -

Unspecified Value parameters: aggregator: (String, String, NotInferedVR) => NotInferedVR

But I clearly have an aggregator there already. Does anyone know what's going on?

 val stream = builder
    .stream(inputTopic)(Consumed.`with`(Serdes.String(), Serdes.ByteArray()))
    .map{ (key: String, value: Array[Byte]) =>
      println(s"key = ${key}")
      val lv = GroupByAction.convertByteArrayToJsonObject(value)
      val lst = List.empty[String]
      val newKey = GroupByAction
        .reKey(lv
          , groupByColumnList
            .asScala
            .toList
          ,lst)
      val newValue = getValFromJSONMessage(lv, aggregateColumnList.asScala.toList.head)
      println(s"newKey = ${newKey}")
      (newKey, newValue)}
    .groupByKey(Serialized.`with`(Serdes.String(), Serdes.String()))
    .aggregate{ () => 0.toString, (k,v,vr: Long) => (v.toString.toLong + vr.toString.toLong).toString }
uh_big_mike_boi
  • 3,350
  • 4
  • 33
  • 64

1 Answers1

2

You can only use the {} form of method call to pass a single parameter, which is treated as a block. You need to pass two parameters, so use () instead:

aggregate( () => 0.toString, (k,v,vr: Long) => (v.toString.toLong + vr.toString.toLong).toString )
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487