我正在尝试结合模式匹配和条件,但是这段代码(这是一个 Samza 任务):
override def process(incomingMessageEnvelope: IncomingMessageEnvelope, messageCollector: MessageCollector, taskCoordinator: TaskCoordinator): Unit = {
val event = (incomingMessageEnvelope getMessage).asInstanceOf[Map[String, Date]]
val symbol = (event get "symbol").asInstanceOf[String]
val eventDate = (event get "date").asInstanceOf[Date]
(store get symbol) match {
case x: java.util.Date if x.equals(eventDate) || x.after(eventDate) => _
case _ => {
this.store.put(symbol, eventDate)
}
}
}
返回此错误:
Error:(30, 38) unbound placeholder parameter
case x if isGreaterOf(x, x) => _
^
你知道错误吗?
谢谢
问候
詹卢卡