API do Flink Scala "argumentos insuficientes"
Estou tendo problemas ao usar a API Apache Flink Scala
Por exemplo, mesmo quando eu pego os exemplos da documentação oficial, o compilador scala me fornece vários erros de compilação.
Código:
object TestFlink {
def main(args: Array[String]) {
val env = ExecutionEnvironment.getExecutionEnvironment
val text = env.fromElements(
"Who's there?",
"I think I hear them. Stand, ho! Who's there?")
val counts = text.flatMap { _.toLowerCase.split("\\W+") filter { _.nonEmpty } }
.map { (_, 1) }
.groupBy(0)
.sum(1)
counts.print()
env.execute("Scala WordCount Example")
}
}
O Scala IDE produz o seguinte para a linhaval text = env.fromElements
Multiple markers at this line
- not enough arguments for method fromElements: (implicit evidence$14: scala.reflect.ClassTag[String], implicit evidence$15:
org.apache.flink.api.common.typeinfo.TypeInformation[String])org.apache.flink.api.scala.DataSet[String]. Unspecified value parameter evidence$15.
- could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[String]
- could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[String]
- not enough arguments for method fromElements: (implicit evidence$14: scala.reflect.ClassTag[String], implicit evidence$15:
org.apache.flink.api.common.typeinfo.TypeInformation[String])org.apache.flink.api.scala.DataSet[String]. Unspecified value parameter evidence$15.
Não é apenasfromElements
método: mesmo que eu leia de um arquivo e tente fazer algo tão simples quantods.map(r => r)
, Eu recebo algo muito semelhante
Multiple markers at this line
- not enough arguments for method map: (implicit evidence$4: org.apache.flink.api.common.typeinfo.TypeInformation[K], implicit
evidence$5: scala.reflect.ClassTag[K])org.apache.flink.api.scala.DataSet[K]. Unspecified value parameters evidence$4, evidence$5.
- could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[K]
- could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[K]
- not enough arguments for method map: (implicit evidence$4: org.apache.flink.api.common.typeinfo.TypeInformation[K], implicit
evidence$5: scala.reflect.ClassTag[K])org.apache.flink.api.scala.DataSet[K]. Unspecified value parameters evidence$4, evidence$5.
Tentei duas versões do Flink: 0.8.1 do Maven Central e a mais recente do repositório do github.
Estou executando o Windows 7, scala 2.10.4, jdk 1.7.0_25, a versão do Scala IDE é 3.0.3-20140327-1716-Typesafe sobre o Eclipse 4.3.0
O que estou fazendo errado?