2018-03-11 17:58:10 +00:00
|
|
|
#ifndef PARQUET_FILTER_H
|
|
|
|
#define PARQUET_FILTER_H
|
|
|
|
|
|
|
|
#include <vector>
|
2018-03-16 00:40:21 +00:00
|
|
|
#include <string>
|
2018-03-11 17:58:10 +00:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
enum ConstraintOperator {
|
|
|
|
Equal,
|
|
|
|
GreaterThan,
|
|
|
|
LessThanOrEqual,
|
|
|
|
LessThan,
|
|
|
|
GreaterThanOrEqual,
|
|
|
|
Match,
|
|
|
|
Like,
|
|
|
|
Glob,
|
|
|
|
Regexp,
|
|
|
|
NotEqual,
|
|
|
|
IsNot,
|
|
|
|
IsNotNull,
|
|
|
|
IsNull,
|
|
|
|
Is
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ValueType {
|
|
|
|
Null,
|
|
|
|
Integer,
|
|
|
|
Double,
|
|
|
|
Blob,
|
|
|
|
Text
|
|
|
|
};
|
|
|
|
|
|
|
|
class Constraint {
|
|
|
|
public:
|
|
|
|
// Kind of a messy constructor function, but it's just for internal use, so whatever.
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2018-03-16 03:04:11 +00:00
|
|
|
int column; // underlying column in the query
|
|
|
|
ConstraintOperator op;
|
|
|
|
ValueType type;
|
|
|
|
|
|
|
|
int64_t intValue;
|
|
|
|
double doubleValue;
|
|
|
|
std::vector<unsigned char> blobValue;
|
|
|
|
// Only set when blobValue is set
|
|
|
|
std::string stringValue;
|
2018-03-11 17:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|