@@ -109,10 +109,17 @@ if [ -n "${5:-}" ]; then
109109 echo " Missing installed Parquet pkg-config metadata" >&2
110110 exit 1
111111 fi
112- export PKG_CONFIG_PATH=" $( dirname " ${parquet_metadata} " ) :${6: +${6} : }${PKG_CONFIG_PATH:- } "
113- library_flags=$( pkg-config --static --libs-only-L parquet arrow-compute)
112+ PKG_CONFIG_PATH=" $( dirname " ${parquet_metadata} " ) :${6: +${6} : }${PKG_CONFIG_PATH:- } "
113+ export PKG_CONFIG_PATH
114+ packages=(parquet arrow-compute)
115+ for dependency in re2 thrift liblz4 libzstd libutf8proc; do
116+ if pkg-config --exists " ${dependency} " ; then
117+ packages+=(" ${dependency} " )
118+ fi
119+ done
120+ library_flags=$( pkg-config --static --libs-only-L " ${packages[@]} " )
114121 read -ra library_dirs <<< " ${library_flags}"
115- library_flags=$( pkg-config --static --libs parquet arrow-compute )
122+ library_flags=$( pkg-config --static --libs " ${packages[@]} " )
116123 read -ra libraries <<< " ${library_flags}"
117124 cpp_version=$( pkg-config --modversion parquet)
118125 link_flags=()
@@ -163,5 +170,37 @@ Version: ${cpp_version}
163170Libs: -L\$ {libdir} ${link_flags[*]}
164171Cflags: -I\$ {includedir} -DARROW_STATIC -DARROW_COMPUTE_STATIC -DPARQUET_STATIC
165172EOF
173+ github_actions_group_begin " Verify staged Arrow Parquet SDK"
174+ cat > " ${build_dir} /parquet_sdk_smoke.cc" << 'EOF '
175+ #include <arrow/api.h>
176+ #include <arrow/compute/initialize.h>
177+ #include <arrow/io/api.h>
178+ #include <parquet/arrow/reader.h>
179+ #include <parquet/arrow/writer.h>
180+
181+ int main() {
182+ if (!arrow::compute::Initialize().ok()) return 1;
183+ arrow::Int64Builder builder;
184+ if (!builder.Append(42).ok()) return 1;
185+ auto values = builder.Finish().ValueOrDie();
186+ auto table = arrow::Table::Make(arrow::schema({arrow::field("value", arrow::int64())}), {values});
187+ for (auto codec : {parquet::Compression::SNAPPY, parquet::Compression::GZIP,
188+ parquet::Compression::ZSTD}) {
189+ auto output = arrow::io::BufferOutputStream::Create().ValueOrDie();
190+ auto properties = parquet::WriterProperties::Builder().compression(codec)->build();
191+ if (!parquet::arrow::WriteTable(*table, arrow::default_memory_pool(), output, 1,
192+ properties).ok()) return 1;
193+ auto input = std::make_shared<arrow::io::BufferReader>(output->Finish().ValueOrDie());
194+ auto reader = parquet::arrow::OpenFile(input, arrow::default_memory_pool()).ValueOrDie();
195+ std::shared_ptr<arrow::Table> actual;
196+ if (!reader->ReadTable(&actual).ok() || !table->Equals(*actual)) return 1;
197+ }
198+ }
199+ EOF
200+ smoke_flags=$( PKG_CONFIG_PATH=' ' PKG_CONFIG_LIBDIR=" ${package_dir} /lib/pkgconfig" pkg-config --cflags --libs arrow-parquet)
201+ read -ra smoke_options <<< " ${smoke_flags}"
202+ " ${CXX:- c++} " -std=c++20 " ${build_dir} /parquet_sdk_smoke.cc" " ${smoke_options[@]} " -o " ${build_dir} /parquet_sdk_smoke"
203+ " ${build_dir} /parquet_sdk_smoke"
204+ github_actions_group_end
166205 github_actions_group_end
167206fi
0 commit comments