Github user tfournier314 commented on the issue: https://github.com/apache/flink/pull/2740 I'd like to make this operation scalable: - by sorting globally - then by doing something like "zipWithIndex" (don't know if it is possible) - then collect() val mapper = input .map( s => (s, 1) ) .groupBy( 0 ) .reduce( (a, b) => (a._1, a._2 + b._2) ) .collect( ) .sortBy( r => (r._2, r._1) ) .zipWithIndex .map { case ((s, c), ind) => (s, ind) } .toMap
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---