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

Scaffolding for in-extension filtering

Supports IS NULL and IS NOT NULL checks
This commit is contained in:
Colin Dellow
2018-03-11 13:58:10 -04:00
parent d28ae86d15
commit 830053c1fc
6 changed files with 244 additions and 8 deletions

65
parquet/parquet_filter.h Normal file
View File

@@ -0,0 +1,65 @@
#ifndef PARQUET_FILTER_H
#define PARQUET_FILTER_H
#include <vector>
#include <cstdint>
enum ConstraintOperator {
Equal,
GreaterThan,
LessThanOrEqual,
LessThan,
GreaterThanOrEqual,
Match,
Like,
Glob,
Regexp,
NotEqual,
IsNot,
IsNotNull,
IsNull,
Is
};
enum ValueType {
Null,
Boolean,
Integer,
Double,
Blob,
Text
};
class Constraint {
int column; // underlying column in the query
ConstraintOperator op;
ValueType type;
bool boolValue;
uintptr_t intValue;
double doubleValue;
// Doubles as string value
std::vector<unsigned char> blobValue;
public:
// Kind of a messy constructor function, but it's just for internal use, so whatever.
Constraint(
int column,
ConstraintOperator op,
ValueType type,
bool boolValue,
uintptr_t intValue,
double doubleValue,
std::vector<unsigned char> blobValue
);
int getColumn();
ConstraintOperator getOperator();
ValueType getType();
bool getBool();
uintptr_t getInt();
double getDouble();
std::vector<unsigned char> getBytes();
};
#endif