wgtmac commented on code in PR #35825: URL: https://github.com/apache/arrow/pull/35825#discussion_r1253953070
########## cpp/src/parquet/arrow/arrow_reader_writer_test.cc: ########## @@ -1342,6 +1354,23 @@ TEST_F(TestUInt32ParquetIO, Parquet_1_0_Compatibility) { using TestStringParquetIO = TestParquetIO<::arrow::StringType>; +#if defined(_WIN64) || defined(__x86_64__) Review Comment: Is `#if defined(_WIN64) || defined(__LP64__)` enough? ########## cpp/src/parquet/encoding.cc: ########## @@ -1484,6 +1521,41 @@ class DictDecoderImpl : public DecoderImpl, virtual public DictDecoder<Type> { // Perform type-specific initiatialization void SetDict(TypedDecoder<Type>* dictionary) override; + template <typename T = Type, + typename = std::enable_if_t<std::is_same_v<T, ByteArrayType> || + std::is_same_v<T, LargeByteArrayType>>> + void SetByteArrayDict(TypedDecoder<Type>* dictionary) { + DecodeDict(dictionary); + + auto dict_values = reinterpret_cast<ByteArray*>(dictionary_->mutable_data()); + + using offset_type = typename EncodingTraits<Type>::ArrowType::offset_type; + + offset_type total_size = 0; + for (int i = 0; i < dictionary_length_; ++i) { + if (AddWithOverflow(total_size, dict_values[i].len, &total_size)) { + throw ParquetException("String/Binary length to large"); Review Comment: ```suggestion throw ParquetException("String/Binary length too large"); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org