ethan-tyler commented on PR #19633:
URL: https://github.com/apache/datafusion/pull/19633#issuecomment-3715079014
> @ethan-tyler I tried tightening the test using `TestMemoryExec` to
materialize a {count: UInt64} row as suggested. However this causes the test to
fail:
>
> ```shell
> TestMemoryExec::with_new_children not implemented
> ```
>
> This happens because physical optimizer rules run and require
`ExecutionPlan::with_new_children`, which `TestMemoryExec` does not implement.
Could you please look into this?
@Nachiket-Roy My bad - should have validated that suggestion first.
TestMemoryExec doesn't implement with_new_children, so it panics during filter
pushdown.
Better to stick with EmptyExec:
```
async fn truncate(&self, _state: &dyn Session) -> Result<Arc<dyn
ExecutionPlan>> {
*self.truncate_called.lock().unwrap() = true;
Ok(Arc::new(EmptyExec::new(Arc::new(Schema::new(vec![
Field::new("count", DataType::UInt64, false),
])))))
}
```
This matches what CaptureDeleteProvider and CaptureUpdateProvider already
do. These tests just verify the hook gets called and validating provider output
is the implementor's responsibility.
The "proper" way to return an actual count is DmlResultExec, but it's
private to the memory table module. Making it public would be a separate
discussion. Sorry for the detour, the original implementation was fine.
--
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]