1
0
mirror of https://github.com/cldellow/sqlite-parquet-vtable.git synced 2025-04-03 09:39:47 +00:00

Allow builds on older versions of sqlite

This commit is contained in:
Addie Morrison 2019-12-08 20:47:11 -06:00
parent 608ddbbe95
commit 4675bd2d3f
5 changed files with 32 additions and 5 deletions

8
CentOS-7.dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM centos:7
RUN yum install -y epel-release
RUN yum install -y sqlite-devel libicu-devel gcc gcc-c++ meson
COPY ci/arrow-centos.repo /etc/yum.repos.d/Apache-Arrow.repo
RUN yum install -y parquet-devel
WORKDIR /src
COPY . /src
RUN mkdir builddir && meson builddir && cd builddir && ninja-build

7
Ubuntu-16.04.dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y apt-transport-https curl gnupg lsb-release pkg-config libsqlite3-dev libicu-dev gcc g++ meson
COPY ci/arrow-ubuntu16.04.list /etc/apt/sources.list.d/apache-arrow.list
RUN curl https://dist.apache.org/repos/dist/dev/arrow/KEYS | apt-key add - && apt-get update && apt-get install -y libparquet-dev
WORKDIR /src
COPY . /src
RUN mkdir builddir && meson builddir && cd builddir && ninja

View File

@ -2,6 +2,6 @@ FROM ubuntu:18.04
RUN apt-get update && apt-get install -y apt-transport-https curl gnupg lsb-release pkg-config libsqlite3-dev libicu-dev gcc g++ meson
COPY ci/arrow-ubuntu18.04.list /etc/apt/sources.list.d/apache-arrow.list
RUN curl -L -o /usr/share/keyrings/apache-arrow-keyring.gpg https://dl.bintray.com/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-keyring.gpg && apt-get update && apt-get install -y libparquet-dev
WORKDIR /src/
VOLUME /src
CMD mkdir builddir && meson builddir && cd builddir && ninja
WORKDIR /src
COPY . /src
RUN mkdir builddir && meson builddir && cd builddir && ninja

View File

@ -1,8 +1,8 @@
project('sqlite-parquet-vtable', 'c', 'cpp', default_options:['c_std=c11', 'cpp_std=c++11'])
arrow = dependency('arrow', version:'0.15.1')
parquet = dependency('parquet', version: '1.5.1')
sqlite = dependency('sqlite3', version: '>=3.21.0')
icu = dependency('icu-i18n')
sqlite = dependency('sqlite3', version: '>=3.7.17')
icu = dependency('icu-i18n', version: '>=50.2')
dependencies = [arrow, parquet, sqlite, icu]
sources = ['src/parquet.cc', 'src/parquet_cursor.cc', 'src/parquet_filter.cc', 'src/parquet_table.cc']

View File

@ -362,12 +362,17 @@ const char *opName(int op) {
return ">=";
case SQLITE_INDEX_CONSTRAINT_MATCH:
return "match";
#ifdef SQLITE_INDEX_CONSTRAINT_LIKE
//SQLite version >= 3.10.0
case SQLITE_INDEX_CONSTRAINT_LIKE:
return "LIKE";
case SQLITE_INDEX_CONSTRAINT_GLOB:
return "GLOB";
case SQLITE_INDEX_CONSTRAINT_REGEXP:
return "REGEXP";
#endif
#ifdef SQLITE_INDEX_CONSTRAINT_NE
//SQLite version >= 3.21.0
case SQLITE_INDEX_CONSTRAINT_NE:
return "!=";
case SQLITE_INDEX_CONSTRAINT_ISNOT:
@ -378,6 +383,7 @@ const char *opName(int op) {
return "IS NULL";
case SQLITE_INDEX_CONSTRAINT_IS:
return "IS";
#endif
default:
return "unknown";
}
@ -447,10 +453,15 @@ ConstraintOperator constraintOperatorFromSqlite(int op) {
return LessThan;
case SQLITE_INDEX_CONSTRAINT_GE:
return GreaterThanOrEqual;
#ifdef SQLITE_INDEX_CONSTRAINT_LIKE
//SQLite version >= 3.10.0
case SQLITE_INDEX_CONSTRAINT_LIKE:
return Like;
case SQLITE_INDEX_CONSTRAINT_GLOB:
return Glob;
#endif
#ifdef SQLITE_INDEX_CONSTRAINT_NE
//SQLite version >= 3.21.0
case SQLITE_INDEX_CONSTRAINT_NE:
return NotEqual;
case SQLITE_INDEX_CONSTRAINT_ISNOT:
@ -461,6 +472,7 @@ ConstraintOperator constraintOperatorFromSqlite(int op) {
return IsNull;
case SQLITE_INDEX_CONSTRAINT_IS:
return Is;
#endif
}
std::ostringstream ss;