|
2 | 2 |
|
3 | 3 | //- utils for reading in config |
4 | 4 | readtableproperties:{[tablepropertiepath] |
5 | | - .lg.o[`readtableproperties;"loading table properties"] |
| 5 | + .lg.o[`readtableproperties;"loading table properties"]; |
6 | 6 | table:`tablename`proctype xkey readcsv[tablepropertiepath;"ssssstsss"]; //read in table from file |
7 | 7 | alltable:?[table;enlist(in;`proctype;enlist`all`);0b;()]; //find any instance of the use "all" or blank for proctype |
8 | 8 | table:table,![alltable;();0b;(enlist`proctype)!enlist(enlist `hdb)],![alltable;();0b;(enlist`proctype)!enlist(enlist `rdb)]; //join rdb and hdb entries for any "all" or blank entries |
9 | 9 | table:![table;enlist(in;`proctype;enlist`all`);0b;`symbol$()]; //remove "all" or blank entries from table |
10 | 10 | table:?[table;$[.proc.proctype=`gateway;();enlist(=;`proctype;`.proc.proctype)];0b;()]; |
11 | 11 | table:update .eodtime.datatimezone ^ datatimezone, .eodtime.rolltimeoffset ^ rolltimeoffset,.eodtime.rolltimezone^rolltimezone from table; |
12 | | - :update `date ^ partitionfield from table where proctype<>`rdb; |
| 12 | + table:update `date ^ partitionfield from table where proctype<>`rdb; |
13 | 13 | .lg.o[`readtableproperties;"Table properties successfully loaded"]; |
| 14 | + :table; |
14 | 15 | }; |
15 | 16 |
|
16 | 17 | readcheckinputs:{[checkinputspath] spliltcolumns[readcsv[checkinputspath;"sbs*"];`invalidpairs;`]}; |
@@ -67,13 +68,13 @@ gettableproperty:extractfromsubdict[;`tableproperties;]; //- extract from `tab |
67 | 68 |
|
68 | 69 | //- get default time from tickerplant or table |
69 | 70 | getdefaulttime:{[dict] |
70 | | - if[(dict`tablename) in key .schema; |
71 | | - :first ?[meta` sv``schema,dict`tablename;enlist(=;`t;"p");();`c]]; |
| 71 | + // go to the tableproperties table |
| 72 | + if[not ` ~ configure:.checkinputs.tablepropertiesconfig[(dict`tablename),.proc.proctype;`primarytimecolumn];:configure]; |
72 | 73 | timestamp:(exec from meta (dict`tablename) where t in "p")`c; |
73 | 74 | if[1 < count timestamp; '`$.checkinputs.formatstring["Table has multiple time columns, please select one of the following {} for the parameter timecolumn";timestamp]]; |
74 | 75 | date:(exec from meta (dict`tablename) where t in "d")`c; |
75 | 76 | if[1 < count date; '`$.checkinputs.formatstring["Table has multiple date columns, please select one of the following {} for the parameter timecolumn";date]]; |
76 | | - if[not timestamp = `;:timestamp]; |
| 77 | + if[not timestamp = `;.checkinputs.tablepropertiesconfig[(dict`tablename),.proc.proctype;`primarytimecolumn]::timestamp;:timestamp]; |
77 | 78 | if[not date = `;:date]; |
78 | 79 | '`$.checkinputs.formatstring["Table:{tablename} does not have a default timecolumn, one must be selected using the time column parameter";dict] |
79 | 80 | }; |
0 commit comments