Skip to content

Commit 00439d1

Browse files
authored
GH-47655: [C++][Parquet][CI] Fix failure to generate seed corpus (#47656)
### Rationale for this change On OSS-Fuzz, generating the Parquet seed corpus would trigger a multiplication overflow when converting a Arrow seconds timestamp column to a Parquet milliseconds timestamp column. ### What changes are included in this PR? Reduce range of input values when writing timestamps to the Parquet seed corpus. ### Are these changes tested? Manually. ### Are there any user-facing changes? No. * GitHub Issue: #47655 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent a91b264 commit 00439d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cpp/src/parquet/arrow/generate_fuzz_corpus.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ Result<std::shared_ptr<RecordBatch>> ExampleBatch1() {
147147
{name_gen(), gen.Decimal32(decimal32(7, 3), kBatchSize, kNullProbability)});
148148

149149
// Timestamp
150+
// (Parquet doesn't have seconds timestamps so the values are going to be
151+
// multiplied by 10)
152+
auto int64_timestamps_array =
153+
gen.Int64(kBatchSize, -9000000000000000LL, 9000000000000000LL, kNullProbability);
150154
for (auto unit : TimeUnit::values()) {
151-
ARROW_ASSIGN_OR_RAISE(auto timestamps, int64_array->View(timestamp(unit, "UTC")));
155+
ARROW_ASSIGN_OR_RAISE(auto timestamps,
156+
int64_timestamps_array->View(timestamp(unit, "UTC")));
152157
columns.push_back({name_gen(), timestamps});
153158
}
154159
// Time32, time64

0 commit comments

Comments
 (0)