Skip to content

CLIENT-4752: Add mapKeysIn(Value...) and align mapKeysIn with CDT key#598

Merged
BrianNichols merged 5 commits into
stagefrom
CLIENT-4752-polymorphic-map-types
May 19, 2026
Merged

CLIENT-4752: Add mapKeysIn(Value...) and align mapKeysIn with CDT key#598
BrianNichols merged 5 commits into
stagefrom
CLIENT-4752-polymorphic-map-types

Conversation

@gagan405
Copy link
Copy Markdown
Contributor

  • Add CTX.mapKeysIn(Value...) for polymorphic map key filters
  • Remove mapKeysIn(double...) and mapKeysIn(float...).
  • Modify Packer.packValueArray and packValueList to emit nil for null elements so ValueArray packing matches list packing.
  • Extend TestCdtOperate with additional tests for mixed types.

… rules

Add CTX.mapKeysIn(Value...) for polymorphic map key filters (string, integer,
blob via Value.get(byte[])), using ValueArray and the same 0x2a context id as
other mapKeysIn overloads.

Remove mapKeysIn(double...) and mapKeysIn(float...).

Require IllegalArgumentException for a null String varargs array in
mapKeysIn(String...), matching mapKeysIn(Value...).

Modify Packer.packValueArray and packValueList to emit nil for null elements so
ValueArray packing matches list packing.

Extend TestCdtOperate with additional tests for mixed types.
@gagan405 gagan405 requested a review from mirzakaracic May 14, 2026 21:25
* @return a map key-list context
* @see #mapKeysIn(String...)
*/
public static CTX mapKeysIn(double... keys) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we should remove these are mark as deprecated, considering it might already be released?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all part of path expressions. From what I understand path expressions are still preview feature I would double check with product.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Test Results (gnu / 8.1.0.3_2)

323 tests   289 ✅  44s ⏱️
  1 suites   34 💤
  1 files      0 ❌

Results for commit 67e799f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Test Results (gnu / 8.1.1.0_1)

439 tests   379 ✅  42s ⏱️
  1 suites   60 💤
  1 files      0 ❌

Results for commit 67e799f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Test Results (bouncycastle / 8.1.1.0_1)

439 tests   379 ✅  45s ⏱️
  1 suites   60 💤
  1 files      0 ❌

Results for commit 67e799f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Test Results (bouncycastle / 8.1.0.3_2)

323 tests   289 ✅  43s ⏱️
  1 suites   34 💤
  1 files      0 ❌

Results for commit 67e799f.

♻️ This comment has been updated with latest results.

mirzakaracic
mirzakaracic previously approved these changes May 18, 2026
@mirzakaracic mirzakaracic requested a review from BrianNichols May 18, 2026 17:40
@mirzakaracic
Copy link
Copy Markdown
Collaborator

For this PR you will have to create equivalent for v8 branch. You can use the /port-to-jdk8 claude or cursor skill.

Copy link
Copy Markdown
Member

@BrianNichols BrianNichols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Packer packValueArray()/packValueList(), why would an item in the array/list ever be null?

@gagan405
Copy link
Copy Markdown
Contributor Author

gagan405 commented May 18, 2026

In Packer packValueArray()/packValueList(), why would an item in the array/list ever be null?

The list/array is passed as-is from the user. The client lib doesn't alter it anywhere. So it is possible that there could be null in the array or the list, which ends up in SerializationException (with inner NPE).

Added a test to validate that. Removing the null check will fail this test: listBinsRoundTripNullValueSlots

Of course, we can also keep it as it is and let the user see SerializationException instead of packing a Nil there.

@BrianNichols BrianNichols merged commit c8279d8 into stage May 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants