martin-g commented on code in PR #24655:
URL: https://github.com/apache/datafusion/pull/24655#discussion_r3870496646
##########
datafusion/catalog/src/memory/table.rs:
##########
@@ -434,18 +389,21 @@ impl MemTable {
assignments: Vec<(String, Expr)>,
filters: Vec<Expr>,
) -> BoxFuture<'a, Result<Arc<dyn ExecutionPlan>>> {
- Box::pin(self.update_inner(state, assignments, filters))
+ Box::pin(ready(self.plan_update(state, assignments, filters)))
}
- async fn update_inner(
+ /// Build the plan of an UPDATE. The rows change when the plan runs, not
+ /// here. Every check of the statement stays here, so that an `EXPLAIN`
+ /// still reports an invalid statement.
+ fn plan_update(
&self,
state: &dyn Session,
assignments: Vec<(String, Expr)>,
filters: Vec<Expr>,
) -> Result<Arc<dyn ExecutionPlan>> {
// Early exit if table has no partitions
if self.batches.is_empty() {
- return Ok(Arc::new(DmlResultExec::new(0)));
+ return Ok(self.dml_exec(vec![], vec![],
MemDmlOp::Update(HashMap::new())));
Review Comment:
Old behavior. I am not sure whether it should be changed or not.
`EXPLAIN UPDATE empty_table SET nonexistent = 1` will return successfully
without complaining that there is no column named `nonexistent`
--
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]