Indexing the keys can be a possible alternative, it's just that we already have an array and it would be cleaner to be able to do array operations by getting elements of a given index.
But yeah, if there is no direct way to do it, indexing keys is a good solution.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.