Skip to content

Commit 05e6488

Browse files
authored
GH-46410: [C++] Add parquet options to Meson configuration (#46647)
### Rationale for this change This continues adding functionality to the Meson configuration ### What changes are included in this PR? This adds the parquet directory to the Meson configuration ### Are these changes tested? Yes ### Are there any user-facing changes? No * GitHub Issue: #46410 Authored-by: Will Ayd <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent b14a537 commit 05e6488

File tree

14 files changed

+625
-13
lines changed

14 files changed

+625
-13
lines changed

cpp/examples/parquet/meson.build

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
example_execs = {
19+
'parquet-low-level-example': {
20+
'sources': files('low_level_api/reader_writer.cc'),
21+
'include_dir': include_directories('low_level_api'),
22+
},
23+
'parquet-low-level-example2': {
24+
'sources': files('low_level_api/reader_writer2.cc'),
25+
'include_dir': include_directories('low_level_api'),
26+
},
27+
'parquet-arrow-example': {
28+
'sources': files('parquet_arrow/reader_writer.cc'),
29+
},
30+
'parquet-stream-api-example': {
31+
'sources': files('parquet_stream_api/stream_reader_writer.cc'),
32+
},
33+
}
34+
35+
if needs_parquet_encryption
36+
example_execs += {
37+
'parquet-encryption-example': {
38+
'sources': files('low_level_api/encryption_reader_writer.cc'),
39+
'include_dir': include_directories('low_level_api'),
40+
},
41+
'parquet-encryption-example-all-crypto-options': {
42+
'sources': files(
43+
'low_level_api/encryption_reader_writer_all_crypto_options.cc',
44+
),
45+
'include_dir': include_directories('low_level_api'),
46+
},
47+
}
48+
endif
49+
50+
foreach key, val : example_execs
51+
executable(
52+
key,
53+
sources: val['sources'],
54+
include_directories: val.get('include_dir', []),
55+
dependencies: [arrow_dep, parquet_dep],
56+
)
57+
endforeach

cpp/meson.build

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,37 @@ needs_csv = get_option('csv').enabled()
5757
needs_azure = get_option('azure').enabled()
5858
needs_gcs = get_option('gcs').enabled()
5959
needs_hdfs = get_option('hdfs').enabled()
60+
needs_parquet = get_option('parquet').enabled()
61+
needs_parquet_encryption = get_option('parquet_require_encryption').enabled()
6062
needs_s3 = get_option('s3').enabled()
61-
needs_filesystem = get_option('filesystem').enabled() or needs_azure or needs_gcs or needs_hdfs or needs_s3
63+
needs_filesystem = (get_option('filesystem').enabled()
64+
or needs_azure
65+
or needs_gcs
66+
or needs_hdfs
67+
or needs_parquet_encryption
68+
or needs_s3
69+
)
6270
needs_integration = get_option('integration').enabled()
6371
needs_tests = get_option('tests').enabled()
6472
needs_acero = get_option('acero').enabled()
6573
needs_flight = get_option('flight').enabled()
66-
needs_ipc = get_option('ipc').enabled() or needs_tests or needs_acero or needs_benchmarks or needs_flight
74+
needs_ipc = (get_option('ipc').enabled()
75+
or needs_tests
76+
or needs_acero
77+
or needs_benchmarks
78+
or needs_flight
79+
or needs_parquet
80+
)
81+
6782
needs_fuzzing = get_option('fuzzing').enabled()
83+
if needs_fuzzing
84+
if meson.version() < '1.8.0'
85+
error(
86+
f'Meson >= 1.8.0 is required for fuzzing support, found @meson.version()@',
87+
)
88+
endif
89+
endif
90+
6891
needs_testing = (get_option('testing').enabled()
6992
or needs_tests
7093
or needs_benchmarks
@@ -81,3 +104,11 @@ needs_zstd = get_option('zstd').enabled()
81104
needs_utilities = get_option('utilities').enabled()
82105

83106
subdir('src/arrow')
107+
108+
if needs_parquet
109+
subdir('src/parquet')
110+
subdir('tools/parquet')
111+
if get_option('parquet_build_examples').enabled()
112+
subdir('examples/parquet')
113+
endif
114+
endif

cpp/meson.options

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ option(
8989
type: 'string',
9090
description: 'Arbitrary string that identifies the kind of package (for informational purposes)',
9191
)
92+
option('parquet', type: 'feature', description: 'Build the Parquet libraries')
93+
option(
94+
'parquet_build_executables',
95+
type: 'feature',
96+
description: 'Build the Parquet executable CLI tools.',
97+
)
98+
option(
99+
'parquet_build_examples',
100+
type: 'feature',
101+
description: 'Build the Parquet examples.',
102+
)
103+
option(
104+
'parquet_require_encryption',
105+
type: 'feature',
106+
description: 'Build support for encryption. Fail if OpenSSL is not found',
107+
)
92108

93109
option('snappy', type: 'feature', description: 'Build with snappy compression')
94110
option(

cpp/src/arrow/ipc/meson.build

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ endif
9494
ipc_fuzz_targets = ['file_fuzz', 'stream_fuzz', 'tensor_stream_fuzz']
9595

9696
if needs_fuzzing
97-
if meson.version() < '1.8.0'
98-
error(
99-
' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format(
100-
meson.version(),
101-
),
102-
)
103-
endif
104-
10597
foreach ipc_fuzz_target : ipc_fuzz_targets
10698
target_name = 'arrow-ipc-@0@'.format(ipc_fuzz_target.replace('_', '-'))
10799
executable(

cpp/src/arrow/meson.build

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ arrow_util_srcs = [
175175
'util/bitmap_ops.cc',
176176
'util/bpacking.cc',
177177
'util/byte_size.cc',
178+
'util/byte_stream_split_internal.cc',
178179
'util/cancel.cc',
179180
'util/compression.cc',
180181
'util/counting_semaphore.cc',
@@ -199,6 +200,7 @@ arrow_util_srcs = [
199200
'util/memory.cc',
200201
'util/mutex.cc',
201202
'util/ree_util.cc',
203+
'util/secure_string.cc',
202204
'util/string.cc',
203205
'util/string_util.cc',
204206
'util/task_group.cc',
@@ -486,7 +488,8 @@ arrow_lib = library(
486488
include_directories: arrow_includes,
487489
dependencies: arrow_deps,
488490
install: true,
489-
gnu_symbol_visibility: 'inlineshidden',
491+
# TODO: re-enable symbol visibility
492+
#gnu_symbol_visibility: 'inlineshidden',
490493
cpp_shared_args: ['-DARROW_EXPORTING'],
491494
)
492495

cpp/src/arrow/util/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ conf_data.set('ARROW_JEMALLOC_VENDORED', false)
5050
conf_data.set('ARROW_JSON', needs_json)
5151
conf_data.set('ARROW_MIMALLOC', false)
5252
conf_data.set('ARROW_ORC', false)
53-
conf_data.set('ARROW_PARQUET', false)
53+
conf_data.set('ARROW_PARQUET', needs_parquet)
5454
conf_data.set('ARROW_SUBSTRAIT', false)
5555
conf_data.set('ARROW_AZURE', false)
5656
conf_data.set('ARROW_ENABLE_THREADING', true)
@@ -73,7 +73,7 @@ conf_data.set('ARROW_WITH_UCX', false)
7373
conf_data.set('ARROW_WITH_UTF8PROC', false)
7474
conf_data.set('ARROW_WITH_ZLIB', needs_zlib)
7575
conf_data.set('ARROW_WITH_ZSTD', needs_zstd)
76-
conf_data.set('PARQUET_REQUIRE_ENCRYPTION', false)
76+
conf_data.set('PARQUET_REQUIRE_ENCRYPTION', needs_parquet_encryption)
7777

7878
configure_file(
7979
input: 'config.h.cmake',

cpp/src/parquet/api/meson.build

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
install_headers(
19+
['io.h', 'reader.h', 'schema.h', 'writer.h'],
20+
subdir: 'parquet/api',
21+
)

cpp/src/parquet/arrow/meson.build

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
install_headers(
19+
['reader.h', 'schema.h', 'test_util.h', 'writer.h'],
20+
subdir: 'parquet/arrow',
21+
)
22+
23+
if needs_fuzzing
24+
executable(
25+
'parquet-arrow-generate-fuzz-corpus',
26+
sources: ['generate_fuzz_corpus.cc'],
27+
dependencies: [arrow_parquet_dep, arrow_test_dep],
28+
)
29+
30+
exeuctable('parquet-arrow-fuzz', sources: ['fuzz.cc'])
31+
endif
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
install_headers(
19+
[
20+
'crypto_factory.h',
21+
'encryption.h',
22+
'file_key_material_store.h',
23+
'file_key_unwrapper.h',
24+
'file_key_wrapper.h',
25+
'file_system_key_material_store.h',
26+
'key_encryption_key.h',
27+
'key_material.h',
28+
'key_metadata.h',
29+
'key_toolkit.h',
30+
'kms_client_factory.h',
31+
'kms_client.h',
32+
'local_wrap_kms_client.h',
33+
'test_encryption_util.h',
34+
'test_in_memory_kms.h',
35+
'two_level_cache_with_expiration.h',
36+
'type_fwd.h',
37+
],
38+
subdir: 'parquet/encryption',
39+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
install_headers(['statistics.h'], subdir: 'parquet/geospatial')

0 commit comments

Comments
 (0)