Skip to content

GH-46410: [C++] Add parquet options to Meson configuration #46647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions cpp/examples/parquet/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

example_execs = {
'parquet-low-level-example': {
'sources': files('low_level_api/reader_writer.cc'),
'include_dir': include_directories('low_level_api'),
},
'parquet-low-level-example2': {
'sources': files('low_level_api/reader_writer2.cc'),
'include_dir': include_directories('low_level_api'),
},
'parquet-arrow-example': {
'sources': files('parquet_arrow/reader_writer.cc'),
},
'parquet-stream-api-example': {
'sources': files('parquet_stream_api/stream_reader_writer.cc'),
},
}

if get_option('parquet_require_encryption').enabled()
example_execs += {
'parquet-encryption-example': {
'sources': files('low_level_api/encryption_reader_writer.cc'),
'include_dir': include_directories('low_level_api'),
},
'parquet-encryption-example-all-crypto-options': {
'sources': files(
'low_level_api/encryption_reader_writer_all_crypto_options.cc',
),
'include_dir': include_directories('low_level_api'),
},
}
endif

foreach key, val : example_execs
executable(
key,
sources: val['sources'],
include_directories: val.get('include_dir', []),
dependencies: [arrow_dep, parquet_dep],
)
endforeach
27 changes: 26 additions & 1 deletion cpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,25 @@ needs_filesystem = get_option('filesystem').enabled() or needs_azure or needs_gc
needs_integration = get_option('integration').enabled()
needs_tests = get_option('tests').enabled()
needs_acero = get_option('acero').enabled()
needs_ipc = get_option('ipc').enabled() or needs_tests or needs_acero or needs_benchmarks
needs_parquet = get_option('parquet').enabled()
needs_ipc = (get_option('ipc').enabled()
or needs_tests
or needs_acero
or needs_benchmarks
or needs_parquet
)

needs_fuzzing = get_option('fuzzing').enabled()
if needs_fuzzing
if meson.version() < '1.8.0'
error(
' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format(
meson.version(),
),
)
endif
endif

needs_testing = (get_option('testing').enabled()
or needs_tests
or needs_benchmarks
Expand All @@ -85,3 +102,11 @@ needs_zstd = get_option('zstd').enabled()
needs_utilities = get_option('utilities').enabled()

subdir('src/arrow')

if needs_parquet
subdir('src/parquet')
subdir('tools/parquet')
if get_option('parquet_build_examples').enabled()
subdir('examples/parquet')
endif
endif
16 changes: 16 additions & 0 deletions cpp/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ option(
type: 'string',
description: 'Arbitrary string that identifies the kind of package (for informational purposes)',
)
option('parquet', type: 'feature', description: 'Build the Parquet libraries')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few differences with the CMake configuration worth calling out.

First, CMake has an extra option for PARQUET_MINIMAL_DEPENDENCY. This seems to maybe not be used all of that often, so I did not bother implementing here. Let me know if that is a mistake.

CMake also requires that when either the executables or examples are built that you use static libraries. My assumption is that was done to make the CMake configuration easier, so I did not place that same restriction in the Meson configuration.

Finally, CMake will fail if a pre-installed version of OpenSSL is not found and encryption is required. This configuration is not as strict, and will use Meson's wrap system to resolve the OpenSSL dependency if it is not provided by the system

option(
'parquet_build_executables',
type: 'feature',
description: 'Build the Parquet executable CLI tools.',
)
option(
'parquet_build_examples',
type: 'feature',
description: 'Build the Parquet examples.',
)
option(
'parquet_require_encryption',
type: 'feature',
description: 'Build support for encryption. Fail if OpenSSL is not found',
)

option('snappy', type: 'feature', description: 'Build with snappy compression')
option(
Expand Down
8 changes: 0 additions & 8 deletions cpp/src/arrow/ipc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ endif
ipc_fuzz_targets = ['file_fuzz', 'stream_fuzz', 'tensor_stream_fuzz']

if needs_fuzzing
if meson.version() < '1.8.0'
error(
' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format(
meson.version(),
),
)
endif

foreach ipc_fuzz_target : ipc_fuzz_targets
target_name = 'arrow-ipc-@0@'.format(ipc_fuzz_target.replace('_', '-'))
executable(
Expand Down
21 changes: 21 additions & 0 deletions cpp/src/parquet/api/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

install_headers(
['io.h', 'reader.h', 'schema.h', 'writer.h'],
subdir: 'parquet/api',
)
31 changes: 31 additions & 0 deletions cpp/src/parquet/arrow/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

install_headers(
['reader.h', 'schema.h', 'test_util.h', 'writer.h'],
subdir: 'parquet/arrow',
)

if needs_fuzzing
executable(
'parquet-arrow-generate-fuzz-corpus',
sources: ['generate_fuzz_corpus.cc'],
dependencies: [arrow_parquet_dep, arrow_test_dep],
)

exeuctable('parquet-arrow-fuzz', sources: ['fuzz.cc'])
endif
39 changes: 39 additions & 0 deletions cpp/src/parquet/encryption/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

install_headers(
[
'crypto_factory.h',
'encryption.h',
'file_key_material_store.h',
'file_key_unwrapper.h',
'file_key_wrapper.h',
'file_system_key_material_store.h',
'key_encryption_key.h',
'key_material.h',
'key_metadata.h',
'key_toolkit.h',
'kms_client_factory.h',
'kms_client.h',
'local_wrap_kms_client.h',
'test_encryption_util.h',
'test_in_memory_kms.h',
'two_level_cache_with_expiration.h',
'type_fwd.h',
],
subdir: 'parquet/encryption',
)
18 changes: 18 additions & 0 deletions cpp/src/parquet/geospatial/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

install_headers(['statistics.h'], subdir: 'parquet/geospatial')
Loading
Loading