Add test for statement prerequisites and materialization