Skip to content

PoC: Extend Map capabilities#1436

Draft
BobdenOs wants to merge 1 commit intomainfrom
feat/mappp
Draft

PoC: Extend Map capabilities#1436
BobdenOs wants to merge 1 commit intomainfrom
feat/mappp

Conversation

@BobdenOs
Copy link
Contributor

@BobdenOs BobdenOs commented Dec 2, 2025

‼️EXPERIMENTAL‼️

Don't expect any of these features to every be actually be released !!!

Examples

A list of implemented and tested Map queries.

// allows simple path expression on Map type columns
SELECT map.a as extract FROM map;
SELECT map.a.b as extract FROM map;

// allows extracting paths through array values
SELECT map.a.b.![*].d as extract FROM map;

// allows filtering on array values before extracting further
SELECT map.a.b.![*][d != null].d as extract FROM map;

// allows selecting from Map values as path expression
SELECT c:Boolean, d:Boolean FROM map:map.a.b

// allows using Map path expressions inside WHERE clauses
SELECT map as extract FROM map WHERE map.a.b != null;
SELECT c:Boolean, d:Boolean FROM ${map}:map.a.b WHERE d != null

// allows selecting from Map values including infix filters
SELECT c:Boolean, d:Boolean FROM ${map}:map.a.b.![*][c != null]

As * is a special character it has to be escaped conincidentially as cds uses ![...] as the escape syntax it creates a very similar syntax as classic JSON path definitions use ![*]. The main difference being the ! which does appropriately points out how crazy of an operation is being used.

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.

1 participant