Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/processes/wdb.q
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ upserttopartition:{[dir;tablename;tabdata;pt;expttype;expt;writedownmode]
` sv .Q.par[dir;pt;tablename],(`$"_"^.Q.an .Q.an?"_" sv string `TORQNULLSYMBOL^ ensuresymlist[expt]),`];
.lg.o[`save;"saving ",(string tablename)," data to partition ",string directory];
/- selecting rows of table with matching partition
r:?[tabdata;$[writedownmode in `partbyenum`partbyfirstchar;enlist(in;first expttype;expt);{(x;y;(),z)}[in;;]'[expttype;expt]];0b;()];
r:?[tabdata;$[writedownmode in `partbyenum`partbyfirstchar;enlist(in;first expttype;enlist expt);
{(x;y;(),z)}[in;;]'[expttype;expt]];0b;()];
/- upsert selected data matched on partition to specific directory
.[upsert;(directory;r);{[e] .lg.e[`savetablesbypart;"Failed to save table to disk : ",e];'e}];
.lg.o[`track;"appending details to partsizes"];
Expand All @@ -168,6 +169,8 @@ savetablesbypart:{[dir;pt;forcesave;tablename;writedownmode]
if[writedownmode~`partbyenum;.merge.checkenumerabletype[tablename;extrapartitiontype]];
/- get list of distinct combinations for partition directories
extrapartitions:.merge.getextrapartitions[tablename;extrapartitiontype];
if[writedownmode~`partbyfirstchar;
extrapartitions:value extrapartitions group .Q.fu[{first each string x}; extrapartitions:raze extrapartitions]];
/- enumerate data to be upserted
enumdata:.Q.en[hdbsettings[`hdbdir];0!.save.manipulate[tablename;`. tablename]];
.lg.o[`save;"enumerated ",(string tablename)," table"];
Expand Down