Skip to content
Open
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
6 changes: 4 additions & 2 deletions cpp/src/arrow/csv/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ class PresizedValueDescWriter : public ValueDescWriter<PresizedValueDescWriter>
// however we allow for one extraneous write in case of excessive columns,
// hence `2 + num_rows * num_cols` (see explanation in PushValue below).
PresizedValueDescWriter(MemoryPool* pool, int32_t num_rows, int32_t num_cols)
: ValueDescWriter(pool, /*values_capacity=*/2 + num_rows * num_cols) {}
: ValueDescWriter(pool, /*values_capacity=*/2 +
static_cast<int64_t>(num_rows) * num_cols) {}

void PushValue(ParsedValueDesc v) {
DCHECK_LT(values_size_, values_capacity_);
Expand Down Expand Up @@ -536,7 +537,8 @@ class BlockParserImpl {
// as the bulk filter has a fixed cost that isn't compensated
// when values are too short.
const int64_t bulk_filter_threshold =
batch_.num_cols_ * (batch_.num_rows_ - start_num_rows) * 10;
static_cast<int64_t>(batch_.num_cols_) * (batch_.num_rows_ - start_num_rows) *
10;
use_bulk_filter_ = (data - *out_data) > bulk_filter_threshold;
}

Expand Down
Loading