2018-03-11 17:58:10 +00:00
|
|
|
#include "parquet_filter.h"
|
|
|
|
|
|
|
|
Constraint::Constraint(
|
|
|
|
int column,
|
|
|
|
ConstraintOperator op,
|
|
|
|
ValueType type,
|
2018-03-13 00:42:50 +00:00
|
|
|
int64_t intValue,
|
2018-03-11 17:58:10 +00:00
|
|
|
double doubleValue,
|
|
|
|
std::vector<unsigned char> blobValue
|
|
|
|
) {
|
|
|
|
this->column = column;
|
|
|
|
this->op = op;
|
|
|
|
this->type = type;
|
|
|
|
this->intValue = intValue;
|
|
|
|
this->doubleValue = doubleValue;
|
|
|
|
this->blobValue = blobValue;
|
2018-03-16 00:40:21 +00:00
|
|
|
|
|
|
|
if(type == Text)
|
|
|
|
stringValue = std::string((char*)&blobValue[0], blobValue.size());
|
2018-03-11 17:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Constraint::getColumn() {
|
|
|
|
return column;
|
|
|
|
}
|
|
|
|
|
|
|
|
ConstraintOperator Constraint::getOperator() {
|
|
|
|
return op;
|
|
|
|
}
|
|
|
|
|
|
|
|
ValueType Constraint::getType() {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2018-03-13 00:42:50 +00:00
|
|
|
int64_t Constraint::getInt() {
|
2018-03-11 17:58:10 +00:00
|
|
|
return intValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
double Constraint::getDouble() {
|
|
|
|
return doubleValue;
|
|
|
|
}
|
|
|
|
|
2018-03-16 01:37:52 +00:00
|
|
|
const std::vector<unsigned char>& Constraint::getBytes() {
|
2018-03-11 17:58:10 +00:00
|
|
|
return blobValue;
|
|
|
|
}
|
2018-03-16 00:40:21 +00:00
|
|
|
|
2018-03-16 01:37:52 +00:00
|
|
|
const std::string& Constraint::getString() {
|
2018-03-16 00:40:21 +00:00
|
|
|
return stringValue;
|
|
|
|
}
|