ARROW-10842 [Rust] decouple IO from json reader, fix crash during json schema inference with invalid json
ARROW-10842 [Rust] decouple IO from json reader, fix crash during json schema inference with invalid json

Other related changes:

 * reuse the same IO code between schema inference and record batch reader.
 * reuse string buffer to avoid repeatitive memory allocation
 * ignore new lines when reading json records
 * avoid hard crash during JSON schema inference caused by invalid json

Closes #8867 from houqp/qp_json

Authored-by: Qingping Hou <333fd10814a9caf78fd740457f76aba4fa74a157@gmail.com>
Signed-off-by: Andrew Lamb <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@nerdnetworks.org>

apache/arrow,laurentgo/arrow,icexelloss/arrow,wesm/arrow,laurentgo/arrow,wesm/arrow,cpcloud/arrow,cpcloud/arrow,kou/arrow,wesm/arrow,apache/arrow,cpcloud/arrow,cpcloud/arrow,apache/arrow,laurentgo/arrow,laurentgo/arrow,icexelloss/arrow,apache/arrow,cpcloud/arrow,wesm/arrow,apache/arrow,wesm/arrow,icexelloss/arrow,laurentgo/arrow,laurentgo/arrow,wesm/arrow,wesm/arrow,icexelloss/arrow,kou/arrow,wesm/arrow,wesm/arrow,icexelloss/arrow,kou/arrow,laurentgo/arrow,apache/arrow,cpcloud/arrow,icexelloss/arrow,icexelloss/arrow,cpcloud/arrow,apache/arrow,cpcloud/arrow,kou/arrow,kou/arrow,apache/arrow,icexelloss/arrow,wesm/arrow,kou/arrow,wesm/arrow,icexelloss/arrow,laurentgo/arrow,cpcloud/arrow,apache/arrow,apache/arrow,kou/arrow,kou/arrow,kou/arrow,laurentgo/arrow,laurentgo/arrow,kou/arrow,cpcloud/arrow,wesm/arrow,kou/arrow,wesm/arrow,laurentgo/arrow,wesm/arrow,laurentgo/arrow,cpcloud/arrow,apache/arrow,cpcloud/arrow,kou/arrow,laurentgo/arrow,apache/arrow,laurentgo/arrow,kou/arrow,kou/arrow,icexelloss/arrow,laurentgo/arrow,icexelloss/arrow,cpcloud/arrow,apache/arrow,icexelloss/arrow,cpcloud/arrow,apache/arrow,icexelloss/arrow,icexelloss/arrow