brunal commented on PR #9468:
URL: https://github.com/apache/arrow-rs/pull/9468#issuecomment-3976681459
Can't this be achieved without any arrow change by using `encoding_rs_rw`
streaming adapters? e.g.
```
// Basic
fn read_utf8(filename: &str, schema: SchemaRef) -> RecordBatch {
let file = File::open(filename).unwrap();
let mut csv = ReaderBuilder::new(Arc::new(schema)).build(file).unwrap();
let batch = csv.next().unwrap().unwrap();
batch
}
// With a different encoding
fn read_other_encoding(filename: &str, schema: SchemaRef, encoding:
&encoding_rs::Encoding) -> RecordBatch {
let file = File::open(filename).unwrap();
let mut decoded = encoding_rs_rw::DecodingReader(file,
encoding.new_decoder());
let mut csv =
ReaderBuilder::new(Arc::new(schema)).build(decoded).unwrap();
let batch = csv.next().unwrap().unwrap();
batch
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]