functions.cppファイルには、cuDFの入出力操作に関連する関数が定義されています。このファイルの関数を順に解説します。
1. read_avro
std::unique_ptr<table> read_avro(
std::vector<std::string> const& filepaths,
avro_reader_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、AVRO形式のファイルを読み込み、cuDFのテーブル形式に変換します。
-
引数
-
filepaths: 読み込むAVROファイルのパスのリスト。 -
options: AVROリーダーのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
-
戻り値
-
std::unique_ptr<table>: 読み込まれたデータを含むテーブルオブジェクト。
-
2. write_avro
void write_avro(
std::string const& filepath,
table_view const& table,
avro_writer_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、cuDFのテーブルをAVRO形式のファイルに書き出します。
-
引数
-
filepath: 書き出すAVROファイルのパス。 -
table: 書き出すデータを含むテーブルビュー。 -
options: AVROライターのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
3. read_parquet
std::unique_ptr<table> read_parquet(
std::vector<std::string> const& filepaths,
parquet_reader_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、Parquet形式のファイルを読み込み、cuDFのテーブル形式に変換します。
-
引数
-
filepaths: 読み込むParquetファイルのパスのリスト。 -
options: Parquetリーダーのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
-
戻り値
-
std::unique_ptr<table>: 読み込まれたデータを含むテーブルオブジェクト。
-
4. write_parquet
void write_parquet(
std::string const& filepath,
table_view const& table,
parquet_writer_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、cuDFのテーブルをParquet形式のファイルに書き出します。
-
引数
-
filepath: 書き出すParquetファイルのパス。 -
table: 書き出すデータを含むテーブルビュー。 -
options: Parquetライターのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
5. read_orc
std::unique_ptr<table> read_orc(
std::vector<std::string> const& filepaths,
orc_reader_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、ORC形式のファイルを読み込み、cuDFのテーブル形式に変換します。
-
引数
-
filepaths: 読み込むORCファイルのパスのリスト。 -
options: ORCリーダーのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
-
戻り値
-
std::unique_ptr<table>: 読み込まれたデータを含むテーブルオブジェクト。
-
6. write_orc
void write_orc(
std::string const& filepath,
table_view const& table,
orc_writer_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、cuDFのテーブルをORC形式のファイルに書き出します。
-
引数
-
filepath: 書き出すORCファイルのパス。 -
table: 書き出すデータを含むテーブルビュー。 -
options: ORCライターのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
7. read_json
std::unique_ptr<table> read_json(
std::vector<std::string> const& filepaths,
json_reader_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、JSON形式のファイルを読み込み、cuDFのテーブル形式に変換します。
-
引数
-
filepaths: 読み込むJSONファイルのパスのリスト。 -
options: JSONリーダーのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
-
戻り値
-
std::unique_ptr<table>: 読み込まれたデータを含むテーブルオブジェクト。
-
8. write_json
void write_json(
std::string const& filepath,
table_view const& table,
json_writer_options const& options,
rmm::mr::device_memory_resource* mr)
この関数は、cuDFのテーブルをJSON形式のファイルに書き出します。
-
引数
-
filepath: 書き出すJSONファイルのパス。 -
table: 書き出すデータを含むテーブルビュー。 -
options: JSONライターのオプションを指定する構造体。 -
mr: デバイスメモリリソースのポインタ。メモリ管理のために使用されます。
-
これらの関数は、cuDFの入出力操作を効率的に実行するための主要なインターフェースを提供します。各関数は特定のファイル形式に対応しており、データの読み書きをGPU上で高速に行うことができます。
Citations:
[1] https://github.com/rapidsai/cudf/blob/branch-24.10/cpp/src/io/functions.cpp