MCPcopy Create free account
hub / github.com/apache/datafusion / create

Method create

datafusion/datasource-parquet/src/file_format.rs:96–120  ·  view source on GitHub ↗
(
        &self,
        state: &dyn Session,
        format_options: &std::collections::HashMap<String, String>,
    )

Source from the content-addressed store, hash-verified

94
95impl FileFormatFactory for ParquetFormatFactory {
96 fn create(
97 &self,
98 state: &dyn Session,
99 format_options: &std::collections::HashMap<String, String>,
100 ) -> Result<Arc<dyn FileFormat>> {
101 let parquet_options = match &self.options {
102 None => {
103 let mut table_options = state.default_table_options();
104 table_options.set_config_format(ConfigFileType::PARQUET);
105 table_options.alter_with_string_hash_map(format_options)?;
106 table_options.parquet
107 }
108 Some(parquet_options) => {
109 let mut parquet_options = parquet_options.clone();
110 for (k, v) in format_options {
111 parquet_options.set(k, v)?;
112 }
113 parquet_options
114 }
115 };
116
117 Ok(Arc::new(
118 ParquetFormat::default().with_options(parquet_options),
119 ))
120 }
121
122 fn default(&self) -> Arc<dyn FileFormat> {
123 Arc::new(ParquetFormat::default())

Callers 2

prepare_filtersMethod · 0.45

Calls 7

newFunction · 0.85
set_config_formatMethod · 0.80
default_table_optionsMethod · 0.45
cloneMethod · 0.45
setMethod · 0.45
with_optionsMethod · 0.45

Tested by 1