Skip to content

test: run the partition-transforms surface of iceberg-verification - #1173

Open
WZhuo wants to merge 1 commit into
apache:mainfrom
WZhuo:feat/iceberg-verification-phase2
Open

WZhuo wants to merge 1 commit into
apache:mainfrom
WZhuo:feat/iceberg-verification-phase2

Conversation

@WZhuo

@WZhuo WZhuo commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Phase 2 of #909: run the partition-transforms surface of apache/iceberg-verification in verification_test, covering all eight subdirectories: identity, bucket, truncate, year, month, day, hour and void.

For each case the test:

  1. Parses input.source_type with TypeFromJson and input.transform with TransformFromString, then binds the transform with Transform::Bind.
  2. Checks that the bound result type is one of decoded.result_types. The expected type strings are parsed and compared as types, so the check does not depend on how ToJson spells a type.
  3. Decodes each of input.values under the source type, applies the bound transform, and compares the result with the value at the same index of decoded.values. Expected values are decoded under the result type and compared as literals, so offset-equivalent timestamptz strings and scale-preserving decimals compare by value.

Values are decoded with LiteralFromJson. The one exception is long, which this surface writes as a decimal string so JSON number handling cannot lose 64-bit precision. Failures are labeled <subdir>/<case-id> result_type or <subdir>/<case-id> values[<index>], as the surface README requires.

All 75 cases are run. 73 pass and 2 fail:

Case Failure
identity/identity-float values[2]: cannot decode input 0: Cannot parse 0 as a float value
identity/identity-double values[2]: cannot decode input 0: Cannot parse 0 as a double value

LiteralFromJson mirrors Java's SingleValueParser.fromJson and requires a JSON number with a fractional part or exponent for float and double. Appendix D of the spec only says "JSON number", and the fixture writes 0. Java on main rejects the same value. I'll raise this on dev@ to decide whether readers should accept any JSON number, so the test reports these cases instead of working around them.

Validation: built and ran verification_test locally on macOS with the results above.

Add the partition-transforms surface to verification_test, covering all
eight subdirectories: identity, bucket, truncate, year, month, day, hour
and void.

Each case binds `input.transform` to `input.source_type` through
TransformFromString and Transform::Bind, checks that the result type is
one of `decoded.result_types`, and applies the bound transform to each
input value. Values are decoded from the surface's language-neutral form
through LiteralFromJson, except that long values are decimal strings in
this surface. Expected values are decoded under the result type and
compared as literals, so offset-equivalent timestamptz strings and
scale-preserving decimals compare by value. Failures are labeled
`result_type` or `values[<index>]` as the surface README requires.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant