-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make CSV block size configurable. (#42)
The default block size in Arrow CSV reader is 1MB (or so?). This PR makes it configurable in multiples of a megabyte. Fixes ECO-142
- Loading branch information
Showing
8 changed files
with
41,628 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
struct IngestProperties { | ||
|
||
IngestProperties(const std::string &_filename, | ||
const std::string &_decryption_key, | ||
const std::vector<std::string> &_utf8_columns, | ||
const std::string &_null_value, | ||
const int &_csv_block_size_mb) | ||
: filename(_filename), decryption_key(_decryption_key), | ||
utf8_columns(_utf8_columns), null_value(_null_value), | ||
csv_block_size_mb(_csv_block_size_mb) {} | ||
|
||
const std::string &filename; | ||
const std::string &decryption_key; | ||
const std::vector<std::string> &utf8_columns; | ||
const std::string &null_value; | ||
const int &csv_block_size_mb; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
#include "common.hpp" | ||
#include <arrow/csv/api.h> | ||
|
||
std::shared_ptr<arrow::Table> read_encrypted_csv( | ||
const std::string &filename, const std::string &decryption_key, | ||
std::vector<std::string> &utf8_columns, const std::string &null_value); | ||
std::shared_ptr<arrow::Table> read_encrypted_csv(const IngestProperties &props); | ||
|
||
std::shared_ptr<arrow::Table> | ||
read_unencrypted_csv(const std::string &filename, | ||
std::vector<std::string> &utf8_columns, | ||
const std::string &null_value); | ||
read_unencrypted_csv(const IngestProperties &props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.