gabotechs commented on code in PR #23672:
URL: https://github.com/apache/datafusion/pull/23672#discussion_r3688615321


##########
datafusion/substrait/src/logical_plan/consumer/rel/read_rel.rs:
##########
@@ -148,19 +148,45 @@ pub async fn from_read_rel(
             let values = if !vt.expressions.is_empty() {
                 let mut exprs = vec![];
                 for row in &vt.expressions {
+                    if row.fields.len() != substrait_schema.fields().len() {
+                        return substrait_err!(
+                            "Field count mismatch: expected {} fields but 
found {} in virtual table row",
+                            substrait_schema.fields().len(),
+                            row.fields.len()
+                        );
+                    }
+
                     let mut row_exprs = vec![];
+                    let mut name_idx = 0;
                     for expression in &row.fields {
-                        let expr = consumer
-                            .consume_expression(expression, &substrait_schema)
-                            .await?;
+                        let expr = match expression.rex_type.as_ref() {
+                            
Some(substrait::proto::expression::RexType::Literal(lit)) => {

Review Comment:
   The first questions that readers might have is:
   
   Why does the `Literal` expression type needs special handling? Adding a 
comment with some context about why this special handling is needed can save 
some investigation time from readers. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to