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
fix(doc): close#19393, make upgrading guide match v51 api (#19648)
Change-Id: Id62d32d14fa19b34b592e186e7962bb96a6a6964
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes#123` indicates that this PR will close issue #123.
-->
- Closes#19393
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
Make datafusion doc great
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
Move “Refactoring of `FileSource` constructors and
`FileScanConfigBuilder` to accept schemas upfront" section to right
place.
## Are these changes tested?
No need for code test.
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
No
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
Signed-off-by: mag1cian <[email protected]>
Copy file name to clipboardExpand all lines: docs/source/library-user-guide/upgrading.md
+85-85Lines changed: 85 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,91 @@ let config = FileScanConfigBuilder::new(object_store_url, source)
107
107
The `pyarrow` feature flag has been removed. This feature has been migrated to
108
108
the `datafusion-python` repository since version `44.0.0`.
109
109
110
+
### Refactoring of `FileSource` constructors and `FileScanConfigBuilder` to accept schemas upfront
111
+
112
+
The way schemas are passed to file sources and scan configurations has been significantly refactored. File sources now require the schema (including partition columns) to be provided at construction time, and `FileScanConfigBuilder` no longer takes a separate schema parameter.
113
+
114
+
**Who is affected:**
115
+
116
+
- Users who create `FileScanConfig` or file sources (`ParquetSource`, `CsvSource`, `JsonSource`, `AvroSource`) directly
117
+
- Users who implement custom `FileFormat` implementations
118
+
119
+
**Key changes:**
120
+
121
+
1.**FileSource constructors now require TableSchema**: All built-in file sources now take the schema in their constructor:
122
+
123
+
```diff
124
+
- let source = ParquetSource::default();
125
+
+ let source = ParquetSource::new(table_schema);
126
+
```
127
+
128
+
2.**FileScanConfigBuilder no longer takes schema as a parameter**: The schema is now passed via the FileSource:
129
+
130
+
```diff
131
+
- FileScanConfigBuilder::new(url, schema, source)
132
+
+ FileScanConfigBuilder::new(url, source)
133
+
```
134
+
135
+
3.**Partition columns are now part of TableSchema**: The `with_table_partition_cols()` method has been removed from `FileScanConfigBuilder`. Partition columns are now passed as part of the `TableSchema` to the FileSource constructor:
+ let source = Arc::new(CsvSource::new(table_schema).with_csv_options(options));
191
+
+ let config = FileScanConfigBuilder::new(url, source)
192
+
.build();
193
+
```
194
+
110
195
### Adaptive filter representation in Parquet filter pushdown
111
196
112
197
As of Arrow 57.1.0, DataFusion uses a new adaptive filter strategy when
@@ -754,91 +839,6 @@ TIMEZONE = '+00:00';
754
839
This change was made to better support using the default timezone in scalar UDF functions such as
755
840
`now`, `current_date`, `current_time`, and `to_timestamp` among others.
756
841
757
-
### Refactoring of `FileSource` constructors and `FileScanConfigBuilder` to accept schemas upfront
758
-
759
-
The way schemas are passed to file sources and scan configurations has been significantly refactored. File sources now require the schema (including partition columns) to be provided at construction time, and `FileScanConfigBuilder` no longer takes a separate schema parameter.
760
-
761
-
**Who is affected:**
762
-
763
-
- Users who create `FileScanConfig` or file sources (`ParquetSource`, `CsvSource`, `JsonSource`, `AvroSource`) directly
764
-
- Users who implement custom `FileFormat` implementations
765
-
766
-
**Key changes:**
767
-
768
-
1.**FileSource constructors now require TableSchema**: All built-in file sources now take the schema in their constructor:
769
-
770
-
```diff
771
-
- let source = ParquetSource::default();
772
-
+ let source = ParquetSource::new(table_schema);
773
-
```
774
-
775
-
2.**FileScanConfigBuilder no longer takes schema as a parameter**: The schema is now passed via the FileSource:
776
-
777
-
```diff
778
-
- FileScanConfigBuilder::new(url, schema, source)
779
-
+ FileScanConfigBuilder::new(url, source)
780
-
```
781
-
782
-
3.**Partition columns are now part of TableSchema**: The `with_table_partition_cols()` method has been removed from `FileScanConfigBuilder`. Partition columns are now passed as part of the `TableSchema` to the FileSource constructor:
+ let source = Arc::new(CsvSource::new(table_schema).with_csv_options(options));
838
-
+ let config = FileScanConfigBuilder::new(url, source)
839
-
.build();
840
-
```
841
-
842
842
### Introduction of `TableSchema` and changes to `FileSource::with_schema()` method
843
843
844
844
A new `TableSchema` struct has been introduced in the `datafusion-datasource` crate to better manage table schemas with partition columns. This struct helps distinguish between:
0 commit comments