From 8ac2eeae900ea70ad99dabc8a279cf07be558503 Mon Sep 17 00:00:00 2001 From: Jefffrey Date: Tue, 25 Nov 2025 11:59:00 +0900 Subject: [PATCH] minor: add builder setting `NdJsonReadOptions::schema_infer_max_records` --- datafusion/core/src/datasource/file_format/options.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datafusion/core/src/datasource/file_format/options.rs b/datafusion/core/src/datasource/file_format/options.rs index e78c5f09553c..6cca0d503376 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]