alamb commented on code in PR #11929:
URL: https://github.com/apache/datafusion/pull/11929#discussion_r1712995933
##########
datafusion/sqllogictest/src/engines/datafusion_engine/runner.rs:
##########
@@ -69,9 +71,11 @@ impl sqllogictest::AsyncDB for DataFusion {
async fn run_query(ctx: &SessionContext, sql: impl Into<String>) ->
Result<DFOutput> {
let df = ctx.sql(sql.into().as_str()).await?;
+ let task_ctx = Arc::new(df.task_ctx());
+ let plan = df.create_physical_plan().await?;
- let types = normalize::convert_schema_to_types(df.schema().fields());
- let results: Vec<RecordBatch> = df.collect().await?;
+ let types = normalize::convert_schema_to_types(plan.schema().fields());
+ let results: Vec<RecordBatch> = collect(plan, task_ctx).await?;
Review Comment:
Another thing you could do that might be even closer to the results, would
be to call `execute` to get a `SendableRecordBatchStream` and retrieve the
schema from that (e.g `stream.schema()`) which should be exactly the same
schema as RecordBatch produced
I think using the physical plan's schema is fine too though and better than
what is on main
##########
datafusion/sqllogictest/test_files/copy.slt:
##########
@@ -378,7 +378,7 @@ select * from validate_parquet_with_options;
2 Bar
# Copy from table to single file
-query IT
+query I
Review Comment:
that certainly makes more send 👍
--
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]