Skip to content
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
2 changes: 1 addition & 1 deletion src/iceberg/parquet/parquet_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class EmptyRecordBatchReader : public ::arrow::RecordBatchReader {
std::shared_ptr<::arrow::Schema> schema() const override { return nullptr; }

::arrow::Status ReadNext(std::shared_ptr<::arrow::RecordBatch>* batch) override {
batch = nullptr;
*batch = nullptr;
return ::arrow::Status::OK();
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/parquet/parquet_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Result<::arrow::Compression::type> ParseCompression(const WriterProperties& prop
} else if (compression_name == "zstd") {
return ::arrow::Compression::ZSTD;
} else {
return InvalidArgument("Unsupported Parquet compression codec: ", compression_name);
return InvalidArgument("Unsupported Parquet compression codec: {}", compression_name);
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/iceberg/util/decimal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ constexpr Decimal kMaxDecimalValue(5421010862427522170LL, 687399551400673279ULL)
constexpr Decimal kMinDecimalValue(-5421010862427522171LL, 17759344522308878337ULL);

struct DecimalComponents {
std::string_view while_digits;
std::string_view whole_digits;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::string_view fractional_digits;
int32_t exponent{0};
char sign{0};
Expand Down Expand Up @@ -92,17 +92,17 @@ bool ParseDecimalComponents(std::string_view str, DecimalComponents* out) {
out->sign = str[pos++];
}
// First run of digits
pos = ParseDigitsRun(str, pos, &out->while_digits);
pos = ParseDigitsRun(str, pos, &out->whole_digits);
if (pos == str.size()) {
return !out->while_digits.empty();
return !out->whole_digits.empty();
}

// Optional dot
if (IsDot(str[pos])) {
// Second run of digits after the dot
pos = ParseDigitsRun(str, ++pos, &out->fractional_digits);
}
if (out->fractional_digits.empty() && out->while_digits.empty()) {
if (out->fractional_digits.empty() && out->whole_digits.empty()) {
// Need at least some digits (whole or fractional)
return false;
}
Expand Down Expand Up @@ -437,10 +437,10 @@ Result<Decimal> Decimal::FromString(std::string_view str, int32_t* precision,
}

// Count number of significant digits (without leading zeros)
size_t first_non_zero = dec.while_digits.find_first_not_of('0');
size_t first_non_zero = dec.whole_digits.find_first_not_of('0');
size_t significant_digits = dec.fractional_digits.size();
if (first_non_zero != std::string_view::npos) {
significant_digits += dec.while_digits.size() - first_non_zero;
significant_digits += dec.whole_digits.size() - first_non_zero;
}

auto parsed_precision = static_cast<int32_t>(significant_digits);
Expand All @@ -454,7 +454,7 @@ Result<Decimal> Decimal::FromString(std::string_view str, int32_t* precision,
}

uint128_t value = 0;
ShiftAndAdd(dec.while_digits, value);
ShiftAndAdd(dec.whole_digits, value);
ShiftAndAdd(dec.fractional_digits, value);
Decimal result(static_cast<int128_t>(value));

Expand Down
Loading