parent
3b0b17c04e
commit
82d3c28895
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,40 @@
|
||||
import sys
|
||||
# import os
|
||||
|
||||
from loguru import logger
|
||||
from os.path import dirname, abspath, join
|
||||
ROOT_DIR = abspath(join(dirname(abspath(__file__)), ".."))
|
||||
|
||||
from loguru import logger
|
||||
logger.remove()
|
||||
logger.add(sys.stderr, level="INFO")
|
||||
logger.add(ROOT_DIR+"/logs/{time:YYYYMMDD-HHmmss}.log", rotation="10 MB", compression="zip", level="INFO")
|
||||
|
||||
from DDBfm import DDBfm
|
||||
from TSLfm import TSLfm
|
||||
|
||||
|
||||
def main():
|
||||
df=None
|
||||
|
||||
with TSLfm() as tsl:
|
||||
# code_list = tsl.get_code_list("国债期货")
|
||||
# code_list += tsl.get_code_list("股指期货")
|
||||
# code_list += tsl.get_code_list("上市期货")
|
||||
# code_list=sorted(list(set(code_list)))
|
||||
|
||||
begin_date='20221031'
|
||||
end_date='20221101'
|
||||
|
||||
|
||||
code_list=['CF2211']
|
||||
df = tsl.process_result_data_type(tsl.get_mkt_min_k(begin_date,end_date,code_list))
|
||||
print(df)
|
||||
|
||||
ddb = DDBfm('dev')
|
||||
ddb.create_hft_database()
|
||||
ddb.create_hft_table(ddb.ddf_hft_mink_tbname,df)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -0,0 +1,29 @@
|
||||
getAllDBs();
|
||||
getDFSDatabases();
|
||||
getScheduledJobs();
|
||||
loadTableBySQL(tableName='pt',dbPath="dfs://tsdb",sql="select * limit 10;");
|
||||
loadTable("dfs://tsdb","pt")
|
||||
loadTable("dfs://hft_stock_ts","KLinePartitioned")
|
||||
listTables("dfs:/hft_futuremarket_ts");
|
||||
|
||||
pt=loadTable("dfs://hft_futuremarket_ts","MinKlinePartitioned")
|
||||
select top 40 * from pt
|
||||
|
||||
select count(*) from loadTable("dfs://hft_futuremarket_ts", "MinKlinePartitioned")
|
||||
schema(pt)
|
||||
|
||||
n=1000000
|
||||
ID=rand(100, n)
|
||||
dates=2017.08.07..2017.08.11
|
||||
date=rand(dates, n)
|
||||
x=rand(10.0, n)
|
||||
t=table(ID, date, x)
|
||||
|
||||
dbDate = database(, VALUE, 2017.08.07..2017.08.11)
|
||||
dbID=database(, RANGE, 0 50 100)
|
||||
db = database("dfs://compoDB", COMPO, [dbDate, dbID])
|
||||
pt = db.createPartitionedTable(t, `pt, `date`ID)
|
||||
pt.append!(t)
|
||||
|
||||
pt=loadTable(db,`pt)
|
||||
select count(x) from pt
|
Loading…
Reference in new issue