Skip to content
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

Cleanup ORC chunked writer #13091

Merged
merged 7 commits into from
Apr 12, 2023
Merged
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
10 changes: 3 additions & 7 deletions cpp/include/cudf/io/detail/orc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -93,13 +93,11 @@ class writer {
* @param options Settings for controlling writing behavior
* @param mode Option to write at once or in chunks
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource to use for device memory allocation
*/
explicit writer(std::unique_ptr<cudf::io::data_sink> sink,
orc_writer_options const& options,
SingleWriteMode mode,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);
rmm::cuda_stream_view stream);

/**
* @brief Constructor with chunked writer options.
Expand All @@ -108,13 +106,11 @@ class writer {
* @param options Settings for controlling writing behavior
* @param mode Option to write at once or in chunks
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource to use for device memory allocation
*/
explicit writer(std::unique_ptr<cudf::io::data_sink> sink,
chunked_orc_writer_options const& options,
SingleWriteMode mode,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);
rmm::cuda_stream_view stream);

/**
* @brief Destructor explicitly declared to avoid inlining in header
Expand Down
10 changes: 3 additions & 7 deletions cpp/include/cudf/io/orc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -781,10 +781,8 @@ class orc_writer_options_builder {
* @endcode
*
* @param options Settings for controlling reading behavior
* @param mr Device memory resource to use for device memory allocation
*/
void write_orc(orc_writer_options const& options,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
void write_orc(orc_writer_options const& options);

/**
* @brief Builds settings to use for `write_orc_chunked()`.
Expand Down Expand Up @@ -1137,10 +1135,8 @@ class orc_chunked_writer {
* @brief Constructor with chunked writer options
*
* @param[in] options options used to write table
* @param[in] mr Device memory resource to use for device memory allocation
*/
orc_chunked_writer(chunked_orc_writer_options const& options,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
orc_chunked_writer(chunked_orc_writer_options const& options);

/**
* @brief Writes table to output.
Expand Down
9 changes: 4 additions & 5 deletions cpp/src/io/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ table_with_metadata read_orc(orc_reader_options const& options, rmm::mr::device_
/**
* @copydoc cudf::io::write_orc
*/
void write_orc(orc_writer_options const& options, rmm::mr::device_memory_resource* mr)
void write_orc(orc_writer_options const& options)
{
namespace io_detail = cudf::io::detail;

Expand All @@ -428,24 +428,23 @@ void write_orc(orc_writer_options const& options, rmm::mr::device_memory_resourc
CUDF_EXPECTS(sinks.size() == 1, "Multiple sinks not supported for ORC writing");

auto writer = std::make_unique<detail_orc::writer>(
std::move(sinks[0]), options, io_detail::SingleWriteMode::YES, cudf::get_default_stream(), mr);
std::move(sinks[0]), options, io_detail::SingleWriteMode::YES, cudf::get_default_stream());

writer->write(options.get_table());
}

/**
* @copydoc cudf::io::orc_chunked_writer::orc_chunked_writer
*/
orc_chunked_writer::orc_chunked_writer(chunked_orc_writer_options const& options,
rmm::mr::device_memory_resource* mr)
orc_chunked_writer::orc_chunked_writer(chunked_orc_writer_options const& options)
{
namespace io_detail = cudf::io::detail;

auto sinks = make_datasinks(options.get_sink());
CUDF_EXPECTS(sinks.size() == 1, "Multiple sinks not supported for ORC writing");

writer = std::make_unique<detail_orc::writer>(
std::move(sinks[0]), options, io_detail::SingleWriteMode::NO, cudf::get_default_stream(), mr);
std::move(sinks[0]), options, io_detail::SingleWriteMode::NO, cudf::get_default_stream());
}

/**
Expand Down
Loading