trushev opened a new pull request, #7895:
URL: https://github.com/apache/hudi/pull/7895
### Change Logs
1. Added column drop check into HoodieTable validation
2. Improved exception message of validation failure
### Impact
Fixed issue:
```sql
-- Step 1.
create table tbl(
`uuid` bigint,
`name` string,
`age` int null, -- column to be dropped
`part` int
) partitioned by (`part`) with (
'connector'='hudi',
'path'='/tmp/tbl',
'hoodie.avro.schema.validate'='false',
'hoodie.datasource.write.schema.allow.auto.evolution.column.drop'='false'
);
insert into tbl values (1, 'Danny', 23, 10);
drop table tbl;
-- Step 2.
create table tbl(
`uuid` bigint,
`name` string,
`part` int
) partitioned by (`part`) with (
'connector'='hudi',
'path'='/tmp/tbl',
'hoodie.avro.schema.validate'='false',
'hoodie.datasource.write.schema.allow.auto.evolution.column.drop'='false'
);
insert into tbl values (2, 'Stephen', 10); -- failure expected
select * from tbl;
```
Expected behavior:
```
Exception -- column dropping is not allowed
```
Actual behavior:
```
+----+-------+----------+-------+
| op | uuid | name | part |
+----+-------+----------+-------+
| +I | 1 | Danny | 10 |
| +I | 2 | Stephen | 10 |
+----+-------+----------+-------+
```
### Risk level (write none, low medium or high below)
Low
### Documentation Update
_Describe any necessary documentation update if there is any new feature,
config, or user-facing change_
- _The config description must be updated if new configs are added or the
default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website.
Please create a Jira ticket, attach the
ticket number here and follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to
make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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]