-
Notifications
You must be signed in to change notification settings - Fork 12
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
Endpoint to easily search/resolve singular entities by via basic Queries #2933
Conversation
backend/src/main/java/com/bakdata/conquery/apiv1/QueryProcessor.java
Outdated
Show resolved
Hide resolved
|
||
// Build query, assuming FilterValues are all of the same concept and connector. | ||
final CQConcept cqConcept = new CQConcept(); | ||
cqConcept.setElements(List.of(filters.get(0).getFilter().getConnector().getConcept())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
du könntest den connector oben schon rausholen beim distinct
public static record ResolveEntitiesContainer(List<FilterValue<?>> filters){ | ||
@ValidationMethod(message = "Only one Connector is supported.") | ||
public boolean isFiltersForSameConnector() { | ||
return filters().stream().map(fv -> fv.getFilter().getConnector()).distinct().count() == 1; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte in eine extra klasse packen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hatte vergessen die Klasse zu löschen
|
||
@POST | ||
@Path("/resolve-entities") | ||
public Stream<Map<String, String>> resolveEntities(@Auth Subject subject, @Valid @NotEmpty List<FilterValue<?>> container, @Context HttpServletRequest request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public Stream<Map<String, String>> resolveEntities(@Auth Subject subject, @Valid @NotEmpty List<FilterValue<?>> container, @Context HttpServletRequest request) { | |
public Stream<Map<String, String>> resolveEntities(@Auth Subject subject, @Valid @NotEmpty List<FilterValue<?>> container) { |
/** | ||
* Execute a basic query on a single concept and return only the included entities Id's. | ||
*/ | ||
public Stream<Map<String, String>> resolveEntities(Subject subject, List<FilterValue<?>> filters, Dataset dataset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wir sollten echt überlegen ob wir nicht einen synchronen/long-poll execution modus anbieten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ja, wobei hier ja das format ja auch ein bestimmtes ist. Long-poll könnte man ja recht einfach über einen query-param in den query-submission Endpunkten machen, und dann mit der gleichen Logik wie hier.
…r.java Co-authored-by: MT <[email protected]>
No description provided.