Blizzara commented on code in PR #10531: URL: https://github.com/apache/datafusion/pull/10531#discussion_r1606981891
########## datafusion/substrait/tests/cases/roundtrip_logical_plan.rs: ########## @@ -607,6 +608,15 @@ async fn qualified_catalog_schema_table_reference() -> Result<()> { roundtrip("SELECT a,b,c,d,e FROM datafusion.public.data;").await } +#[tokio::test] +async fn roundtrip_local_relation() -> Result<()> { + let ctx = create_context().await?; + let row1 = vec![lit(1), lit("a")]; + let row2 = vec![lit(2), lit("b")]; + let plan = LogicalPlanBuilder::values(vec![row1, row2])?.build()?; Review Comment: Ah, I'm blind, thanks! I tried switching to that, but it produces somewhat ugly plans as it uses `make_array` and `struct` as UDFs, making the assert fail: ``` left: "Values: (Int64(1), Utf8(\"a\"), List([[-213.1, , 5.5, 2.0, 1.0], []]) AS make_array(make_array(Float64(-213.1),NULL,Float64(5.5),Float64(2),Float64(1)),make_array()), Struct({c0:true,c1:1}) AS struct(Boolean(true),Int64(1))), (Int64(NULL), Utf8(NULL), List(), Struct({c0:,c1:}))" right: "Values: (Int64(1), Utf8(\"a\"), List([[-213.1, , 5.5, 2.0, 1.0], []]), Struct({c0:true,c1:1})), (Int64(NULL), Utf8(NULL), List(), Struct({c0:,c1:}))" ``` The `AS` aliases it produces seem to get ignored (the column names are still column1, column2, column3, ..), so it doesn't seem to make sense to map them into Substrait (and I'm not even sure if that'd be possible). Any ideas how to go around that? -- 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