Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions code/common/merge.q
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ checkenumerabletype:{[tablename;extrapartitiontype]
getextrapartitions:{[tablename;extrapartitiontype]
value each ?[tablename;();1b;extrapartitiontype!extrapartitiontype]
};
/ - functional select equivilent to select distinct [ extrapartitiontype ] from [ tablename ] group exec {first each string x} distinct [ extrapartitiontype ] from [ tablename ]

getfirstcharpartitions:{[tablename;extrapartitiontype] raze each value (?[tablename;();();(distinct;first extrapartitiontype)]) group ?[tablename;();();({first each string x};(distinct;first extrapartitiontype))]};


/-function to return partition directory chunks that will be called in batch by mergebypart function
getpartchunks:{[partdirs;mergelimit]
Expand Down
4 changes: 1 addition & 3 deletions code/processes/wdb.q
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ savetablesbypart:{[dir;pt;forcesave;tablename;writedownmode]
/- check if provided column extrapartitiontype indeed has an enumerable type in table
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]];
extrapartitions:$[writedownmode~`partbyfirstchar;.merge.getfirstcharpartitions;.merge.getextrapartitions][tablename;extrapartitiontype];
/- enumerate data to be upserted
enumdata:.Q.en[hdbsettings[`hdbdir];0!.save.manipulate[tablename;`. tablename]];
.lg.o[`save;"enumerated ",(string tablename)," table"];
Expand Down