1

There is an application scenario: if I have a table A, which is the contract name corresponding to different dates. Now I want to get continuous tick data based on this table (the specific contract for different dates is determined by table A). If I use ej (all tick memory, A, 'TradingDay`InstrumentID) to get the data, the left table of ej will be very Large, it doesn't feel very efficient. Is there any solution for this?

To be specific,

For table A, each trading day corresponds to a certain contract. The tick partition is a combination partition based on the transaction day and the first two letters of the contract name (`IF) as the value. The table structure can be assumed to have 4 fields, TradingDay, UpdateTime, InstrumentID, LastPrice, and ProductID.

dovish618
  • 156
  • 5

1 Answers1

0

To take continuous contract data, you can submit a query for each row in table A, and finally use union to merge

def getTickData(dict){
 curDate = dict.TradingDay
 curID = dict.InstrumentID
 curProductID = curID.left(2)
 return select TradingDay, UpdateTime, InstrumentID, LastPrice from loadTable("db", "table") where TradingDay = curDate, ProductId =curProductID, InstrumentID = curID
}

ploop(getTicketData, A).unionAll(false)

dovish618
  • 156
  • 5