Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query doesn't support select elements for map column #1526

Closed
ivan-zaitsev opened this issue Oct 14, 2024 · 2 comments
Closed

Query doesn't support select elements for map column #1526

ivan-zaitsev opened this issue Oct 14, 2024 · 2 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@ivan-zaitsev
Copy link

Query doesn't support select elements for map column.

Example of code:

CREATE TABLE data (fields map<VARCHAR, VARCHAR>);
class Data {
        Map<String, String> fields;
}

CassandraOperations cassandraOperations;

Select query = QueryBuilder.selectFrom("table").all()
        .element("map", QueryBuilder.literal("key1"))
        .element("map", QueryBuilder.literal("key2"));

Data data = cassandraOperations.select(query, Data.class);

data object will not have map elements present.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 14, 2024
@ivan-zaitsev
Copy link
Author

As a workaround possible to create custom Mapper, but not so easy to make it universal to work with any data model.

@mp911de
Copy link
Member

mp911de commented Oct 15, 2024

The query SELECT map['key1'],map['key2'] FROM table isn't supposed to map any keys into Data.fields as the property names do not match. In fact, map['key1'] has no column name. You have to provide a data structure along a query where property names map to column names.

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
@mp911de mp911de added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants