Repository navigation
docs: Refresh view query language section - #144
Conversation
|
@pvlugter any more feature I have missed that would be good to cover here? |
# Conflicts: # akka-javasdk-tests/src/test/java/akkajavasdk/ViewIntegrationTest.java # akka-javasdk-tests/src/test/java/akkajavasdk/components/views/AllTheTypesView.java
octonato
left a comment
There was a problem hiding this comment.
LGTM, but waiting Peter's feedback before merging.
Left a command about word 'support', but not blocking.
|
|
||
| ==== Grouping | ||
|
|
||
| Grouping of results based on a field is supported using `collect(*)`. Each found key leads to one returned entry, where |
There was a problem hiding this comment.
so, there was this other PR recently that replaces the usage of the term 'support' by alternatives.
#137
| Grouping of results based on a field is supported using `collect(*)`. Each found key leads to one returned entry, where | |
| Grouping of results based on a field is done using `collect(*)`. Each found key leads to one returned entry, where |
But I see that we use the term quite a lot in this page. Hard to replace it in most cases, IMO.
There was a problem hiding this comment.
Yeah, it's all over this page, let's leave it for now.
4929ef2 to
57c6f21
Compare
pvlugter
left a comment
There was a problem hiding this comment.
LGTM. I think most things are covered now, and things that were Yugabyte limitations before already removed.
|
|
||
| ==== Grouping | ||
|
|
||
| Grouping of results based on a field is supported using `collect(*)`. Each found key leads to one returned entry, where |
There was a problem hiding this comment.
Do we need to also talk about 'structural' projections here? Where collect(*) uses all the fields, but you can also select/rename fields. Or nested collects. There are some examples under advanced queries, but could be useful with a reference description here.
There was a problem hiding this comment.
Sounds good to cover 👍
There was a problem hiding this comment.
👍 But doesn't yet replace the * in collect(*) with multiple selected fields. But maybe that should be left for the advanced queries anyway. Something you may want to do when there's more complex state and multiple queries for a view, and some of them want to only return the relevant subset of the state.
|
|
||
| ==== Count | ||
|
|
||
| Counting results matching a query can be done using `count(*)`. |
There was a problem hiding this comment.
We probably do want to use count(*) here, even if it's not a proper aggregation but a separate query for the total_count() for paging. But does this create a warning at the moment? Or maybe we can distinguish this usage from the other one (when it's combined with regular results) and only have the deprecation then.
There was a problem hiding this comment.
I didn't see any when testing a query like SELECT count(*) FROM somewhere but I'll double check if there is a warning in the log.
I'm showing off total_count() in the paging section, I tried to read up on issues, but I'm not entirely if I understood correctly wrt the two different count aggregations.
There was a problem hiding this comment.
It indeed shows up right now, so would need some fix in the runtime for specific count queries:
[info] 2025-01-15 09:28:19,054 WARN akka.javasdk.ServiceLog - Warning reported from Akka runtime: AK-00131 View [all_the_field_types_view] query method on [countRows]: The COUNT(*) operator for paged view queries is deprecated, replaced by the total_count() function.
[info] Update this view query to use `total_count() AS fieldName` instead.
There was a problem hiding this comment.
Upstream fix for that https://github.com/lightbend/kalix-runtime/pull/3337
Co-authored-by: Peter Vlugter <59895+pvlugter@users.noreply.github.com>
References: https://github.com/lightbend/kalix/issues/12160