alamb commented on code in PR #4514:
URL: https://github.com/apache/arrow-datafusion/pull/4514#discussion_r1039786822
##########
datafusion/core/tests/sqllogictests/src/insert/mod.rs:
##########
@@ -74,12 +71,17 @@ pub async fn insert(ctx: &SessionContext, insert_stmt:
&SQLStatement) -> Result<
.collect::<std::result::Result<Vec<DFExpr>, DataFusionError>>()?;
// Directly use `select` to get `RecordBatch`
let dataframe = ctx.read_empty()?;
- insert_batches.push(dataframe.select(logical_exprs)?.collect().await?)
+
origin_batches.extend(dataframe.select(logical_exprs)?.collect().await?)
}
- // Final, append the `RecordBatch` to memtable's batches
- let mut table_batches = table_batches.write();
- table_batches.extend(insert_batches);
+ // Replace new batches schema to old schema
+ for batch in origin_batches.iter_mut() {
+ *batch = RecordBatch::try_new(schema.clone(),
batch.columns().to_vec())?;
Review Comment:
this is interesting -- I guess we can sort it out as a follow on
--
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]