@@ -72,7 +72,7 @@ use log::{debug, warn};
72
72
/// The base configurations for a [`DataSourceExec`], the a physical plan for
73
73
/// any given file format.
74
74
///
75
- /// Use [`Self::build `] to create a [`DataSourceExec`] from a ``FileScanConfig`.
75
+ /// Use [`DataSourceExec::from_data_source `] to create a [`DataSourceExec`] from a ``FileScanConfig`.
76
76
///
77
77
/// # Example
78
78
/// ```
@@ -669,65 +669,6 @@ impl DataSource for FileScanConfig {
669
669
}
670
670
671
671
impl FileScanConfig {
672
- /// Create a new [`FileScanConfig`] with default settings for scanning files.
673
- ///
674
- /// See example on [`FileScanConfig`]
675
- ///
676
- /// No file groups are added by default. See [`Self::with_file`], [`Self::with_file_group`] and
677
- /// [`Self::with_file_groups`].
678
- ///
679
- /// # Parameters:
680
- /// * `object_store_url`: See [`Self::object_store_url`]
681
- /// * `file_schema`: See [`Self::file_schema`]
682
- #[ allow( deprecated) ] // `new` will be removed same time as `with_source`
683
- pub fn new (
684
- object_store_url : ObjectStoreUrl ,
685
- file_schema : SchemaRef ,
686
- file_source : Arc < dyn FileSource > ,
687
- ) -> Self {
688
- let statistics = Statistics :: new_unknown ( & file_schema) ;
689
- let file_source = file_source
690
- . with_statistics ( statistics. clone ( ) )
691
- . with_schema ( Arc :: clone ( & file_schema) ) ;
692
- Self {
693
- object_store_url,
694
- file_schema,
695
- file_groups : vec ! [ ] ,
696
- constraints : Constraints :: default ( ) ,
697
- projection : None ,
698
- limit : None ,
699
- table_partition_cols : vec ! [ ] ,
700
- output_ordering : vec ! [ ] ,
701
- file_compression_type : FileCompressionType :: UNCOMPRESSED ,
702
- new_lines_in_values : false ,
703
- file_source : Arc :: clone ( & file_source) ,
704
- batch_size : None ,
705
- expr_adapter_factory : None ,
706
- }
707
- }
708
-
709
- /// Set the file source
710
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
711
- pub fn with_source ( mut self , file_source : Arc < dyn FileSource > ) -> Self {
712
- self . file_source =
713
- file_source. with_statistics ( Statistics :: new_unknown ( & self . file_schema ) ) ;
714
- self
715
- }
716
-
717
- /// Set the table constraints of the files
718
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
719
- pub fn with_constraints ( mut self , constraints : Constraints ) -> Self {
720
- self . constraints = constraints;
721
- self
722
- }
723
-
724
- /// Set the statistics of the files
725
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
726
- pub fn with_statistics ( mut self , statistics : Statistics ) -> Self {
727
- self . file_source = self . file_source . with_statistics ( statistics) ;
728
- self
729
- }
730
-
731
672
fn projection_indices ( & self ) -> Vec < usize > {
732
673
match & self . projection {
733
674
Some ( proj) => proj. clone ( ) ,
@@ -788,88 +729,6 @@ impl FileScanConfig {
788
729
self . constraints . project ( & indexes) . unwrap_or_default ( )
789
730
}
790
731
791
- /// Set the projection of the files
792
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
793
- pub fn with_projection ( mut self , projection : Option < Vec < usize > > ) -> Self {
794
- self . projection = projection;
795
- self
796
- }
797
-
798
- /// Set the limit of the files
799
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
800
- pub fn with_limit ( mut self , limit : Option < usize > ) -> Self {
801
- self . limit = limit;
802
- self
803
- }
804
-
805
- /// Add a file as a single group
806
- ///
807
- /// See [Self::file_groups] for more information.
808
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
809
- #[ allow( deprecated) ]
810
- pub fn with_file ( self , file : PartitionedFile ) -> Self {
811
- self . with_file_group ( FileGroup :: new ( vec ! [ file] ) )
812
- }
813
-
814
- /// Add the file groups
815
- ///
816
- /// See [Self::file_groups] for more information.
817
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
818
- pub fn with_file_groups ( mut self , mut file_groups : Vec < FileGroup > ) -> Self {
819
- self . file_groups . append ( & mut file_groups) ;
820
- self
821
- }
822
-
823
- /// Add a new file group
824
- ///
825
- /// See [Self::file_groups] for more information
826
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
827
- pub fn with_file_group ( mut self , file_group : FileGroup ) -> Self {
828
- self . file_groups . push ( file_group) ;
829
- self
830
- }
831
-
832
- /// Set the partitioning columns of the files
833
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
834
- pub fn with_table_partition_cols ( mut self , table_partition_cols : Vec < Field > ) -> Self {
835
- self . table_partition_cols = table_partition_cols
836
- . into_iter ( )
837
- . map ( |f| Arc :: new ( f) as FieldRef )
838
- . collect ( ) ;
839
- self
840
- }
841
-
842
- /// Set the output ordering of the files
843
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
844
- pub fn with_output_ordering ( mut self , output_ordering : Vec < LexOrdering > ) -> Self {
845
- self . output_ordering = output_ordering;
846
- self
847
- }
848
-
849
- /// Set the file compression type
850
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
851
- pub fn with_file_compression_type (
852
- mut self ,
853
- file_compression_type : FileCompressionType ,
854
- ) -> Self {
855
- self . file_compression_type = file_compression_type;
856
- self
857
- }
858
-
859
- /// Set the new_lines_in_values property
860
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
861
- pub fn with_newlines_in_values ( mut self , new_lines_in_values : bool ) -> Self {
862
- self . new_lines_in_values = new_lines_in_values;
863
- self
864
- }
865
-
866
- /// Set the batch_size property
867
- #[ deprecated( since = "47.0.0" , note = "use FileScanConfigBuilder instead" ) ]
868
- pub fn with_batch_size ( mut self , batch_size : Option < usize > ) -> Self {
869
- self . batch_size = batch_size;
870
- self
871
- }
872
-
873
732
/// Specifies whether newlines in (quoted) values are supported.
874
733
///
875
734
/// Parsing newlines in quoted values may be affected by execution behaviour such as
@@ -1099,12 +958,6 @@ impl FileScanConfig {
1099
958
. collect ( ) )
1100
959
}
1101
960
1102
- /// Returns a new [`DataSourceExec`] to scan the files specified by this config
1103
- #[ deprecated( since = "47.0.0" , note = "use DataSourceExec::new instead" ) ]
1104
- pub fn build ( self ) -> Arc < DataSourceExec > {
1105
- DataSourceExec :: from_data_source ( self )
1106
- }
1107
-
1108
961
/// Write the data_type based on file_source
1109
962
fn fmt_file_source ( & self , t : DisplayFormatType , f : & mut Formatter ) -> FmtResult {
1110
963
write ! ( f, ", file_type={}" , self . file_source. file_type( ) ) ?;
0 commit comments