Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-3870

[C++] Add Peek to InputStream API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.12.0
    • C++

    Description

      Some InputStream sources support lookahead without advancing the stream, like BufferReader and BufferedInputStream. This is used in Parquet's internal IO APIs, so it would be useful to be able to remove these after a deprecation cycle

      https://github.com/apache/arrow/blob/master/cpp/src/parquet/util/memory.h#L375

      If an InputStream does not support Peek, the returned string_view would have zero size.

      Another option is to have Peek return Status, so that NotImplemented can be returned. I would prefer to return 0-length if the operation is not supported

      Attachments

        Issue Links

          Activity

            People

              wesm Wes McKinney
              wesm Wes McKinney
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m