Commit 47d990e
authored
chore: Add assertion for empty data files for append action (#1301)
## What changes are included in this PR?
The general usage to append data files is
```rust
let mut action = txn.fast_append(/*commit_uuid=*/ None, /*key_metadata=*/ vec![])?;
action.add_data_files(new_data_files)?;
let txn = action.apply().await?;
let table = txn.commit(catalog).await?
```
I found if ` new_data_files` is empty by accident, a new manifest file
will still be created and tracked by manifest list file, which doesn't
make sense to me (let me if team thinks it's a valid and ideal use
case).
In this PR, I did a few changes:
- Add a new invalid argument error code;
- Add assertion to fail empty data files append, and empty action commit
use cases.
## Are these changes tested?
Existing unit tests pass, and add a validation test for invalid data
file append.1 parent 7e36243 commit 47d990e
3 files changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
222 | 231 | | |
223 | 232 | | |
224 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
| |||
0 commit comments