{"id":19766208,"url":"https://github.com/akaliutau/map-redux","last_synced_at":"2026-05-11T13:06:14.589Z","repository":{"id":193917389,"uuid":"689706063","full_name":"akaliutau/map-redux","owner":"akaliutau","description":"MapRedux is a lightweight library to aggregate data from Map-like data structures.","archived":false,"fork":false,"pushed_at":"2023-09-10T19:46:38.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T00:13:28.250Z","etag":null,"topics":["data-aggregation","json"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akaliutau.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-10T16:50:02.000Z","updated_at":"2023-09-10T18:01:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebf48593-ef98-43e0-a50c-456f8ea6fc1a","html_url":"https://github.com/akaliutau/map-redux","commit_stats":null,"previous_names":["akaliutau/map-redux"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fmap-redux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fmap-redux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fmap-redux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaliutau%2Fmap-redux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akaliutau","download_url":"https://codeload.github.com/akaliutau/map-redux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241099613,"owners_count":19909577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-aggregation","json"],"created_at":"2024-11-12T04:23:20.298Z","updated_at":"2026-05-11T13:06:09.563Z","avatar_url":"https://github.com/akaliutau.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"About\n======\n\nMapRedux is a lightweight library to aggregate data from Map-like data structures.\n\nMotivation\n===========\n\nThe library is to merge data from Map-like structures into [aggregated] Map structures.\n\nThe most useful features:\n\n* Support of custom Reducers\n* Support of sorting by multiple columns\n\nHow to use\n============\n\nAdd dependency:\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.akaliutau\u003c/groupId\u003e\n  \u003cartifactId\u003emapredux\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nConsider the following input:\n\n```json lines\n{\"country\": \"Netherlands\", \"age\": 25, \"hobbies\": \"swimming\", \"region\": \"Europe\", \"name\": \"Alice\"}\n{\"country\": \"US\", \"age\": 23, \"hobbies\": \"reading\", \"region\": \"North America\", \"name\": \"Bob\"}\n{\"country\": \"US\", \"age\": 29, \"hobbies\": \"spying\", \"region\": \"North America\", \"name\": \"Eve\"}\n{\"country\": \"South Korea\", \"age\": 31, \"hobbies\": \"walking\", \",region\": \"Asia\", \"name\": \"Yuni\"}\n{\"age\": 18, \"region\": \"North America\", \"name\": \"X\"}\n\n```\n\n```\nMapRedux mr = new MapRedux.Builder()\n        .select(\n                column(\"name\", \"count\", \"count\"),\n                column(\"age\", \"avg_age\", \"avg\"),\n                column(\"region\"),\n                column(\"country\"),\n                column(\"hobbies\", \"set\")\n        )\n        .where(m -\u003e (int) m.get(\"age\") \u003e 18)\n        .groupBy(\"region\", \"country\")\n        .orderBy(new StringColumnComparator(\"region\"))\n        .build();\nList\u003cMap\u003cString, Object\u003e\u003e result = mr.reduce(records);\n\n```\n\nAggregated results will look like this:\n\n```json lines\n{\"country\": \"South Korea\", \"avg_age\": 31.0, \"hobbies\": [\"walking\"], \"count\": 1, \"region\": \"Asia\"}\n{\"country\": \"Netherlands\", \"avg_age\": 25.0, \"hobbies\": [\"swimming\"], \"count\": 1, \"region\": \"Europe\"}\n{\"country\": \"US\", \"avg_age\": 26.0, \"hobbies\": [\"spying\", \"reading\"], \"count\": 2, \"region\": \"North America\"}\n```\n\nFurther work\n============\n\nThe current version is effectively a pre-release; full release will include more features and improvements in terms of \nstability and performance","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakaliutau%2Fmap-redux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakaliutau%2Fmap-redux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakaliutau%2Fmap-redux/lists"}