vbarua commented on code in PR #12983: URL: https://github.com/apache/datafusion/pull/12983#discussion_r1806754949
########## datafusion/substrait/src/logical_plan/consumer.rs: ########## @@ -800,79 +801,71 @@ pub async fn from_substrait_rel( Ok(Expr::Literal(from_substrait_literal( lit, extensions, - &base_schema.names, + &named_struct.names, &mut name_idx, )?)) }) .collect::<Result<_>>()?; - if name_idx != base_schema.names.len() { + if name_idx != named_struct.names.len() { return substrait_err!( "Names list must match exactly to nested schema, but found {} uses for {} names", name_idx, - base_schema.names.len() + named_struct.names.len() ); } Ok(lits) }) .collect::<Result<_>>()?; - Ok(LogicalPlan::Values(Values { - schema: DFSchemaRef::new(schema), - values, - })) - } - Some(ReadType::LocalFiles(lf)) => { - let named_struct = read.base_schema.as_ref().ok_or_else(|| { - substrait_datafusion_err!("No base schema provided for LocalFiles") - })?; - - fn extract_filename(name: &str) -> Option<String> { - let corrected_url = - if name.starts_with("file://") && !name.starts_with("file:///") { + Ok(LogicalPlan::Values(Values { + schema: DFSchemaRef::new(substrait_schema), + values, + })) Review Comment: minor/non-blocking: strictly speaking, we should call `read_with_schema` here as well because it's valid to define a `projection` for a VirtualTable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org