Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Dec 1, 2023
1 parent c7ffbf4 commit 273840d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1641,8 +1641,8 @@ else if(this.getOpCode() == Builtins.MAX_POOL || this.getOpCode() == Builtins.AV
case DECOMPRESS:
if(OptimizerUtils.ALLOW_SCRIPT_LEVEL_COMPRESS_COMMAND){
checkNumParameters(1);
checkMatrixParam(getFirstExpr());
output.setDataType(DataType.MATRIX);
checkMatrixFrameParam(getFirstExpr());
output.setDataType(getFirstExpr().getOutput().getDataType());
output.setDimensions(id.getDim1(), id.getDim2());
output.setBlocksize (id.getBlocksize());
output.setValueType(id.getValueType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ public boolean containsNull() {
public abstract boolean possiblyContainsNaN();

public Array<?> changeTypeWithNulls(ValueType t) {

final ABooleanArray nulls = getNulls();
if(nulls == null)
return changeType(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,17 @@ public static <T> Array<T> compressToDDC(Array<T> arr) {
* @return a compressed column group.
*/
public static <T> Array<?> compressToDDC(Array<T> arr, ValueType vt, boolean containsNull) {
if(containsNull)
return compressToDDC(arr.changeTypeWithNulls(vt));
else
return compressToDDC(arr.changeType(vt));
Array<?> arrT;
try{
arrT = containsNull? arr.changeTypeWithNulls(vt):arr.changeType(vt);
}
catch(Exception e ){
// fall back to full analysis.
Pair<ValueType, Boolean> ct = arr.analyzeValueType();
arrT = ct.getValue()? arr.changeTypeWithNulls(ct.getKey()): arr.changeType(ct.getKey());
}

return compressToDDC(arrT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private FrameLibApplySchema(FrameBlock fb, ValueType[] schema, boolean[] nulls,
}

private FrameBlock apply() {

if(k <= 1 || nCol == 1)
applySingleThread();
else
Expand All @@ -121,7 +122,17 @@ private FrameBlock apply() {

final String[] colNames = fb.getColumnNames(false);
final ColumnMetadata[] meta = fb.getColumnMetadata();
return new FrameBlock(schema, colNames, meta, columnsOut);

FrameBlock out = new FrameBlock(schema, colNames, meta, columnsOut);
if(LOG.isDebugEnabled()){

long inMem = fb.getInMemorySize();
long outMem = out.getInMemorySize();
LOG.debug(String.format("Schema Apply Input Size: %16d" , inMem));
LOG.debug(String.format(" Output Size: %16d" , outMem));
LOG.debug(String.format(" Ratio : %4.3f" , ((double) inMem / outMem)));
}
return out;
}

private void applySingleThread() {
Expand Down

0 comments on commit 273840d

Please sign in to comment.