Repository navigation
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of #909: run the
partition-transformssurface of apache/iceberg-verification inverification_test, covering all eight subdirectories:identity,bucket,truncate,year,month,day,hourandvoid.For each case the test:
input.source_typewithTypeFromJsonandinput.transformwithTransformFromString, then binds the transform withTransform::Bind.decoded.result_types. The expected type strings are parsed and compared as types, so the check does not depend on howToJsonspells a type.input.valuesunder the source type, applies the bound transform, and compares the result with the value at the same index ofdecoded.values. Expected values are decoded under the result type and compared as literals, so offset-equivalenttimestamptzstrings and scale-preserving decimals compare by value.Values are decoded with
LiteralFromJson. The one exception islong, which this surface writes as a decimal string so JSON number handling cannot lose 64-bit precision. Failures are labeled<subdir>/<case-id> result_typeor<subdir>/<case-id> values[<index>], as the surface README requires.All 75 cases are run. 73 pass and 2 fail:
identity/identity-floatvalues[2]: cannot decode input 0: Cannot parse 0 as a float valueidentity/identity-doublevalues[2]: cannot decode input 0: Cannot parse 0 as a double valueLiteralFromJsonmirrors Java'sSingleValueParser.fromJsonand requires a JSON number with a fractional part or exponent forfloatanddouble. Appendix D of the spec only says "JSON number", and the fixture writes0. 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_testlocally on macOS with the results above.