How to use Artic properly
octosport opened this issue · 1 comments
octosport commented
Arctic Version
Any
Arctic Store
ChunkStore
Platform and version
Linux
Description of problem and/or code sample that reproduces the issue
Although the library seems very powerful it lacks simple production use cases. If I take the example in ChunkStore:
>>> df = DataFrame(data={'data': [1, 2, 3, 4, 5, 6, 7, 8, 9],
'open': [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9],
'close': [1.2, 2.3, 3.4, 4.5, 5.6, 6.7, 7.8, 8.9, 9.0],
'prev_close': [.1, .2, .3, .4, .5, .6, .7, .8, .8],
'volume': [1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000]
},
index=MultiIndex.from_tuples([(dt(2016, 1, 1), 1),
(dt(2016, 1, 2), 1),
(dt(2016, 1, 3), 1),
(dt(2016, 2, 1), 1),
(dt(2016, 2, 2), 1),
(dt(2016, 2, 3), 1),
(dt(2016, 3, 1), 1),
(dt(2016, 3, 2), 1),
(dt(2016, 3, 3), 1)],
names=['date', 'id'])
)
>>> lib.write('column_test', df, chunk_size='D')
>>> lib.read('column_test', columns=['prev_close', 'volume'])
prev_close volume
date id
2016-01-01 1 0.1 1000
2016-01-02 1 0.2 2000
2016-01-03 1 0.3 3000
2016-02-01 1 0.4 4000
2016-02-02 1 0.5 5000
2016-02-03 1 0.6 6000
2016-03-01 1 0.7 7000
2016-03-02 1 0.8 8000
2016-03-03 1 0.8 9000
- How do you add a new column, for instance, a high or low, without making a new symbol but updating that one?
It seems possible in ChunkStore using update but we need to precise chunk_range and the new data frame to be written has to contain old columns + the new one. It is not possible to only append one new column without deleting the rest of the data - How do you update each column individually on the 2016-03-04 (say I do not get each data point at the same time)?
It seems possible in ChunkStore using update but we need to precise chunk_range otherwise, data are overwritten - How do you read multiple symbol volumes and get them in one data frame?
It is possible in ChunkStore to read by passing a list of symbols - How do you update/append in TickStore? And I guess in VersionStore you write a new version for each update?
My understanding is TickStore only write as ticks are only read one time
Maybe my understanding is not correct and the database is not designed for these cases which is perfectly fine. Otherwise, I can not find this information in the doc.
Thanks