Dandandan commented on a change in pull request #487:
URL: https://github.com/apache/arrow-datafusion/pull/487#discussion_r646110346
##########
File path: datafusion/src/physical_plan/json.rs
##########
@@ -202,16 +202,11 @@ impl NdJsonExec {
max_records: Option<usize>,
) -> Result<Schema> {
let mut schemas = Vec::new();
- let mut records_to_read = max_records.unwrap_or(usize::MAX);
- while records_to_read > 0 && !filenames.is_empty() {
+ let lines_per_file = max_records.map(|x| x / filenames.len());
Review comment:
I think we should round up and either read a bit more lines than
specified or check whether the limit has been reached.
--
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]