Skip to content
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
2 changes: 1 addition & 1 deletion ci/conda_env_cpp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ gflags
glog
gmock>=1.10.0
google-cloud-cpp>=1.34.0
grpc-cpp<=1.50.1
gtest>=1.10.0
libgrpc
libprotobuf
libutf8proc
lz4-c
Expand Down
9 changes: 5 additions & 4 deletions cpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ needs_testing = (get_option('testing').enabled()
or needs_integration
)
needs_json = get_option('json').enabled() or needs_testing
needs_orc = get_option('orc').enabled()
needs_brotli = get_option('brotli').enabled() or needs_fuzzing
needs_bz2 = get_option('bz2').enabled()
needs_lz4 = get_option('lz4').enabled()
needs_snappy = get_option('snappy').enabled()
needs_zlib = get_option('zlib').enabled()
needs_zstd = get_option('zstd').enabled()
needs_lz4 = get_option('lz4').enabled() or needs_orc
needs_snappy = get_option('snappy').enabled() or needs_orc
needs_zlib = get_option('zlib').enabled() or needs_orc
needs_zstd = get_option('zstd').enabled() or needs_orc
needs_utilities = get_option('utilities').enabled()

subdir('src/arrow')
Expand Down
6 changes: 6 additions & 0 deletions cpp/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ option('git_description', type: 'string')

option('lz4', type: 'feature', description: 'Build with lz4 compression')

option(
'orc',
type: 'feature',
description: 'Build the Arrow ORC adapter',
)

option(
'package_kind',
type: 'string',
Expand Down
39 changes: 39 additions & 0 deletions cpp/src/arrow/adapters/orc/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(['adapter.h', 'options.h'], subdir: 'arrow/adapters/orc')

arrow_orc_dep = declare_dependency(
include_directories: include_directories('.'),
dependencies: [arrow_dep],
)

meson.override_dependency('arrow-orc', arrow_orc_dep)

pkg.generate(
filebase: 'arrow-orc',
name: 'Apache Arrow ORC',
description: 'ORC modules for Apache Arrow',
requires: ['arrow'],
)

exc = executable(
'arrow-orc-adapter-test',
sources: ['adapter_test.cc'],
dependencies: [arrow_test_dep, orc_dep],
)
test('arrow-orc-adapter-test', exc)
5 changes: 4 additions & 1 deletion cpp/src/arrow/adapters/orc/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ Status AppendTimestampBatch(liborc::ColumnVectorBatch* column_vector_batch,
const int64_t* seconds = batch->data.data() + offset;
const int64_t* nanos = batch->nanoseconds.data() + offset;

auto transform_timestamp = [seconds, nanos](int64_t index) {
auto transform_timestamp = [seconds, nanos, valid_bytes](int64_t index) -> int64_t {
if (valid_bytes && !valid_bytes[index]) {
return 0;
}
return seconds[index] * kOneSecondNanos + nanos[index];
};

Expand Down
20 changes: 20 additions & 0 deletions cpp/src/arrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,22 @@ if needs_json
}
endif

if needs_orc
orc_dep = dependency('orc')
arrow_components += {
'arrow_orc': {
'sources': files(
'adapters/orc/adapter.cc',
'adapters/orc/options.cc',
'adapters/orc/util.cc',
),
'dependencies': [orc_dep],
},
}
else
orc_dep = disabler()
endif

arrow_srcs = []
include_dir = include_directories('..')
arrow_includes = [include_dir]
Expand Down Expand Up @@ -835,6 +851,10 @@ if needs_json
subdir('json')
endif

if needs_orc
subdir('adapters/orc')
endif

if needs_ipc
subdir('ipc')
endif
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ conf_data.set('ARROW_JEMALLOC', false)
conf_data.set('ARROW_JEMALLOC_VENDORED', false)
conf_data.set('ARROW_JSON', needs_json)
conf_data.set('ARROW_MIMALLOC', false)
conf_data.set('ARROW_ORC', false)
conf_data.set('ARROW_ORC', needs_orc)
conf_data.set('ARROW_PARQUET', needs_parquet)
conf_data.set('ARROW_SUBSTRAIT', false)
conf_data.set('ARROW_AZURE', false)
Expand Down
27 changes: 27 additions & 0 deletions cpp/subprojects/apache-orc.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.

[wrap-file]
directory = orc-2.2.0
source_url = https://www.apache.org/dyn/closer.lua?action=download&filename=orc/orc-2.2.0/orc-2.2.0.tar.gz
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/apache-orc_2.2.0-1/orc-2.2.0.tar.gz
source_filename = orc-2.2.0.tar.gz
source_hash = b15aca45a7e73ffbd1bbc36a78cd1422d41f07721092a25f43448e6e16f4763b
wrapdb_version = 2.2.0-1

[provide]
orc = orc_dep
Loading