Skip to content

Apache DataFusion SQL Query Engine

minor: add builder setting `NdJsonReadOptions::schema_infer_max_records` (#18920)

Jeffrey Vo7cbb4432ba66
diff --git a/datafusion/core/src/datasource/file_format/options.rs b/datafusion/core/src/datasource/file_format/options.rs
index e78c5f0955..6cca0d5033 100644
--- a/datafusion/core/src/datasource/file_format/options.rs
+++ b/datafusion/core/src/datasource/file_format/options.rs
@@ -523,6 +523,12 @@ impl<'a> NdJsonReadOptions<'a> {
self.file_sort_order = file_sort_order;
self
}
+
+ /// Specify how many rows to read for schema inference
+ pub fn schema_infer_max_records(mut self, schema_infer_max_records: usize) -> Self {
+ self.schema_infer_max_records = schema_infer_max_records;
+ self
+ }
}
#[async_trait]