Revanth14 opened a new pull request, #2246:
URL: https://github.com/apache/iceberg-go/pull/2246
## Problem
Follow-up to #2191. `decodeValue` unwraps `{"type":"literal","value":...}`,
and it is also how `initialDefaultLiteral` decodes a field's `initial-default`.
A default stored as that wrapper object was therefore read as its inner value,
although the spec's single-value JSON for defaults has no wrapper form.
## Fix
The unwrap moves into `decodePredicateValue`, used only by the predicate
`value` and `values` items. `decodeValue` now parses bare values only, so a
wrapped default is rejected with `ErrInvalidArgument`. Predicate parsing is
unchanged.
## Testing
`TestTranslateColumnNamesRejectsWrappedInitialDefault` covers the wrapped
default and fails with the unwrap back in `decodeValue`. The existing
`TestUnmarshalExpressionLiteralWrapper` tests still cover the predicate side.
gofmt, `go vet ./...` and `go test -race ./...` pass.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]