Skip to content

Commit 675de1a

Browse files
committed
[ksqlDB.RestApi.Client] - left join select many example wiki
1 parent b9cfda6 commit 675de1a

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Package had to be renamed to ksqlDB.Api.Client
1+
The package had to be renamed to ksqlDB.Api.Client
22

33
This package generates ksql queries from your .NET C# linq queries. You can filter, project, limit, etc. your push notifications server side with [ksqlDB push queries](https://docs.ksqldb.io/en/latest/developer-guide/ksqldb-rest-api/streaming-endpoint/).
44
You can continually process computations over unbounded (theoretically never-ending) streams of data.
@@ -3051,6 +3051,31 @@ response = await restApiClient.InsertIntoAsync(payment);
30513051
response = await restApiClient.InsertIntoAsync(shipment);
30523052
```
30533053

3054+
Left joins can be also constructed in the following (less readable) way:
3055+
3056+
```C#
3057+
var query2 = KSqlDBContext.CreateQueryStream<Order>()
3058+
.GroupJoin(Source.Of<Payment>(), c => c.OrderId, c => c.Id, (order, gj) => new
3059+
{
3060+
order,
3061+
grouping = gj
3062+
})
3063+
.SelectMany(c => c.grouping.DefaultIfEmpty(), (o, s1) => new
3064+
{
3065+
o.order.OrderId,
3066+
shipmentId = s1.Id,
3067+
});
3068+
```
3069+
3070+
Equivalent KSQL:
3071+
3072+
```KSQL
3073+
SELECT order.OrderId OrderId, s1.Id AS shipmentId FROM Orders order
3074+
LEFT JOIN Payments s1
3075+
ON order.OrderId = s1.Id
3076+
EMIT CHANGES;
3077+
```
3078+
30543079
# LinqPad samples
30553080
[Push Query](https://github.com/tomasfabian/ksqlDB.RestApi.Client-DotNet/tree/main/Samples/ksqlDB.RestApi.Client.LinqPad/ksqlDB.RestApi.Client.linq)
30563081

0 commit comments

Comments
 (0)