I would like to implement a fast “group by” like feature in Java.
I have a List<List<String>> and I want to iterate through based on groupping on different indexes.
For example:
A1 B1 C1 value_1 A1 B1 C2 value_2 A1 B2 C1 value_3 A1 B2 C2 value_4
I want some aggregations using groupping on first and third column.
And I want it to be fast – avoid calculating every sum at every query.
The values from the “table” are changing constantly.
Any thoughts?
Java is not well suited for that task. I’d rather go with an in memory SQL database. First dump the values to a table and then retrieve the rows with a
selectSQL statement grouping, ordering or summing by different columns.