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
14 changes: 9 additions & 5 deletions src/iceberg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@
set(ICEBERG_INCLUDES "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src>"
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>")
set(ICEBERG_SOURCES
arrow_c_data_guard_internal.cc
catalog/in_memory_catalog.cc
expression/expression.cc
expression/literal.cc
file_reader.cc
file_writer.cc
inheritable_metadata.cc
json_internal.cc
manifest_adapter.cc
manifest_entry.cc
manifest_list.cc
manifest_reader.cc
manifest_reader_internal.cc
manifest_writer.cc
metadata_columns.cc
name_mapping.cc
partition_field.cc
Expand All @@ -45,13 +50,12 @@ set(ICEBERG_SOURCES
transform.cc
transform_function.cc
type.cc
manifest_reader.cc
manifest_reader_internal.cc
manifest_writer.cc
arrow_c_data_guard_internal.cc
util/gzip_internal.cc
util/murmurhash3_internal.cc
util/timepoint.cc
util/gzip_internal.cc)
v1_metadata.cc
v2_metadata.cc
v3_metadata.cc)

set(ICEBERG_STATIC_BUILD_INTERFACE_LIBS)
set(ICEBERG_SHARED_BUILD_INTERFACE_LIBS)
Expand Down
25 changes: 25 additions & 0 deletions src/iceberg/arrow/nanoarrow_error_transform_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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.
*/

#pragma once

#define ICEBERG_NANOARROW_RETURN_IF_NOT_OK(status, error) \
if (status != NANOARROW_OK) [[unlikely]] { \
return InvalidArrowData("Nanoarrow error msg: {}", error.message); \
}
4 changes: 2 additions & 2 deletions src/iceberg/avro/avro_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class AvroWriter::Impl {
return {};
}

Status Write(ArrowArray data) {
Status Write(ArrowArray& data) {
ICEBERG_ARROW_ASSIGN_OR_RETURN(auto result,
::arrow::ImportArray(&data, &arrow_schema_));

Expand Down Expand Up @@ -119,7 +119,7 @@ class AvroWriter::Impl {

AvroWriter::~AvroWriter() = default;

Status AvroWriter::Write(ArrowArray data) { return impl_->Write(data); }
Status AvroWriter::Write(ArrowArray& data) { return impl_->Write(data); }

Status AvroWriter::Open(const WriterOptions& options) {
impl_ = std::make_unique<Impl>();
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/avro/avro_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ICEBERG_BUNDLE_EXPORT AvroWriter : public Writer {

Status Close() final;

Status Write(ArrowArray data) final;
Status Write(ArrowArray& data) final;

std::optional<Metrics> metrics() final;

Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/file_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ICEBERG_EXPORT Writer {
/// \brief Write arrow data to the file.
///
/// \return Status of write results.
virtual Status Write(ArrowArray data) = 0;
virtual Status Write(ArrowArray& data) = 0;

/// \brief Get the file statistics.
/// Only valid after the file is closed.
Expand Down
Loading
Loading