zeapo commented on pull request #7309:
URL: https://github.com/apache/arrow/pull/7309#issuecomment-636863181


   I've updated the little poc: 
https://github.com/apache/arrow/compare/master...zeapo:feature/buffer-exposed
   
   The main changes are:
   ```rust
   pub fn infer_json_schema_from_seekable<R: Read + Seek>(
      source: &mut R,
      max_read_records: Option<usize>
   ) -> Result<Arc<Schema>>
   ```
   and
   ```rust
   pub fn infer_json_schema_from_reader<R: Read>(
      reader: &mut BufReader<R>,
      max_read_records: Option<usize>
   ) -> Result<Arc<Schema>>
   ```
   And the fact the `build` requires a `Seek` too. This makes the builder 
`File` agnostic, and relies only on Seek.
   
   Now, if the user (i.e. me? ^_^) wants to use a non-seekable, I'd use the 
infer on the buffer, handle the memory myself and pass the schema I inferred. 
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to