laskoviymishka commented on code in PR #3432:
URL: https://github.com/apache/iceberg-rust/pull/3432#discussion_r4362985378
##########
crates/iceberg/src/spec/values/datum.rs:
##########
@@ -330,6 +334,8 @@ impl Display for Datum {
) => {
write!(f, "{}", decimal_from_i128_with_scale(*val, *scale))
}
+ // The scale lives on the dropped source type, so only the
unscaled value is left.
+ (PrimitiveType::Unknown, PrimitiveLiteral::Int128(val)) =>
write!(f, "{val}"),
Review Comment:
Could we format decimal with a schema that still has the source, or leave
the decimal arm out of this PR? Java's
[`toHumanString`](https://github.com/apache/iceberg/blob/2856631da4d81e79ece85c3694bfd81a86ca612e/api/src/main/java/org/apache/iceberg/transforms/Transform.java#L168-L202)
falls back to `value.toString()`, which keeps the `BigDecimal` scale. Go's
manifest reader keeps the Avro scale in
[`DecimalLiteral`](https://github.com/apache/iceberg-go/blob/bee737f17cdfb8ab1a4a2cfc18a7833903305028/manifest.go#L2749-L2760)
and [prints it
scaled](https://github.com/apache/iceberg-go/blob/bee737f17cdfb8ab1a4a2cfc18a7833903305028/literals.go#L1332-L1334).
Both give `p=1.23` where this writes `p=123`.
To me, @JeonDaehong's manifest-schema point is the fix, not a follow-up.
`PartitionSpec` [has no
schema](https://github.com/apache/iceberg-rust/blob/b765bbf1a9465c98eedc46236484a22bee4b115a/crates/iceberg/src/spec/partition.rs#L68-L73),
but a caller holding the manifest can pass
[`ManifestMetadata::schema()`](https://github.com/apache/iceberg-rust/blob/b765bbf1a9465c98eedc46236484a22bee4b115a/crates/iceberg/src/spec/manifest/metadata.rs#L32).
Int, long and uuid don't need to wait on this.
--
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]