Conversation
There was a problem hiding this comment.
Re: Demos/FeedDemo/Program.cs
Running
q -p 5001
q).u.upd:{[tbl;row] insert[tbl](row)}
q)mytable:([]time:`timespan$();sym:`symbol$();price:`float$();size:`long$())get many `type errors. Just running ParallelInsertRows with the q instance changed to add printing of message received i.e.
q).z.ps:{0N!x;value x}
see what's causing the errors (mismatching types for the table updates):
(".u.upd";`mytable;(0D00:00:00.000000000;`SYMBOL;49i;300))
'type
The code should prob have been
// Assumes a remote schema of mytable:([]time:`timespan$();sym:`symbol$();price:`float$();size:`long$())
object[] row = new object[]
{
new c.KTimespan(i),
"SYMBOL",
Convert.ToDouble(i)
300L
};Though since data is being sent on threads, each thread is interleaving with each other giving different order each time (as expected). Order is the same per thread, but not across threads. e.g. first run, looking at first 5 entries to table when only running parallel inserts:
q)5#mytable
time sym price size
--------------------------------------
0D00:00:00.000000000 SYMBOL 0 300
0D00:00:00.000000000 SYMBOL 75 300
0D00:00:00.000000000 SYMBOL 50 300
0D00:00:00.000000000 SYMBOL 25 300
0D00:00:00.000000000 SYMBOL 26 300 next run has different order, as expected due to threading
q)5#mytable
time sym price size
--------------------------------------
0D00:00:00.000000000 SYMBOL 50 300
0D00:00:00.000000000 SYMBOL 0 300
0D00:00:00.000000000 SYMBOL 75 300
0D00:00:00.000000000 SYMBOL 25 300
0D00:00:00.000000000 SYMBOL 76 300 Depending on use-case, this may not be desirable & will leave it off the demo as closer to programming paradigm rather than API example.
|
@sshanks-kx could you please take a look? :-) |
|
See comment above regarding parallel inserts. Will not be adding it in for now. Thanks for raising. |
Oh ok but if I will push PR with .net 8 only? |
No description provided.