Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
Option should be treated the same way as other generic objects where it can be used as a key if generic argument implements Comparable.
Here's a scalatest in FunSpec format that illustrates the issue:
```
case class MyKey(x: Option[String])
it("can't use options inside classes used as keys") {
val a = env.fromCollection(Seq(MyKey(Some("a")), MyKey(Some("c"))))
val b = env.fromCollection(Seq(MyKey(Some("a")), MyKey(Some("z"))))
intercept[InvalidProgramException]
// workaround
a.coGroup(b)
.where(e => e.toString) // `e` should be translated to any object that implements Comparable interface to be a valid key.
.equalTo(e => e.toString)
}
```
Attachments
Issue Links
- duplicates
-
FLINK-2673 Scala API does not support Option type as key
- Closed