You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move newlines_in_values from FileScanConfig to CsvSource (#19313)
## Summary
This PR moves the CSV-specific `newlines_in_values` configuration option
from `FileScanConfig` (a shared format-agnostic configuration) to
`CsvSource` where it belongs.
- Add `newlines_in_values` field and methods to `CsvSource`
- Add `has_newlines_in_values()` method to `FileSource` trait (returns
`false` by default)
- Update `FileSource::repartitioned()` to use the new trait method
- Remove `new_lines_in_values` from `FileScanConfig` and its builder
- Update proto serialization to read from/write to `CsvSource`
- Update tests and documentation
- Add migration guide to `upgrading.md`
Closes#18453
## Test plan
- [x] All existing tests pass
- [x] Doc tests pass
- [x] Proto roundtrip tests pass
- [x] Clippy clean
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
note = "newlines_in_values has moved to CsvSource. Access it via CsvSource::csv_options().newlines_in_values instead. It will be removed in 58.0.0 or 6 months after 52.0.0 is released, whichever comes first."
941
+
)]
942
+
pubfnnewlines_in_values(&self) -> bool{
943
+
false
944
+
}
945
+
948
946
#[deprecated(
949
947
since = "52.0.0",
950
948
note = "This method is no longer used, use eq_properties instead. It will be removed in 58.0.0 or 6 months after 52.0.0 is released, whichever comes first."
@@ -954,17 +952,6 @@ impl FileScanConfig {
954
952
props.constraints().clone()
955
953
}
956
954
957
-
/// Specifies whether newlines in (quoted) values are supported.
958
-
///
959
-
/// Parsing newlines in quoted values may be affected by execution behaviour such as
960
-
/// parallel file scanning. Setting this to `true` ensures that newlines in values are
961
-
/// parsed successfully, which may reduce performance.
962
-
///
963
-
/// The default behaviour depends on the `datafusion.catalog.newlines_in_values` setting.
964
-
pubfnnewlines_in_values(&self) -> bool{
965
-
self.new_lines_in_values
966
-
}
967
-
968
955
#[deprecated(
969
956
since = "52.0.0",
970
957
note = "This method is no longer used, use eq_properties instead. It will be removed in 58.0.0 or 6 months after 52.0.0 is released, whichever comes first."
Copy file name to clipboardExpand all lines: docs/source/library-user-guide/upgrading.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,40 @@ See <https://github.com/apache/datafusion/issues/19056> for more details.
57
57
58
58
Note that the internal API has changed to use a trait `ListFilesCache` instead of a type alias.
59
59
60
+
### `newlines_in_values` moved from `FileScanConfig` to `CsvOptions`
61
+
62
+
The CSV-specific `newlines_in_values` configuration option has been moved from `FileScanConfig` to `CsvOptions`, as it only applies to CSV file parsing.
63
+
64
+
**Who is affected:**
65
+
66
+
- Users who set `newlines_in_values` via `FileScanConfigBuilder::with_newlines_in_values()`
67
+
68
+
**Migration guide:**
69
+
70
+
Set `newlines_in_values` in `CsvOptions` instead of on `FileScanConfigBuilder`:
71
+
72
+
**Before:**
73
+
74
+
```rust,ignore
75
+
let source = Arc::new(CsvSource::new(file_schema.clone()));
76
+
let config = FileScanConfigBuilder::new(object_store_url, source)
77
+
.with_newlines_in_values(true)
78
+
.build();
79
+
```
80
+
81
+
**After:**
82
+
83
+
```rust,ignore
84
+
let options = CsvOptions {
85
+
newlines_in_values: Some(true),
86
+
..Default::default()
87
+
};
88
+
let source = Arc::new(CsvSource::new(file_schema.clone())
89
+
.with_csv_options(options));
90
+
let config = FileScanConfigBuilder::new(object_store_url, source)
91
+
.build();
92
+
```
93
+
60
94
### Removal of `pyarrow` feature
61
95
62
96
The `pyarrow` feature flag has been removed. This feature has been migrated to
0 commit comments