File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ checkenumerabletype:{[tablename;extrapartitiontype]
4040getextrapartitions : {[tablename ;extrapartitiontype ]
4141 value each ? [tablename ;();1b ;extrapartitiontype ! extrapartitiontype ]
4242 };
43+ / - functional select equivilent to select distinct [ extrapartitiontype ] from [ tablename ] group exec {first each string x} distinct [ extrapartitiontype ] from [ tablename ]
44+
45+ getfirstcharpartitions : {[tablename ;extrapartitiontype ] raze each value (? [tablename ;();();(distinct ;first extrapartitiontype )]) group ? [tablename ;();();({first each string x};(distinct ;first extrapartitiontype ))]};
46+
4347
4448/-function to return partition directory chunks that will be called in batch by mergebypart function
4549getpartchunks : {[partdirs ;mergelimit ]
Original file line number Diff line number Diff line change @@ -168,9 +168,7 @@ savetablesbypart:{[dir;pt;forcesave;tablename;writedownmode]
168168 /- check if provided column extrapartitiontype indeed has an enumerable type in table
169169 if [writedownmode ~`partbyenum ;.merge.checkenumerabletype [tablename ;extrapartitiontype ]];
170170 /- get list of distinct combinations for partition directories
171- extrapartitions : .merge.getextrapartitions [tablename ;extrapartitiontype ];
172- if [writedownmode ~`partbyfirstchar ;
173- extrapartitions : value extrapartitions group .Q.fu [{first each string x}; extrapartitions : raze extrapartitions ]];
171+ extrapartitions : $ [writedownmode ~`partbyfirstchar ;.merge.getfirstcharpartitions ;.merge.getextrapartitions ][tablename ;extrapartitiontype ];
174172 /- enumerate data to be upserted
175173 enumdata : .Q.en [hdbsettings [`hdbdir ];0 ! .save.manipulate [tablename ;`. tablename ]];
176174 .lg.o [`save ;"enumerated " , (string tablename ), " table" ];
You can’t perform that action at this time.
0 commit comments