Subscribing to tickerplant by sym

97 views
Skip to first unread message

R__2

unread,
Oct 19, 2016, 12:51:07 PM10/19/16
to AquaQ TorQ
So this problem has been plauging me for a really long time, and I cant figure out the solution:

see the below two links


attached is my tickerplant.q file, my tick.q file, database.q, and u.q , and my start batch script.

I have ZERO idea why this doesnt work. Its completely mind boggling
tickerplant.q
tick.q
u.q
startproccess.txt

Jonny Press

unread,
Oct 19, 2016, 3:34:43 PM10/19/16
to R__2, AquaQ TorQ
Hi Riz (not sure if that is your name or not!)

What exactly is it you are trying to achieve? 

I think the issue is that you have .u.upd defined to be .u.pub.  When you subscribe to all symbols (`) you will see data being fed through as .u.sel will just bypass the select code

q)h".u.sel"                                                                                                                                                                                                 
{$[`~y;x;select from x where sym in y]}

When you subscribe to a single sym, the call to .u.sel will fail, and therefore the call to .u.upd will fail. 

You will probably also see that if you set up two subscriptions, the first subscribing for the single sym and the second subscribing for all syms, then neither will receive any data as the .u.upd call will fail on the first call to .u.sel and not execute the second one. 

Assuming you are using a standard TorQ set up, you can turn on logging for the TP to log all the calls coming in (replace appconfig/settings/tickerplant.q with the attached file)

You can then see the errors with something like

select from .usage.usage where status=“e”

run on the tickerplant itself (or look at the usage_tickerplant.log)

Thanks 

Jonny
 

This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages to clients of AquaQ Analytics may contain information that is confidential and legally privileged. Please do not read, copy, forward, or store this message unless you are an intended recipient of it. If you have received this message in error, please forward it to the sender and delete it completely from your computer system
tickerplant.q
ATT00001.htm

Rizwan Patel

unread,
Oct 19, 2016, 3:49:10 PM10/19/16
to Jonny Press, AquaQ TorQ
.u.upd on the tickerplant is 

"{[t;x]{[t;x;w]if[count x:sel[x]w 1;(neg first w)(`upd;t;x)]}[t;x]each w t}"

You are correct about the errors being in the log. although a type error here isnt helpful
q)'type
@
{$[`~y;x;select from x where sym in y]}[(2016.10.19T15:41:48.247;`ZB;`Dec16;`..
`ZB


So not sure if what you described is the problem or not

Jonny Press

unread,
Oct 20, 2016, 3:33:56 AM10/20/16
to Rizwan Patel, AquaQ TorQ
I’m pretty sure the problem is what I described. 

You are passing a list of lists (or maybe just a list) as the y argument to .u.pub (as you have redefined .u.upd:.u.pub).  .u.pub expects [`tablename; table of data]

This fails in the .u.sel bit (which is the error you see).  .u.sel expects [table of data; list of symbols]

.u.sel[list; `] will succeed as the ` (all symbols) wild card means that it just returns the y argument as is (i.e. the list)
.u.sel[list; `ZB] will fail as it tries to do 

select from list where sym in `ZB

which fails with a type error. 

What is it you are trying to achieving by setting .u.upd:.u.pub ? 

Thanks 

Jonny


--
You received this message because you are subscribed to the Google Groups "AquaQ TorQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kdbtorq+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/kdbtorq/CACHXVu0hdtbD1UVBWPW9SSaLb8V1ofsCemCeBphmWuZPF054jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages