Skip to content

Commit

Permalink
debug logs in if then else
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalgoyal committed Mar 27, 2024
1 parent f4bbebd commit ceea919
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
18 changes: 13 additions & 5 deletions common/core/src/main/java/zingg/common/core/block/Block.java
Expand Up @@ -126,14 +126,18 @@ public void estimateElimCount(Canopy<R> c, long elimCount) {
Canopy<R>best = null;

for (FieldDefinition field : fieldsOfInterest) {
LOG.debug("Trying for " + field + " with data type " + field.getDataType() + " and real dt "
+ getDataTypeFromString(field.getDataType()));
if (LOG.isDebugEnabled()){
LOG.debug("Trying for " + field + " with data type " + field.getDataType() + " and real dt "
+ getDataTypeFromString(field.getDataType()));
}
//Class type = FieldClass.getFieldClassClass(field.getFieldClass());
FieldDefinition context = field;
if (least ==0) break;//how much better can it get?
// applicable functions
List<HashFunction<D,R,C,T>> functions = functionsMap.get(getDataTypeFromString(field.getDataType()));
LOG.debug("functions are " + functions);
if (LOG.isDebugEnabled()){
LOG.debug("functions are " + functions);
}

if (functions != null) {

Expand All @@ -144,8 +148,10 @@ public void estimateElimCount(Canopy<R> c, long elimCount) {
//!childless.contains(function, field.fieldName)
)
{
LOG.debug("Evaluating field " + field.fieldName
if (LOG.isDebugEnabled()){
LOG.debug("Evaluating field " + field.fieldName
+ " and function " + function + " for " + field.dataType);
}
Canopy<R>trial = getNodeFromCurrent(node, function,
context);
estimateElimCount(trial, least);
Expand Down Expand Up @@ -182,7 +188,9 @@ public void estimateElimCount(Canopy<R> c, long elimCount) {
}*/
}
else {
LOG.debug("No child " + function);
if (LOG.isDebugEnabled()){
LOG.debug("No child " + function);
}
//childless.add(function, field.fieldName);
}

Expand Down
Expand Up @@ -32,7 +32,7 @@ public String call(String field) {
r = field.trim().substring(0, endIndex);
}
}
LOG.debug("Applying " + this.getName() + " on " + field + " and returning " + r);
//LOG.debug("Applying " + this.getName() + " on " + field + " and returning " + r);
return r;
}

Expand Down
1 change: 1 addition & 0 deletions spark/core/src/test/java/zingg/block/TestBlock.java
Expand Up @@ -50,6 +50,7 @@ public void testTree() throws Throwable {
// primary deciding is unique year so identityInteger should have been picked
Canopy<Row> head = blockingTree.getHead();
assertEquals("identityInteger", head.getFunction().getName());
blockingTree.toString();

}

Expand Down

0 comments on commit ceea919

Please sign in to comment.