You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
don't error if more fields exist than expected in a struct expression (#267)
This allows us to evaluate a `struct` expression where the base data has
more fields than the specified schema.
This is an alternative to #264, and matches more closely with the spec
which states:
> clients can assume that unrecognized actions, fields, and/or metadata
domains are never required in order to correctly interpret the
transaction log. Clients must ignore such unrecognized fields, and
should not produce an error when reading a table that contains
unrecognized fields.
NB: This does NOT actually _drop_ the data from the returned expression,
it just does no validation on columns that aren't specified. So if the
parquet files contains:
```json
{
"a": 1,
"b": 2,
}
```
and kernel passes a struct schema like `{"name": "a", "type": "int"}`,
the returned data will be:
```json
{
"a": 1,
"b": 2,
}
```
This works for metadata since we can then call `extract` and things will
"just work", but might not be good enough for when we do final "fix-up"
via expressions. However, actually dropping the column from the arrow
data requires a lot more code change, so I'm proposing we do this for
now to fix things like #261, and then figure out the best way to "do the
right thing" when a subset of fields are specified in a struct
expression.
Verified that things work as expected with this change:
```
D select * from delta_scan('/home/nick/databricks/delta-kernel-rs/acceptance/tests/dat/out/reader_tests/generated/with_checkpoint/delta/');
┌─────────┬───────┬────────────┐
│ letter │ int │ date │
│ varchar │ int64 │ date │
├─────────┼───────┼────────────┤
│ a │ 93 │ 1975-06-01 │
│ b │ 753 │ 2012-05-01 │
│ c │ 620 │ 1983-10-01 │
│ a │ 595 │ 2013-03-01 │
│ │ 653 │ 1995-12-01 │
└─────────┴───────┴────────────┘
```
Closes#261
0 commit comments