delta
delta copied to clipboard
[Spark] Test type widening compatibility with other Delta features
Description
Additional tests covering type widening and:
- Reading CDF
- Column mapping
- Time travel
- RESTORE
- CLONE
How was this patch tested?
Test only
Added a few suggestions for additional tests. Do we already have tests for constraints and generated columns. AFAIK we disallow type changes on generated columns, but constraints might be interesting as it's possible to create a constraint after changing the type.
There are tests already for generated columns and constraints, added as part of https://github.com/delta-io/delta/pull/2881
I added a test here to cover constraints + RESTORE which is an interesting case:
- Change column
a
type frombyte
toint
- Add a CHECK constraint on column
a
. - RESTORE table to before the type change.
The constraint was added on type int
and the column now has type byte
. This does work though because CHECK constraints are part of the table metadata and it gets removed during RESTORE.