Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-1537

[C++] The patch for PARQUET-1508 leads to infinite loop and infinite memory allocation when reading very sparse ByteArray columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • cpp-4.0.0
    • parquet-cpp
    • None

    Description

      In this loop

      https://github.com/apache/arrow/commit/3d435e4f8d5fb7a54a4a9d285e1a42d60186d8dc#diff-47fe879cb9baad6c633c55f0a34a09c3R739

      The branch of if dealing with null values does not increment variable 'i'. Therefore on chunks containing only NULLs once a thread enters the loop, it stays in that loop forever. I'm not entirely sure whether 'num_values' variable was meant to be the number of non-NULL values, yet the total number of values is passed here https://github.com/apache/arrow/blob/3d435e4f8d5fb7a54a4a9d285e1a42d60186d8dc/cpp/src/parquet/arrow/record_reader.cc#L528

       

      On my local machine adding `++i` to the NULL-handling branch seems to fix the problem. Unfortunately, I'm not familiar with the codebase enough to be certain it's a proper fix.

      Attachments

        1. example.parquet
          7.64 MB
          Valery Meleshkin

        Activity

          People

            hatem Hatem Helal
            sumerman Valery Meleshkin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: