cockroachdb / cockroachdb/cockroach

sql/schemachanger: add CREATE VIEW variants to random schema change workload

Open
#164,276 0 comments 0 reactions 0 assignees View on GitHub
A-schema-changer-impl C-enhancement T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

## Summary

Extend the random schema change workload to exercise `CREATE OR REPLACE VIEW`, `CREATE TEMPORARY VIEW`, `CREATE MATERIALIZED VIEW`, and `REFRESH MATERIALIZED VIEW`. This depends on #164271, #164272, #164273, and #164274.

## Describe the solution you'd like

- Extend the existing `createView` op type in `operation_generator.go` with new variants (OR REPLACE, TEMPORARY, MATERIALIZED)
- Add `REFRESH MATERIALIZED VIEW` as a new operation type
- Add error expectation handling for edge cases
- Run the workload and verify no unexpected panics

## Code References

- [operation_generator.go:1555](https://github.com/cockroachdb/cockroach/blob/7f85419e8fa/pkg/workload/schemachange/operation_generator.go#L1555) — existing `createView` implementation
- [optype.go:130](https://github.com/cockroachdb/cockroach/blob/7f85419e8fa/pkg/workload/schemachange/optype.go#L130) — op type registration for `createView`

Epic: CRDB-31466

Jira issue: CRDB-60731

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.