anoopj commented on PR #3483:
URL: https://github.com/apache/iceberg-rust/pull/3483#issuecomment-6236180278

   I thought about it, and it's what the Java implementation does as well.
   Opted for this because I was a surgical change. I can align with the Java
   approach.
   
   On Sat, Oct 17, 2026, 4:16 AM Fokko Driesprong ***@***.***>
   wrote:
   
   > ***@***.**** commented on this pull request.
   > ------------------------------
   >
   > In crates/iceberg/src/spec/values/datum.rs
   > <https://github.com/apache/iceberg-rust/pull/3483#discussion_r4302464179>:
   >
   > > +    /// Returns a copy whose literal is widened to `target` for the 
value
   > +    /// promotions `int` -> `long` and `float` -> `double`, so a value 
written
   > +    /// under the narrower type compares against a predicate bound to the 
wider
   > +    /// one. Any other `target` returns an unchanged copy; decimals 
already
   > +    /// compare across precisions.
   > +    pub(crate) fn promote_to(&self, target: &PrimitiveType) -> Datum {
   > +        match (&self.literal, target) {
   > +            (PrimitiveLiteral::Int(value), PrimitiveType::Long) => 
Datum::long(*value),
   > +            (PrimitiveLiteral::Float(value), PrimitiveType::Double) => 
Datum::double(value.0),
   > +            _ => self.clone(),
   > +        }
   > +    }
   >
   > I'm lesser known with the PyIceberg codebase, but we could also push this
   > down into the projected schema when reading the manifest. This way we
   > always get the current spec.
   >
   > This avoids having to promote all the values afterwards.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/iceberg-rust/pull/3483?email_source=notifications&email_token=AACB4KGVF3647CFJ4RDH3GT5UNIA7A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNJVG42TEOJZGQY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5557529941>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AACB4KHBS7MADFQ7LAEFUSD5UNIA7AVCNFSNUABFKJSXA33TNF2G64TZHM3DMOJQGEYTANRWHNEXG43VMU5TKOBZGMZTQMBTGU42C5QC>
   > .
   > Triage notifications, keep track of coding agent tasks and review pull
   > requests on the go with GitHub Mobile for iOS
   > 
<https://github.com/notifications/mobile/ios/AACB4KBVGYHQ55T57OZPBWL5UNIA7A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNJVG42TEOJZGQY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
   > and Android
   > 
<https://github.com/notifications/mobile/android/AACB4KFUM5AGY2XSGX22WD35UNIA7A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNJVG42TEOJZGQY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
   > Download it today!
   > You are receiving this because you authored the thread.Message ID:
   > ***@***.***>
   >
   


-- 
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]

Reply via email to