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:
65
parquet/parquet_filter.h
Normal file
65
parquet/parquet_filter.h
Normal 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
|
Reference in New Issue
Block a user