I was planning on writing a blog post on how to save data to disk from a q process but then realized that I need to first cover the enumeration process because any data you wish to write to disk must be enumerated if it has a sym column. If you try to save a table with columns of type symbol, you will get a type
error. I am sure you are familiar with the generic concept of enumeration. If not, you can read up more about it here.
There are many benefits of enumeration but one main benefit is that enumeration normalizes data. How is that helpful? Suppose, you have a trade table with a million rows that contain data for syms AAPL
, IBM
, and MSFT
. Your table will have numerous repeating records per sym. Think of the many times you will have to save AAPL sym. It can get a bit overwhelming for large tables…for multiple dates…for thousands of syms. If you were to apply enumeration, you would only have to save this value once. Let’s elaborate on that.