Blizzara commented on code in PR #10531:
URL: https://github.com/apache/datafusion/pull/10531#discussion_r1601980707


##########
datafusion/substrait/src/logical_plan/producer.rs:
##########
@@ -165,6 +168,53 @@ pub fn to_substrait_rel(
                 }))),
             }))
         }
+        LogicalPlan::Values(v) => {
+            let names = v
+                .schema
+                .fields()
+                .iter()
+                .map(|f| f.name().to_owned())
+                // todo: collect also nested names
+                .collect();
+            let field_types = r#type::Struct {
+                types: v
+                    .schema
+                    .fields()
+                    .iter()
+                    .map(|f| to_substrait_type(f.data_type()).unwrap())
+                    .collect(),
+                type_variation_reference: DEFAULT_TYPE_REF,
+                nullability: Nullability::Unspecified as i32,
+            };
+            let values = v
+                .values
+                .iter()
+                .map(|row| {
+                    let fields = row
+                        .iter()
+                        .map(|v| match v {
+                            Expr::Literal(sv) => 
to_substrait_literal(sv).unwrap(),
+                            _ => panic!(),

Review Comment:
   note for self: better error



-- 
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