(
&self,
state: &dyn Session,
projection: Option<&Vec<usize>>,
_filters: &[Expr],
_limit: Option<usize>,
)
| 225 | } |
| 226 | |
| 227 | async fn scan( |
| 228 | &self, |
| 229 | state: &dyn Session, |
| 230 | projection: Option<&Vec<usize>>, |
| 231 | _filters: &[Expr], |
| 232 | _limit: Option<usize>, |
| 233 | ) -> Result<Arc<dyn ExecutionPlan>> { |
| 234 | let mut partitions = vec![]; |
| 235 | for arc_inner_vec in self.batches.iter() { |
| 236 | let inner_vec = arc_inner_vec.read().await; |
| 237 | partitions.push(inner_vec.clone()) |
| 238 | } |
| 239 | |
| 240 | let mut source = |
| 241 | MemorySourceConfig::try_new(&partitions, self.schema(), projection.cloned())?; |
| 242 | |
| 243 | let show_sizes = state.config_options().explain.show_sizes; |
| 244 | source = source.with_show_sizes(show_sizes); |
| 245 | |
| 246 | // add sort information if present |
| 247 | let sort_order = self.sort_order.lock(); |
| 248 | if !sort_order.is_empty() { |
| 249 | let df_schema = DFSchema::try_from(Arc::clone(&self.schema))?; |
| 250 | |
| 251 | let eqp = state.execution_props(); |
| 252 | let mut file_sort_order = vec![]; |
| 253 | for sort_exprs in sort_order.iter() { |
| 254 | let physical_exprs = |
| 255 | create_physical_sort_exprs(sort_exprs, &df_schema, eqp)?; |
| 256 | file_sort_order.extend(LexOrdering::new(physical_exprs)); |
| 257 | } |
| 258 | source = source.try_with_sort_information(file_sort_order)?; |
| 259 | } |
| 260 | |
| 261 | Ok(DataSourceExec::from_data_source(source)) |
| 262 | } |
| 263 | |
| 264 | /// Returns an ExecutionPlan that inserts the execution results of a given [`ExecutionPlan`] into this [`MemTable`]. |
| 265 | /// |
no test coverage detected