1
0
mirror of https://github.com/cldellow/sqlite-parquet-vtable.git synced 2025-09-16 22:49:59 +00:00

Row-filtering for other string ops

This commit is contained in:
Colin Dellow
2018-03-17 15:28:51 -04:00
parent 03a20a9432
commit a3af16eb54
4 changed files with 82 additions and 19 deletions

View File

@@ -15,6 +15,22 @@ Constraint::Constraint(
this->doubleValue = doubleValue;
this->blobValue = blobValue;
if(type == Text)
if(type == Text) {
stringValue = std::string((char*)&blobValue[0], blobValue.size());
if(op == Like) {
// This permits more rowgroups than is strictly needed
// since it assumes an implicit wildcard. But it's
// simple to implement, so we'll go with it.
likeStringValue = stringValue;
size_t idx = likeStringValue.find_first_of("%");
if(idx != std::string::npos) {
likeStringValue = likeStringValue.substr(0, idx);
}
idx = likeStringValue.find_first_of("_");
if(idx != std::string::npos) {
likeStringValue = likeStringValue.substr(0, idx);
}
}
}
}