You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/08 18:06:52 UTC

[GitHub] [arrow] houqp commented on a change in pull request #8867: ARROW-10842 [Rust] decouple IO from json schema inference code

houqp commented on a change in pull request #8867:
URL: https://github.com/apache/arrow/pull/8867#discussion_r538675155



##########
File path: rust/arrow/src/json/reader.rs
##########
@@ -250,19 +326,17 @@ pub fn infer_json_schema<R: Read>(
     reader: &mut BufReader<R>,
     max_read_records: Option<usize>,
 ) -> Result<SchemaRef> {
-    let mut values: HashMap<String, HashSet<DataType>> = HashMap::new();
-
-    let mut line = String::new();
-    for _ in 0..max_read_records.unwrap_or(std::usize::MAX) {
-        reader.read_line(&mut line)?;
-        if line.is_empty() {
-            break;
-        }
-        let record: Value = serde_json::from_str(&line.trim()).expect("Not valid JSON");

Review comment:
       that's right.




----------------------------------------------------------------
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:
users@infra.apache.org