commit b14583ba37 initially added the
parquet filter with saying
Note that this change makes it possible to load Apache Parquet files
if and only if orcus has been built with the parquet import filter
enabled. Using orcus without the parquet import filter enabled will
not break the build or run-time behavior; you just can't load parquet
files.
This is bad since silently failing like this doesn't tell people what
the problem is. Not having the option at all is clearer and more deterministic.
And the internal liborcus in a "standard" LibreOffice build didn't build with parquet
enabled at all anyway, thus leaving LibreOffice offering the option without even able to
load the files.
This patch adds
a) an explicit --with-parquet-filter configure flag on which the config
is built or not
b) based on that flag also gives --with-parquet-filter to liborcus'
configure. (which then of course will make that liborcus linked
against libparquet. But if people explicitely specify it..)
c) fixes the build of liborcus against arrow 23 (see
https://gitlab.com/orcus/orcus/-/commit/bae0e6e659cf4df2590288f566004eef7096dee4 -
that incidentially also fixed the liborcus build against 22 for me
This is a generalized version of a local patch I carry in Debian - which
I added some time after I made liborcus in Debian *do*
--with-parquet-filter :)
Change-Id: I72b15893fe4fa8e08a556f27b2d6ab942c9858cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204685
Tested-by: Jenkins
Reviewed-by: René Engelhard <rene@debian.org>
26 lines
1.1 KiB
Diff
26 lines
1.1 KiB
Diff
diff --git a/src/liborcus/orcus_parquet.cpp b/src/liborcus/orcus_parquet.cpp
|
|
index eb90ef970ed3d4f8a4a01596e9ace161f33c82f4..dcc10c14db21ded8915baf759684e3c3b4692c7d 100644
|
|
--- a/src/liborcus/orcus_parquet.cpp
|
|
+++ b/src/liborcus/orcus_parquet.cpp
|
|
@@ -13,6 +13,7 @@
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wshadow"
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
+#include <arrow/buffer.h>
|
|
#include <arrow/io/file.h>
|
|
#include <arrow/io/memory.h>
|
|
#include <parquet/stream_reader.h>
|
|
@@ -346,9 +347,10 @@ class orcus_parquet::impl
|
|
|
|
void read_stream_with_sheet_name(std::string_view sheet_name, std::string_view stream)
|
|
{
|
|
- auto buf = std::make_shared<arrow::io::BufferReader>(stream);
|
|
+ auto buf = std::make_shared<arrow::Buffer>(stream);
|
|
+ auto buf_reader = std::make_shared<arrow::io::BufferReader>(buf);
|
|
|
|
- auto file_reader = parquet::ParquetFileReader::Open(buf);
|
|
+ auto file_reader = parquet::ParquetFileReader::Open(buf_reader);
|
|
if (!file_reader)
|
|
{
|
|
warn("failed to open a parquet file reader from an in-memory buffer.");
|