Closed KovtunV closed 2 years ago
Hi @KovtunV,
you are right SourceExtensions
shouldn't be internal. The fix will be next in an upcoming release. You can verify it with the release candidate 2.2.0-rc.1 I've just published.
Thank you very much for reporting this issue!
Regards Tomas.
@tomasfabian Thank you, now it's opened but generates wrong query.
var stream = context
.CreateQueryStream<EnduserModel>("endusers")
.WithOffsetResetPolicy(AutoOffsetReset.Latest)
.Join(Source.Of<SubEnduserModel>("sub_endusers").Within(Duration.OfDays(1)),
enduser => K.Functions.ExtractJsonField(enduser.Data, "$.enduser_id"),
sub => sub.EnduserId,
(enduser, sub) => new { EnduserId = sub.EnduserId, Name = sub.Name, Raw = enduser.Data });
SELECT sub.EnduserId EnduserId, sub.Name Name, enduser.Data AS Raw FROM endusers enduser
INNER JOIN sub_endusers sub
WITHIN 1 DAYS ON enduser.EXTRACTJSONFIELD(enduser.Data, '$.enduser_id') = sub.EnduserId
EMIT CHANGES;
wrong text: function enduser.EXTRACTJSONFIELD
Byt the way, is it possible to create stream as select via LINQ? Like
CREATE STREAM EVENTS as
SELECT sub.EnduserId EnduserId, sub.Name Name, enduser.Data Raw
FROM endusers enduser
INNER JOIN sub_endusers sub
WITHIN 1 DAYS GRACE PERIOD 1 DAYS
ON EXTRACTJSONFIELD (enduser.Data, '$.enduser_id') = sub.EnduserId;
@KovtunV you found an edge case with ksql functions in joins which I haven't realized up to this time. I fixed it. I released ksqlDB.RestApi.Client 2.2.0, please verify it again. Thanks a lot!
Regarding the create streams as select check the ToStatementString method or CreateOrReplaceTableStatement.
@tomasfabian It works, thanks!
Hello, why ksqlDB.RestApi.Client.KSql.Linq.SourceExtensions is internal?
I want to join stream to stream, but get en error
Stream-Stream joins must have a WITHIN clause specified. None was provided
However can't reach Within extension method since it's internal.