alamb commented on code in PR #19432:
URL: https://github.com/apache/datafusion/pull/19432#discussion_r2639996083


##########
datafusion/datasource-csv/src/file_format.rs:
##########
@@ -619,12 +620,20 @@ impl CsvFormat {
             }
         }
 
-        let schema = build_schema_helper(column_names, 
column_type_possibilities);
+        let schema = build_schema_helper(
+            column_names,
+            column_type_possibilities,
+            initial_records_to_read == 0,
+        );
         Ok((schema, total_records_read))
     }
 }
 
-fn build_schema_helper(names: Vec<String>, types: Vec<HashSet<DataType>>) -> 
Schema {
+fn build_schema_helper(

Review Comment:
   Can you please add some comments here explaining what "disable_inference" 
does and when it should be called? 
   
   Also, I think it is important to make sure the expectation of what will 
happen when rows to sample is set to zero is documented
   
   Can you please update the documentation for `SCHEMA_INFER_MAX_REC` in 
https://datafusion.apache.org/user-guide/sql/format_options.html#csv-format-options
   
   to say that if this is set to zero all fields will be inferred as Utf8?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to