Why don't Tuple types implement Comparable?

Posted by Frank Grimes on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Why-don-t-Tuple-types-implement-Comparable-tp26276.html

Hi,

I've recently started to evaluate Flink and have found it odd that its Tuple types, while Serializable, don't implement java.lang.Comparable.
This means that I either need to provide an KeySelector for many operations or subtype the Tuple types and provide my own implementation of compareTo for each.

Is there a technical reason why this was omitted?

For example, the JOOQ/JOOL Tuple types all implement Comparable:
https://github.com/jOOQ/jOOL/blob/master/jOOL-java-8/src/main/java/org/jooq/lambda/tuple/Tuple2.java#L39

As an aside, I tried replacing usage of Flink's Tuple types with the JOOL ones but they caused a StackOverflowError similar to this one:
https://issues.apache.org/jira/browse/FLINK-3922

Thanks,

Frank Grimes