Hi,
The standard TorQ Tickerplant is based on the standard kdb+ Tick Tickerplant. With the standard TorQ TP, both a time field and sym field are required. Time is expected to be the first field in each message and will be added automatically if it's not present. Sym is required for subscriptions. One way to work around these requirements would be to, as you mentioned before, modify the code in tickerplant.q. However, you may find it easier to use the TorQ Segmented Tickerplant instead as it has the same functionality as the standard TP without these restrictions.
You'll load segmentedtickerplant.q instead of tickerplant.q. By default, the segmented TP will look for a time field and add one to each message if it's not present, but you can get around this by modifying .stplg.updtab for each of the tables in $KDBAPPCONFIG/settings/segmentedtickerplant.q (
example). Something like {[x;y] x}, where x is the incoming message and y is the current time, will work just fine. You'll want .stplg.updtab to look something like this for each of the relevant tables:
table1 | {[x;y] x}
table2 | {[x;y] x}
...
The flag -schemafile is only used to pass the schema information to the tickerplant on TP startup. By default, when the RDB starts up it retrieves the schema from the Tickerplant. If this isn't happening, check .rdb.schema on the RDB as it should be set to 1b.
For loading a csv file into TorQ, you have a few options: load into a separate process and push it to the TP, load it directly into the RDB, or load it directly into the HDB. It mostly depends on what you want to do with it. Loading the actual data into a given process, whether its within TorQ or not, should follow the same
steps.
If loading from a separate process, you could do the following:
- Connect to the Tickerplant from the client process
- Load the csv file from the client process and save it as a table ( for example, table:("FFJJCCS";enlist",") 0: `:path/to/example.csv)
- From the client process, call upd on the TP and provide the name of the table you wish to push to as well as the table you created in step 2
- Check to make sure that the content of the csv was pushed to the subscribers
If loading directly into the RBD, you can load the content of the csv as you would normally and then upsert it to a table:
- `table upsert
("FFJJCCS";enlist",") 0: `:path/to/example.csv
Thanks,
Nick