Merged
Conversation
10 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements the MAP_VALUES SQL function, which extracts all values from a map and returns them as an array. This complements the existing MAP_KEYS function by providing access to map values.
- Adds the
MAP_VALUESfunction to the SQL compiler and runtime library - Implements corresponding test cases for the new function
- Updates documentation to include the new function
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Regression1Tests.java | Adds Ignore import (unused in this diff) |
| MapTests.java | Renames test method for clarity and adds comprehensive tests for MAP_VALUES function |
| FunctionDocumentation.java | Fixes multiline handling in test pattern parsing |
| CalciteFunctions.java | Registers the MAP_VALUES function with Calcite |
| ExpressionCompiler.java | Adds MAP_VALUES case to expression compilation logic |
| map.md | Documents the new MAP_VALUES function with examples |
| function-index.md | Adds index entry for MAP_VALUES function |
| map.rs | Implements the Rust runtime functions for MAP_VALUES |
docs.feldera.com/docs/sql/map.md
Outdated
| | <a id="cardinality"></a>`CARDINALITY`(map) | Returns the number of key-value pairs in the map. | `CARDINALITY(MAP['x', 4])` => 1 | | ||
| | <a id="map_contains_key"></a>`MAP_CONTAINS_KEY`(map, key) | Returns true when the map has an item with the specified key; `NULL` if any argument is `NULL`. | `MAP_CONTAINS_KEY(MAP['x', 4], 'x')` => `true` | | ||
| | <a id="map_keys"></a>`MAP_KEYS`(map) | Returns a sorted ARRAY of the appropriate type with all the keys of the MAP. | `MAP_KEYS(MAP['x', 4, 'y', 5])` => `['x', 'y']` | | ||
| | <a id="map_values"></a>`MAP_VALUES`(map) | Returns an ARRAY of the appropriate type with all the values of the MAP. | `MAP_KEYS(MAP['x', 4, 'y', 5])` => `[4, 5]` | |
There was a problem hiding this comment.
The example incorrectly uses MAP_KEYS instead of MAP_VALUES. It should demonstrate the MAP_VALUES function.
Suggested change
| | <a id="map_values"></a>`MAP_VALUES`(map) | Returns an ARRAY of the appropriate type with all the values of the MAP. | `MAP_KEYS(MAP['x', 4, 'y', 5])` => `[4, 5]` | | |
| | <a id="map_values"></a>`MAP_VALUES`(map) | Returns an ARRAY of the appropriate type with all the values of the MAP. | `MAP_VALUES(MAP['x', 4, 'y', 5])` => `[4, 5]` | |
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
2c66869 to
58ca77f
Compare
lalithsuresh
approved these changes
Nov 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5111