123456789101112131415161718192021222324252627282930313233 |
- login(`admin, `123456);
- use fundit::sqlUtilities;
- /*
- * 初始化建库
- */
- directory = "dfs://fundit/mfdb/";
- // dropDatabase(directory);
- // Not sure why PKEY cannot be used
- db = database(directory, partitionType=HASH, partitionScheme=[SYMBOL, 5], engine='TSDB');
- directory = "dfs://fundit/pfdb/";
- db = database(directory, partitionType=HASH, partitionScheme=[SYMBOL, 5], engine='TSDB');
- directory = "dfs://fundit/raw_db/";
- db = database(directory, partitionType=HASH, partitionScheme=[SYMBOL, 5], engine='TSDB');
- /*
- * 初始化建表
- *
- */
- db = get_local_database('fundit', 'mfdb');
- tb_nav = table(100:0, ['entity_id', 'price_date', 'cumulative_nav', 'nav', 'isvalid', 'createtime', 'updatetime'],
- [SYMBOL, DATE, DOUBLE, DOUBLE, INT, DATETIME, DATETIME]);
- //dropTable(db, 'public_nav');
- createPartitionedTable(db, tb_nav, 'public_nav', partitionColumns='entity_id', sortColumns=['entity_id', 'price_date'], keepDuplicates=LAST);
- createPartitionedTable(db, tb_nav, 'nav', partitionColumns='entity_id', sortColumns=['entity_id', 'price_date'], keepDuplicates=LAST);
- createPartitionedTable(db, tb_nav, 'market_indexes', partitionColumns='entity_id', sortColumns=['entity_id', 'price_date'], keepDuplicates=LAST);
|