From 774f10df7a7e1587f1996e1d8dc70d5cf7b8075f Mon Sep 17 00:00:00 2001 From: mwish Date: Fri, 26 Apr 2024 01:44:25 +0800 Subject: [PATCH] MINOR: [C++][Parquet] fix dict_length for ReadDictionary when not having dict (#41344) ### Rationale for this change `dictionary_length = 0` is used when page doesn't have dictionary, however, this should be a nop. ### What changes are included in this PR? Change `dictionary_length = 0` to `*dictionary_length = 0`. ### Are these changes tested? No? ### Are there any user-facing changes? no Authored-by: mwish Signed-off-by: mwish --- cpp/src/parquet/column_reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/parquet/column_reader.cc b/cpp/src/parquet/column_reader.cc index 2566a989c1d21..eae7ac4252735 100644 --- a/cpp/src/parquet/column_reader.cc +++ b/cpp/src/parquet/column_reader.cc @@ -1340,7 +1340,7 @@ class TypedRecordReader : public TypedColumnReaderImpl, const void* ReadDictionary(int32_t* dictionary_length) override { if (this->current_decoder_ == nullptr && !this->HasNextInternal()) { - dictionary_length = 0; + *dictionary_length = 0; return nullptr; } // Verify the current data page is dictionary encoded. The current_encoding_ should