This is an automated email from the ASF dual-hosted git repository.
wjones127 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 8e5f6c8018 GH-35228: [C++][Parquet] Minor: Comment typo fixing in
Parquet Reader (#35229)
8e5f6c8018 is described below
commit 8e5f6c801886edffc20143c2329ffa46d8173891
Author: mwish <[email protected]>
AuthorDate: Thu Apr 20 02:35:14 2023 +0800
GH-35228: [C++][Parquet] Minor: Comment typo fixing in Parquet Reader
(#35229)
### Rationale for this change
Change some comments
### What changes are included in this PR?
Change some comments in parquet reader
### Are these changes tested?
no need.
### Are there any user-facing changes?
no
* Closes: #35228
Authored-by: mwish <[email protected]>
Signed-off-by: Will Jones <[email protected]>
---
cpp/src/parquet/arrow/reader.cc | 6 +++---
cpp/src/parquet/column_reader.cc | 10 +++++-----
cpp/src/parquet/column_reader.h | 2 +-
cpp/src/parquet/level_conversion.cc | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/cpp/src/parquet/arrow/reader.cc b/cpp/src/parquet/arrow/reader.cc
index 5b39de93d9..4079f447ea 100644
--- a/cpp/src/parquet/arrow/reader.cc
+++ b/cpp/src/parquet/arrow/reader.cc
@@ -754,7 +754,7 @@ Status StructReader::GetRepLevels(const int16_t** data,
int64_t* length) {
*data = nullptr;
if (children_.size() == 0) {
*length = 0;
- return Status::Invalid("StructReader had no childre");
+ return Status::Invalid("StructReader had no children");
}
// This method should only be called when this struct or one of its parents
@@ -870,7 +870,7 @@ Status GetReader(const SchemaField& field, const
std::shared_ptr<Field>& arrow_f
return Status::OK();
}
- // These two types might not be equal if there column pruning occurred.
+ // These two types might not be equal if there is column pruning occurred.
// further down the stack.
const std::shared_ptr<DataType> reader_child_type =
child_reader->field()->type();
// This should really never happen but was raised as a question on the code
@@ -892,7 +892,7 @@ Status GetReader(const SchemaField& field, const
std::shared_ptr<Field>& arrow_f
*schema_child_type.field(1)->type())) {
list_field = list_field->WithType(std::make_shared<::arrow::MapType>(
reader_child_type->field(
- 0), // field 0 is unchanged baed on previous if statement
+ 0), // field 0 is unchanged based on previous if statement
reader_child_type->field(1)));
}
// Map types are list<struct<key, value>> so use ListReader
diff --git a/cpp/src/parquet/column_reader.cc b/cpp/src/parquet/column_reader.cc
index da7ddf0b46..fec74794e2 100644
--- a/cpp/src/parquet/column_reader.cc
+++ b/cpp/src/parquet/column_reader.cc
@@ -1349,7 +1349,7 @@ class TypedRecordReader : public
TypedColumnReaderImpl<DType>,
valid_bits_ = AllocateBuffer(pool);
def_levels_ = AllocateBuffer(pool);
rep_levels_ = AllocateBuffer(pool);
- Reset();
+ TypedRecordReader::Reset();
}
// Compute the values capacity in bytes for the given number of elements
@@ -1367,7 +1367,7 @@ class TypedRecordReader : public
TypedColumnReaderImpl<DType>,
// Delimit records, then read values at the end
int64_t records_read = 0;
- if (levels_position_ < levels_written_) {
+ if (has_values_to_process()) {
records_read += ReadRecordData(num_records);
}
@@ -1525,7 +1525,7 @@ class TypedRecordReader : public
TypedColumnReaderImpl<DType>,
int64_t values_seen = 0;
int64_t skipped_records = DelimitRecords(num_records, &values_seen);
ReadAndThrowAwayValues(values_seen);
- // Mark those levels and values as consumed in the the underlying page.
+ // Mark those levels and values as consumed in the underlying page.
// This must be done before we throw away levels since it updates
// levels_position_ and levels_written_.
this->ConsumeBufferedValues(levels_position_ - start_levels_position);
@@ -1554,7 +1554,7 @@ class TypedRecordReader : public
TypedColumnReaderImpl<DType>,
// If 'at_record_start_' is false, but (skipped_records == num_records), it
// means that for the last record that was counted, we have not seen all
- // of it's values yet.
+ // of its values yet.
while (!at_record_start_ || skipped_records < num_records) {
// Is there more data to read in this row group?
// HasNextInternal() will advance to the next page if necessary.
@@ -1579,7 +1579,7 @@ class TypedRecordReader : public
TypedColumnReaderImpl<DType>,
break;
}
- // For skip we will read the levels and append them to the end
+ // For skipping we will read the levels and append them to the end
// of the def_levels and rep_levels just like for read.
ReserveLevels(batch_size);
diff --git a/cpp/src/parquet/column_reader.h b/cpp/src/parquet/column_reader.h
index 0e6c091502..ee5fc7fc6c 100644
--- a/cpp/src/parquet/column_reader.h
+++ b/cpp/src/parquet/column_reader.h
@@ -384,7 +384,7 @@ class PARQUET_EXPORT RecordReader {
/// If this Reader was constructed with read_dense_for_nullable(), there is
no space for
/// nulls and null_count() will be 0. There is no read-ahead/buffering for
values. For
/// FLBA and ByteArray types this value reflects the values written with the
last
- /// ReadRecords call since thoser readers will reset the values after each
call.
+ /// ReadRecords call since those readers will reset the values after each
call.
int64_t values_written() const { return values_written_; }
/// \brief Number of definition / repetition levels (from those that have
diff --git a/cpp/src/parquet/level_conversion.cc
b/cpp/src/parquet/level_conversion.cc
index 49ae15d640..98d6281e57 100644
--- a/cpp/src/parquet/level_conversion.cc
+++ b/cpp/src/parquet/level_conversion.cc
@@ -171,7 +171,7 @@ void DefRepLevelsToList(const int16_t* def_levels, const
int16_t* rep_levels,
void DefRepLevelsToBitmap(const int16_t* def_levels, const int16_t* rep_levels,
int64_t num_def_levels, LevelInfo level_info,
ValidityBitmapInputOutput* output) {
- // DefReplevelsToListInfo assumes it for the actual list method and this
+ // DefRepLevelsToListInfo assumes it for the actual list method and this
// method is for parent structs, so we need to bump def and ref level.
level_info.rep_level += 1;
level_info.def_level += 1;