Successful push to Tickerplant, yet 'type error on pushing process?

Hello,

I have the following table schemas in the sym.q file for my TP:

 

/sym.q quote:(time:timespan$();sym:symbol$();bid:float$();ask:float$(); bsize:int$();asize:int$()) trade:(time:timespan$();sym:symbol$();price:float$();size:int$()) agg: (time:timespan$(); sym:symbol$(); maxBid:float$();minAsk:float$(); maxPrice:float$();minPrice:float$(); totalVolume:`int$())

 

I’m running SampleFeed.q from this FeedHandler and running an RDB from this r.q.  The RDB’s trade and quote tables are populating properly. 

Now I am running a separate complex event processor (CEP) using the same code as r.q above. In this CEP I can push a row to trade using 

 

/CEP.q h: neg hopen 5000 h(.u.upd;trade;(.z.n;`a;1f;1))

 

and that row successfully appears in trade when called from the RDB.

However when I try to push similarly to agg, which as shown above has meta (n, s, f, f, f, f, i):

 

/CEP.q h(.u.upd;agg;(.z.n;`a;1f;1f;1f;1f;1))

 

The CEP returns a 'type error – however, when I call agg from the RDB, the row is successfully pushed, without error in the TP or RDB!

 

Does anyone know what’s happening there?

 

Kind regards,

Michael

 

 

Hi Michael,

I would suggest passing 1i explicitly to ensure consistent types

Data types | Basics | kdb+ and q documentation - Kdb+ and q documentation (kx.com)

What’s the meta of agg on your target process? i.e. run meta[agg] to confirm this aligns with a loaded schema, and not something kdb was guessed based on the first inserted record.

My guess is that whilst you can see ‘1’ in agg, it’s not actually of type -6h or ‘i’

Hope this helps.

David