Hi John,
The patch is attached here.
2014-04-11 4:24 GMT+08:00 K. John Wu <[email protected]>:
> Thanks, 忠博.
>
> Would you mind resend the patch to bord.cpp as a separate file so that
> I can more easily apply it?
>
> John
>
>
> On 4/10/14, 4:16 AM, 田忠博 wrote:
> > Hi,
> >
> > I'm building an in-memory system to analyse real-time logs and
> > events, and find Fastbit an excellent fit. I use a ibis::tablex as
> > insert buffer, then transfer the tablex as a ibis::part using toTable.
> > As parts generated, oldest ones will be discarded to save memory.
> > Queries are performed as an ibis::liga of the parts list. I wrap these
> > routines as a python package, and thank to Fastbit, it works like a
> charm.
> >
> > I find several minor issues, and try to fix with the following patches:
> >
> > 1. Segfault with getColumnsAsStrings
> >
> > diff --git a/src/mensa.cpp b/src/mensa.cpp
> > index 6ebe74d..71eb143 100755
> > --- a/src/mensa.cpp
> > +++ b/src/mensa.cpp
> > @@ -2283,8 +2283,6 @@ int64_t ibis::mensa::getColumnAsStrings(const
> > char* cn,
> > const ibis::column* col = dp.getColumn(cn);
> > if (col == 0)
> > return -3;
> > - if (col->getValuesArray(&tmp) < 0)
> > - return -4;
> >
> > size_t i0 = (begin > irow ? begin - irow : 0);
> > const size_t i1 = (end>=irow+dp.nRows() ? dp.nRows() :
> >
> > tmp will be cast as a pointer of vector and finally crash system, I
> > think these should be a typo.
> >
> > 2. When using toTable method, the category fields do not have a
> > dictionary with them. And when process LIKE queries, system crash.
> >
> > diff --git a/src/bord.cpp b/src/bord.cpp
> > index 44d328d..441a954 100755
> > --- a/src/bord.cpp
> > +++ b/src/bord.cpp
> > @@ -6242,6 +6242,19 @@ long ibis::bord::column::patternSearch(const
> > char* pat,
> > return -2;
> > }
> >
> > + if (0 == dic) {
> > + ibis::util::timer mytimer(evt.c_str(), 3);
> > + const std::vector<std::string>&
> > + vals(*static_cast<const std::vector<std::string>*>(buffer));
> > +
> > + hits.clear();
> > + for (size_t j = 0; j < vals.size(); ++ j) {
> > + if (ibis::util::strMatch(vals[j].c_str(), pat))
> > + hits.setBit(j, 1);
> > + }
> > + hits.adjustSize(0, thePart ? thePart->nRows() : vals.size());
> > + }
> > + else {
> > const array_t<uint32_t>&vals(*static_cast<const
> > array_t<uint32_t>*>(buffer));
> >
> > if (pat == 0) { // null string can not match any thing
> > @@ -6269,6 +6282,7 @@ long ibis::bord::column::patternSearch(const
> > char* pat,
> > }
> >
> > hits.adjustSize(0, thePart ? thePart->nRows() : vals.size());
> > + }
> > return hits.cnt();
> > } // ibis::bord::column::patternSearch
> >
> > So, when dic is NULL, a walk-through match should be good enough.
> >
> > And finally, thanks for the excellent library.
> >
> >
> > _______________________________________________
> > FastBit-users mailing list
> > [email protected]
> > https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
> >
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
>
diff --git a/src/bord.cpp b/src/bord.cpp
index 44d328d..441a954 100755
--- a/src/bord.cpp
+++ b/src/bord.cpp
@@ -6242,6 +6242,19 @@ long ibis::bord::column::patternSearch(const char* pat,
return -2;
}
+ if (0 == dic) {
+ ibis::util::timer mytimer(evt.c_str(), 3);
+ const std::vector<std::string>&
+ vals(*static_cast<const std::vector<std::string>*>(buffer));
+
+ hits.clear();
+ for (size_t j = 0; j < vals.size(); ++ j) {
+ if (ibis::util::strMatch(vals[j].c_str(), pat))
+ hits.setBit(j, 1);
+ }
+ hits.adjustSize(0, thePart ? thePart->nRows() : vals.size());
+ }
+ else {
const array_t<uint32_t>&vals(*static_cast<const array_t<uint32_t>*>(buffer));
if (pat == 0) { // null string can not match any thing
@@ -6269,6 +6282,7 @@ long ibis::bord::column::patternSearch(const char* pat,
}
hits.adjustSize(0, thePart ? thePart->nRows() : vals.size());
+ }
return hits.cnt();
} // ibis::bord::column::patternSearch
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users