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



##########
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:
       is this the line that causes a hard crash on invalid json?




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


Reply via email to