1818use crate :: logical_plan:: consumer:: SubstraitConsumer ;
1919use crate :: logical_plan:: consumer:: from_substrait_literal;
2020use crate :: logical_plan:: consumer:: from_substrait_named_struct;
21- use crate :: logical_plan:: consumer:: utils:: { ensure_schema_compatibility, rename_field } ;
21+ use crate :: logical_plan:: consumer:: utils:: ensure_schema_compatibility;
2222use datafusion:: common:: {
2323 DFSchema , DFSchemaRef , TableReference , not_impl_err, plan_err,
2424 substrait_datafusion_err, substrait_err,
@@ -158,12 +158,10 @@ pub async fn from_read_rel(
158158
159159 let mut row_exprs = vec ! [ ] ;
160160 let mut name_idx = 0 ;
161- for ( field_idx , expression) in row. fields . iter ( ) . enumerate ( ) {
161+ for expression in & row. fields {
162162 let expr = match expression. rex_type . as_ref ( ) {
163163 Some ( substrait:: proto:: expression:: RexType :: Literal ( lit) ) => {
164- if !named_struct. names . is_empty ( ) {
165- name_idx += 1 ; // top-level names are provided through schema
166- }
164+ name_idx += 1 ; // top-level names are provided through schema
167165 Expr :: Literal (
168166 from_substrait_literal (
169167 consumer,
@@ -175,12 +173,7 @@ pub async fn from_read_rel(
175173 )
176174 }
177175 _ => {
178- rename_field (
179- substrait_schema. field ( field_idx) . as_ref ( ) ,
180- & named_struct. names ,
181- field_idx,
182- & mut name_idx,
183- ) ?;
176+ name_idx += 1 ; // top-level names are provided through schema
184177 consumer
185178 . consume_expression ( expression, & substrait_schema)
186179 . await ?
0 commit comments