diff --git a/code/processes/wdb.q b/code/processes/wdb.q index 60892d152..f22b6f238 100644 --- a/code/processes/wdb.q +++ b/code/processes/wdb.q @@ -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"]; @@ -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"];