Skip to content

Commit

Permalink
Avoid warning
Browse files Browse the repository at this point in the history
  • Loading branch information
CerielJacobs committed Sep 2, 2020
1 parent 2642a1d commit c20fa48
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/vlog/forward/column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,44 +243,30 @@ EDBColumn::EDBColumn(EDBLayer &edb, const Literal &lit, uint8_t posColumn,
}

size_t EDBColumn::estimateSize() const {
QSQQuery query(l);
if (!unq) {
return layer.getCardinality(*query.getLiteral());
return layer.getCardinality(l);
} else {
return layer.getCardinalityColumn(*query.getLiteral(), posColumn);
return layer.getCardinalityColumn(l, l.getPosVars()[posColumn]);
}
}

size_t EDBColumn::size() const {
// TODO: check this! It seems to assume that arity == 3? --Ceriel
QSQQuery query(l);
size_t retval;
if (!unq) {
if (l.getNVars() == 2) {
retval = layer.getCardinality(*query.getLiteral());
} else if (l.getNVars() == 1) {
retval = layer.getCardinality(*query.getLiteral());
} else {
retval = EDBColumnReader(l, posColumn, presortPos, layer, unq).size();
}
retval = layer.getCardinality(l);
} else {
retval = layer.getCardinalityColumn(l, l.getPosVars()[posColumn]);
/*
// TODO: check this! It seems to assume that arity == 3? --Ceriel
if (l.getNVars() == 2) {
retval = layer.getCardinalityColumn(*query.getLiteral(), l.getPosVars()[posColumn]);
} else {
LOG(WARNL) << "Must go through all the column"
" to count the size";
retval = EDBColumnReader(l, posColumn, presortPos, layer, unq).size();
}
*/
}
#if TRACE
size_t sz = getReader()->asVector().size();
if (sz != retval) {
LOG(TRACEL) << "query = " << l.tostring();
LOG(TRACEL) << "sz = " << sz << ", should be " << retval;
LOG(TRACEL) << "unq = " << unq << ", l.getNVars = " << (int) l.getNVars();
throw 10;
}
#endif
return retval;
}

Expand Down

0 comments on commit c20fa48

Please sign in to comment.